functionp.3

foundation2_fluffos_v1/lib/doc/driver/efuns/functions/functionp.3 · 1.3 KB

From the archive foundation2_fluffos_v1.zip

Download the archive   « Back to the archive contents

.\"determine whether or not a given variable is a function pointer
.TH functionp 3 "5 Sep 1994" MudOS "LPC Library Functions"

.SH NAME
functionp() - determine whether or not a given variable is a function
pointer, and if so what kind

.SH SYNOPSIS
int functionp( mixed arg );

.SH DESCRIPTION
Return nonzero if `arg' is a function pointer and zero (0) otherwise.
Function pointers are variables of type 'function' as indicated in the
documentation for the type 'function', for example:

f = (: obj, func :);

The return value indicates the type of function pointer using the
values given in the driver include file "include/origin.h".

function pointer type	value
---------------------	-----
call_other		ORIGIN_CALL_OTHER
lfun			ORIGIN_LOCAL
efun			ORIGIN_EFUN
simul_efun		ORIGIN_SIMUL_EFUN
functional		ORIGIN_FUNCTIONAL

These values are bit values; in addition, 1 will be added if arguments
were included in the definition (for example, (: previous_object, -1 :) )

To test if a function variable is an efun pointer:

if (functionp(f) & ORIGIN_EFUN) ...

to test if it is an efun or simul_efun:

if (functionp(f) & (ORIGIN_EFUN | ORIGIN_SIMUL_EFUN)) ...

to test if it has args:

if (functionp(f) & 1) ...

.SH SEE ALSO
mapp(3), stringp(3), pointerp(3), objectp(3), intp(3), bufferp(3), floatp(3),
nullp(3), undefinedp(3), errorp(3), lpc/types/function

Site Stats

Snippets: 1791
Codebases: 571