graph.c File Reference

Implementation of the directed graph class interface. More...

#include "graph.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>

Include dependency graph for graph.c:

Go to the source code of this file.

Functions

graph * newGraph (const char *name)
 Creates a new graph node.
void deleteGraph (graph *src)
 Frees all memory for this node.
void graphConnect (graph *src, const graph *dest)
 Connects two graphs in one direction.
void graphColorNode (graph *src, unsigned long color)
 Sets a color value for a certain graph node.
unsigned long graphGetColorNode (graph *src)
 Returns a color value of a graph.
const char * graphGetNameNode (graph *src)
 Returns the nodes name.
list * graphGetConnections (graph *src)
 Returns a list of all the other graphs that the node is connected to.


Detailed Description

Implementation of the directed graph class interface.

Author:
Dorian Weber

Definition in file graph.c.


Function Documentation

void deleteGraph ( graph *  src  ) 

Frees all memory for this node.

Parameters:
[in] src graph node

Definition at line 34 of file graph.c.

void graphColorNode ( graph *  src,
unsigned long  color 
)

Sets a color value for a certain graph node.

Parameters:
[in] src graph node to color
[in] color the color

Definition at line 59 of file graph.c.

void graphConnect ( graph *  src,
const graph *  dest 
)

Connects two graphs in one direction.

Parameters:
[in] src source node that marks the starting point of the edge
[in] dest target node that marks the end point of the edge

Definition at line 43 of file graph.c.

unsigned long graphGetColorNode ( graph *  src  ) 

Returns a color value of a graph.

Parameters:
[in] src node to read the color from
Returns:
the color

Definition at line 65 of file graph.c.

list* graphGetConnections ( graph *  src  ) 

Returns a list of all the other graphs that the node is connected to.

Definition at line 77 of file graph.c.

const char* graphGetNameNode ( graph *  src  ) 

Returns the nodes name.

Definition at line 71 of file graph.c.

graph* newGraph ( const char *  name  ) 

Creates a new graph node.

Parameters:
[in] name specifies the name of this node
Returns:
pointer to a graph node

Definition at line 23 of file graph.c.


Generated on Fri Jun 5 15:31:57 2009 for DeadStrip Utility by  doxygen 1.5.8