00001 00023 #ifndef ROXML_TYPES_H 00024 #define ROXML_TYPES_H 00025 00034 typedef int(*roxml_parse_func)(char *chunk, void * data); 00035 00044 typedef struct memory_cell { 00045 int type; 00046 int occ; 00047 void *ptr; 00048 pthread_t id; 00049 struct memory_cell *next; 00050 struct memory_cell *prev; 00051 } memory_cell_t; 00052 00060 typedef struct _xpath_cond { 00061 char rel; 00062 char axes; 00063 char op; 00064 char op2; 00065 char func; 00066 char func2; 00067 char *arg1; 00068 char *arg2; 00069 struct _xpath_node *xp; 00070 struct _xpath_cond *next; 00071 } xpath_cond_t; 00072 00080 typedef struct _xpath_node { 00081 char abs; 00082 char rel; 00083 char axes; 00084 char *name; 00085 struct _xpath_cond *xp_cond; 00086 struct _xpath_cond *cond; 00087 struct _xpath_node *next; 00088 } xpath_node_t; 00089 00097 typedef struct _xpath_tok_table { 00098 unsigned char id; 00099 unsigned char ids[256]; 00100 pthread_mutex_t mut; 00101 struct _xpath_tok *next; 00102 } xpath_tok_table_t; 00103 00111 typedef struct _xpath_tok { 00112 unsigned char id; 00113 struct _xpath_tok *next; 00114 } xpath_tok_t; 00115 00124 typedef struct node { 00125 unsigned char type; 00126 union { 00127 char *buf; 00128 FILE *fil; 00129 void *src; 00130 } src; 00131 unsigned long pos; 00132 unsigned long end; 00133 struct node *sibl; 00134 struct node *chld; 00135 struct node *prnt; 00136 struct node *attr; 00137 struct node *text; 00138 struct node *next; 00139 void *priv; 00140 } node_t; 00141 00149 typedef struct _roxml_load_ctx { 00150 int pos; 00151 int empty_text_node; 00152 int state; 00153 int previous_state; 00154 int mode; 00155 int inside_node_state; 00156 int type; 00157 void * src; 00158 node_t *candidat_node; 00159 node_t *candidat_txt; 00160 node_t *candidat_arg; 00161 node_t *candidat_val; 00162 node_t *current_node; 00163 } roxml_load_ctx_t; 00164 00172 typedef struct _roxml_xpath_ctx { 00173 int pos; 00174 int is_first_node; 00175 int wait_first_node; 00176 int shorten_cond; 00177 int nbpath; 00178 int bracket; 00179 int parenthesys; 00180 int quoted; 00181 int dquoted; 00182 int context; 00183 xpath_node_t * first_node; 00184 xpath_node_t * new_node; 00185 xpath_cond_t * new_cond; 00186 } roxml_xpath_ctx_t; 00187 00194 typedef struct _roxml_parser_item { 00195 int count; 00196 int def_count; 00197 char chunk; 00198 roxml_parse_func func; 00199 struct _roxml_parser_item *next; 00200 } roxml_parser_item_t; 00201 00202 #endif /* ROXML_TYPES_H */ 00203