libbubulle/edges.h

35 lines
918 B
C
Raw Normal View History

2023-03-21 20:31:50 +01:00
/*
* edges.h
2023-03-28 14:50:40 +02:00
* a part of libbubulle from tTh
2023-03-21 20:31:50 +01:00
*/
/* --------------------------------------------------------------------- */
2023-03-24 15:32:13 +01:00
typedef struct {
2023-03-28 14:50:40 +02:00
int A, B;
short burz;
2023-03-24 15:32:13 +01:00
} AnEdge;
typedef struct {
2023-03-26 12:44:34 +02:00
unsigned long magic;
2023-03-24 15:32:13 +01: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 12:44:34 +02:00
2023-03-28 14:50:40 +02: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 00:03:54 +02:00
2023-03-28 14:50:40 +02:00
int is_edge_in_list(EdgeList *list, int p0, int p1);
2023-03-26 12:44:34 +02:00
2023-03-28 14:50:40 +02:00
int print_edgelist_desc(EdgeList *list, int k);
2023-03-30 05:05:32 +02:00
int print_the_edges(FILE *file, EdgeList *list, int k);
2023-03-26 12:44:34 +02:00
/* --------------------------------------------------------------------- */