TORCS  1.3.9
The Open Racing Car Simulator
module.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  module.cpp -- Dynamic module management
3  -------------------
4  created : Fri Aug 13 22:25:53 CEST 1999
5  copyright : (C) 1999-2014 by Eric Espie, Bernhard Wymann
6  email : torcs@free.fr
7  version : $Id$
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
35 #ifdef WIN32
36 #include <windows.h>
37 #endif
38 #include <tgf.h>
39 #include "os.h"
40 
41 void
42 gfModInit(void)
43 {
44 }
45 
56 int
57 GfModLoad(unsigned int gfid, char *dllname, tModList **modlist)
58 {
59  if (GfOs.modLoad) {
60  return GfOs.modLoad(gfid, dllname, modlist);
61  } else {
62  return -1;
63  }
64 }
65 
74 int
75 GfModLoadDir(unsigned int gfid, char *dir, tModList **modlist)
76 {
77  if (GfOs.modLoadDir) {
78  return GfOs.modLoadDir(gfid, dir, modlist);
79  } else {
80  return -1;
81  }
82 }
83 
90 int
92 {
93  if (GfOs.modUnloadList) {
94  return GfOs.modUnloadList(modlist);
95  } else {
96  return -1;
97  }
98 }
99 
109 int
110 GfModInfo(unsigned int gfid, char *dllname, tModList **modlist)
111 {
112  if (GfOs.modInfo) {
113  return GfOs.modInfo(gfid, dllname, modlist);
114  } else {
115  return -1;
116  }
117 }
118 
128 int
129 GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist)
130 {
131  if (GfOs.modInfoDir) {
132  return GfOs.modInfoDir(gfid, dir, level, modlist);
133  } else {
134  return -1;
135  }
136 }
137 
144 int
146 {
147  if (GfOs.modFreeInfoList) {
148  return GfOs.modFreeInfoList(modlist);
149  } else {
150  return -1;
151  }
152 }
int GfModLoad(unsigned int gfid, char *dllname, tModList **modlist)
Load the specified DLLs.
Definition: module.cpp:57
tfModGetInfoDir modInfoDir
Definition: os.h:42
int GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist)
Get the generic module information of the DLLs of the specified directory.
Definition: module.cpp:129
int GfModInfo(unsigned int gfid, char *dllname, tModList **modlist)
Get the generic information of the specified DLL.
Definition: module.cpp:110
tfModLoadDir modLoadDir
Definition: os.h:39
tfModGetInfo modInfo
Definition: os.h:41
#define dllname
The Gaming Framework API.
tGfOs GfOs
Definition: os.cpp:37
tfModFreeInfoList modFreeInfoList
Definition: os.h:43
int GfModUnloadList(tModList **modlist)
Unload the DLLs of a list.
Definition: module.cpp:91
int GfModFreeInfoList(tModList **modlist)
Free the info contained in the specified list.
Definition: module.cpp:145
tfModLoad modLoad
Definition: os.h:38
int GfModLoadDir(unsigned int gfid, char *dir, tModList **modlist)
Load the DLLs in the specified directory.
Definition: module.cpp:75
tfModUnloadList modUnloadList
Definition: os.h:40
list of module interfaces
Definition: tgf.h:203
void gfModInit(void)
Definition: module.cpp:42