testharn.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- #ifndef _THG_H
- #define _THG_H
- /*******************************************************************************
- * Include Files
- *******************************************************************************/
- #include "string.h"
- /*******************************************************************************
- * Macro Definitions
- *******************************************************************************/
- #define GROUP(c1, c2, c3, c4, c5) ( (long) (
- (c1 - 48) + 50L * (c2 - 48) + 2500L * (c3 - 48) +
- 125000L * (c4 - 48) + 6250000L *(c5 - 48)
- ) )
- #define DECLARE_GROUPFUNC(name) void name(char *cmd, char *options);
- #define DEFINE_GROUPFUNC(name) void name(char *cmd, char *options)
- {
- #define GROUP_SWITCH if ( strcmp(cmd, "") == 0) { return; }
- #define END_GROUPFUNC }
- #define CASE_CMD(CMD) else if ( strcmp(cmd, CMD) == 0 ) {
- #define DEFAULT else {
- #define END_CASE }
- #define OPTIONS options
- /*******************************************************************************
- * Type Definitions
- *******************************************************************************/
- typedef struct {
- long group;
- void (*func)(char*, char*);
- } THGConnection;
- /*******************************************************************************
- * Function Prototypes
- *******************************************************************************/
- void TH_GetParam(char *parstring, char *formatstr, ...);
- SAMP(ErrCode) SAMP(TH_Send)(char *group, char *cmd, char *format, ...);
- SAMP(ErrCode) SAMP(TH_Trace)(char *msg);
- SAMP(ErrCode) SAMP(TH_Init)(void);
- SAMP(ErrCode) SAMP(TH_Term)(void);
- #endif
- /*******************************************************************************
- * End of File
- *******************************************************************************/