SDK Linking C Functions

From Recital Documentation Wiki
Revision as of 10:06, 9 June 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

External 'C' Functions can be linked into the following Recital product executables:


Product Relinked Executables
Recital Developer for Linux <path>/db.exe
Recital Developer for UNIX <path>/db.exe
Recital Developer for OpenVMS [<path>]DB_XX.EXE
Recital Server for Linux <path>/db_netserver

<path>/db_recserver

Recital 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 Developer for Linux <path>/sdk/api/linked
Recital Developer for UNIX <path>/sdk/api/linked
Recital Developer for OpenVMS [<path>.SDK.API]
Recital Server for Linux <path>/api/linked
Recital 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 (Recital Developer) or dbsmake (Recital Server) utilities are used to link them into the Recital executables as defined above.


Product dbmake
Recital Developer for Linux <path>/sdk/api/linked/dbmake
Recital Developer for UNIX <path>/sdk/api/linked/dbmake
Recital Developer for OpenVMS [<path>.SDK.API]DBMAKE.COM
Recital Universal Application Server for Linux <path>/api/linked/dbsmake
Recital Universal Application Server for UNIX <path>/api/linked/dbsmake


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