2014-11-18 23:08:34 +08:00
|
|
|
|
#ifndef ACL_TEST_STRUCT_INCLUDE_H
|
|
|
|
|
#define ACL_TEST_STRUCT_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
# ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
#include "stdlib/acl_array.h"
|
|
|
|
|
|
|
|
|
|
typedef struct AUT_LINE {
|
|
|
|
|
char cmd_name[128]; /* <20><><EFBFBD><EFBFBD><EEBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int result; /* ִ<>н<EFBFBD><D0BD><EFBFBD> */
|
|
|
|
|
int argc; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
ACL_ARRAY *argv; /* <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> */
|
|
|
|
|
char *args_str; /* <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>ı<EFBFBD><C4B1><EFBFBD> */
|
|
|
|
|
int valid_line_idx; /* <20><><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>к<EFBFBD> */
|
|
|
|
|
int line_number; /* <20><><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD><D0B5>к<EFBFBD> */
|
|
|
|
|
void *arg_inner; /* <20>ڲ<EFBFBD>ע<EFBFBD><D7A2><EFBFBD>Լ<EFBFBD><D4BC>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýṹ<C3BD><E1B9B9> */
|
|
|
|
|
void (*free_arg_inner)(void*);
|
|
|
|
|
void *arg_outer; /* <20>ⲿӦ<E2B2BF><D3A6>ע<EFBFBD><D7A2><EFBFBD>Լ<EFBFBD><D4BC>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýṹ<C3BD><E1B9B9> */
|
|
|
|
|
int obj_type; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ,
|
|
|
|
|
* defined as: AUT_OBJ_
|
|
|
|
|
*/
|
|
|
|
|
} AUT_LINE;
|
|
|
|
|
|
|
|
|
|
typedef int (*AUT_FN) (AUT_LINE *test_line, void *arg);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ˵<EFBFBD><EFBFBD>: <EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>һ<EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽṹ
|
|
|
|
|
*/
|
|
|
|
|
typedef struct AUT_FN_ITEM {
|
|
|
|
|
const char *cmd_name; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
const char *fn_name; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
AUT_FN fn_callback; /* <20><><EFBFBD><EFBFBD><EFBFBD>ûص<C3BB><D8B5><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
void *arg; /* <20><><EFBFBD>Իص<D4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õIJ<C3B5><C4B2><EFBFBD> */
|
|
|
|
|
int inner; /* <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
} AUT_FN_ITEM;
|
|
|
|
|
|
|
|
|
|
/* <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9><EFBFBD><EFBFBD> */
|
|
|
|
|
typedef struct {
|
|
|
|
|
char *name;
|
|
|
|
|
char *value;
|
|
|
|
|
} AUT_ARG_ITEM;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int match_number; /* <20>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0BBA5><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>,
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: loop_begin <EFBFBD><EFBFBD> loop_end ֮<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>ԷdzɶԵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
|
|
|
|
* stop <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
*/
|
|
|
|
|
AUT_LINE *peer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD>гɶԵ<C9B6><D4B5><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int flag; /* define as: AUT_FLAG_ */
|
|
|
|
|
int status; /* define as: AUT_STAT_ */
|
|
|
|
|
int valid_line_idx; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>±<EFBFBD>λ<EFBFBD><CEBB> */
|
|
|
|
|
|
|
|
|
|
/* ˽<><CBBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int nloop_max; /* <20><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>л<EFBFBD><D0BB><EFBFBD> */
|
|
|
|
|
int nloop_cur; /* <20><>ǰѭ<C7B0><D1AD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD> */
|
|
|
|
|
int offset_valid_line_idx; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><C2B1><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int loop_sleep; /* ѭ<><D1AD>ִ<EFBFBD><D6B4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϣ */
|
|
|
|
|
} AUT_CMD_TOKEN;
|
|
|
|
|
|
|
|
|
|
#define AUT_OBJ_OUTER 0 /* Ĭ<><C4AC>Ϊ<EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define AUT_OBJ_INNER 1 /* Ϊ<>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
|
|
|
|
|
#define AUT_FLAG_LOOP_BEGIN 1
|
|
|
|
|
#define AUT_FLAG_LOOP_BREAK 2
|
|
|
|
|
#define AUT_FLAG_LOOP_CONTINUE 3
|
|
|
|
|
#define AUT_FLAG_LOOP_END 4
|
|
|
|
|
|
|
|
|
|
#define AUT_FLAG_IF 5
|
|
|
|
|
#define AUT_FLAG_ELSE 6
|
|
|
|
|
#define AUT_FLAG_ELIF 7
|
|
|
|
|
#define AUT_FLAG_ENDIF 8
|
|
|
|
|
|
|
|
|
|
#define AUT_FLAG_STOP 9
|
|
|
|
|
|
|
|
|
|
#define AUT_STAT_FREE 0
|
|
|
|
|
#define AUT_STAT_BUSY 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define AUT_LOOP_BREAK -100
|
|
|
|
|
|
|
|
|
|
#define VAR_AUT_LOG_PRINT 0x0001
|
|
|
|
|
#define VAR_AUT_LOG_FPRINT 0x0010
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>еĹؼ<C4B9><D8BC><EFBFBD> */
|
|
|
|
|
/* <20><>־<EFBFBD><D6BE>¼<EFBFBD><C2BC><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_LOG "LOG"
|
|
|
|
|
|
|
|
|
|
/* ִ<><D6B4>ֹͣ<CDA3><D6B9>־λ */
|
|
|
|
|
#define VAR_AUT_STOP "STOP"
|
|
|
|
|
|
|
|
|
|
/* <20><>Ϣ<EFBFBD><CFA2>־λ */
|
|
|
|
|
#define VAR_AUT_SLEEP "SLEEP"
|
|
|
|
|
|
|
|
|
|
/* <20><>ͣ<EFBFBD><CDA3>־λ */
|
|
|
|
|
#define VAR_AUT_PAUSE "PAUSE"
|
|
|
|
|
|
|
|
|
|
/* ѭ<><D1AD>ִ<EFBFBD>п<EFBFBD>ʼ<EFBFBD><CABC>־λ */
|
|
|
|
|
#define VAR_AUT_LOOP_BEGIN "LOOP_BEGIN"
|
|
|
|
|
|
|
|
|
|
/* ѭ<><D1AD>ִ<EFBFBD><D6B4>ֹͣ<CDA3><D6B9>־λ */
|
|
|
|
|
#define VAR_AUT_LOOP_END "LOOP_END"
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>ִ<EFBFBD><D6B4> */
|
|
|
|
|
#define VAR_AUT_LOOP_BREAK "LOOP_BREAK"
|
|
|
|
|
|
|
|
|
|
/* ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_LOOP_CONTINUE "LOOP_CONTINUE"
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>жϿ<D0B6>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_IF "IF"
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD> else <20><><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_ELSE "ELSE"
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>жϽ<D0B6><CFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_ENDIF "ENDIF"
|
|
|
|
|
|
|
|
|
|
/* <20><>תִ<D7AA><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define VAR_AUT_GOTO "GOTO"
|
|
|
|
|
|
|
|
|
|
/*----------------- <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> -----------------------------*/
|
|
|
|
|
/**
|
|
|
|
|
* ͨ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> VAR_AUT_SLEEP <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾΪ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ;
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> VAR_AUT_LOOP_BEGIN <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾѭ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define VAR_AUT_ITEM_COUNT "COUNT"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|