2021-12-13 10:44:21 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2021-11-14 21:30:59 +01:00
|
|
|
typedef char fix_str[256];
|
|
|
|
typedef struct node *nodept;
|
|
|
|
typedef struct nodes graph_vec;
|
|
|
|
|
|
|
|
struct nodes {
|
|
|
|
int n;
|
|
|
|
int cap;
|
2021-12-13 10:44:21 +01:00
|
|
|
nodept node[1000];
|
2021-11-14 21:30:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct node {
|
2021-12-13 10:44:21 +01:00
|
|
|
bool intern;
|
|
|
|
int num; // le numero de noeud
|
|
|
|
int nbs; // nombre de successeurs
|
|
|
|
fix_str func; // noms de fonctions
|
|
|
|
int cap;
|
|
|
|
nodept *succ; // les successeurs
|
2021-11-14 21:30:59 +01:00
|
|
|
};
|
2021-12-13 10:44:21 +01:00
|
|
|
|
|
|
|
struct node *new_node(int num);
|
|
|
|
void delete_node(struct node *n);
|
|
|
|
void insert_succ(graph_vec *g, int i, int i1, fix_str str);
|
|
|
|
graph_vec new_graph(int cap);
|
|
|
|
void insert_node(graph_vec *g, int i, fix_str str, bool intern);
|
|
|
|
void delete_graph(graph_vec *g);
|
|
|
|
int is_in(graph_vec g, fix_str func);
|
|
|
|
void print_node(nodept node);
|