Package list libmawk / 90d5d2b3-585a-4bfd-a55b-70221f790edb/main doc / libmawk_call_function.3libmawk.html

Tree @90d5d2b3-585a-4bfd-a55b-70221f790edb/main (Download .tar.gz)

libmawk_call_function.3libmawk.html @90d5d2b3-585a-4bfd-a55b-70221f790edb/mainraw · history · blame

<!-- Creator     : groff version 1.22.2 -->
<!-- CreationDate: Sat Jun 14 14:27:31 2014 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta name="generator" content="groff -Thtml, see">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }


<h1 align="center">LIBMAWK_CALL_FUNCTION</h1>

<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#RETURN VALUE">RETURN VALUE</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>


<a name="NAME"></a>

<p style="margin-left:11%; margin-top: 1em">libmawk_call_function
&minus; call an user defined (script) function</p>

<a name="SYNOPSIS"></a>

<p style="margin-left:11%; margin-top: 1em"><b>#include

<p style="margin-left:11%; margin-top: 1em"><b>int
libmawk_call_function(mawk_state_t *</b><i>MAWK</i><b>,
const char *</b><i>fname</i><b>, CELL *</b><i>res</i><b>,
const char *</b><i>argtpes</i><b>, ...); <br>
int libmawk_call_functionp(mawk_state_t *</b><i>MAWK</i><b>,
const char *</b><i>fname</i><b>, CELL *</b><i>res</i><b>,
const char *</b><i>argtpes</i><b>, void **args);</b></p>

<a name="DESCRIPTION"></a>

<p style="margin-left:11%; margin-top: 1em">The
<b>libmawk_call_function</b>() function looks up an user
defined awk function called <i>fname</i> , fills the stack
with arguments converted from the varargs and calls the
function. The <b>libmawk_call_functionp</b>() performs the
same action but avoids using vararg by requiring an array of
generic pointers to the function arguments.</p>

<p style="margin-left:11%; margin-top: 1em">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.</p>

<p style="margin-left:11%; margin-top: 1em">If res is
non-NULL, it is cell_destroyed (regardless of errors) and
the return value of the user function is copied into it. The
caller shall run libmawk_cell_destroy on it.</p>

<p style="margin-left:11%; margin-top: 1em">Argument m is a
libmawk context previously returned by libmawk_initialize()
or libmawk_initialize_stage3().</p>

<a name="RETURN VALUE"></a>

<p style="margin-left:11%; margin-top: 1em">A pointer to
the cell returned by the user function. The cell
returnedmust be destroyed by the application using

<a name="SEE ALSO"></a>

<p style="margin-left:11%; margin-top: 1em"><b>libmawk_initialize_stage</b>(3libmawk),