skip to main content

Calling C Language Functions and Other External Routines : Calling C Language Functions from isCOBOL : Dynamic Method

Dynamic Method
These are the steps to use the Dynamic method of calling external language routines:
 
Note - for modularity, Veryant recommends using a different directory for user-created shared libraries.
Then Either
Note - multiple library names must be separated using the newline character, "\n", or the platform-specific separator; for UNIX platforms use the colon “:” character, for Windows use semi-colon “;”
-or-
CALL "myroutines.so".
The isCOBOL runtime framework will then load “myroutines.so” and make the routines available for CALLing.
In case the function in the shared library is named the same way as the library itself, it can be called directly. Consider the following statement for example.
 
CALL "test" USING Param-1.
If the test function is included in libtest.so (or test.dll on Windows) shared library, there’s no need to call the shared library or to add it to iscobol.shared_library_list configuration property. The isCOBOL Framework will load the library automatically. Otherwise, if the function name does not match with the library name, it’s necessary to load the library through CALL or iscobol.shared_library_list before using its functions.
If the function name has the same name of the native library, you can call the function directly and the isCOBOL Framework will automatically load the library in memory.
For example, with the following statement
CALL "foo" USING Param-1.
the isCOBOL Framework tries to load the foo library (foo.dll on Windows, foo.so on Unix), unless the library is already loaded in memory, and then calls the foo function passing Param-1 to it.
isCOBOL allows to pass up to 255 parameters to a C function.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left