* src/vcg.c: Include `xalloc.h'.

(add_colorentry): New.
(add_classname): New.
(add_infoname): New.
* src/vcg.h: Add new prototypes.
This commit is contained in:
Marc Autret
2001-08-27 12:02:47 +00:00
parent 6f5e0eea04
commit b1722803ec
3 changed files with 58 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2001-08-27 Marc Autret <autret_m@epita.fr>
* src/vcg.c: Include `xalloc.h'.
(add_colorentry): New.
(add_classname): New.
(add_infoname): New.
* src/vcg.h: Add new prototypes.
2001-08-27 Akim Demaille <akim@epita.fr>
* Makefile.maint: Sync. again with CVS Autoconf.

View File

@@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */
#include "system.h"
#include "xalloc.h"
#include "vcg.h"
#include "vcg_defaults.h"
@@ -425,6 +426,46 @@ add_edge (graph_t *graph, edge_t *edge)
graph->edge_list = edge;
}
void
add_classname (graph_t *g, int val, char *name)
{
struct classname_s *classname;
classname = XMALLOC (struct classname_s, 1);
classname->no = val;
classname->name = name;
classname->next = g->classname;
g->classname = classname;
}
void
add_infoname (graph_t *g, int integer, char *string)
{
struct infoname_s *infoname;
infoname = XMALLOC (struct infoname_s, 1);
infoname->integer = integer;
infoname->string = string;
infoname->next = g->infoname;
g->infoname = infoname;
}
/* Build a colorentry struct and add it to the list. */
void
add_colorentry (graph_t *g, int color_idx, int red_cp,
int green_cp, int blue_cp)
{
struct colorentry_s *ce;
ce = XMALLOC (struct colorentry_s, 1);
ce->color_index = color_idx;
ce->red_cp = red_cp;
ce->green_cp = green_cp;
ce->blue_cp = blue_cp;
ce->next = g->colorentry;
g->colorentry = ce;
}
/*-------------------------------------.
| Open and close functions (formatted) |
`-------------------------------------*/
@@ -480,6 +521,7 @@ close_graph(graph_t *graph, struct obstack *os)
{
obstack_1grow (os, '\n');
/* FIXME: Unallocate nodes and edges if required. */
{
node_t *node;
@@ -702,7 +744,9 @@ output_graph (graph_t *graph, struct obstack *os)
if (graph->hidden != G_HIDDEN)
obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden);
/* FIXME: Unallocate struct list if required.
Maybe with a little function. */
if (graph->classname != G_CLASSNAME)
{
struct classname_s *ite;

View File

@@ -999,6 +999,11 @@ void new_edge PARAMS ((edge_t *edge));
void add_node PARAMS ((graph_t *graph, node_t *node));
void add_edge PARAMS ((graph_t *graph, edge_t *edge));
void add_colorentry PARAMS ((graph_t *g, int color_idx, int red_cp,
int green_cp, int blue_cp));
void add_classname PARAMS ((graph_t *g, int val, char *name));
void add_infoname PARAMS ((graph_t *g, int val, char *name));
void open_node PARAMS ((struct obstack *os));
void output_node PARAMS ((node_t *node, struct obstack *os));
void close_node PARAMS ((struct obstack *os));