35 regex_t *re = g_malloc0 (
sizeof (regex_t));
43 e = regcomp (re, re_str, REG_EXTENDED | REG_NOSUB | REG_ICASE);
49 regerror (e, re, errbuf,
sizeof (errbuf));
50 nasl_perror (NULL,
"Line %d: Cannot compile regex: %s (error %d: %s)\n",
51 lnb, re_str, e, errbuf);
99 for (i = 0; i < 4; i++)
112 for (i = 0; i < 4; i++)
113 if (c->
link[i] != NULL)
121#ifdef SCRATCH_FREED_MEMORY
157#ifdef SCRATCH_FREED_MEMORY
158 memset (c, 0xFF,
sizeof (*c));
171 nasl_perror (NULL,
"ref_cell: ref count is negative!\n");
189 "NODE_EMPTY",
"NODE_IF_ELSE",
"NODE_INSTR_L",
"NODE_FOR",
190 "NODE_WHILE",
"NODE_FOREACH",
"NODE_REPEAT_UNTIL",
"NODE_REPEATED",
191 "NODE_FUN_DEF",
"NODE_FUN_CALL",
"NODE_DECL",
"NODE_ARG",
192 "NODE_RETURN",
"NODE_BREAK",
"NODE_CONTINUE",
194 "NODE_ARRAY_EL",
"NODE_AFF",
"NODE_VAR",
"NODE_LOCAL",
195 "NODE_GLOBAL",
"NODE_PLUS_EQ",
"NODE_MINUS_EQ",
"NODE_MULT_EQ",
196 "NODE_DIV_EQ",
"NODE_MODULO_EQ",
198 "NODE_L_SHIFT_EQ",
"NODE_R_SHIFT_EQ",
"NODE_R_USHIFT_EQ",
"EXPR_AND",
199 "EXPR_OR",
"EXPR_NOT",
201 "EXPR_PLUS",
"EXPR_MINUS",
"EXPR_U_MINUS",
"EXPR_MULT",
202 "EXPR_DIV",
"EXPR_MODULO",
"EXPR_EXPO",
204 "EXPR_BIT_AND",
"EXPR_BIT_OR",
"EXPR_BIT_XOR",
"EXPR_BIT_NOT",
205 "EXPR_INCR",
"EXPR_DECR",
"EXPR_L_SHIFT",
"EXPR_R_SHIFT",
208 "COMP_MATCH",
"COMP_NOMATCH",
"COMP_RE_MATCH",
"COMP_RE_NOMATCH",
210 "COMP_LT",
"COMP_LE",
"COMP_EQ",
"COMP_NE",
211 "COMP_GT",
"COMP_GE",
"CONST_INT",
"CONST_STR",
212 "CONST_DATA",
"CONST_REGEX",
216 "REF_VAR",
"REF_ARRAY",
"DYN_ARRAY"};
222 for (j = 0; j < n; j++)
243 snprintf (txt,
sizeof (txt),
"%ld", c->
x.
i_val);
247 if ((
unsigned int) c->
size >= sizeof (txt) + 2)
249 snprintf (txt,
sizeof (txt),
"\"%s", c->
x.
str_val);
250 strcpy (txt + (
sizeof (txt) - 5),
"...\"");
253 snprintf (txt,
sizeof (txt),
"\"%s\"", c->
x.
str_val);
283 printf (
"* UNKNOWN %d (0x%x)*\n", c->
type, c->
type);
292 printf (
"\tSize=%d (0x%x)", c->
size, c->
size);
300 printf (
"Val=%ld\n", c->
x.
i_val);
314 printf (
"Val=(null)\n");
316 printf (
"Val=\"%s\"\n", c->
x.
str_val);
321 printf (
"Ref=(null)\n");
325 printf (
"Ref=(type=%d, name=%s, value=%s)\n", v->
u.
var_type,
336 for (i = 0; i < 4; i++)
345 static char txt4[4][32];
355 snprintf (txt, 32,
"%s (%d)",
node_names[t], t);
357 snprintf (txt, 32,
"*UNKNOWN* (%d)", t);
365 printf (
"^^^^ %p ^^^^^\n", (
void *) c);
372 printf (
"vvvvvvvvvvvvvvvvvv\n");
381 snprintf (txt,
sizeof (txt),
" at or near line %d ", c->
line_nb);
void nasl_perror(lex_ctxt *lexic, char *msg,...)
tree_cell * dup_cell(const tree_cell *tc)
void ref_cell(tree_cell *c)
char * dump_cell_val(const tree_cell *c)
void nasl_dump_tree(const tree_cell *c)
int cell_type(const tree_cell *c)
static tree_cell * alloc_tree_cell()
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str, int *err_c)
const char * nasl_type_name(int t)
static char * node_names[]
int nasl_is_leaf(const tree_cell *pc)
static void free_tree(tree_cell *c)
static void dump_tree(const tree_cell *c, int n, int idx)
tree_cell * alloc_expr_cell(int lnb, int t, tree_cell *l, tree_cell *r)
tree_cell * alloc_typed_cell(int typ)
static void prefix(int n, int i)
char * get_line_nb(const tree_cell *c)
void deref_cell(tree_cell *c)
const char * var2str(anon_nasl_var *v)
void free_array(nasl_array *a)
struct st_nasl_array nasl_array
struct st_n_nasl_var named_nasl_var
union TC::@332262321161220155002104006201360276211317150140 x