10#define HAVE_SYS_SOCKET_H
11#define HAVE_NETINET_IN_H
13#define HAVE_SYS_TIME_H
19#ifdef LIBXML_FTP_ENABLED
27#ifdef HAVE_SYS_SOCKET_H
30#ifdef HAVE_NETINET_IN_H
31#include <netinet/in.h>
33#ifdef HAVE_ARPA_INET_H
45#ifdef HAVE_SYS_SELECT_H
46#include <sys/select.h>
48#ifdef HAVE_SYS_SOCKET_H
51#ifdef HAVE_SYS_TYPES_H
78#if !defined(__BEOS__) || defined(__HAIKU__)
79#define closesocket(s) close(s)
85#define PF_INET AF_INET
90#ifdef HAVE_BROKEN_SS_FAMILY
91#define ss_family __ss_family
96#define XML_SOCKLEN_T unsigned int
99#define FTP_COMMAND_OK 200
100#define FTP_SYNTAX_ERROR 500
101#define FTP_GET_PASSWD 331
102#define FTP_BUF_SIZE 1024
104#define XML_NANO_MAX_URLBUF 4096
106typedef struct xmlNanoFTPCtxt {
124 char controlBuf[FTP_BUF_SIZE + 1];
127 int controlBufAnswer;
128} xmlNanoFTPCtxt, *xmlNanoFTPCtxtPtr;
132static int proxyPort = 0;
133static char *proxyUser =
NULL;
134static char *proxyPasswd =
NULL;
135static int proxyType = 0;
158xmlFTPErrMemory(
const char *
extra)
172xmlNanoFTPInit(
void) {
188 if (
env && ((
env[0] ==
'*' ) && (
env[1] == 0)))
192 xmlNanoFTPScanProxy(
env);
196 xmlNanoFTPScanProxy(
env);
217xmlNanoFTPCleanup(
void) {
222 if (proxyUser !=
NULL) {
226 if (proxyPasswd !=
NULL) {
251xmlNanoFTPProxy(
const char *
host,
int port,
const char *
user,
252 const char *passwd,
int type) {
257 if (proxyUser !=
NULL) {
261 if (proxyPasswd !=
NULL) {
285xmlNanoFTPScanURL(
void *
ctx,
const char *URL) {
286 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
292 if (ctxt->protocol !=
NULL) {
294 ctxt->protocol =
NULL;
296 if (ctxt->hostname !=
NULL) {
298 ctxt->hostname =
NULL;
300 if (ctxt->path !=
NULL) {
304 if (URL ==
NULL)
return;
322 ctxt->port =
uri->port;
354xmlNanoFTPUpdateURL(
void *
ctx,
const char *URL) {
355 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
362 if (ctxt->protocol ==
NULL)
364 if (ctxt->hostname ==
NULL)
375 if ((
strcmp(ctxt->protocol,
uri->scheme)) ||
377 ((
uri->port != 0) && (ctxt->port !=
uri->port))) {
383 ctxt->port =
uri->port;
385 if (ctxt->path !=
NULL) {
411xmlNanoFTPScanProxy(
const char *URL) {
423 "Removing FTP proxy info\n");
426 "Using FTP proxy %s\n", URL);
428 if (URL ==
NULL)
return;
441 proxyPort =
uri->port;
456xmlNanoFTPNewCtxt(
const char *URL) {
457 xmlNanoFTPCtxtPtr
ret;
460 ret = (xmlNanoFTPCtxtPtr)
xmlMalloc(
sizeof(xmlNanoFTPCtxt));
462 xmlFTPErrMemory(
"allocating FTP context");
469 ret->returnValue = 0;
470 ret->controlBufIndex = 0;
471 ret->controlBufUsed = 0;
475 if (unescaped !=
NULL) {
476 xmlNanoFTPScanURL(
ret, unescaped);
478 }
else if (URL !=
NULL)
479 xmlNanoFTPScanURL(
ret, URL);
492xmlNanoFTPFreeCtxt(
void *
ctx) {
493 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
494 if (ctxt ==
NULL)
return;
495 if (ctxt->hostname !=
NULL)
xmlFree(ctxt->hostname);
496 if (ctxt->protocol !=
NULL)
xmlFree(ctxt->protocol);
503 ctxt->controlBufIndex = -1;
504 ctxt->controlBufUsed = -1;
520xmlNanoFTPParseResponse(
char *
buf,
int len) {
523 if (
len < 3)
return(-1);
524 if ((*
buf >=
'0') && (*
buf <=
'9'))
529 if ((*
buf >=
'0') && (*
buf <=
'9'))
534 if ((*
buf >=
'0') && (*
buf <=
'9'))
552xmlNanoFTPGetMore(
void *
ctx) {
553 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
559 if ((ctxt->controlBufIndex < 0) || (ctxt->controlBufIndex > FTP_BUF_SIZE)) {
562 "xmlNanoFTPGetMore : controlBufIndex = %d\n",
563 ctxt->controlBufIndex);
568 if ((ctxt->controlBufUsed < 0) || (ctxt->controlBufUsed > FTP_BUF_SIZE)) {
571 "xmlNanoFTPGetMore : controlBufUsed = %d\n",
572 ctxt->controlBufUsed);
576 if (ctxt->controlBufIndex > ctxt->controlBufUsed) {
579 "xmlNanoFTPGetMore : controlBufIndex > controlBufUsed %d > %d\n",
580 ctxt->controlBufIndex, ctxt->controlBufUsed);
588 if (ctxt->controlBufIndex > 0) {
589 memmove(&ctxt->controlBuf[0], &ctxt->controlBuf[ctxt->controlBufIndex],
590 ctxt->controlBufUsed - ctxt->controlBufIndex);
591 ctxt->controlBufUsed -= ctxt->controlBufIndex;
592 ctxt->controlBufIndex = 0;
594 size = FTP_BUF_SIZE - ctxt->controlBufUsed;
598 "xmlNanoFTPGetMore : buffer full %d \n", ctxt->controlBufUsed);
606 if ((
len =
recv(ctxt->controlFd, &ctxt->controlBuf[ctxt->controlBufIndex],
615 "xmlNanoFTPGetMore : read %d [%d - %d]\n",
len,
616 ctxt->controlBufUsed, ctxt->controlBufUsed +
len);
618 ctxt->controlBufUsed +=
len;
619 ctxt->controlBuf[ctxt->controlBufUsed] = 0;
632xmlNanoFTPReadResponse(
void *
ctx) {
633 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
645 len = xmlNanoFTPGetMore(
ctx);
649 if ((ctxt->controlBufUsed == 0) && (
len == 0)) {
652 ptr = &ctxt->controlBuf[ctxt->controlBufIndex];
653 end = &ctxt->controlBuf[ctxt->controlBufUsed];
657 "\n<<<\n%s\n--\n",
ptr);
669 ctxt->controlBufAnswer =
ptr - ctxt->controlBuf;
677 ctxt->controlBufIndex = ctxt->controlBufUsed;
683 if (
res < 0)
goto get_more;
684 ctxt->controlBufIndex =
ptr - ctxt->controlBuf;
686 ptr = &ctxt->controlBuf[ctxt->controlBufIndex];
705xmlNanoFTPGetResponse(
void *
ctx) {
708 res = xmlNanoFTPReadResponse(
ctx);
722xmlNanoFTPCheckResponse(
void *
ctx) {
723 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
731 FD_SET(ctxt->controlFd, &rfd);
741 return(xmlNanoFTPReadResponse(
ctx));
749xmlNanoFTPSendUser(
void *
ctx) {
750 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
755 if (ctxt->user ==
NULL)
777xmlNanoFTPSendPasswd(
void *
ctx) {
778 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
783 if (ctxt->passwd ==
NULL)
811xmlNanoFTPQuit(
void *
ctx) {
812 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
841xmlNanoFTPConnect(
void *
ctx) {
842 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
850 if (ctxt->hostname ==
NULL)
864 memset (&ctxt->ftpAddr, 0,
sizeof(ctxt->ftpAddr));
896 if ((
size_t)tmp->
ai_addrlen >
sizeof(ctxt->ftpAddr)) {
927 sizeof(((
struct sockaddr_in *)&ctxt->ftpAddr)->sin_addr)) {
963 res = xmlNanoFTPGetResponse(ctxt);
1009 if (proxyUser !=
NULL) {
1014 buf[
sizeof(
buf) - 1] = 0;
1026 res = xmlNanoFTPGetResponse(ctxt);
1029 if (proxyPasswd ==
NULL)
1033 if (proxyPasswd !=
NULL)
1037 buf[
sizeof(
buf) - 1] = 0;
1049 res = xmlNanoFTPGetResponse(ctxt);
1072 switch (proxyType) {
1078 buf[
sizeof(
buf) - 1] = 0;
1090 res = xmlNanoFTPGetResponse(ctxt);
1096 if (proxyType == 1) {
1104 if (ctxt->user ==
NULL)
1109 ctxt->user, ctxt->hostname);
1110 buf[
sizeof(
buf) - 1] = 0;
1122 res = xmlNanoFTPGetResponse(ctxt);
1123 if ((
res == 1) || (
res == 2)) {
1128 if (ctxt->passwd ==
NULL)
1132 buf[
sizeof(
buf) - 1] = 0;
1144 res = xmlNanoFTPGetResponse(ctxt);
1145 if ((
res == 1) || (
res == 2)) {
1150 if (proxyType == 2) {
1170 res = xmlNanoFTPSendUser(ctxt);
1176 res = xmlNanoFTPGetResponse(ctxt);
1191 res = xmlNanoFTPSendPasswd(ctxt);
1197 res = xmlNanoFTPGetResponse(ctxt);
1203 "FTP server asking for ACCNT on anonymous\n");
1229xmlNanoFTPConnectTo(
const char *
server,
int port) {
1230 xmlNanoFTPCtxtPtr ctxt;
1238 ctxt = (xmlNanoFTPCtxtPtr) xmlNanoFTPNewCtxt(
NULL);
1242 if (ctxt->hostname ==
NULL) {
1243 xmlNanoFTPFreeCtxt(ctxt);
1247 res = xmlNanoFTPConnect(ctxt);
1249 xmlNanoFTPFreeCtxt(ctxt);
1267 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1283 buf[
sizeof(
buf) - 1] = 0;
1293 res = xmlNanoFTPGetResponse(ctxt);
1297 if (
res == 2)
return(1);
1315xmlNanoFTPDele(
void *
ctx,
const char *
file) {
1316 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1334 buf[
sizeof(
buf) - 1] = 0;
1344 res = xmlNanoFTPGetResponse(ctxt);
1348 if (
res == 2)
return(1);
1365xmlNanoFTPGetConnection(
void *
ctx) {
1366 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1370 unsigned char ad[6], *adp, *portp;
1371 unsigned int temp[6];
1381 memset (&dataAddr, 0,
sizeof(dataAddr));
1383 if ((ctxt->ftpAddr).ss_family ==
AF_INET6) {
1400 if (ctxt->passive) {
1402 if ((ctxt->ftpAddr).ss_family ==
AF_INET6)
1417 res = xmlNanoFTPReadResponse(
ctx);
1430 cur = &ctxt->controlBuf[ctxt->controlBufAnswer];
1431 while (((*
cur <
'0') || (*
cur >
'9')) && *
cur !=
'\0')
cur++;
1433 if ((ctxt->ftpAddr).ss_family ==
AF_INET6) {
1436 "Invalid answer to EPSV\n");
1448 if (
sscanf (
cur,
"%u,%u,%u,%u,%u,%u", &
temp[0], &
temp[1], &
temp[2],
1451 "Invalid answer to PASV\n");
1457 for (
i=0;
i<6;
i++) ad[
i] = (
unsigned char) (
temp[
i] & 0xff);
1462 if (
connect(ctxt->dataFd, (
struct sockaddr *) &dataAddr, dataAddrLen) < 0) {
1470 if ((ctxt->ftpAddr).ss_family ==
AF_INET6)
1476 if (
bind(ctxt->dataFd, (
struct sockaddr *) &dataAddr, dataAddrLen) < 0) {
1483 if (
listen(ctxt->dataFd, 1) < 0) {
1489 if ((ctxt->ftpAddr).ss_family ==
AF_INET6) {
1493 adp = (
unsigned char *) buf6;
1494 portp = (
unsigned char *) &((
struct sockaddr_in6 *)&dataAddr)->sin6_port;
1502 adp[0] & 0xff, adp[1] & 0xff, adp[2] & 0xff, adp[3] & 0xff,
1503 portp[0] & 0xff, portp[1] & 0xff);
1506 buf[
sizeof(
buf) - 1] = 0;
1518 res = xmlNanoFTPGetResponse(ctxt);
1524 return(ctxt->dataFd);
1538xmlNanoFTPCloseConnection(
void *
ctx) {
1539 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1550 FD_SET(ctxt->controlFd, &rfd);
1552 FD_SET(ctxt->controlFd, &efd);
1564 "xmlNanoFTPCloseConnection: timeout\n");
1568 res = xmlNanoFTPGetResponse(ctxt);
1589xmlNanoFTPParseList(
const char *
list, ftpListCallback
callback,
void *userData) {
1600 unsigned long size = 0;
1606 while (*
cur ==
' ')
cur++;
1607 while ((*
cur >=
'0') && (*
cur <=
'9'))
1608 links = (links * 10) + (*
cur++ -
'0');
1609 while ((*
cur ==
' ') || (*
cur ==
'\n') || (*
cur ==
'\r'))
1612 }
else if (*
list ==
'+') {
1615 while ((*
cur ==
' ') || (*
cur ==
'\n') || (*
cur ==
'\r'))
1617 if (*
cur == 0)
return(0);
1619 while (*
cur !=
' ') {
1623 if (*
cur == 0)
return(0);
1626 while (*
cur ==
' ')
cur++;
1627 if (*
cur == 0)
return(0);
1628 while ((*
cur >=
'0') && (*
cur <=
'9'))
1629 links = (links * 10) + (*
cur++ -
'0');
1630 while (*
cur ==
' ')
cur++;
1631 if (*
cur == 0)
return(0);
1633 while (*
cur !=
' ') {
1637 if (*
cur == 0)
return(0);
1640 while (*
cur ==
' ')
cur++;
1641 if (*
cur == 0)
return(0);
1643 while (*
cur !=
' ') {
1647 if (*
cur == 0)
return(0);
1650 while (*
cur ==
' ')
cur++;
1651 if (*
cur == 0)
return(0);
1652 while ((*
cur >=
'0') && (*
cur <=
'9'))
1654 while (*
cur ==
' ')
cur++;
1655 if (*
cur == 0)
return(0);
1657 while (*
cur !=
' ') {
1661 if (*
cur == 0)
return(0);
1664 while (*
cur ==
' ')
cur++;
1665 if (*
cur == 0)
return(0);
1666 while ((*
cur >=
'0') && (*
cur <=
'9'))
1668 while (*
cur ==
' ')
cur++;
1669 if (*
cur == 0)
return(0);
1670 if ((
cur[1] == 0) || (
cur[2] == 0))
return(0);
1671 if ((
cur[1] ==
':') || (
cur[2] ==
':')) {
1672 while ((*
cur >=
'0') && (*
cur <=
'9'))
1673 hour = (hour * 10) + (*
cur++ -
'0');
1675 while ((*
cur >=
'0') && (*
cur <=
'9'))
1676 minute = (minute * 10) + (*
cur++ -
'0');
1678 while ((*
cur >=
'0') && (*
cur <=
'9'))
1679 year = (year * 10) + (*
cur++ -
'0');
1681 while (*
cur ==
' ')
cur++;
1682 if (*
cur == 0)
return(0);
1684 while ((*
cur !=
'\n') && (*
cur !=
'\r')) {
1688 if (*
cur == 0)
return(0);
1691 if ((*
cur !=
'\n') && (*
cur !=
'\r'))
1693 while ((*
cur ==
'\n') || (*
cur ==
'\r'))
1717xmlNanoFTPList(
void *
ctx, ftpListCallback
callback,
void *userData,
1719 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1726 if (ctxt ==
NULL)
return (-1);
1728 if (xmlNanoFTPCwd(ctxt, ctxt->path) < 1)
1730 ctxt->dataFd = xmlNanoFTPGetConnection(ctxt);
1736 if (xmlNanoFTPCwd(ctxt, ctxt->path) < 1)
1739 ctxt->dataFd = xmlNanoFTPGetConnection(ctxt);
1744 buf[
sizeof(
buf) - 1] = 0;
1755 res = xmlNanoFTPReadResponse(ctxt);
1765 FD_SET(ctxt->dataFd, &rfd);
1767 FD_SET(ctxt->dataFd, &efd);
1777 res = xmlNanoFTPCheckResponse(ctxt);
1791 if ((
len =
recv(ctxt->dataFd, &
buf[indx],
sizeof(
buf) - (indx + 1), 0)) < 0) {
1811 xmlNanoFTPCloseConnection(ctxt);
1827xmlNanoFTPGetSocket(
void *
ctx,
const char *
filename) {
1828 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1835 ctxt->dataFd = xmlNanoFTPGetConnection(ctxt);
1850 res = xmlNanoFTPReadResponse(ctxt);
1859 buf[
sizeof(
buf) - 1] = 0;
1870 res = xmlNanoFTPReadResponse(ctxt);
1875 return(ctxt->dataFd);
1892xmlNanoFTPGet(
void *
ctx, ftpDataCallback
callback,
void *userData,
1894 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1900 if (ctxt ==
NULL)
return(-1);
1912 FD_SET(ctxt->dataFd, &rfd);
1922 res = xmlNanoFTPCheckResponse(ctxt);
1944 return(xmlNanoFTPCloseConnection(ctxt));
1960xmlNanoFTPRead(
void *
ctx,
void *
dest,
int len) {
1961 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
1966 if (
len <= 0)
return(0);
1972 xmlNanoFTPCloseConnection(ctxt);
1990xmlNanoFTPOpen(
const char *URL) {
1991 xmlNanoFTPCtxtPtr ctxt;
1998 ctxt = (xmlNanoFTPCtxtPtr) xmlNanoFTPNewCtxt(URL);
2000 if (xmlNanoFTPConnect(ctxt) < 0) {
2001 xmlNanoFTPFreeCtxt(ctxt);
2004 sock = xmlNanoFTPGetSocket(ctxt, ctxt->path);
2006 xmlNanoFTPFreeCtxt(ctxt);
2022xmlNanoFTPClose(
void *
ctx) {
2023 xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr)
ctx;
2033 xmlNanoFTPQuit(ctxt);
2037 xmlNanoFTPFreeCtxt(ctxt);
2048void ftpList(
void *userData,
const char *
filename,
const char* attrib,
2049 const char *owner,
const char *
group,
unsigned long size,
int links,
2050 int year,
const char *
month,
int day,
int hour,
int minute) {
2055void ftpData(
void *userData,
const char *
data,
int len) {
2056 if (userData ==
NULL)
return;
2067 char *tstfile =
NULL;
2071 ctxt = xmlNanoFTPNewCtxt(
argv[1]);
2072 if (xmlNanoFTPConnect(ctxt) < 0) {
2074 "Couldn't connect to %s\n",
argv[1]);
2080 ctxt = xmlNanoFTPConnectTo(
"localhost", 0);
2083 "Couldn't connect to localhost\n");
2086 xmlNanoFTPList(ctxt, ftpList,
NULL, tstfile);
2087 output =
fopen(
"/tmp/tstdata",
"w");
2088 if (output !=
NULL) {
2089 if (xmlNanoFTPGet(ctxt, ftpData, (
void *) output, tstfile) < 0)
2091 "Failed to get file\n");
2094 xmlNanoFTPClose(ctxt);
2104 "%s : FTP support not compiled in\n",
argv[0]);
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
void user(int argc, const char *argv[])
static LPCWSTR LPCWSTR LPCWSTR env
static DOUBLE day(DOUBLE time)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
static const WCHAR month[12][4]
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
void __xmlIOErr(int domain, int code, const char *extra)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static IPrintDialogCallback callback
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBVAR void * xmlGenericErrorContext
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
#define GETHOSTBYNAME_ARG_CAST
namespace GUID const ADDRINFOEXW * hints
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
struct sockaddr * ai_addr
struct addrinfo * ai_next
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
XMLPUBFUN xmlURIPtr XMLCALL xmlParseURIRaw(const char *str, int raw)
XMLPUBFUN char *XMLCALL xmlURIUnescapeString(const char *str, int len, char *target)
XMLPUBFUN void XMLCALL xmlFreeURI(xmlURIPtr uri)
static rfbScreenInfoPtr server
int PASCAL FAR WSACleanup(void)
XMLPUBFUN void XMLCALL xmlMemoryDump(void)
XMLPUBFUN xmlChar *XMLCALL xmlStrndup(const xmlChar *cur, int len)