📄 sqlist.h
字号:
/*sqlist.c*/
#define LIST_INIT_SIZE 20
#define LIST_INCREMENT 10
#define MAKE_SQLIST(TYPE,LISTNAME) struct _##LISTNAME\
{\
TYPE *elem;\
int length;\
int listsize;\
}LISTNAME;
#define SQLIST_INIT(TYPE,LISTNAME) \
LISTNAME##.elem=(TYPE *)malloc(LIST_INIT_SIZE*sizeof(LISTNAME)); \
LISTNAME##.length=0; \
LISTNAME##.listsize=LIST_INIT_SIZE;
#define SQLIST_INSERTBACK(TYPE,LISTNAME,ELEM,COPYFUNC) \
if(LISTNAME##.length>=LISTNAME##.listsize-1) \
{ \
LISTNAME##.elem=(TYPE*)malloc((LISTNAME##.listsize+LIST_INCREMENT)*sizeof(LISTNAME)); \
LISTNAME##.listsize+=LIST_INCREMENT; \
} \
COPYFUNC(&##LISTNAME##.elem[LISTNAME##.length++],&##ELEM); \
#define MakeSqlist(type,listname) MAKE_SQLIST(type,listname)
#define SqlistInit(type,listname) SQLIST_INIT(type,listname)
#define SqlistInsertback(type,listname,elem,copyfunc) \
SQLIST_INSERTBACK(type,listname,elem,copyfunc)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -