Next: Reading arguments
Up: Adding new internal functions
Previous: Adding new internal functions
Every internal function has the same interface:
A simple example:
- it takes one input argument, a ``lexical context''. The NASL arguments
are variables in the context, either ``named'' or ``numbered''.
The context is chained to the calling context.
- and it returns a ``tree cell''. The returned cell should be ``referenced''
once; you shouldn't have to do anything as all the cell allocation
functions set ``ref_count'' to 1.
- If you do not want to return a value, returns FAKE_CELL.
- If you want to return a serious error, returns NULL.
fprintf(stderr, "My test function was called\n");
/* let's look at the context */
/* And return nothing (in NASL) */