my_rpg documentation 1.0.0
Loading...
Searching...
No Matches
mylist.h
1/*
2** EPITECH PROJECT, 2023
3** my list
4** File description:
5** struct of linked list
6*/
7
8#ifndef MYLIST_H
9 #define MYLIST_H
10 #include <stdlib.h>
11
12typedef enum type {
13 INT,
14 CHAR,
15 STR,
16 UNKNOW,
17 SFSPRITE,
18 SFTEXT,
19 LABEL,
20 INSTRUCTION,
21} type_t;
22
23typedef struct nodes {
24 struct nodes *previous;
25 void *data;
26 type_t type;
27 struct nodes *next;
28} nodes_t;
29
30int list_size(nodes_t **head);
31int just_remove_in_list(nodes_t **head, void *data,
32 int (*cmp)(void *, void *));
33int del_matching_node(nodes_t **head, void *data, int (*cmp)(void *, void *));
34void push_f(nodes_t **head, void *data, type_t type);
35int print_list(nodes_t **head);
36int print_typed_value(void *data, type_t type);
37int delete_list(nodes_t **head, char const *);
38
39//Doubly
40int remove_doubly(nodes_t **head, void *id, int cmp(void *, void *));
41void print_list_doubly(nodes_t **head);
42void push_f_doubly(nodes_t **head, void *data, type_t type);
43void push_b_doubly(nodes_t **head, void *data, type_t type);
44int remove_doubly_free(nodes_t **head, void *id, int cmp(void *, void *));
45nodes_t *previous_to_next(nodes_t **head, nodes_t *to_delete);
46nodes_t *pop_b_doubly(nodes_t **list);
47nodes_t *pop_f_doubly(nodes_t **list);
48
49int my_strput(char const *str);
50int my_lenstr(char const *str);
51void my_charput(char c);
52int my_nbr_put(int nb);
53int my_cmpstr(char const *str1, char const *str2);
54char *my_dupstr(char const *src);
55char *print_adress(unsigned int nbr, char const *base);
56
57
58int my_intcmp_void(void *data, void *ref);
59int my_strcmp_void(void *data, void *ref);
60int my_pointercmp(void *s1, void *s2);
61
62
63void super_push_f(nodes_t **head, void *data, type_t type);
64void super_push_b(nodes_t **head, void *data, type_t type);
65nodes_t *my_find_node(nodes_t const *begin, void const *data_ref,
66 int (*cmp) ());
67
68#endif
Definition mylist.h:23