00001 #ifndef EVALTYPE_H
00002 #define EVALTYPE_H
00003
00004 #define MAX_EVALFUNC_PARAMS 8
00005
00006
00007 #include "qword.h"
00008
00009
00010
00011
00012
00013 typedef enum {
00014 TYPE_UNKNOWN,
00015 TYPE_BYTE,
00016 TYPE_WORD,
00017 TYPE_DWORD
00018 } eval_inttype;
00019
00020 typedef struct {
00021 qword value;
00022 eval_inttype type;
00023 } eval_int;
00024
00025 typedef struct {
00026 double value;
00027 } eval_float;
00028
00029 typedef struct {
00030 char *value;
00031 int len;
00032 } eval_str;
00033
00034 typedef enum {
00035 SCALAR_NULL=0,
00036 SCALAR_INT,
00037 SCALAR_STR,
00038 SCALAR_FLOAT,
00039 SCALAR_ANY,
00040 SCALAR_VARARGS
00041 } eval_scalartype;
00042
00043 typedef union {
00044 eval_int integer;
00045 eval_str str;
00046 eval_float floatnum;
00047 } eval_scalarbody;
00048
00049 typedef struct {
00050 eval_scalartype type;
00051 eval_scalarbody scalar;
00052 } eval_scalar;
00053
00054 typedef struct {
00055 int count;
00056 eval_scalar *scalars;
00057 } eval_scalarlist;
00058
00059 typedef struct {
00060 char *name;
00061 void *func;
00062 eval_scalartype ptype[MAX_EVALFUNC_PARAMS];
00063 char *desc;
00064 } eval_func;
00065
00066 typedef enum {
00067 PROTOMATCH_OK=0,
00068 PROTOMATCH_NAME_FAIL,
00069 PROTOMATCH_PARAM_FAIL
00070 } eval_protomatch;
00071
00072 #endif
00073