41 for (c = ctxt; c != NULL; c = c->
up_ctxt)
62 lexic,
"insert_nasl_func: function '%s' is already defined\n", fname);
68 if (decl_node != NULL && decl_node !=
FAKE_CELL)
80 if (decl_node == NULL || decl_node ==
FAKE_CELL)
82 nasl_perror (lexic,
"Cannot insert NULL or FAKE cell as function\n");
109 int nb_u = 0, nb_a = 0;
110 tree_cell *pc = NULL, *pc2 = NULL, *retc = NULL;
112 char *trace_buf = NULL;
113 char *temp_funname = NULL, *tmp_filename = NULL;
114 int trace_buf_len = 0, tn;
115 #define TRACE_BUF_SZ 255 132 for (pc = arg_list; pc != NULL; pc = pc->
link[1])
141 for (nb_u = 0, pc = arg_list; pc != NULL; pc = pc->
link[1])
152 tn = snprintf (trace_buf + trace_buf_len,
167 tn = snprintf (trace_buf + trace_buf_len,
169 nb_a > 0 ?
", " :
"", pc->
x.
str_val,
184 nasl_trace (lexic,
"NASL> %s ...)\n", trace_buf);
206 g_free (temp_funname);
209 g_free (tmp_filename);
224 "nasl_func_call: return value from %s is not atomic!\n",
tree_cell * nasl_return(lex_ctxt *ctxt, tree_cell *retv)
int nasl_trace_enabled(void)
Checks if the nasl_trace_fp is set.
const char * nasl_get_filename(const char *function)
void ref_cell(tree_cell *c)
tree_cell * copy_ref_array(const tree_cell *c1)
void nasl_dump_tree(const tree_cell *c)
tree_cell * cell2atom(lex_ctxt *lexic, tree_cell *c1)
void deref_cell(tree_cell *c)
void nasl_set_filename(const char *filename)
static nasl_func * get_func(lex_ctxt *ctxt, const char *name)
This function climbs up in the context list and searches for a given.
struct script_infos * script_infos
const char * nasl_get_function_name()
void free_lex_ctxt(lex_ctxt *c)
void nasl_trace(lex_ctxt *lexic, char *msg,...)
Prints debug message in printf fashion to nasl_trace_fp if it exists.
lex_ctxt * init_empty_lex_ctxt()
int nasl_is_leaf(const tree_cell *pc)
named_nasl_var * add_named_var_to_ctxt(lex_ctxt *, const char *, tree_cell *)
char * dump_cell_val(const tree_cell *c)
nasl_func * func_is_internal(const char *)
void free_func(nasl_func *f)
void nasl_perror(lex_ctxt *lexic, char *msg,...)
tree_cell * nasl_func_call(lex_ctxt *lexic, const nasl_func *f, tree_cell *arg_list)
void nasl_set_function_name(const char *funname)
anon_nasl_var * add_numbered_var_to_ctxt(lex_ctxt *, int, tree_cell *)
nasl_func * insert_nasl_func(lex_ctxt *lexic, const char *fname, tree_cell *decl_node, int lint_mode)
tree_cell * decl_nasl_func(lex_ctxt *lexic, tree_cell *decl_node, int lint_mode)
nasl_func * get_func_ref_by_name(lex_ctxt *ctxt, const char *name)
tree_cell * nasl_exec(lex_ctxt *lexic, tree_cell *st)
Execute a parse tree.
struct struct_lex_ctxt * up_ctxt