void mpsl_argv(int argc, char * argv[]);
Fills the ARGV global MPSL array with an array of arguments. These
are usually the ones sent to main()
.
mpdm_t mpsl_boolean(int b);
Returns MPSL's 'false' or 'true' values depending on the value in b.
mpdm_t mpsl_compile(mpdm_t code);
Compiles a string of MPSL code and returns an mpdm value executable
by mpdm_exec()
. If there is a syntax (or other type) error, NULL
is returned instead.
mpdm_t mpsl_compile_file(mpdm_t file);
Compiles a source file of MPSL code and returns an mpdm value
executable by mpdm_exec()
. If file is an MPSL file descriptor,
it's read as is and compiled; otherwise, it's assumed to be a
file name, that will be searched for in any of the paths defined
in the INC MPSL global array (take note that the current
directory is NOT searched by default). If the file cannot be found
or there is any other error, NULL is returned instead.
mpdm_t mpsl_error(mpdm_t err);
Generates an error. The err error message is stored in the ERROR mpsl variable and the mpsl_abort global flag is set, so no further mpsl code can be executed until reset.
mpdm_t mpsl_eval(mpdm_t code, mpdm_t args);
Evaluates a piece of code. The code can be a string containing MPSL source code (that will be compiled) or a direct executable value. If the compilation or the execution gives an error, the ERROR variable will be set to a printable value and NULL returned. Otherwise, the exit value from the code is returned and ERROR set to NULL. The abort flag is reset on exit.
mpdm_t mpsl_get_symbol(mpdm_t s);
Gets the value of a symbol. The symbol can be local or global (if the symbol exists in both tables, the local value will be returned).
This function is only meant to be executed from inside an MPSL
program; from outside, it's exactly the same as calling mpdm_sget()
(as the local symbol table won't exist).
int mpsl_is_true(mpdm_t v);
If v is a valid MPSL 'false' value (NULL, "" or the "0" string), returns zero, or nonzero otherwise.
mpdm_t mpsl_set_symbol(mpdm_t s, mpdm_t v);
Assigns the value v to the s symbol. If the value exists as a local symbol, it's assigned to it; otherwise, it's set as a global symbol (and created if it does not exist).
This function is only meant to be executed from inside an MPSL
program; from outside, it's exactly the same as calling mpdm_sset()
(as the local symbol table won't exist).