📄 table.h
字号:
#ifndef TABLE_H#define TABLE_H#include <stdio.h>#include <stdlib.h>#include <unistd.h>//表示数据类型的宏.//void #define TYPE_VOID 1 //1 void#define TYPE_IPVOID 2 //2 空指针#define TYPE_OPVOID 3 //3 空指针,输出数据//int #define TYPE_INT 4 //4 int#define TYPE_IPINT 5 //5 整数指针#define TYPE_OPINT 6 //6 整数指针,输出//char #define TYPE_CHR 7 //7 字符#define TYPE_ISTR 8 //8 字符指针#define TYPE_OSTR 9 //9 字符指针,输出//struct TDVSSS_divice #define TYPE_TD 10 //a struct TDVSSS_device #define TYPE_IPTD 11 //b struct TDVSSS_device类型的指针#define TYPE_OPTD 12 //c struct TDVSSS_device类型的指针,输出//struct sm #define TYPE_SM 13 //d#define TYPE_IPSM 14 //e#define TYPE_OPSM 15 //f//struct timetouch #define TYPE_TT 16 //g #define TYPE_IPTT 17 //h#define TYPE_OPTT 18 //i//表示函数参数的排列方式的宏#define MARK_0 1 //函数没有参数.#define MARK_1_4 2 //函数有一个参数,参数类型为:int.#define MARK_1_8 3 //函数有一个参数,参数类型为:char*.#define MARK_1_9 4 //函数有一个参数,参数类型为:char*.#define MARK_2_44 5#define MARK_2_46 6#define MARK_2_48 7 //函数有两个参数,参数类型依此为: int,char*.#define MARK_2_84 8 //函数有两个参数,参数类型依此为:char*,int#define MARK_2_94 9 //函数有两个参数,参数类型依此为:char*,int#define MARK_3_484 10 //函数有三个参数,依次为:int,char*,int.#define MARK_5_4844b 11 //函数有五个参数,依次为: int,char*,int,int,struct TDVSSS_device*.#define MARK_5_4966c 12 //函数有五个参数,依次为: int,char*,int*,int*,struct TDVSSS_device*.#define MARK_1_e 13#define MARK_1_f 14#define MARK_1_h 15#define MAX_ARGUMENT 10 //目前支持的函数参数的最大个数#define MAX_MEMBER 20 //目前支持的数据结构的成员变量的最大个数#define MAX_MULTICALL 10typedef int (*fn_ptr)();struct funcformat { char* name; //函数名称 int ret_type; //函数返回值类型 int success; //成功,返回值 fn_ptr func; //函数指针 int argc; //参数个数 int mark; //表示参数排列方式 int argv[MAX_ARGUMENT]; //各个参数的类型,argv[0]代表第一个参数,依此类推,参数个数的最大值为MAX_ARGUMENT}; //描述数据结构的成员变量的属性struct member { int offset; //此成员变量在数据结构中的偏移值 int type; //此成员变量的数据类型,};//描述数据结构的属性struct struct_format { char *name; //数据结构名称; int type; //用数字表示的数据结构名称 int size; //此数据结构所占空间大小 int count; //成员变量的个数 struct member member[MAX_MEMBER]; //各个成员变量的属性.};void callfunc(int,char*);//error code#define ENOTFUNC 1 //字符串不是函数#define EUNKNOWNFUNC 2 //未知的函数#define EUNKNOWNARGV 3 //未知的参数#define EUNKNOWNMARK 4 //未知的函数#define EUNKNOWNRET 5 //未知的返回值#define EINVALIDARG 6 //无效的参数#define ENOMEMORY 7 //内存不够#define EMAXMEMBER 8 //超过最大成员变量值的限止 #define EPOINTER 9 //空指针#define EOTHER 10#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -