TORCS  1.3.9
The Open Racing Car Simulator
Dynamic Modules API


This is the interface to load/unload the shared libraries (or DLLs). More...

Functions

int GfModLoad (unsigned int gfid, char *dllname, tModList **modlist)
 Load the specified DLLs. More...
 
int GfModLoadDir (unsigned int gfid, char *dir, tModList **modlist)
 Load the DLLs in the specified directory. More...
 
int GfModUnloadList (tModList **modlist)
 Unload the DLLs of a list. More...
 
int GfModInfo (unsigned int gfid, char *dllname, tModList **modlist)
 Get the generic information of the specified DLL. More...
 
int GfModInfoDir (unsigned int gfid, char *dir, int level, tModList **modlist)
 Get the generic module information of the DLLs of the specified directory. More...
 
int GfModFreeInfoList (tModList **modlist)
 Free the info contained in the specified list. More...
 

Detailed Description


This is the interface to load/unload the shared libraries (or DLLs).

Two modes are allowed, the access by filename, of the access by the entire directory. When the directory mode is used, the filenames are not known in advance, this allows more flexibility at runtime.

The generic information can be retrieved, without keeping the DLL loaded. The gfid parameter is used to differentiate the modules using different includes. This functionality is not used yet. This API is not used for shared libraries linked staticaly at compilation time.

Function Documentation

◆ GfModFreeInfoList()

int GfModFreeInfoList ( tModList **  modlist)

Free the info contained in the specified list.

Parameters
modlistList of info to free
Returns
0 Ok
-1 Error

Definition at line 145 of file module.cpp.

◆ GfModInfo()

int GfModInfo ( unsigned int  gfid,
char *  dllname,
tModList **  modlist 
)

Get the generic information of the specified DLL.

Parameters
gfidMask for version control
dllnameFile name of the DLL
modlistThe information are stored here.
Returns
>=0 Number of modules infoed
-1 Error
Warning
The modlist contains only one element

Definition at line 110 of file module.cpp.

◆ GfModInfoDir()

int GfModInfoDir ( unsigned int  gfid,
char *  dir,
int  level,
tModList **  modlist 
)

Get the generic module information of the DLLs of the specified directory.

Parameters
gfidMask for version checking
dirDirectory name where to find the DLLs
levelIndicates the sub dir level (0 or 1)
modlistList of module description structure
Returns
>=0 Number of modules infoed
-1 Error

Definition at line 129 of file module.cpp.

◆ GfModLoad()

int GfModLoad ( unsigned int  gfid,
char *  dllname,
tModList **  modlist 
)

Load the specified DLLs.

Parameters
gfidMask for version checking
dllnameFile name of the DLL
modlistList of module description structure
Returns
>=0 Number of modules loaded
-1 Error
Warning
The modlist contains only one element
See also
tModList

Definition at line 57 of file module.cpp.

◆ GfModLoadDir()

int GfModLoadDir ( unsigned int  gfid,
char *  dir,
tModList **  modlist 
)

Load the DLLs in the specified directory.

Parameters
gfidMask for version checking
dirDirectory name where to find the DLLs
modlistList of module description structure
Returns
>=0 Number of modules loaded
-1 Error

Definition at line 75 of file module.cpp.

◆ GfModUnloadList()

int GfModUnloadList ( tModList **  modlist)

Unload the DLLs of a list.

Parameters
modlistList of DLLs to unload
Returns
0 Ok
-1 Error

Definition at line 91 of file module.cpp.