The LevAWC Project
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
cslist.h
Go to the documentation of this file.
1 /*
2  * _____
3  * ANSI / ___/
4  * / /__
5  * \___/
6  *
7  * Filename: cslist.h
8  * Author : Kyle Loudon/Dan Levin
9  * Date : Mon Apr 08 19:29:27 2013
10  * Version : 0.51
11  * ---
12  * Description: A circular, singly-linked list - implemented as a pure, generic ADT
13  *
14  * Revision history - coming up below:
15  *
16  * Date Revision message
17  * 130409 Created this file
18  * 150331 This code ready for version 0.51
19  *
20  */
25 #ifndef _CSLIST_H_
26 #define _CSLIST_H_
27 
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <malloc.h>
32 #include <assert.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
43  typedef struct CSList_ *CSlist;
44 
50  typedef struct CSListElmt_ *CSlistNode;
51 
52  /* FUNCTION DECLARATIONS */
53 
70  CSlist CSLISTinit(void (*destroy)(void *data));
71 
86  void CSLISTdestroy(CSlist clist);
87 
105  int CSLISTinsnext(CSlist clist, CSlistNode node, const void *data);
106 
124  int CSLISTremnext(CSlist clist, CSlistNode node, void **data);
125 
133  int CSLISTsize(CSlist clist);
134 
141  CSlistNode CSLISThead(CSlist clist);
142 
152  int CSLISTishead(CSlist clist, CSlistNode node);
153 
160  void *CSLISTdata(CSlistNode node);
161 
169  CSlistNode CSLISTnext(CSlistNode node);
170 
191  CSlistNode CSLISTfindnode(CSlist clist, const void *data);
192 
206  void CSLISTsetmatch(CSlist clist, int (*match)(const void *key1,
207  const void *key2));
242  int CSLISTfind_remove(CSlist clist, void **data);
243 
255  void CSLISTtraverse(CSlist clist, void (*callback)(const void *data));
256 
257 #ifdef __cplusplus
258 }
259 #endif
260 
261 #endif /* _CSLIST_H_ */
262