ZE-Standard-Libraries/include/chain/chain.h

289 lines
9.8 KiB
C
Raw Normal View History

2019-01-11 18:22:04 +00:00
#ifndef chain_h
#define chain_h
2018-08-22 14:50:08 +00:00
2019-01-11 18:22:04 +00:00
#include <chain/chain_type.h>
#include <list/list.h>
2018-08-22 14:50:08 +00:00
/************************************************
*: ,
* 使.
************************************************/
/*
*, 使
*if_sid指示函数是否为节点获取ID
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithInt(int, _Bool if_sid);
2018-08-22 14:50:08 +00:00
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithUInt(unsigned int, _Bool if_sid);
2018-08-22 14:50:08 +00:00
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithULLInt(unsigned long long, _Bool if_sid);
2018-08-22 14:50:08 +00:00
/*
*, 使
*if_sid指示函数是否为节点获取ID
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithDouble(double, _Bool if_sid);
2018-08-22 14:50:08 +00:00
/*
*, 使
*if_sid指示函数是否为节点获取ID
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithString(const char *, _Bool if_sid);
2018-08-22 14:50:08 +00:00
/*
*, 使
*if_sid指示函数是否为节点获取ID
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithPointer(const void *, _Bool if_sid);
2018-08-22 14:50:08 +00:00
2019-01-06 10:44:11 +00:00
2018-08-22 14:50:08 +00:00
/************************************************
*: ,
* 使
*: .
************************************************/
/*
*
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *nodeWithComplex(void);
2018-08-22 14:50:08 +00:00
/*
*
*: type指明所输入值的类型,value为指向所输入值的内存空间的指针
2019-01-06 10:44:11 +00:00
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int addValueForComplex(CNode *, int type, void *value);
2018-08-22 14:50:08 +00:00
/*
*
2019-01-06 10:44:11 +00:00
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int addIntForComplex(CNode *, int);
2018-08-22 14:50:08 +00:00
/*
*
2019-01-06 10:44:11 +00:00
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int addDoubleForComplex(CNode *, double);
2018-08-22 14:50:08 +00:00
/*
*
2019-01-06 10:44:11 +00:00
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int addStringForComplex(CNode *, char *);
2018-08-22 14:50:08 +00:00
/*
*
2019-01-06 10:44:11 +00:00
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int addPointerForComplex(CNode *, void *);
2018-08-22 14:50:08 +00:00
/************************************************
*: ,
************************************************/
/*
*
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int updateValueWithIntForNode(CNode *,int);
2018-08-22 14:50:08 +00:00
/*
*
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int updateValueWithULLIntForNode(CNode *, uint64_t);
2018-08-22 14:50:08 +00:00
/*
*
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int updateValueWithDoubleForNode(CNode *,double);
2018-08-22 14:50:08 +00:00
/*
*
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int updateValueWithStringForNode(CNode *,char *);
2018-08-22 14:50:08 +00:00
/*
*
*: 0,-1.*/
2019-01-11 18:22:04 +00:00
extern int updateValueWithPointerForNode(CNode *,void *);
2018-08-22 14:50:08 +00:00
/************************************************
*: ,
************************************************/
/*
*,
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
Chain *mply_findByIntForNode(Chain*, int);
2018-08-22 14:50:08 +00:00
/*
*,
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
Chain *mply_findByDoubleForNode(Chain*, double);
2018-08-22 14:50:08 +00:00
/*
*,
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
Chain *mply_findByStringForNode(Chain*, char *);
2018-08-22 14:50:08 +00:00
/*
*,
2019-01-06 10:44:11 +00:00
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
Chain *mply_findByPointerForNode(Chain*, void *);
2018-08-22 14:50:08 +00:00
/************************************************
*:
************************************************/
/*
*
*: p_func为一个函数指针, (type)/(value)/(args),
2019-01-11 18:22:04 +00:00
,,,,
expand_resources为一个链表,
2019-01-06 10:44:11 +00:00
*: ,,NULL.*/
2019-01-11 18:22:04 +00:00
extern Chain *listThrough(Chain *p_list, Chain *(*p_func)(unsigned int type, void *value, Chain *args), Chain *expand_resources);
2018-08-22 14:50:08 +00:00
/*
*,便
*/
2019-01-11 18:22:04 +00:00
extern Chain *newReturn(int if_status ,int status, char *argc, ...);
2018-08-22 14:50:08 +00:00
/*
*,便
*/
2019-01-11 18:22:04 +00:00
Chain *newCReturn(void);
2018-08-22 14:50:08 +00:00
/*
*,便
*/
2019-01-11 18:22:04 +00:00
uint64_t getInfoForListThrough(Chain *expand_resources, int type);
2018-08-22 14:50:08 +00:00
/************************************************
*:
************************************************/
/*
*
*/
2019-01-11 18:22:04 +00:00
uint64_t calListMemory(Chain *);
2018-08-22 14:50:08 +00:00
2018-08-23 16:57:38 +00:00
/***********************************************
*:
***********************************************/
/*
**/
2019-01-11 18:22:04 +00:00
extern uint64_t len(Chain *p_list);
2018-08-23 16:57:38 +00:00
/*
*
*: 1,0.*/
2019-01-11 18:22:04 +00:00
extern int isListEmpty(Chain *p_list);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern int getByIntForNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern unsigned int getByUIntForNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern double getByDoubleForNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern char *getByStringForNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern void *getByPointerForNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*
*: */
2019-01-11 18:22:04 +00:00
extern unsigned long long getIndexForNode(Chain *p_list,CNode *p_node);
2018-08-23 16:57:38 +00:00
/*
*,.
*: ,NULL*/
2019-01-11 18:22:04 +00:00
extern CNode *updateNodeByIndex(Chain *p_list, void *new_value, unsigned long long index);
2018-08-23 16:57:38 +00:00
/**********************************************
*:
*********************************************/
/*
*,,.
*: ID相同.
*: ,NULL*/
2019-01-11 18:22:04 +00:00
extern CNode *copyNode(CNode *);
2018-08-23 16:57:38 +00:00
/*
*,,.
*: ID相同.
*: ,NULL*/
2019-01-11 18:22:04 +00:00
Chain *copyList(Chain *p_list);
2018-08-23 16:57:38 +00:00
/*
*
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *findByIndexForNode(Chain *, unsigned long long);
2018-08-23 16:57:38 +00:00
/*
*
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *findByIntForNode(Chain *, int);
2018-08-23 16:57:38 +00:00
/*
*
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *findByDoubleForNode(Chain *, double);
2018-08-23 16:57:38 +00:00
/*
*.
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *findByStringForNode(Chain *, char *);
2018-08-23 16:57:38 +00:00
/*
*.
*: ,NULL.*/
2019-01-11 18:22:04 +00:00
extern CNode *findByPointerForNode(Chain *, void *);
2019-01-06 10:44:11 +00:00
2019-01-11 18:22:04 +00:00
#endif /* chain_h */