Patrick Monnerat | 6e4d870 | 2014-03-04 17:11:02 +0100 | [diff] [blame] | 1 | /** |
| 2 | *** Replace system/C library calls by EBCDIC wrappers. |
| 3 | *** This is a layer inserted between libxml2 itself and the EBCDIC |
| 4 | *** environment. |
| 5 | *** |
| 6 | *** See Copyright for the status of this software. |
| 7 | *** |
| 8 | *** Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A. |
| 9 | **/ |
| 10 | |
| 11 | #ifndef __WRAPPERS_H_ |
| 12 | #define __WRAPPERS_H_ |
| 13 | |
| 14 | /** |
| 15 | *** OS/400 specific defines. |
| 16 | **/ |
| 17 | |
| 18 | #define __cplusplus__strings__ |
| 19 | |
| 20 | /** |
| 21 | *** Force header inclusions before renaming procedures to UTF-8 wrappers. |
| 22 | **/ |
| 23 | |
| 24 | #include <sys/types.h> |
| 25 | #include <sys/socket.h> |
| 26 | #include <arpa/inet.h> |
| 27 | #include <netdb.h> |
| 28 | |
| 29 | #include "dlfcn.h" |
| 30 | |
| 31 | |
| 32 | /** |
| 33 | *** UTF-8 wrappers prototypes. |
| 34 | **/ |
| 35 | |
| 36 | extern int _lx_getaddrinfo(const char * node, const char * service, |
| 37 | const struct addrinfo * hints, struct addrinfo * * res); |
| 38 | extern const char * |
| 39 | _lx_inet_ntop(int af, |
| 40 | const void * src, char * dst, socklen_t size); |
| 41 | extern void * _lx_dlopen(const char * filename, int flag); |
| 42 | extern void * _lx_dlsym(void * handle, const char * symbol); |
| 43 | extern char * _lx_dlerror(void); |
| 44 | |
| 45 | |
| 46 | #ifdef HAVE_ZLIB_H |
| 47 | |
| 48 | #include <zlib.h> |
| 49 | |
| 50 | extern gzFile _lx_gzopen(const char * path, const char * mode); |
| 51 | extern gzFile _lx_gzdopen(int fd, const char * mode); |
| 52 | |
| 53 | #endif |
| 54 | |
| 55 | |
| 56 | /** |
| 57 | *** Rename data/procedures to UTF-8 wrappers. |
| 58 | **/ |
| 59 | |
| 60 | #define getaddrinfo _lx_getaddrinfo |
| 61 | #define inet_ntop _lx_inet_ntop |
| 62 | #define dlopen _lx_dlopen |
| 63 | #define dlsym _lx_dlsym |
| 64 | #define dlerror _lx_dlerror |
| 65 | #define gzopen _lx_gzopen |
| 66 | #define gzdopen _lx_gzdopen |
| 67 | #define inflateInit2_ _lx_inflateInit2_ |
| 68 | #define deflateInit2_ _lx_deflateInit2_ |
| 69 | |
| 70 | #endif |