next up previous contents index
Next: Calling functions Up: Declarations Previous: Function declarations   Contents   Index

Retrieving function arguments

Inside a NASL function, named arguments are just accessed as any local variable. Unnamed arguments are implemented through the special array _FCT_ANON_ARGS15. This variable will be NULL in interpretors below NASL_LEVEL 2190. You may put this at the start of scripts that need this function:

if (NASL_LEVEL < 2190) exit(0); # _FCT_ANON_ARGS is not implemented
  1. Writing to _FCT_ANON_ARGS is undefined. Currently, the memory is wasted but the value cannot be read back.
  2. Using _FCT_ANON_ARGS to try to read named arguments is bad too. Currently, there is a protection and a NULL value is returned.



Michel Arboi 2005-04-29