-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.h
98 lines (78 loc) · 2.38 KB
/
file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* @file file.h
* @author meo ([email protected])
* @brief fichier de mise en oeuvre de la File
* @version 0.1
* @date 2022-10-04
*
* @copyright Copyright (c) 2022
*
*/
#ifndef FILE_H
#define FILE_H
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct element_file_int{
int val;
struct element_file_int *suivant;
} t_element_file_int;
typedef struct element_file_char{
char val;
struct element_file_char *suivant;
} t_element_file_char;
typedef struct element_file_float{
float val;
struct element_file_float *suivant;
} t_element_file_float;
typedef struct element_file_double{
double val;
struct element_file_double *suivant;
} t_element_file_double;
typedef struct element_file_long{
long val;
struct element_file_long *suivant;
} t_element_file_long;
typedef struct element_file_bool{
bool val;
struct element_file_bool *suivant;
} t_element_file_bool;
typedef struct element_file_string{
char *val;
struct element_file_string *suivant;
} t_element_file_string;
typedef enum type_file{
FILE_INT,
FILE_CHAR,
FILE_FLOAT,
FILE_DOUBLE,
FILE_LONG,
FILE_BOOL,
FILE_STRING
} t_type_file;
typedef struct file{
void * premier;
void * dernier;
t_type_file type;
void (*enfiler)(struct file *, void *);
void (*defiler)(struct file *, void *);
} t_file;
extern t_file * creer_file(t_type_file type);
extern bool est_vide(t_file * file);
extern void enfiler(t_file * file, void * val);
extern void defiler(t_file * file, void * val);
static void enfiler_int(t_file * file, void * val);
static void enfiler_char(t_file * file, void * val);
static void enfiler_float(t_file * file, void * val);
static void enfiler_double(t_file * file, void * val);
static void enfiler_long(t_file * file, void * val);
static void enfiler_bool(t_file * file, void * val);
static void enfiler_string(t_file * file, void * val);
static void defiler_int(t_file * file, void * val);
static void defiler_char(t_file * file, void * val);
static void defiler_float(t_file * file, void * val);
static void defiler_double(t_file * file, void * val);
static void defiler_long(t_file * file, void * val);
static void defiler_bool(t_file * file, void * val);
static void defiler_string(t_file * file, void * val);
#endif