Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dump.c File Reference

Actions interface implementation. More...

#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "gr.h"
#include "hash_map.h"

Go to the source code of this file.

Defines

#define ASSERT_DUMP(d)   assert(d && "invalid dump object")
#define ASSERT_MODEL(m)   assert(m && "invalid dump model")

Functions

gr_dump_tgr_dump_create (void)
void gr_dump_delete (gr_dump_t *dump)
void gr_dump_node (gr_dump_t *dump, gr_id_t node, const char *label, const char *attr[], gr_color_t textcol, gr_color_t col)
void gr_dump_edge (gr_dump_t *dump, gr_id_t from, gr_id_t to, const char *label, const char *attr[], gr_color_t col, gr_linestyle_t linestyle)
void gr_dump_node_def (gr_dump_t *dump, gr_id_t node, const char *label, const char *attr[])
void gr_dump_edge_def (gr_dump_t *dump, gr_id_t from, gr_id_t to, const char *label, const char *attr[])
void gr_dump_create_subgraph (gr_dump_t *dump, gr_id_t node, const char *label, const char *attr[], gr_color_t textcol, gr_color_t col)
void gr_dump_finish_subgraph (gr_dump_t *dump)
gr_color_t gr_dump_get_node_color (gr_dumper_index_t index)
gr_color_t gr_dump_get_edge_color (gr_dumper_index_t index)
void gr_dump_set_colors (gr_dumper_index_t index, gr_color_t node_color, gr_color_t edge_color)
void gr_dump_exclude_node_type (gr_dump_t *dump, gr_id_t node_type)
void gr_dump_set_node_infotag (gr_dump_t *dump, gr_id_t node_type, gr_id_t attr_id)
void gr_dump_color_node_type (gr_dump_t *dump, gr_id_t node_type, gr_color_t color)
void gr_dump_color_edge_type (gr_dump_t *dump, gr_id_t node_type, gr_color_t color)
void gr_dump_group_incoming (gr_dump_t *dump, gr_id_t node_type)

Variables

struct {
   gr_color_t   node_color
   gr_color_t   edge_color
colors [GR_DUMP_INDEX_MAX]


Detailed Description

Actions interface implementation.

Date:
17.9.2003
Author:
Sebastian Hack
Id
dump.c,v 1.11 2005/10/10 14:16:43 rubino Exp

Definition in file dump.c.


Define Documentation

#define ASSERT_DUMP  )     assert(d && "invalid dump object")
 

Definition at line 39 of file dump.c.

Referenced by gr_dump_create_subgraph(), gr_dump_delete(), gr_dump_edge(), gr_dump_finish_subgraph(), and gr_dump_node().

#define ASSERT_MODEL  )     assert(m && "invalid dump model")
 

Definition at line 40 of file dump.c.


Function Documentation

void gr_dump_color_edge_type gr_dump_t dump,
gr_id_t  edge_type,
gr_color_t  color
 

Colors a edge type (and all non-recolored sub-types) with a given color.

Parameters:
dump The dumper object.
edge_type The node type ID.
color The new text color.

Definition at line 228 of file dump.c.

References gr_kind_id, gr_kind_integer, gr_map_put(), gr_value_init, gr_value_set_id(), and gr_value_set_integer().

Referenced by vcg_dump().

void gr_dump_color_node_type gr_dump_t dump,
gr_id_t  node_type,
gr_color_t  color
 

Colors a node type (and all non-recolored sub-types) with a given color.

Parameters:
dump The dumper object.
node_type The node type ID.
color The new text color.

Definition at line 210 of file dump.c.

References gr_kind_id, gr_kind_integer, gr_map_put(), gr_value_init, gr_value_set_id(), and gr_value_set_integer().

Referenced by vcg_dump().

gr_dump_t* gr_dump_create void   ) 
 

Creates a generic dumper object. Should not be called by user.

Definition at line 59 of file dump.c.

References _gr_dump_t::colored_edges, _gr_dump_t::colored_nodes, _gr_dump_t::exclude_nodes, gr_kind_id, gr_map_hash_factory(), gr_set_new(), _gr_dump_t::group_types, and _gr_dump_t::info_tag.

Referenced by gr_dump_dpref_new(), gr_dump_graphml_new(), and gr_dump_vcg_new().

void gr_dump_create_subgraph gr_dump_t dump,
gr_id_t  node,
const char *  label,
const char *  attr[],
gr_color_t  textcol,
gr_color_t  col
 

Creates a subgraph from a node.

Parameters:
dump The dumper.
node The node's ID.
label The label to use for the subgraph, may be NULL.
attr A NULL terminated array of strings containing the attributes
textcol The color of the text.
col The color of the subgraph.

Definition at line 129 of file dump.c.

References ASSERT_DUMP, and ASSERT_MODEL.

Referenced by dpref_delete(), and dump_groups().

void gr_dump_delete gr_dump_t dump  ) 
 

Delete a graph dumper. This deallocates all memory, closes all files, etc.

Parameters:
dump The dumper.

Definition at line 75 of file dump.c.

References ASSERT_DUMP, ASSERT_MODEL, _gr_dump_model_t::del, gr_map_delete(), gr_set_delete(), _gr_dump_t::model, and _gr_id_entry_t::next.

Referenced by dpref_delete(), gr_dump_dpref_new(), gr_dump_graphml_new(), gr_dump_vcg_new(), vcg_dump(), and vcg_dump_match().

void gr_dump_edge gr_dump_t dump,
gr_id_t  from,
gr_id_t  to,
const char *  label,
const char *  attr[],
gr_color_t  col,
gr_linestyle_t  linestyle
 

Dump an edge.

Parameters:
dump The dumper object.
from The node Id of the source node of the edge.
to The node Id of the target node of the edge.
label The edge's label, may be NULL.
attr A NULL terminated array of strings containing the attributes.
col The edge's color.
linestyle The edge's linestyle

Definition at line 108 of file dump.c.

References ASSERT_DUMP, and ASSERT_MODEL.

Referenced by dpref_delete(), dump_edges_from_node(), gr_dump_edge_def(), and gr_dump_match().

void gr_dump_edge_def gr_dump_t dump,
gr_id_t  from,
gr_id_t  to,
const char *  label,
const char *  attr[]
 

Dump an edge with default color and line style.

Parameters:
dump The dumper object.
from The node Id of the source node of the edge.
to The node Id of the target node of the edge.
label The edge's label, may be NULL.
attr A NULL terminated array of strings containing the attributes.

Definition at line 123 of file dump.c.

References colors, edge_color, gr_dump_edge(), GR_DUMP_INDEX_NORMAL, and GR_LINE_DEFAULT.

void gr_dump_exclude_node_type gr_dump_t dump,
gr_id_t  node_type
 

Removes a node type (and all sub-types) from the dump. This also will remove all incoming and outgoing edges from the dump.

Definition at line 172 of file dump.c.

References gr_kind_id, gr_set_add(), gr_value_init, and gr_value_set_id().

Referenced by vcg_dump().

void gr_dump_finish_subgraph gr_dump_t dump  ) 
 

Finishes a subgraph.

Parameters:
dump The dumper.

Definition at line 138 of file dump.c.

References ASSERT_DUMP, and ASSERT_MODEL.

Referenced by dump_groups(), and finish_subgraphs().

gr_color_t gr_dump_get_edge_color gr_dumper_index_t  index  ) 
 

Returns the color of a node for a given index.

Parameters:
index The color index.
Returns:
The node text color for this index.

Definition at line 153 of file dump.c.

References colors, GR_DUMP_INDEX_MAX, GR_DUMP_INDEX_NORMAL, and GR_RANGE_CHECK.

Referenced by dump_edges_from_node(), and gr_get_def_edge_color().

gr_color_t gr_dump_get_node_color gr_dumper_index_t  index  ) 
 

Returns the color of a node for a given index.

Parameters:
index The color index.
Returns:
The node text color for this index.

Definition at line 146 of file dump.c.

References colors, GR_DUMP_INDEX_MAX, GR_DUMP_INDEX_NORMAL, and GR_RANGE_CHECK.

Referenced by dump_groups(), dump_nodes(), gr_dump_match(), and gr_get_def_node_color().

void gr_dump_group_incoming gr_dump_t dump,
gr_id_t  node_type
 

Creates a subgraph from a node type by grouping all incomings

Definition at line 246 of file dump.c.

References _gr_id_entry_t::id, and _gr_id_entry_t::next.

Referenced by vcg_dump().

void gr_dump_node gr_dump_t dump,
gr_id_t  node,
const char *  label,
const char *  attr[],
gr_color_t  textcol,
gr_color_t  col
 

Dump a node.

Parameters:
dump The dumper.
node The node's ID.
label The label to use for the node, may be NULL.
attr A NULL terminated array of strings containing the attributes
textcol The color of the text.
col The color of the node.

Definition at line 99 of file dump.c.

References ASSERT_DUMP, and ASSERT_MODEL.

Referenced by dpref_delete(), dump_nodes(), gr_dump_match(), and gr_dump_node_def().

void gr_dump_node_def gr_dump_t dump,
gr_id_t  node,
const char *  label,
const char *  attr[]
 

Dump a node with default color.

Parameters:
dump The dumper.
node The node's ID.
label The label to use for the node, may be NULL.
attr A NULL terminated array of strings containing the attributes.

Definition at line 118 of file dump.c.

References colors, GR_DUMP_INDEX_NORMAL, gr_dump_node(), and node_color.

void gr_dump_set_colors gr_dumper_index_t  index,
gr_color_t  node_color,
gr_color_t  edge_color
 

Returns the color of a node for a given index.

Parameters:
index The color index.
node_color The node text color for this index.
edge_color The edge text color for this index.

Definition at line 160 of file dump.c.

References colors, edge_color, GR_DUMP_INDEX_MAX, GR_DUMP_INDEX_NORMAL, GR_RANGE_CHECK, and node_color.

void gr_dump_set_node_infotag gr_dump_t dump,
gr_id_t  node_type,
gr_id_t  attr_id
 

Definition at line 189 of file dump.c.

References gr_id_is_valid, gr_kind_id, gr_map_put(), gr_value_init, and gr_value_set_id().

Referenced by vcg_dump().


Variable Documentation

struct { ... } colors[GR_DUMP_INDEX_MAX] [static]
 

Lookup table for colors.

Referenced by gr_dump_edge_def(), gr_dump_get_edge_color(), gr_dump_get_node_color(), gr_dump_node_def(), and gr_dump_set_colors().

gr_color_t edge_color
 

color for edges

Definition at line 48 of file dump.c.

Referenced by gr_dump_edge_def(), and gr_dump_set_colors().

gr_color_t node_color
 

color for nodes

Definition at line 47 of file dump.c.

Referenced by gr_dump_node_def(), and gr_dump_set_colors().


Generated on Wed Apr 5 15:28:19 2006 for libgr by  doxygen 1.4.1