sysLoadLibrary

C Scripting Language
Reference Manual
Version 4.4.0

<< Back  End  Next >>
 
 
INDEX
Introduction
Installation
Using the CSL executive
Language
Directives
System library
   sysCommand
   sysDate
   sysDateFormat
   sysDateTime
   sysDirectory
   sysElapsed
   sysEnvVar
   sysLoadScript
   sysLoadLibrary
   sysLog
   sysLogFile
   sysLogLevel
   sysPrompt
   sysSleep
   sysSecondsSince
   sysShow
   sysStartDate
   sysStartDateTime
   sysStartTime
   sysStartTimestamp
   sysTime
   sysTimestamp
   sysTrace
String library
Math library
Regular expression lib.
File library
Database library
Async Communication
Registry/Profile handling
Windows control
C API
C++ Class Interface
CSL links
  
sysLoadLibrary(
  const dllname) // name of library

Loads a library (DLL or shared library) at runtime.

OS/2: The Library is searched in all directories listed by LIBPATH in CONFIG.SYS, or in the environment variables BEGINLIBPATH and ENDLIBPATH.

Win32: The Library is searched in the directory where CSL.EXE is (respectively your own VisualAge C++ Program using the CSL API), the current directory, and all directories listed in the PATH environment variable.

Unixish systems: The Library is searched all directories listed in the LD_LIBRARY_PATH environment variable.

To access any functions or identifiers of the library they have to be forward declared (usually by a .csl file).

Example:

#loadLibrary 'ZcSysLib'
 
static const strLib = 'ZcStrLib'
 
#loadScript strLib+'.csl' // include forwards
 
main()
{
   sysLoadLibrary(strLib); // load ZcStrLib.csl
   sysLog(strUpper('john wayne'));
}

NOTES:
CSL will not load the same library more than once; any attempts to do so will be silently ignored.
I recommend to load the forward declarations by #loadScript rather than #include, because that will avoid multiple includes. (In C/C++ you would have to make constructions like #ifndef _XXX_ ... #define _XXX_ ... body ... #endif)

  Copyright © IBK Landquart Last revision: 27.05.2002 << Back  Top  Next >>