Codebase list libmawk / debian/1.0.0-1 doc / libmawk_call_function.3libmawk.html
debian/1.0.0-1

Tree @debian/1.0.0-1 (Download .tar.gz)

libmawk_call_function.3libmawk.html @debian/1.0.0-1raw · 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"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<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 }
</style>
<title>LIBMAWK_CALL_FUNCTION</title>

</head>
<body>

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

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

<hr>


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



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

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


<p style="margin-left:11%; margin-top: 1em"><b>#include
&lt;libmawk.h&gt;</b></p>

<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>

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


<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>

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


<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
libmawk_cell_destroy.</p>

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



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