Sample: cleaning up Inheritance
[io/quag.git] / libs / basekit / source / DynLib.h
blob63bcb031cae585a401125443c1409dcb66d55309
1 /* based on DynLib.c contributed by Daniel A. Koepke
2 * Reorg, Steve Dekorte, 2003-08-30
3 * See _BSDLicense.txt
4 */
6 #ifndef DYNLIB_DEFINED
7 #define DYNLIB_DEFINED 1
9 #include "Common.h"
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 typedef void DynLibNoArgFunction(void);
16 typedef void DynLibOneArgFunction(void *arg);
18 typedef struct
20 char *path;
21 char *initFuncName;
22 void *initArg;
23 char *freeFuncName;
24 void *freeArg;
25 char *error;
26 void *handle;
27 int refCount;
28 } DynLib;
30 BASEKIT_API DynLib *DynLib_new(void);
31 BASEKIT_API void DynLib_free(DynLib *self);
33 BASEKIT_API void DynLib_setPath_(DynLib *self, const char *path);
34 BASEKIT_API char *DynLib_path(DynLib *self);
36 BASEKIT_API void DynLib_setInitFuncName_(DynLib *self, const char *name);
37 BASEKIT_API char *DynLib_initFuncName(DynLib *self);
38 BASEKIT_API void DynLib_setInitArg_(DynLib *self, void *arg);
40 BASEKIT_API void DynLib_setFreeFuncName_(DynLib *self, const char *name);
41 BASEKIT_API char *DynLib_freeFuncName(DynLib *self);
42 BASEKIT_API void DynLib_setFreeArg_(DynLib *self, void *arg);
44 BASEKIT_API void DynLib_setError_(DynLib *self, const char *path);
45 BASEKIT_API char *DynLib_error(DynLib *self);
47 BASEKIT_API void DynLib_open(DynLib *self);
48 BASEKIT_API unsigned char DynLib_isOpen(DynLib *self);
49 BASEKIT_API void DynLib_close(DynLib *self);
50 BASEKIT_API void *DynLib_pointerForSymbolName_(DynLib *self, const char *symbolName);
52 #ifdef __cplusplus
54 #endif
55 #endif