-
Notifications
You must be signed in to change notification settings - Fork 0
/
lists.h
executable file
·51 lines (45 loc) · 1.48 KB
/
lists.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @file lists.h
* Lists Header file.
*
* Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD.
*
* This source code, which was not part of the CircleMUD legacy code,
* is attributed to:
* Copyright 2012 by Joseph Arnusch.
*/
#ifndef _LISTS_HEADER
#define _LISTS_HEADER
struct item_data {
struct item_data * pPrevItem;
struct item_data * pNextItem;
void * pContent;
};
struct list_data {
struct item_data * pFirstItem;
struct item_data * pLastItem;
unsigned short int iIterators;
unsigned short int iSize;
};
struct iterator_data {
struct list_data * pList;
struct item_data * pItem;
};
/* Externals */
extern struct list_data * global_lists;
extern struct list_data * group_list;
/* Locals */
void add_to_list(void * pContent, struct list_data * pList);
void * random_from_list(struct list_data * pList);
struct list_data * randomize_list(struct list_data * pList);
struct list_data * create_list(void);
void * merge_iterator(struct iterator_data * pIterator, struct list_data * pList);
void remove_iterator(struct iterator_data * pIterator);
void * next_in_list(struct iterator_data * pIterator);
void remove_from_list(void * pContent, struct list_data * pList);
struct item_data * find_in_list(void * pContent, struct list_data * pList);
void * simple_list(struct list_data * pList);
void free_list(struct list_data * pList);
void clear_simple_list(void);
#endif