19 |
Boston, MA 02111-1307, USA. */ |
Boston, MA 02111-1307, USA. */ |
20 |
|
|
21 |
#include "system.h" |
#include "system.h" |
22 |
|
#include "xalloc.h" |
23 |
#include "vcg.h" |
#include "vcg.h" |
24 |
#include "vcg_defaults.h" |
#include "vcg_defaults.h" |
25 |
|
|
426 |
graph->edge_list = edge; |
graph->edge_list = edge; |
427 |
} |
} |
428 |
|
|
429 |
|
void |
430 |
|
add_classname (graph_t *g, int val, char *name) |
431 |
|
{ |
432 |
|
struct classname_s *classname; |
433 |
|
|
434 |
|
classname = XMALLOC (struct classname_s, 1); |
435 |
|
classname->no = val; |
436 |
|
classname->name = name; |
437 |
|
classname->next = g->classname; |
438 |
|
g->classname = classname; |
439 |
|
} |
440 |
|
|
441 |
|
void |
442 |
|
add_infoname (graph_t *g, int integer, char *string) |
443 |
|
{ |
444 |
|
struct infoname_s *infoname; |
445 |
|
|
446 |
|
infoname = XMALLOC (struct infoname_s, 1); |
447 |
|
infoname->integer = integer; |
448 |
|
infoname->string = string; |
449 |
|
infoname->next = g->infoname; |
450 |
|
g->infoname = infoname; |
451 |
|
} |
452 |
|
|
453 |
|
/* Build a colorentry struct and add it to the list. */ |
454 |
|
void |
455 |
|
add_colorentry (graph_t *g, int color_idx, int red_cp, |
456 |
|
int green_cp, int blue_cp) |
457 |
|
{ |
458 |
|
struct colorentry_s *ce; |
459 |
|
|
460 |
|
ce = XMALLOC (struct colorentry_s, 1); |
461 |
|
ce->color_index = color_idx; |
462 |
|
ce->red_cp = red_cp; |
463 |
|
ce->green_cp = green_cp; |
464 |
|
ce->blue_cp = blue_cp; |
465 |
|
ce->next = g->colorentry; |
466 |
|
g->colorentry = ce; |
467 |
|
} |
468 |
|
|
469 |
/*-------------------------------------. |
/*-------------------------------------. |
470 |
| Open and close functions (formatted) | |
| Open and close functions (formatted) | |
471 |
`-------------------------------------*/ |
`-------------------------------------*/ |
521 |
{ |
{ |
522 |
obstack_1grow (os, '\n'); |
obstack_1grow (os, '\n'); |
523 |
|
|
524 |
|
/* FIXME: Unallocate nodes and edges if required. */ |
525 |
{ |
{ |
526 |
node_t *node; |
node_t *node; |
527 |
|
|
744 |
|
|
745 |
if (graph->hidden != G_HIDDEN) |
if (graph->hidden != G_HIDDEN) |
746 |
obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden); |
obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden); |
747 |
|
|
748 |
|
/* FIXME: Unallocate struct list if required. |
749 |
|
Maybe with a little function. */ |
750 |
if (graph->classname != G_CLASSNAME) |
if (graph->classname != G_CLASSNAME) |
751 |
{ |
{ |
752 |
struct classname_s *ite; |
struct classname_s *ite; |