buggy version of the parser. debugging with fsanitizer
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# define LEM_IN_H
|
||||
|
||||
# include "libft.h"
|
||||
# include <fcntl.h>
|
||||
|
||||
typedef struct s_node
|
||||
{
|
||||
@@ -22,6 +23,7 @@ typedef struct s_node
|
||||
int y;
|
||||
char role;
|
||||
int ind;
|
||||
struct s_node *next;
|
||||
} t_node;
|
||||
|
||||
typedef struct s_ind
|
||||
@@ -36,6 +38,7 @@ typedef struct s_lmdata
|
||||
int nbants;
|
||||
int nb_nodes;
|
||||
t_list *nodes;
|
||||
t_node *nodes_data;
|
||||
t_ind **adj;
|
||||
} t_lmdata;
|
||||
|
||||
@@ -46,9 +49,67 @@ typedef struct s_bfs
|
||||
int queue;
|
||||
} t_bfs;
|
||||
|
||||
//LEM_IN MT STRUCTS
|
||||
|
||||
typedef struct s_syntax
|
||||
{
|
||||
int nb_state;
|
||||
int s_cmd;
|
||||
int s_pos;
|
||||
int s_vert;
|
||||
int e_vert;
|
||||
int gr_status;
|
||||
int e_cmd;
|
||||
int e_pos;
|
||||
int v_flag;
|
||||
} t_syntax;
|
||||
|
||||
typedef struct s_adjnode
|
||||
{
|
||||
int dest;
|
||||
struct s_adjnode *next;
|
||||
} t_adjnode;
|
||||
|
||||
typedef struct s_adjlist
|
||||
{
|
||||
t_adjnode *head;
|
||||
} t_adjlist;
|
||||
|
||||
typedef struct s_graph
|
||||
{
|
||||
int vert;
|
||||
t_adjlist *array;
|
||||
} t_graph;
|
||||
|
||||
typedef struct s_neighbour
|
||||
{
|
||||
int vertnum;
|
||||
struct s_neighbor *next;
|
||||
} t_neighbor;
|
||||
|
||||
|
||||
|
||||
//MT-FUNCTIONS
|
||||
int lm_error_exit(int flag);
|
||||
int lm_parser(int fd, t_syntax *synt,
|
||||
t_lmdata *ldata, t_graph *graph);
|
||||
void lm_init_data(t_syntax *synt, t_lmdata *ldata);
|
||||
void lm_add_vertex(t_lmdata *ldata, char *raw, char flag);
|
||||
t_adjnode *lm_new_node(int dest);
|
||||
t_graph *lm_creategraph(int v);
|
||||
void lm_add_edge(t_graph *graph, int src, int dest);
|
||||
void lm_ext_conn(t_graph *graph, t_lmdata *data, char *raw, t_syntax *synt);
|
||||
int lm_find_index(t_lmdata *data, char *str);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void lm_initdata(t_lmdata *data);
|
||||
int lm_getparams(t_lmdata *data);
|
||||
|
||||
|
||||
|
||||
t_ind *lst_indadd(t_ind **lst, int ind);
|
||||
void lst_inddel(t_ind **lst);
|
||||
|
||||
|
Reference in New Issue
Block a user