Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
klist.h
Go to the documentation of this file.
1#ifndef __KLIST_H__
2#define __KLIST_H__
3
4#include "../dlib/dlib.h"
5
6
7#ifdef __cplusplus
8extern "C" {
9#endif /* __cplusplus */
10
11typedef struct {
12 int Key;
13 void *Data;
15
16typedef struct {
18 int Clean;
19 int Counter;
20} Klist_t;
21
22
23/*
24 * Function prototypes
25 */
26void* a_Klist_get_data(Klist_t *Klist, int Key);
27int a_Klist_insert(Klist_t **Klist, void *Data);
28void a_Klist_remove(Klist_t *Klist, int Key);
29int a_Klist_length(Klist_t *Klist);
30void a_Klist_free(Klist_t **Klist);
31
32
33#ifdef __cplusplus
34}
35#endif /* __cplusplus */
36
37#endif /* __KLIST_H__ */
void a_Klist_free(Klist_t **Klist)
Free a Klist.
Definition klist.c:110
void a_Klist_remove(Klist_t *Klist, int Key)
Remove data by Key.
Definition klist.c:86
void * a_Klist_get_data(Klist_t *Klist, int Key)
Return the data pointer for a given Key (or NULL if not found)
Definition klist.c:43
int a_Klist_insert(Klist_t **Klist, void *Data)
Insert a data pointer and return a key for it.
Definition klist.c:56
int a_Klist_length(Klist_t *Klist)
Return the number of elements in the Klist.
Definition klist.c:102
Definition dlib.h:131
void * Data
data reference
Definition klist.h:13
int Key
primary key
Definition klist.h:12
int Counter
counter (for making keys)
Definition klist.h:19
int Clean
check flag
Definition klist.h:18
Dlist * List
Definition klist.h:17