2018-12-30 16:43:04 -08:00
|
|
|
|
---
|
|
|
|
|
|
title: functions / functionp
|
|
|
|
|
|
---
|
2023-11-25 09:50:24 -08:00
|
|
|
|
# functionp
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### NAME
|
2018-12-30 16:59:01 -08:00
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
|
functionp() - determine whether or not a given variable is a function
|
|
|
|
|
|
pointer, and if so what kind
|
|
|
|
|
|
|
|
|
|
|
|
### SYNOPSIS
|
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
|
int functionp( mixed arg );
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### DESCRIPTION
|
2018-12-30 16:59:01 -08:00
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
|
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 val‐
|
|
|
|
|
|
ues given in the driver include file "include/function.h".
|
|
|
|
|
|
|
2022-09-02 21:48:01 -04:00
|
|
|
|
function pointer type value
|
|
|
|
|
|
--------------------- -----
|
|
|
|
|
|
call_other FP_CALL_OTHER
|
|
|
|
|
|
lfun FP_LOCAL
|
|
|
|
|
|
efun FP_EFUN
|
|
|
|
|
|
simul_efun FP_SIMUL
|
|
|
|
|
|
functional FP_FUNCTIONAL
|
|
|
|
|
|
|
|
|
|
|
|
In addition, the following values will be added in some cases:
|
|
|
|
|
|
FP_HAS_ARGUMENTS arguments provided
|
|
|
|
|
|
FP_OWNER_DESTED creator has been dested
|
|
|
|
|
|
FP_NOT_BINDABLE not rebindable)
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
The last set of values are bit values and can be tested with bit opera‐
|
2022-09-02 21:48:01 -04:00
|
|
|
|
tions. The value FP_MASK is provided for ignoring the bit values and
|
2018-12-30 16:43:04 -08:00
|
|
|
|
testing the basic type of the function pointer.
|
|
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
|
|
|
|
To test if a function variable is an efun pointer:
|
|
|
|
|
|
|
|
|
|
|
|
if ((functionp(f) & FP_MASK) == FP_EFUN) ...
|
|
|
|
|
|
|
|
|
|
|
|
to test if it has args:
|
|
|
|
|
|
|
|
|
|
|
|
if (functionp(f) & FP_HAS_ARGUMENTS) ...
|
|
|
|
|
|
|
|
|
|
|
|
### SEE ALSO
|
2018-12-30 16:59:01 -08:00
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
|
mapp(3), stringp(3), pointerp(3), objectp(3), intp(3), bufferp(3),
|
docs: validate "See Also" references, drop dead ones, document valid_ffi (#1251)
* empty
* docs: validate "See Also" references, drop dead ones, document valid_ffi
Reviewed the "See Also" section of every doc and dropped man-page
cross-references whose target page does not exist (verified against the
driver source, not just the docs tree):
- errorp, each, opcprof, dump_socket_status, extract, shadowp,
destruct_env_of, move, inventory_visible, inventory_accessible
These name efuns/applies that no longer exist in FluffOS. keys/values now
point at the `for` construct in place of the defunct `each` efun.
valid_ffi was the one "referenced but undocumented" case: it is a real
master apply (APPLY_VALID_FFI) gating every ffi_load/symbol/prepare/
callback, so it gets a proper apply page rather than having its references
removed. Sidebar regenerated to include it.
The 13 modern markdown-link "See Also" sections were already clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 01:09:17 -04:00
|
|
|
|
floatp(3), nullp(3), undefinedp(3), bind(3), lpc/types/func‐
|
2018-12-30 16:43:04 -08:00
|
|
|
|
tion
|
2019-10-19 01:03:49 -07:00
|
|
|
|
|