C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
link_list.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "common.h"
8 
10 typedef enum {
16 }e_lltype;
17 
19 typedef struct llnode {
21  struct llnode *nxt;
22  struct llnode *prv;
24 
26 typedef struct linklist {
27  char *name;
29  int count;
31 
32  // linklist head and tail ref
35 
36  // linklist routines
53 
61 
62 
63 //API
64 t_gen create_link_list (char *name, e_lltype type, t_dparams *dprm);
Top level include containg common headers.
data params struct defn
Definition: common.h:18
Link list node definition.
Definition: link_list.h:19
t_gen data
Pointer to the data to be stored in link list.
Definition: link_list.h:20
struct llnode * prv
Pointer to prev node in list.
Definition: link_list.h:22
struct llnode * nxt
Pointer to next node in list.
Definition: link_list.h:21
f_gen2 f_find
fn type of find a elem function
Definition: typedefs.h:60
void(* f_free)(t_gen, char *, int)
Definition: typedefs.h:67
f_vgen f_print
fn type to print function
Definition: typedefs.h:56
f_vgen f_destroy
fn type of destroy function
Definition: typedefs.h:61
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
t_gen(* f_gen2)(t_gen, t_gen)
fn ptr that takes two gen ptr and return gen ptr
Definition: typedefs.h:47
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
f_vgen2 f_assign
Definition: typedefs.h:68
f_genidx f_del_idx
fn type of get elem at idx function
Definition: typedefs.h:62
f_vgen2 f_swap
Definition: typedefs.h:69
f_gen2 f_del
fn type of delete elem function
Definition: typedefs.h:59