C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
typedefs.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include <stdbool.h>
7 
9 typedef char t_int8;
10 typedef unsigned char t_uint8;
11 typedef short t_int16;
12 typedef unsigned short t_uint16;
13 typedef int t_int32;
14 typedef unsigned int t_uint32;
15 typedef float t_float;
16 typedef double t_double;
17 
19 typedef enum data_types {
32 
34 typedef enum {
35  eLESS=-1,
36  eEQUAL=0,
37  eGREAT=1,
38 } e_cmpr;
39 
41 typedef void* t_gen;
42 
43 
44 
46 typedef t_gen (*f_gen)(t_gen);
47 typedef t_gen (*f_gen2)(t_gen, t_gen);
48 typedef t_gen (*f_gen3)(t_gen, t_gen, t_gen);
49 typedef void (*f_vgen)(t_gen);
50 typedef void (*f_vgen2)(t_gen, t_gen);
51 typedef t_gen (*f_genidx)(t_gen, int);
52 
53 typedef bool (*f_empty)(t_gen);
54 typedef bool (*f_full)(t_gen);
55 typedef int (*f_len)(t_gen);
56 typedef f_vgen f_print;
57 
58 typedef f_vgen2 f_ins;
59 typedef f_gen2 f_del;
60 typedef f_gen2 f_find;
61 typedef f_vgen f_destroy;
64 
66 typedef e_cmpr (*f_cmpr)(t_gen,t_gen);
67 typedef void(*f_free)(t_gen, char*, int);
68 typedef f_vgen2 f_assign;
69 typedef f_vgen2 f_swap;
70 
71 typedef e_cmpr (*f_cmp_idx)(t_gen,int, int);
72 typedef void (*f_swp_idx)(t_gen,int, int);
73 typedef void (*f_cpy_idx)(t_gen,int, t_gen);
void(* f_vgen)(t_gen)
fn ptr that takes one gen ptr and return nothing
Definition: typedefs.h:49
unsigned char t_uint8
Definition: typedefs.h:10
f_gen2 f_find
fn type of find a elem function
Definition: typedefs.h:60
bool(* f_empty)(t_gen)
fn type of an empty function
Definition: typedefs.h:53
void(* f_free)(t_gen, char *, int)
Definition: typedefs.h:67
f_vgen f_print
fn type to print function
Definition: typedefs.h:56
unsigned short t_uint16
Definition: typedefs.h:12
f_vgen f_destroy
fn type of destroy function
Definition: typedefs.h:61
void(* f_cpy_idx)(t_gen, int, t_gen)
Definition: typedefs.h:73
e_cmpr(* f_cmpr)(t_gen, t_gen)
Basic operations required for generic data type support.
Definition: typedefs.h:66
f_genidx f_get_idx
fn type of delete elem at idx function
Definition: typedefs.h:63
void(* f_swp_idx)(t_gen, int, int)
Definition: typedefs.h:72
t_gen(* f_genidx)(t_gen, int)
fn ptr that takes one gen ptr, idx and return gen ptr
Definition: typedefs.h:51
double t_double
Definition: typedefs.h:16
bool(* f_full)(t_gen)
fn type of a full function
Definition: typedefs.h:54
t_gen(* f_gen2)(t_gen, t_gen)
fn ptr that takes two gen ptr and return gen ptr
Definition: typedefs.h:47
void(* f_vgen2)(t_gen, t_gen)
fn ptr that takes two gen ptr and return nothing
Definition: typedefs.h:50
int t_int32
Definition: typedefs.h:13
enum data_types e_data_types
Enum to create data structure of the following type.
int(* f_len)(t_gen)
fn type of get len function
Definition: typedefs.h:55
void * t_gen
Base Data type used for all data structure and data elements.
Definition: typedefs.h:41
f_vgen2 f_ins
fn type of insert elem function
Definition: typedefs.h:58
t_gen(* f_gen)(t_gen)
Generic data pointer definitions that are common to most data structure operations.
Definition: typedefs.h:46
t_gen(* f_gen3)(t_gen, t_gen, t_gen)
fn ptr that takes three gen ptr and return gen ptr
Definition: typedefs.h:48
short t_int16
Definition: typedefs.h:11
f_vgen2 f_assign
Definition: typedefs.h:68
float t_float
Definition: typedefs.h:15
unsigned int t_uint32
Definition: typedefs.h:14
f_genidx f_del_idx
fn type of get elem at idx function
Definition: typedefs.h:62
e_cmpr
Custom Compare function return type.
Definition: typedefs.h:34
@ eGREAT
Definition: typedefs.h:37
@ eLESS
Definition: typedefs.h:35
@ eEQUAL
Definition: typedefs.h:36
f_vgen2 f_swap
Definition: typedefs.h:69
f_gen2 f_del
fn type of delete elem function
Definition: typedefs.h:59
e_cmpr(* f_cmp_idx)(t_gen, int, int)
Definition: typedefs.h:71
char t_int8
Typedefing Standard data types.
Definition: typedefs.h:9
data_types
Enum to create data structure of the following type.
Definition: typedefs.h:19
@ eUINT8
Definition: typedefs.h:21
@ eINT16
Definition: typedefs.h:22
@ eFLOAT
Definition: typedefs.h:26
@ eSTRING
Definition: typedefs.h:28
@ eDOUBLE
Definition: typedefs.h:27
@ eINT32
Definition: typedefs.h:24
@ eUINT16
Definition: typedefs.h:23
@ eGEN
Definition: typedefs.h:29
@ eUSER
Definition: typedefs.h:30
@ eUINT32
Definition: typedefs.h:25
@ eINT8
Definition: typedefs.h:20