2023-03-22 06:31:50 +11:00
|
|
|
/*
|
|
|
|
* edges.h
|
2023-03-28 23:50:40 +11:00
|
|
|
* a part of libbubulle from tTh
|
2023-04-03 07:44:35 +11:00
|
|
|
*
|
|
|
|
* https://git.tetalab.org/tTh/libbubulle
|
2023-03-22 06:31:50 +11:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
2023-03-25 01:32:13 +11:00
|
|
|
|
|
|
|
typedef struct {
|
2023-03-28 23:50:40 +11:00
|
|
|
int A, B;
|
2023-04-03 07:44:35 +11:00
|
|
|
short burz; /* for what usage ??? */
|
2023-03-25 01:32:13 +11:00
|
|
|
} AnEdge;
|
|
|
|
|
|
|
|
typedef struct {
|
2023-03-26 21:44:34 +11:00
|
|
|
unsigned long magic;
|
2023-03-25 01:32:13 +11:00
|
|
|
char name[SZ_BUBULLE_TEXT+1];
|
|
|
|
int size; /* max number of edges */
|
|
|
|
int fidx; /* next free slot */
|
|
|
|
AnEdge *edges;
|
|
|
|
unsigned long flags;
|
|
|
|
} EdgeList;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
2023-03-26 21:44:34 +11:00
|
|
|
|
2023-03-28 23:50:40 +11:00
|
|
|
EdgeList * alloc_edgelist(char *name, int sz, int flags);
|
|
|
|
int free_edgelist(EdgeList *list, int k);
|
|
|
|
int push_an_edge(EdgeList *list, int p0, int p1);
|
|
|
|
int push_a_missing_edge(EdgeList *list, int p0, int p1);
|
2023-03-27 09:03:54 +11:00
|
|
|
|
2023-04-03 07:44:35 +11:00
|
|
|
// int is_edge_in_list(EdgeList *list, int p0, int p1);
|
2023-03-26 21:44:34 +11:00
|
|
|
|
2023-03-28 23:50:40 +11:00
|
|
|
int print_edgelist_desc(EdgeList *list, int k);
|
2023-04-03 07:44:35 +11:00
|
|
|
int edges_to_data(char *fname, EdgeList *list, int k);
|
2023-03-30 14:05:32 +11:00
|
|
|
int print_the_edges(FILE *file, EdgeList *list, int k);
|
2023-03-26 21:44:34 +11:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|