2 *** UTF-8/EBCDIC wrappers to system and C library procedures.
4 *** See Copyright for the status of this software.
6 *** Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
10 #include <sys/socket.h>
11 #include <arpa/inet.h>
19 #include "libxml/xmlmemory.h"
21 #include "transcode.h"
24 static const char * lxdles = NULL;
28 _lx_getaddrinfo(const char * node, const char * service,
29 const struct addrinfo * hints, struct addrinfo * * res)
35 i = getaddrinfo(xmlTranscodeResult(node, NULL, &d, NULL),
36 xmlTranscodeResult(service, NULL, &d, NULL), hints, res);
43 _lx_inet_ntop(int af, const void * src, char * dst, socklen_t size)
46 const char * cp1 = inet_ntop(af, src, dst, size);
53 if (!(cp2 = xmlTranscodeString(cp1, NULL, NULL)))
59 xmlFree((char *) cp2);
61 return (const char *) NULL;
64 memcpy(dst, cp2, i + 1);
65 xmlFree((char *) cp2);
71 _lx_dlopen(const char * filename, int flag)
77 result = dlopen(xmlTranscodeResult(filename, NULL, &d, NULL), flag);
84 _lx_dlsym(void * handle, const char * symbol)
90 result = dlsym(handle, xmlTranscodeResult(symbol, NULL, &d, NULL));
100 char * cp1 = (char *) dlerror();
106 xmlFree((char *) lxdles);
108 lxdles = (const char *) xmlTranscodeString(cp1, NULL, NULL);
109 return (char *) lxdles;
117 _lx_gzopen(const char * path, const char * mode)
123 f = gzopen(xmlTranscodeResult(path, NULL, &d, NULL),
124 xmlTranscodeResult(mode, NULL, &d, NULL));
131 _lx_gzdopen(int fd, const char * mode)
137 f = gzdopen(fd, xmlTranscodeResult(mode, NULL, &d, NULL));
143 _lx_inflateInit2_(z_streamp strm, int windowBits,
144 const char * version, int stream_size)
150 r = inflateInit2_(strm, windowBits,
151 xmlTranscodeResult(version, NULL, &d, NULL), stream_size);
157 _lx_deflateInit2_(z_streamp strm, int level, int method, int windowBits,
158 int memLevel, int strategy, const char * version, int stream_size)
164 r = deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
165 xmlTranscodeResult(version, NULL, &d, NULL), stream_size);