Crossings Minimization  1.0
dot.h File Reference

Module for reading files in .dot format. More...

#include <stdio.h>
#include <stdbool.h>
Include dependency graph for dot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void initDot (FILE *in)
 
void getNameFromDotFile (char *buffer)
 
bool nextEdge (FILE *in, char *source_buffer, char *destination_buffer)
 
void dotPreamble (FILE *out, const char *graph_name, const char *initial_comment)
 
void endDot (FILE *out)
 
void outputEdge (FILE *out, const char *src, const char *dst)
 

Detailed Description

Module for reading files in .dot format.

Author
Matt Stallmann
Date
1998/07/17, modified for new experiments 2008/12/17
Id
dot.h 2 2011-06-07 19:50:41Z mfms

Definition in file dot.h.

Function Documentation

◆ dotPreamble()

void dotPreamble ( FILE *  out,
const char *  graph_name,
const char *  initial_comment 
)

Writes the first part of a dot file to the output stream: comments about how the graph was created and seed information

Definition at line 210 of file dot.c.

Referenced by outputEdge(), and writeDot().

◆ endDot()

void endDot ( FILE *  out)

Writes the final '}'

Definition at line 217 of file dot.c.

Referenced by outputEdge(), and writeDot().

◆ getNameFromDotFile()

void getNameFromDotFile ( char *  buffer)

Stores the name of the graph in the given buffer. Assumes the buffer is large enough.

Definition at line 167 of file dot.c.

References graph_name.

Referenced by allocateAdjacencyLists().

◆ initDot()

void initDot ( FILE *  in)

Stores information about the dot file and advances the input to the point where edges can be read. NOTE: information in an initial comment is lost

Todo:
eventually will want to pick up the first comment

Definition at line 144 of file dot.c.

References error(), error_message, graph_name, MAX_NAME_LENGTH, and skip_blanks_and_comments().

Referenced by allocateAdjacencyLists(), createEdges(), and outputEdge().

Here is the call graph for this function:

◆ nextEdge()

bool nextEdge ( FILE *  in,
char *  source_buffer,
char *  destination_buffer 
)

Reads the next edge from the input, storing the names of the vertices in buffers. Assumes the buffers are large enough.

Returns
true if another edge was found.

Definition at line 172 of file dot.c.

References error(), error_message, read_identifier(), and skip_blanks_and_comments().

Referenced by allocateAdjacencyLists(), createEdges(), and outputEdge().

Here is the call graph for this function:

◆ outputEdge()

void outputEdge ( FILE *  out,
const char *  src,
const char *  dst 
)

Writes the edge (src, dst) to the output

Definition at line 222 of file dot.c.

References dotPreamble(), endDot(), initDot(), main(), nextEdge(), and outputEdge().

Referenced by outputEdge(), and writeDot().

Here is the call graph for this function: