SDK Linking C Functions
Template:Todo: paths etc to be updated
External 'C' Functions can be linked into the following Recital product executables:
Product | Relinked Executables |
---|---|
Recital Terminal Developer for Linux | <path>/db.exe |
Recital Terminal Developer for UNIX | <path>/db.exe |
Recital Terminal Developer for OpenVMS | [<path>]DB_XX.EXE |
Recital Universal Application Server for Linux | <path>/db_netserver
<path>/db_recserver |
Recital Universal Application Server for UNIX | <path>/db_netserver
<path>/db_recserver |
Defining the C functions
External 'C' functions are defined in the RECITAL/API definition file db.api located in the 'api linked' directory.
Product | Default API Linked Directory |
---|---|
Recital Terminal Developer for Linux | <path>/sdk/api/linked |
Recital Terminal Developer for UNIX | <path>/sdk/api/linked |
Recital Terminal Developer for OpenVMS | [<path>.SDK.API] |
Recital Universal Application Server for Linux | <path>/api/linked |
Recital Universal Application Server for UNIX | <path>/api/linked |
The first column contains the RECITAL function name and the second column contains the name of the 'C' function to be linked with RECITAL. When writing functions in 'C', Recital recommends that they are prefixed with "dbapi_" so that they do not conflict with any internal Recital functions. The dbmake linking utility will automatically compile and link in all the *.c files in the 'api linked' directory.
RECITAL NAME C FUNCTION NAME
apitest dbapi_apitest
The Recital function name cannot be longer than 10 characters.
Linking in 'C' functions
Once all the 'C' functions are defined in the db.api file the dbmake utility is used to link them into the Recital executables as defined above.
Product | dbmake |
---|---|
Recital Terminal Developer for Linux | <path>/sdk/api/linked/dbmake |
Recital Terminal Developer for UNIX | <path>/sdk/api/linked/dbmake |
Recital Terminal Developer for OpenVMS | [<path>.SDK.API]DBMAKE.COM |
Recital Universal Application Server for Linux | <path>/api/linked/dbmake |
Recital Universal Application Server for UNIX | <path>/api/linked/dbmake |
Using the 'C' functions
Once the functions have been linked into Recital they can be used in the same way that a Recital function can be used.
If you do not specify the correct number of parameters to the 'C' function Recital will display the error message "Invalid parameter". If the incorrect data type is passed, Recital will display the error message "Data type mismatch in parameter list."