LIBMAWK_CALL_FUNCTION

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

NAME

libmawk_call_function − call an user defined (script) function

SYNOPSIS

#include <libmawk.h>

CELL *libmawk_call_function(mawk_state_t *MAWK, const char *fname, const char *argtpes, ...);
CELL *libmawk_call_functionp(mawk_state_t *
MAWK, const char *fname, const char *argtpes, void **args);

DESCRIPTION

The libmawk_call_function() function looks up user defined awk function called fname , fills the stack with arguments converted from the varargs and calls the function. The libmawk_call_functionp() performs the same action but avoids using vararg by requiring an array of generic pointers to the function arguments.

Argtype is a zero terminated string for both functions, each character corresponding to an argument. Type characters are described in libmawk_set_cell() manual page.

Argument m is a libmawk context previously returned by libmawk_initialize() or libmawk_initialize_stage3().

RETURN VALUE

A pointer to the cell returned by the user function. The cell returnedmust be destroyed by the application using libmawk_cell_destroy.

SEE ALSO

libmawk_initialize_stage(3libmawk), libmawk_initialize(3libmawk), libmawk_cell_destroy(3libmawk), libmawk_set_cell(3libmawk),