3 * Copyright (C) 2008-2011 Beelzebub Inc. All rights reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef __sharedlib_header_h__
26 #define __sharedlib_header_h__
28 #if defined(_WIN32) || defined(_WIN32)
29 # define SHAREDLIB_ISWINNT 1
30 #elif defined(__unix__) || defined(__linux__)
31 # define SHAREDLIB_ISUNIX
33 # error "Unknown or unsupported Operating system?"
40 #endif /* __cplusplus */
42 typedef struct shl_handle_t shl_handle_t
;
44 shl_handle_t
* shl_new();
45 shl_handle_t
* shl_openlib(const char* path
);
46 shl_handle_t
* shl_openself();
47 void shl_destroy(shl_handle_t
* shl
);
48 void shl_closelib(shl_handle_t
* shl
);
49 int shl_havesym(shl_handle_t
* shl
, const char* sym
);
50 void* shl_resolve(shl_handle_t
* shl
, const char* sym
);
51 void* shl_loadsym(shl_handle_t
* shl
, const char* sym
);
52 int shl_geterrcode(shl_handle_t
* shl
);
53 const char* shl_geterrstr(shl_handle_t
* shl
);
54 int shl_preload(const char* path
);
58 #endif /*__cplusplus */
60 #endif /* __sharedlib_header_h__ */