blob: a8f0f92ef7079fb466f3bec7160b690d92fd5d3e (
plain)
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
52
53
54
55
56
57
58
59
60
|
#ifndef LIST_SSS_H
#define LIST_SSS_H
#include <stdio.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#include <talloc.h>
#include "util/util.h"
#define LIST_SSS_SUCCESS 0
#define LIST_SSS_ERROR -1
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef int Bool;
/*
** the linked list structure
*/
typedef struct _list_sss
{
void *data;
struct _list_sss *next;
} list_sss;
/*
** function prototypes
*/
void initList (list_sss **list);
list_sss *allocateNode (TALLOC_CTX *ctx,void *data);
void appendNode (TALLOC_CTX *ctx,list_sss **list,void * data);
int delNode (list_sss **list,list_sss *node);
Bool is_empty_list (list_sss *list);
list_sss *getNthNode (list_sss *list,int n);
size_t numNodes (list_sss **head);
#endif /* LIST_SSS_H */
|