Difference between revisions of "SDK Linking C Functions"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(7 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
External 'C' Functions can be linked into the following Recital product executables: | External 'C' Functions can be linked into the following Recital product executables: | ||
Line 6: | Line 5: | ||
!Product||Relinked Executables | !Product||Relinked Executables | ||
|- | |- | ||
− | |Recital | + | |Recital Developer for Linux||<path>/db.exe |
|- | |- | ||
− | |Recital | + | |Recital Developer for UNIX ||<path>/db.exe |
|- | |- | ||
− | |Recital | + | |Recital Developer for OpenVMS||[<path>]DB_XX.EXE |
|- | |- | ||
− | |Recital | + | |Recital Server for Linux||<path>/db_netserver |
<path>/db_recserver | <path>/db_recserver | ||
|- | |- | ||
− | |Recital | + | |Recital Server for UNIX||<path>/db_netserver |
<path>/db_recserver | <path>/db_recserver | ||
|- | |- | ||
Line 21: | Line 20: | ||
− | ==Defining the C functions | + | ==Defining the C functions== |
External 'C' functions are defined in the RECITAL/API definition file db.api located in the 'api linked' directory. | External 'C' functions are defined in the RECITAL/API definition file db.api located in the 'api linked' directory. | ||
Line 29: | Line 28: | ||
!Product||Default API Linked Directory | !Product||Default API Linked Directory | ||
|- | |- | ||
− | |Recital | + | |Recital Developer for Linux||<path>/sdk/api/linked |
|- | |- | ||
− | |Recital | + | |Recital Developer for UNIX ||<path>/sdk/api/linked |
|- | |- | ||
− | |Recital | + | |Recital Developer for OpenVMS||[<path>.SDK.API] |
|- | |- | ||
− | |Recital | + | |Recital Server for Linux||<path>/api/linked |
|- | |- | ||
− | |Recital | + | |Recital Server for UNIX||<path>/api/linked |
|- | |- | ||
|} | |} | ||
Line 43: | Line 42: | ||
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. | 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. | ||
+ | |||
<code lang="c"> | <code lang="c"> | ||
Line 48: | Line 48: | ||
apitest dbapi_apitest | apitest dbapi_apitest | ||
</code> | </code> | ||
+ | |||
The Recital function name cannot be longer than 10 characters. | The Recital function name cannot be longer than 10 characters. | ||
+ | |||
==Linking in 'C' functions== | ==Linking in 'C' functions== | ||
− | Once all the 'C' functions are defined in the db.api file the dbmake | + | 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. |
Line 59: | Line 61: | ||
!Product||dbmake | !Product||dbmake | ||
|- | |- | ||
− | |Recital | + | |Recital Developer for Linux||<path>/sdk/api/linked/dbmake |
|- | |- | ||
− | |Recital | + | |Recital Developer for UNIX ||<path>/sdk/api/linked/dbmake |
|- | |- | ||
− | |Recital | + | |Recital Developer for OpenVMS||[<path>.SDK.API]DBMAKE.COM |
|- | |- | ||
− | |Recital Universal Application Server for Linux||<path>/api/linked/ | + | |Recital Universal Application Server for Linux||<path>/api/linked/dbsmake |
|- | |- | ||
− | |Recital Universal Application Server for UNIX||<path>/api/linked/ | + | |Recital Universal Application Server for UNIX||<path>/api/linked/dbsmake |
|- | |- | ||
|} | |} | ||
− | |||
Line 81: | Line 82: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SDK]] | [[Category:SDK]] | ||
+ | [[Category:Reference]] |
Latest revision as of 10:06, 9 June 2009
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."