-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.h
More file actions
43 lines (37 loc) · 902 Bytes
/
list.h
File metadata and controls
43 lines (37 loc) · 902 Bytes
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
#include "gl_def.h"
#ifndef __ADLIST_H__
#define __ADLIST_H__
typedef struct listNode {
struct listNode *prev;
struct listNode *next;
void *value;
} listNode;
typedef struct list {
listNode *head;
listNode *tail;
unsigned int len;
} list;
typedef struct listIter {
listNode *next;
int direction;
} listIter;
typedef struct Account{
char *acc_type;
char *acc_id;
char *acc_pwd;
}Account;
/*global data*/
list gl_list;
/*prototype*/
list *listCreate(void);
void listRelease(list *list);
list *listAddNodeHead(list *list,void *value);
list *listAddNodeTail(list *list,void *value);
bool initList(list *list);
bool insertList(list *list,char *type,char *id,char *pwd);
bool listDelNode(list *list,listNode *node);
void showListNode(listNode *node);
listNode *searchListByTypeAndID(list *list,char *type,char *id);
bool freeListNode(listNode *node);
bool freeAccount(Account *pac);
#endif