1234567891011121314151617181920 |
- #include <igraph.h>
- #include "graph.h"
- graph_t* graph_init() {
- graph_t *g;
- g = calloc(1, sizeof(graph_t));
- g->graph = calloc(1, sizeof(igraph_t));
- g->initialised = 0;
- return g;
- }
- void graph_destroy(graph_t *g) {
- if(g->initialised) {
- igraph_destroy(g->graph);
- g->initialised = 0;
- }
- free(g);
- g = NULL;
- }
|