C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
common.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "os.h"
8 #include "typedefs.h"
9 #include "logger.h"
10 #include "memory_manager.h"
11 #include "fault_manager.h"
12 #include "generic_def.h"
13 
18 typedef struct data_params {
19  // type of datatypes
21 
22  // data type specific routines
27 
31 
35 
37 void dummy_free(void *mem_addr, char *file, int line);
38 
struct data_params t_dparams
data params struct defn
void init_data_params(t_dparams *, e_data_types)
Called to initalize data params for default data types Else for custom data types the data params str...
Definition: common.c:15
void dummy_free(void *mem_addr, char *file, int line)
Dummy free function Else for custom data types the data params structure is to be defined by user
Definition: common.c:75
Contains declarations of fault manager routines.
Contains Macros that are used for defining psuedo data template functions.
Defines Macros for logging.
Contains decalration of structures for maintaing all mem alloc and frees.
Used for including os specific headers.
data params struct defn
Definition: common.h:18
f_cmpr cmpr
Routine used for comparing two given elems of said type.
Definition: common.h:23
f_get_idx get_idx
Routine used for getting elem in given array index.
Definition: common.h:32
f_swap swap
Routine used for swaping two elemnts of goven data.
Definition: common.h:25
e_data_types type
Holds elem data type.
Definition: common.h:20
f_swp_idx swap_idx
Routine used for swapring elems in given array indicies.
Definition: common.h:29
f_free free
Routine used for freeing elements of said data.
Definition: common.h:26
f_cpy_idx copy_idx
Routine used for copying elems in given array indicies.
Definition: common.h:30
f_print print_data
Routine used for printing elem data.
Definition: common.h:33
f_cmp_idx cmpr_idx
Routine used for comparing elems in given array indicies.
Definition: common.h:28
f_assign assign
Routine used for creating memory for storing the data.
Definition: common.h:24
Contains typedefs for all necessary data type and function pointers.
void(* f_free)(t_gen, char *, int)
Definition: typedefs.h:67
f_vgen f_print
fn type to print function
Definition: typedefs.h:56
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
enum data_types e_data_types
Enum to create data structure of the following type.
f_vgen2 f_assign
Definition: typedefs.h:68
f_vgen2 f_swap
Definition: typedefs.h:69
e_cmpr(* f_cmp_idx)(t_gen, int, int)
Definition: typedefs.h:71