File: list.h

package info (click to toggle)
wcalc 2.2.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,228 kB
  • ctags: 698
  • sloc: ansic: 6,918; objc: 1,835; sh: 766; yacc: 644; lex: 573; makefile: 78
file content (37 lines) | stat: -rw-r--r-- 914 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 *
 * This file is the header of a basic, generic list (well, technically, a
 * queue) object implementation.
 *
 */
#ifndef WCALC_PACKETLIST
#define WCALC_PACKETLIST

struct _list;
typedef struct _list *List;
struct _list_iterator;
typedef struct _list_iterator *ListIterator;

/* this is for the memory pools */
void lists_init(void);
void lists_cleanup(void);

/* List operations */
void addToList(List *, void *);
void addToListHead(List *, void *);
void *getHeadOfList(List);
void *peekListElement(List, size_t);
void *getListElement(List, size_t);
inline void *peekAheadInList(List);
inline unsigned long listLen(List);
void removeFromList(List, void *);
void freeList(List *);

/* ListIterator operations */
ListIterator getListIterator(List);
void *currentListElement(ListIterator);
void *nextListElement(ListIterator);
void resetListIterator(ListIterator);
void freeListIterator(ListIterator);

#endif