2018-07-23 04:59:16 +00:00
|
|
|
#ifndef LIST_EXPAND_H
|
2018-08-03 10:32:20 +00:00
|
|
|
#define LIST_EXPAND_H
|
|
|
|
|
2018-08-17 08:58:15 +00:00
|
|
|
#include "list.h"
|
|
|
|
|
2018-08-21 08:26:31 +00:00
|
|
|
#define __RETURN(argc, args...) newReturn(1, -1, argc , args)
|
|
|
|
#define __CRETURN__ newCReturn()
|
|
|
|
#define __SEND_ARG(argc, args...) newReturn(0, -1, argc , args)
|
|
|
|
#define __CALLBACK_STATE(name) List *_do##name(unsigned int, void *, List *)
|
|
|
|
#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);
|
|
|
|
#define __CALLBACK_CALL(name) _do##name
|
|
|
|
#define __LIST_LEN getInfoForListThrough(expand_resources,0)
|
|
|
|
#define __NOW_INDEX getInfoForListThrough(expand_resources,1)
|
|
|
|
#define __RTN_ARGS_P(list,x,type) (type *) lidxp(list, x);
|
|
|
|
#define __RTN_ARGS(list,x,type) *((type *) lidxp(list, x));
|
2018-08-17 08:58:15 +00:00
|
|
|
|
|
|
|
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);
|
2018-08-14 15:59:55 +00:00
|
|
|
|
|
|
|
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 *);
|
2018-07-23 04:59:16 +00:00
|
|
|
|
2018-08-03 03:38:19 +00:00
|
|
|
Node *nodeWithComplex(void);
|
|
|
|
int addValueForComplex(Node *, int type, void *value);
|
|
|
|
int addIntForComplex(Node *, int);
|
|
|
|
int addDoubleForComplex(Node *, double);
|
|
|
|
int addStringForComplex(Node *, char *);
|
2018-08-07 04:10:55 +00:00
|
|
|
int addPointerForComplex(Node *, void *);
|
|
|
|
|
2018-08-14 15:59:55 +00:00
|
|
|
int updateValueWithIntForNode(Node *,int);
|
2018-08-21 08:26:31 +00:00
|
|
|
int updateValueWithULLIntForNode(Node *, unsigned long long);
|
2018-08-14 15:59:55 +00:00
|
|
|
int updateValueWithDoubleForNode(Node *,double);
|
|
|
|
int updateValueWithStringForNode(Node *,char *);
|
|
|
|
int updateValueWithPointerForNode(Node *,void *);
|
2018-07-23 04:59:16 +00:00
|
|
|
|
2018-08-14 15:59:55 +00:00
|
|
|
List *mply_findByIntForNode(List*, int);
|
|
|
|
List *mply_findByDoubleForNode(List*, double);
|
|
|
|
List *mply_findByStringForNode(List*, char *);
|
|
|
|
List *mply_findByPointerForNode(List*, void *);
|
2018-07-23 04:59:16 +00:00
|
|
|
|
2018-08-03 03:38:19 +00:00
|
|
|
void printListInfo(List *p_list,int priority);
|
|
|
|
void printNodeInfo(Node *p_node,int priority);
|
2018-08-21 08:26:31 +00:00
|
|
|
void printList(List *);
|
|
|
|
void printListForCustom(List *p_list,void (*func)(void *value));
|
|
|
|
void printNode(Node *p_node);
|
|
|
|
|
|
|
|
__CALLBACK_STATE(printListForCustom);
|
2018-07-23 04:59:16 +00:00
|
|
|
|
2018-08-07 04:10:55 +00:00
|
|
|
List *listThrough(List *p_list, List *(*p_func)(unsigned int type, void *value, List *), List *expand_resources);
|
2018-08-17 08:58:15 +00:00
|
|
|
List *newReturn(int if_status ,int status, char *argc, ...);
|
|
|
|
List *newCReturn(void);
|
2018-08-21 08:26:31 +00:00
|
|
|
unsigned long long getInfoForListThrough(List *expand_resources, int type);
|
2018-07-23 05:47:31 +00:00
|
|
|
unsigned long long calListMemory(List *);
|
2018-07-23 04:59:16 +00:00
|
|
|
|
|
|
|
#endif
|