ZE-Standard-Libraries/list/list.h

59 lines
1.7 KiB
C
Raw Normal View History

2018-07-23 04:59:16 +00:00
#ifndef LIST_H
#define LIST_H
#include "../type/type.h"
2018-07-25 14:10:09 +00:00
#include "../id/id.h"
2018-07-23 04:59:16 +00:00
2018-08-03 03:38:19 +00:00
int safeModeForNode(int ifon);
int releaseSingleListForsafeModeForNode(List *p_list);
int releaseSingleNodeForsafeModeForNode(List *p_list);
int releaseAllForNode(void);
2018-07-23 04:59:16 +00:00
List *initList(void);
Node *initNode(void);
2018-08-07 04:10:55 +00:00
int initMallocValueForNode(Node *,unsigned int,const void *);
2018-07-23 04:59:16 +00:00
int insertInHead(List *p_list, Node *p_node);
int insertInTail(List *p_list, Node *p_node);
int exchangeLocation(Node *p_node,Node *t_node);
Node *copyNode(Node *);
2018-07-30 09:45:33 +00:00
int removeById(List *p_list, const SID *s_id);
2018-07-23 04:59:16 +00:00
int removeByNode(List *p_list, Node *p_node);
int popFromHead(List *p_list);
int popFromTail(List *p_list);
2018-08-03 03:38:19 +00:00
unsigned long long len(List *p_list);
2018-07-23 04:59:16 +00:00
2018-08-03 03:38:19 +00:00
Node *findByIdForNode(List *p_list, const SID *s_id);
Node *findByValue(List *p_list, unsigned int type, const void *value);
List *mply_findByValue(List *p_list, unsigned int type, const void *value);
2018-07-23 04:59:16 +00:00
2018-08-03 03:38:19 +00:00
int releaseList(List *p_list);
2018-08-03 10:32:20 +00:00
int releaseListForCustom(List *p_list, int (*func)(void *));
2018-08-03 03:38:19 +00:00
int releaseListForSingle(List *p_list);
int releaseNode(Node *p_node);
2018-08-03 10:32:20 +00:00
int releaseNodeForCustom(Node *p_node, int (*func)(void *));
2018-08-03 03:38:19 +00:00
int releaseOnlyNode(Node *p_node);
2018-07-23 04:59:16 +00:00
2018-08-03 03:38:19 +00:00
int isListEmpty(List *p_list);
List *copyList(List *p_list);
2018-07-23 04:59:16 +00:00
2018-08-03 10:32:20 +00:00
int pushInfo(Info *p_info, const char *head,const char *body);
Error *pushError(unsigned int type, int pri, Info *p_info);
Notice *pushNotice(unsigned int type, Info *p_info);
Info *initInfo(const char *head, const char *body);
Error *createError(Info *info,unsigned int type,int pri);
Notice *createWarning(Info *info, unsigned int type, int pri);
int showError(Error *);
int showWarning(Notice *);
2018-07-23 04:59:16 +00:00
static int if_safeModeForNode;
2018-08-03 03:38:19 +00:00
static List *node_list;
static List *list_list;
2018-07-23 04:59:16 +00:00
#endif