![]() |
![]()
| ![]() |
![]()
NAMEsnobol4load - Loading extension modules into SNOBOL4 SYNOPSISmodulename.c:
SYNOPSISExternal C functions are loaded into SNOBOL4 via the LOAD() function. LOAD() is passed a prototype which names the function and may describe the minimum number and types of the parameters the function will be passed, as well as the return type. The typedefs int_t and real_t should be used in C code for all SNOBOL4 INTEGER and REAL values, or value truncation may occur. The function should use one of the following macros to return a
value (the type of which should be compatible with the type in the prototype
passed to the LOAD() function:
Parameters are accessed positionally via the following macros.
When a data type is specified in the LOAD() prototype, values passed
to the function will automatically be converted to the specified data type.
The following macros do NOT perform data type conversion, and using the
wrong macro to access a parameter will return garbage, or worse.
External functions can be written to take polymorphic parameters by leaving the type name blank in the prototype, or passing arguments in excess of those described in the prototype. For example "FOO(,STRING)INTEGER" is a function with two parameters, the first is polymorphic. The LA_TYPE(n) macro must be used to determine the actual parameter data type;
Loadable code can be compiled and installed using snobol4setup(3), which generates a modulename.sno include file. SEE ALSOsnobol4(1), snobol4setup(3), snopea(7)
|