OpenVAS Scanner
7.0.1~git
|
Go to the documentation of this file.
50 regex_t *re = g_malloc0 (
sizeof (regex_t));
58 e = regcomp (re, re_str, REG_EXTENDED | REG_NOSUB | REG_ICASE);
64 regerror (e, re, errbuf,
sizeof (errbuf));
65 nasl_perror (NULL,
"Line %d: Cannot compile regex: %s (error %d: %s)\n",
66 lnb, re_str, e, errbuf);
113 for (i = 0; i < 4; i++)
126 for (i = 0; i < 4; i++)
127 if (c->
link[i] != NULL)
135 #ifdef SCRATCH_FREED_MEMORY
171 #ifdef SCRATCH_FREED_MEMORY
172 memset (c, 0xFF,
sizeof (*c));
185 nasl_perror (NULL,
"ref_cell: ref count is negative!\n");
203 "NODE_EMPTY",
"NODE_IF_ELSE",
"NODE_INSTR_L",
"NODE_FOR",
204 "NODE_WHILE",
"NODE_FOREACH",
"NODE_REPEAT_UNTIL",
"NODE_REPEATED",
205 "NODE_FUN_DEF",
"NODE_FUN_CALL",
"NODE_DECL",
"NODE_ARG",
206 "NODE_RETURN",
"NODE_BREAK",
"NODE_CONTINUE",
208 "NODE_ARRAY_EL",
"NODE_AFF",
"NODE_VAR",
"NODE_LOCAL",
209 "NODE_GLOBAL",
"NODE_PLUS_EQ",
"NODE_MINUS_EQ",
"NODE_MULT_EQ",
210 "NODE_DIV_EQ",
"NODE_MODULO_EQ",
212 "NODE_L_SHIFT_EQ",
"NODE_R_SHIFT_EQ",
"NODE_R_USHIFT_EQ",
"EXPR_AND",
213 "EXPR_OR",
"EXPR_NOT",
215 "EXPR_PLUS",
"EXPR_MINUS",
"EXPR_U_MINUS",
"EXPR_MULT",
216 "EXPR_DIV",
"EXPR_MODULO",
"EXPR_EXPO",
218 "EXPR_BIT_AND",
"EXPR_BIT_OR",
"EXPR_BIT_XOR",
"EXPR_BIT_NOT",
219 "EXPR_INCR",
"EXPR_DECR",
"EXPR_L_SHIFT",
"EXPR_R_SHIFT",
222 "COMP_MATCH",
"COMP_NOMATCH",
"COMP_RE_MATCH",
"COMP_RE_NOMATCH",
224 "COMP_LT",
"COMP_LE",
"COMP_EQ",
"COMP_NE",
225 "COMP_GT",
"COMP_GE",
"CONST_INT",
"CONST_STR",
226 "CONST_DATA",
"CONST_REGEX",
230 "REF_VAR",
"REF_ARRAY",
"DYN_ARRAY"};
236 for (j = 0; j < n; j++)
257 snprintf (txt,
sizeof (txt),
"%ld", c->
x.
i_val);
261 if ((
unsigned int) c->
size >= sizeof (txt) + 2)
263 snprintf (txt,
sizeof (txt),
"\"%s", c->
x.
str_val);
264 strcpy (txt + (
sizeof (txt) - 5),
"...\"");
267 snprintf (txt,
sizeof (txt),
"\"%s\"", c->
x.
str_val);
297 printf (
"* UNKNOWN %d (0x%x)*\n", c->
type, c->
type);
306 printf (
"\tSize=%d (0x%x)", c->
size, c->
size);
314 printf (
"Val=%ld\n", c->
x.
i_val);
328 printf (
"Val=(null)\n");
330 printf (
"Val=\"%s\"\n", c->
x.
str_val);
335 printf (
"Ref=(null)\n");
339 printf (
"Ref=(type=%d, name=%s, value=%s)\n", v->
u.
var_type,
350 for (i = 0; i < 4; i++)
359 static char txt4[4][32];
369 snprintf (txt, 32,
"%s (%d)",
node_names[t], t);
371 snprintf (txt, 32,
"*UNKNOWN* (%d)", t);
379 printf (
"^^^^ %p ^^^^^\n", c);
386 printf (
"vvvvvvvvvvvvvvvvvv\n");
395 snprintf (txt,
sizeof (txt),
" at or near line %d ", c->
line_nb);
const char * nasl_type_name(int t)
void free_array(nasl_array *a)
int cell_type(const tree_cell *c)
const char * var2str(anon_nasl_var *v)
static void free_tree(tree_cell *c)
void nasl_dump_tree(const tree_cell *c)
void nasl_perror(lex_ctxt *lexic, char *msg,...)
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str)
tree_cell * dup_cell(const tree_cell *tc)
char * dump_cell_val(const tree_cell *c)
tree_cell * alloc_tree_cell()
static void prefix(int n, int i)
char * get_line_nb(const 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)
void ref_cell(tree_cell *c)
int nasl_is_leaf(const tree_cell *pc)
static char * node_names[]
void deref_cell(tree_cell *c)
tree_cell * alloc_typed_cell(int typ)