添加注释.

This commit is contained in:
Saturneic 2018-08-22 22:50:08 +08:00
parent 5eaafa0b64
commit 8dd9e19477

View File

@ -3,63 +3,347 @@
#include "list.h"
#define __RETURN(argc, args...) newReturn(1, -1, argc , args)
#define __CRETURN__ newCReturn()
/************************************************
*便
************************************************/
/****
*
*/
/*
*使
*: argc指示传递参数的类型格式;args为需要返回的参数.*/
#define __SEND_ARG(argc, args...) newReturn(0, -1, argc , args)
/*
*使
*: name为回调函数名.*/
#define __CALLBACK_STATE(name) List *_do##name(unsigned int, void *, List *)
/*
*使
*: name为回调函数名.*/
#define __CALLBACK_DEFINE(name) List *_do##name(unsigned int type, void *value, List *expand_resources)
#define __VALUE(c_type) (c_type)value
#define __ARGS(x, type) *((type *) lidxp(expand_resources, x));
#define __ARGS_P(x, type) (type *) lidxp(expand_resources, x);
/*
*使
*: name为回调函数名.*/
#define __CALLBACK_CALL(name) _do##name
#define __LIST_LEN getInfoForListThrough(expand_resources,0)
#define __NOW_INDEX getInfoForListThrough(expand_resources,1)
/*
*使
*: x为该值的顺序号, type为获取的指针值的类型.*/
#define __RTN_ARGS_P(list,x,type) (type *) lidxp(list, x);
#define __RTN_ARGS(list,x,type) *((type *) lidxp(list, x));
Node *nodeWithInt(int, _Bool if_sid);
Node *nodeWithUInt(unsigned int, _Bool if_sid);
Node *nodeWithULLInt(unsigned long long, _Bool if_sid);
Node *nodeWithDouble(double, _Bool if_sid);
Node *nodeWithString(const char *, _Bool if_sid);
Node *nodeWithPointer(const void *, _Bool if_sid);
s_Node *s_nodeWithInt(int);
s_Node *s_nodeWithUInt(unsigned int);
s_Node *s_nodeWithDouble(double);
s_Node *s_nodeWithString(const char *);
s_Node *s_nodeWithPointer(const void *);
Node *nodeWithComplex(void);
int addValueForComplex(Node *, int type, void *value);
int addIntForComplex(Node *, int);
int addDoubleForComplex(Node *, double);
int addStringForComplex(Node *, char *);
int addPointerForComplex(Node *, void *);
/*
*使
*: x为该值的顺序号, type为获取的值的类型.*/
#define __RTN_ARGS(list,x,type) *((type *) lidxp(list, x));
/****
*
*/
/*
*使
*: c_type为获取值的类型.*/
#define __VALUE(c_type) (c_type)value
/*
*使
*: x为该值的顺序号, type为获取值的类型.*/
#define __ARGS(x, type) *((type *) lidxp(expand_resources, x));
/*
*使
*: x为该值的顺序号, type为获取的指针值的类型.*/
#define __ARGS_P(x, type) (type *) lidxp(expand_resources, x);
/*
*使
*/
#define __LIST_LEN getInfoForListThrough(expand_resources,0)
/*
*使
*/
#define __NOW_INDEX getInfoForListThrough(expand_resources,1)
/*
*使
*: argc指示返回参数的个数;args为需要返回的参数.*/
#define __RETURN(argc, args...) newReturn(1, -1, argc , args)
/*
*使
*/
#define __CRETURN__ newCReturn()
/************************************************
*: ,
* 使.
************************************************/
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithInt(int, _Bool if_sid);
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithUInt(unsigned int, _Bool if_sid);
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithULLInt(unsigned long long, _Bool if_sid);
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithDouble(double, _Bool if_sid);
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithString(const char *, _Bool if_sid);
/*
*, 使
*if_sid指示函数是否为节点获取ID
*: ,NULL.*/
extern Node *nodeWithPointer(const void *, _Bool if_sid);
/************************************************
*: ,
* 使.
************************************************/
/*
*, 使
*: ,NULL.*/
extern s_Node *s_nodeWithInt(int);
/*
*, 使
*: ,NULL.*/
extern s_Node *s_nodeWithUInt(unsigned int);
/*
*, 使
*: ,NULL.*/
extern s_Node *s_nodeWithDouble(double);
/*
*, 使
*: ,NULL.*/
extern s_Node *s_nodeWithString(const char *);
/*
*, 使
*: ,NULL.*/
extern s_Node *s_nodeWithPointer(const void *);
int updateValueWithIntForNode(Node *,int);
int updateValueWithULLIntForNode(Node *, unsigned long long);
int updateValueWithDoubleForNode(Node *,double);
int updateValueWithStringForNode(Node *,char *);
int updateValueWithPointerForNode(Node *,void *);
List *mply_findByIntForNode(List*, int);
List *mply_findByDoubleForNode(List*, double);
List *mply_findByStringForNode(List*, char *);
/************************************************
*: ,
* 使
*: .
************************************************/
/*
*
*: ,NULL.*/
extern Node *nodeWithComplex(void);
/*
*
*: type指明所输入值的类型,value为指向所输入值的内存空间的指针
*: 0,-1.*/
extern int addValueForComplex(Node *, int type, void *value);
/*
*
*: 0,-1.*/
extern int addIntForComplex(Node *, int);
/*
*
*: 0,-1.*/
extern int addDoubleForComplex(Node *, double);
/*
*
*: 0,-1.*/
extern int addStringForComplex(Node *, char *);
/*
*
*: 0,-1.*/
extern int addPointerForComplex(Node *, void *);
/************************************************
*: ,
************************************************/
/*
*
*: 0,-1.*/
extern int updateValueWithIntForNode(Node *,int);
/*
*
*: 0,-1.*/
extern int updateValueWithULLIntForNode(Node *, unsigned long long);
/*
*
*: 0,-1.*/
extern int updateValueWithDoubleForNode(Node *,double);
/*
*
*: 0,-1.*/
extern int updateValueWithStringForNode(Node *,char *);
/*
*
*: 0,-1.*/
extern int updateValueWithPointerForNode(Node *,void *);
/************************************************
*: ,
************************************************/
/*
*,
*: ,NULL.*/
List *mply_findByIntForNode(List*, int);
/*
*,
*: ,NULL.*/
List *mply_findByDoubleForNode(List*, double);
/*
*,
*: ,NULL.*/
List *mply_findByStringForNode(List*, char *);
/*
*,
*: ,NULL.*/
List *mply_findByPointerForNode(List*, void *);
void printListInfo(List *p_list,int priority);
void printNodeInfo(Node *p_node,int priority);
void printList(List *);
void printListForCustom(List *p_list,void (*func)(void *value));
void printNode(Node *p_node);
__CALLBACK_STATE(printListForCustom);
List *listThrough(List *p_list, List *(*p_func)(unsigned int type, void *value, List *), List *expand_resources);
List *newReturn(int if_status ,int status, char *argc, ...);
/************************************************
*:
************************************************/
/*
*
*: priority为每行输出信息前的空格数除以4*/
void printListInfo(List *p_list,int priority);
/*
*
*: priority为每行输出信息前的空格数乘以4*/
void printNodeInfo(Node *p_node,int priority);
/*
*
*/
void printList(List *);
/*
*
*: func为一个函数指针, */
void printListForCustom(List *p_list,void (*func)(void *value));
/*
*printListForCustom函数的回调函数
*/
__CALLBACK_STATE(printListForCustom);
/*
*
*/
void printNode(Node *p_node);
/************************************************
*:
************************************************/
/*
*
*: p_func为一个函数指针, (type)/(value)/(args),
,,,,
expand_resources为一个链表,
*: ,,NULL.*/
extern List *listThrough(List *p_list, List *(*p_func)(unsigned int type, void *value, List *args), List *expand_resources);
/*
*,便
*/
extern List *newReturn(int if_status ,int status, char *argc, ...);
/*
*,便
*/
List *newCReturn(void);
/*
*,便
*/
unsigned long long getInfoForListThrough(List *expand_resources, int type);
/************************************************
*:
************************************************/
/*
*
*/
unsigned long long calListMemory(List *);
#endif