
#ifndef _PAP_DEFINE_
#define _PAP_DEFINE_


#define MAX_WORD_NUM		16
#define MAX_PARA_NUM		255	
#define MAX_REMAIN_NUM		32
#define KEY_CMD_LEN     	32
#define MAX_RESCMD_NUM		8
#define MAX_WORD_LENGTH		128

enum TParamsType
{
	PARAM_TYPE_ANY,															//任意类型，不校验
	PARAM_TYPE_INT,															//整型，校验上下限值
	PARAM_TYPE_STR,															//字符串型，校验最大最小长度
	PARAM_TYPE_CUSTOM,  													//自定义类型，调用handle函数处理
};																			

#ifndef PAP_FAIL
#define PAP_FAIL			(-1)
#endif

#ifndef PAP_SUCC
#define PAP_SUCC			0
#endif

#ifndef RET_FAIL
#define RET_FAIL			(-1)
#endif

#ifndef RET_SUCC
#define RET_SUCC			0
#endif

/*回调函数定义*/
typedef int (*CallBackKeyCmd)(void* _pvBuf, int _iSzie, void* _pvUser);
typedef int (*CallBackGetParam)(int _iType, void* _pvBuf, int _iSzie, void* _pvUser);
typedef struct tagAnalyzeParam
{
	int						iSize;
	char**					pcCmdText;										//协议数组
	int						iWordNum;										//协议个数
	int						iParamNum;										//参数个数
	CallBackKeyCmd			pfCb;											//参数处理回调
	CallBackGetParam		pfGetParam;										//获取参数回调
	void*					pvUser;
}AnalyzeParam, *pAnalyzeParam;
typedef int (*CallBackAnalyze)(pAnalyzeParam _pParam);

typedef struct _TProtFrame TProtFrame;
#endif
