29 for (c = ctxt; c != NULL; c = c->
up_ctxt)
50 lexic,
"insert_nasl_func: function '%s' is already defined\n", fname);
56 if (decl_node != NULL && decl_node !=
FAKE_CELL)
68 if (decl_node == NULL || decl_node ==
FAKE_CELL)
70 nasl_perror (lexic,
"Cannot insert NULL or FAKE cell as function\n");
97 int nb_u = 0, nb_a = 0;
98 tree_cell *pc = NULL, *pc2 = NULL, *retc = NULL;
100 char *trace_buf = NULL;
101 char *temp_funname = NULL, *tmp_filename = NULL;
102 int trace_buf_len = 0, tn;
103#define TRACE_BUF_SZ 255
120 for (pc = arg_list; pc != NULL; pc = pc->
link[1])
129 for (nb_u = 0, pc = arg_list; pc != NULL; pc = pc->
link[1])
140 tn = snprintf (trace_buf + trace_buf_len,
155 tn = snprintf (trace_buf + trace_buf_len,
157 nb_a > 0 ?
", " :
"", pc->
x.
str_val,
172 nasl_trace (lexic,
"NASL> %s ...)\n", trace_buf);
186#pragma GCC diagnostic push
187#pragma GCC diagnostic ignored "-Wpedantic"
191#pragma GCC diagnostic pop
202 g_free (temp_funname);
205 g_free (tmp_filename);
220 "nasl_func_call: return value from %s is not atomic!\n",
tree_cell * cell2atom(lex_ctxt *lexic, tree_cell *c1)
tree_cell * nasl_exec(lex_ctxt *lexic, tree_cell *st)
Execute a parse tree.
int nasl_trace_enabled(void)
Checks if the nasl_trace_fp is set.
void nasl_set_function_name(const char *funname)
void nasl_set_filename(const char *filename)
void nasl_trace(lex_ctxt *lexic, char *msg,...)
Prints debug message in printf fashion to nasl_trace_fp if it exists.
const char * nasl_get_function_name()
void nasl_perror(lex_ctxt *lexic, char *msg,...)
const char * nasl_get_filename(const char *function)
void free_func(nasl_func *f)
tree_cell * nasl_func_call(lex_ctxt *lexic, const nasl_func *f, tree_cell *arg_list)
tree_cell * decl_nasl_func(lex_ctxt *lexic, tree_cell *decl_node, int lint_mode)
static nasl_func * get_func(lex_ctxt *ctxt, const char *name)
This function climbs up in the context list and searches for a given.
nasl_func * insert_nasl_func(lex_ctxt *lexic, const char *fname, tree_cell *decl_node, int lint_mode)
nasl_func * get_func_ref_by_name(lex_ctxt *ctxt, const char *name)
tree_cell * nasl_return(lex_ctxt *ctxt, tree_cell *retv)
struct st_nasl_func nasl_func
nasl_func * func_is_internal(const char *)
void free_lex_ctxt(lex_ctxt *c)
lex_ctxt * init_empty_lex_ctxt()
named_nasl_var * add_named_var_to_ctxt(lex_ctxt *, const char *, tree_cell *)
struct struct_lex_ctxt lex_ctxt
anon_nasl_var * add_numbered_var_to_ctxt(lex_ctxt *, int, tree_cell *)
void ref_cell(tree_cell *c)
char * dump_cell_val(const tree_cell *c)
void nasl_dump_tree(const tree_cell *c)
int nasl_is_leaf(const tree_cell *pc)
void deref_cell(tree_cell *c)
tree_cell * copy_ref_array(const tree_cell *c1)
union TC::@332262321161220155002104006201360276211317150140 x
struct script_infos * script_infos
struct struct_lex_ctxt * up_ctxt