My library
Library for common tasks
types.h
Go to the documentation of this file.
1
7#ifndef SEEN_TYPES
8#define SEEN_TYPES
9
13typedef char byte;
14
20typedef char *spec_t;
21
25typedef char *string;
26
31typedef struct {
36
40 void *body;
41
45 unsigned int size;
46} *ArrayList;
47
53typedef struct node {
57 void *data;
58
62 struct node *linked;
64
69typedef struct {
74
79
84
88 unsigned int size;
89} *LinkedList;
90
95typedef struct {
100
105} *Stack;
106
111typedef struct {
116
121
126
130 unsigned int size;
131} *Queue;
132
133#endif
ArrayList type
Definition: types.h:31
spec_t type
The type of the elements contained by the ArrayList. Refer to spec_t.
Definition: types.h:35
unsigned int size
The number of elements contained by the ArrayList.
Definition: types.h:45
void * body
Void pointer to the first element of the ArrayList.
Definition: types.h:40
LinkedList type
Definition: types.h:69
Node head
Head of the LinkedList.
Definition: types.h:78
Node tail
Tail of the LinkedList.
Definition: types.h:83
spec_t type
The type of the elements contained by the LinkedList. Refer to spec_t.
Definition: types.h:73
unsigned int size
The number of elements contained by the LinkedList.
Definition: types.h:88
Queue type
Definition: types.h:111
spec_t type
The type of the elements contained by the Queue. Refer to spec_t.
Definition: types.h:115
Node head
Head of the Queue.
Definition: types.h:120
Node tail
Tail of the Queue.
Definition: types.h:125
unsigned int size
The number of elements contained by the Queue.
Definition: types.h:130
Stack type
Definition: types.h:95
spec_t type
The type of the elements contained by the Stack. Refer to spec_t.
Definition: types.h:99
Node head
Head of the Stack.
Definition: types.h:104
Node type
Definition: types.h:53
struct node * linked
The Node this Node is linked to.
Definition: types.h:62
void * data
Pointer to the value contained.
Definition: types.h:57
char * spec_t
Used to specify type of argument passed in functions that require a type specifier.
Definition: types.h:20
char byte
Alias for char, just to avoid confusion with 8 bit numbers and ASCII characters.
Definition: types.h:13
char * string
Alias for char *, used when an array of char is actually used as a string.
Definition: types.h:25
struct node * Node
Node type