-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.h
More file actions
133 lines (113 loc) · 3.17 KB
/
Copy pathtypes.h
File metadata and controls
133 lines (113 loc) · 3.17 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/**
* @file types.h
* @author Pietro Firpo (pietro.firpo@pm.me)
* @brief Collection of useful types
*/
#ifndef SEEN_TYPES
#define SEEN_TYPES
/**
* @brief Alias for char, just to avoid confusion with 8 bit numbers and ASCII characters
*/
typedef char byte;
/**
* @brief Used to specify type of argument passed in functions that require a type specifier
* @details Supported specifiers: `"%c"` (char), `"%i"` (int), `"%f"` (float), `"%lf"` (double), `"%p"` (pointer)
* @note Some functions may not support some identifiers or may support additional identifiers. In those cases refer to that function documentation
*/
typedef char *spec_t;
/**
* @brief Alias for char *, used when an array of char is actually used as a string
*/
typedef char *string;
/**
* @brief ::ArrayList type
* @note All the parameters in this structure must be intended as read-only. Manually modifying them can cause unknown and unwanted behavior
*/
typedef struct {
/**
* @brief The type of the elements contained by the ::ArrayList. Refer to ::spec_t
*/
spec_t type;
/**
* @brief Void pointer to the first element of the ::ArrayList
*/
void *body;
/**
* @brief The number of elements contained by the ::ArrayList
*/
unsigned int size;
} *ArrayList;
/**
* @brief ::Node type
* @details Base component of every linked data type
* @note All the parameters in this structure must be intended as read-only. Manually modifying them can cause unknown and unwanted behavior
*/
typedef struct node {
/**
* @brief Pointer to the value contained
*/
void *data;
/**
* @brief The ::Node this ::Node is linked to
*/
struct node *linked;
} *Node;
/**
* @brief ::LinkedList type
* @note All the parameters in this structure must be intended as read-only. Manually modifying them can cause unknown and unwanted behavior
*/
typedef struct {
/**
* @brief The type of the elements contained by the ::LinkedList. Refer to ::spec_t
*/
spec_t type;
/**
* @brief Head of the ::LinkedList
*/
Node head;
/**
* @brief Tail of the ::LinkedList
*/
Node tail;
/**
* @brief The number of elements contained by the ::LinkedList
*/
unsigned int size;
} *LinkedList;
/**
* @brief ::Stack type
* @note All the parameters in this structure must be intended as read-only. Manually modifying them can cause unknown and unwanted behavior
*/
typedef struct {
/**
* @brief The type of the elements contained by the ::Stack. Refer to ::spec_t
*/
spec_t type;
/**
* @brief Head of the ::Stack
*/
Node head;
} *Stack;
/**
* @brief ::Queue type
* @note All the parameters in this structure must be intended as read-only. Manually modifying them can cause unknown and unwanted behavior
*/
typedef struct {
/**
* @brief The type of the elements contained by the ::Queue. Refer to ::spec_t
*/
spec_t type;
/**
* @brief Head of the ::Queue
*/
Node head;
/**
* @brief Tail of the ::Queue
*/
Node tail;
/**
* @brief The number of elements contained by the ::Queue
*/
unsigned int size;
} *Queue;
#endif