diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/include/curl/curl.h E:\Projects\curl-7.12.1/include/curl/curl.h --- C:\Downloads\curl-7.12.1_orig/include/curl/curl.h 2004-06-22 22:39:50.000000000 -0700 +++ E:\Projects\curl-7.12.1/include/curl/curl.h 2004-10-25 23:58:57.421875000 -0700 @@ -52,9 +52,14 @@ * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf * format strings when outputting a variable of type curl_off_t. */ + #if defined(_MSC_VER) || defined(__LCC__) /* MSVC */ +#ifdef _WIN32_WCE + typedef long curl_off_t; +#else typedef signed __int64 curl_off_t; +#endif #define CURL_FORMAT_OFF_T "%I64d" #else /* _MSC_VER || __LCC__ */ #if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__) diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/include/curl/multi.h E:\Projects\curl-7.12.1/include/curl/multi.h --- C:\Downloads\curl-7.12.1_orig/include/curl/multi.h 2004-03-24 22:53:42.000000000 -0800 +++ E:\Projects\curl-7.12.1/include/curl/multi.h 2004-11-01 14:40:32.718750000 -0800 @@ -51,7 +51,7 @@ #define WIN32 1 #endif -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || defined(__MINGW32__) #include #else diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/socket.h E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/socket.h --- C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/socket.h 1969-12-31 16:00:00.000000000 -0800 +++ E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/socket.h 2004-04-26 22:38:40.000000000 -0700 @@ -0,0 +1 @@ +/* not used */ diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/stat.h E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/stat.h --- C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/stat.h 1969-12-31 16:00:00.000000000 -0800 +++ E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/stat.h 2004-04-26 22:38:40.000000000 -0700 @@ -0,0 +1 @@ +/* not used */ diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/types.h E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/types.h --- C:\Downloads\curl-7.12.1_orig/include/WinCEDummyFiles/sys/types.h 1969-12-31 16:00:00.000000000 -0800 +++ E:\Projects\curl-7.12.1/include/WinCEDummyFiles/sys/types.h 2004-04-26 22:38:40.000000000 -0700 @@ -0,0 +1 @@ +/* not used */ diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/config-win32ce.h E:\Projects\curl-7.12.1/lib/config-win32ce.h --- C:\Downloads\curl-7.12.1_orig/lib/config-win32ce.h 1969-12-31 16:00:00.000000000 -0800 +++ E:\Projects\curl-7.12.1/lib/config-win32ce.h 2004-11-01 14:37:12.484375000 -0800 @@ -0,0 +1,258 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +#ifndef __CONFIG_WIN32_H +#define __CONFIG_WIN32_H + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define as the return type of signal handlers (int or void). */ +/*#define RETSIGTYPE void */ + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* Define this to 'int' if ssize_t is not an available typedefed type */ +#define ssize_t int + +/* Define this to 'int' if socklen_t is not an available typedefed type */ +#if !defined(ENABLE_IPV6) && ((_MSC_VER < 1300) || !defined(USE_SSLEAY)) +#define socklen_t int +#endif + +/* The size of a `curl_off_t', as computed by sizeof. */ +#ifdef SIZEOF_CURL_OFF_T +#undef SIZEOF_CURL_OFF_T +#endif + +/* Borland lacks _lseeki64(), so we don't support >2GB files */ +#define SIZEOF_CURL_OFF_T 4 + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +/* #define TIME_WITH_SYS_TIME 1 */ + +/* Define cpu-machine-OS */ +#define OS "i386-pc-win32" + +/* The number of bytes in a long double. */ +#define SIZEOF_LONG_DOUBLE 16 + +/* The number of bytes in a long long. */ +/* #define SIZEOF_LONG_LONG 8 */ + +/* Define if you have the gethostbyaddr function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define if you have the gethostname function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define if you have the getpass function. */ +/*#define HAVE_GETPASS 1*/ + +/* Define if you have the getservbyname function. */ +#define HAVE_GETSERVBYNAME 1 + +/* Define if you have the gettimeofday function. */ +/* #define HAVE_GETTIMEOFDAY 1 */ + +/* Define if you have the inet_addr function. */ +#define HAVE_INET_ADDR 1 + +/* Define if you have the inet_ntoa function. */ +#define HAVE_INET_NTOA 1 + +/* Define if you have the perror function. */ +#define HAVE_PERROR 1 + +/* Define if you have the select function. */ +#define HAVE_SELECT 1 + +/* Define if you have the socket function. */ +#define HAVE_SOCKET 1 + +/* Define if you have the strcasecmp function. */ +/*#define HAVE_STRCASECMP 1*/ + +/* Define if you have the stricmp function. */ +//#define HAVE_STRICMP 1 + +/* Define if you have the strdup function. */ +//#define HAVE_STRDUP 1 + +/* Define if you have the strftime function. */ +//#define HAVE_STRFTIME 1 + +/* Define if you have the strstr function. */ +#define HAVE_STRSTR 1 + +/* Define if you have the strtoll function. */ +#ifdef MINGW32 +#define HAVE_STRTOLL 1 +#endif + +/* Define if you have the tcgetattr function. */ +/*#define HAVE_TCGETATTR 1*/ + +/* Define if you have the tcsetattr function. */ +/*#define HAVE_TCSETATTR 1*/ + +/* Define if you have the uname function. */ +/*#define HAVE_UNAME 1*/ + +/* Define if you have utime() */ +#define HAVE_UTIME 1 + +/* Define if you have the header file. */ +/*#define HAVE_ALLOCA_H 1*/ + +/* Define if you have the malloc.h file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the header file. */ +/* #define HAVE_ARPA_INET_H 1 */ + +/* Define if you have the header file. */ +//#define HAVE_ASSERT_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_CRYPTO_H */ + +/* Define if you have the header file. */ +/*#define HAVE_DLFCN_H 1*/ + +/* Define if you have the header file. */ +/* #undef HAVE_ERR_H */ + +/* Define if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_GETOPT_H */ + +/* Define if you have the header file. */ +/* #define HAVE_NETDB_H 1 */ + +/* Define if you have the header file. */ +/*#define HAVE_NETINET_IN_H 1*/ + +/* Define if you have the header file. */ +/*#define HAVE_SGTTY_H 1*/ + +/* Define if you have the header file. */ +/* #undef HAVE_SSL_H */ + +/* Define if you have the header file. */ +/*#define HAVE_SYS_PARAM_H 1*/ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_SELECT_H 1 */ + +/* Define if you have the header file. */ +/*#define HAVE_SYS_SOCKET_H 1*/ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_SOCKIO_H 1 */ + +/* Define if you have the header file. */ +//#define HAVE_SYS_STAT_H 1 + +/* Define if you have the header file */ +#define HAVE_SYS_UTIME_H 1 + +/* Define if you have the header file. */ +//#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the header file. */ +/* #define HAVE_TERMIO_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_TERMIOS_H 1 */ + +/* Name of package */ +#define PACKAGE "curl" + +/* Define if you have the header file. */ +#define HAVE_IO_H 1 + +/* Define if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define if you have the header file. */ +#define HAVE_WINSOCK_H 1 + +/* Define if you have the header file. */ +//#define HAVE_WINSOCK2_H 1 + +/* Define if you have the header file. */ +//#define HAVE_WS2TCPIP_H 1 + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you have the closesocket function. */ +#define HAVE_CLOSESOCKET 1 + +/* Define if you have the setvbuf function. */ +#define HAVE_SETVBUF 1 + +/* Define if you have the RAND_screen function when using SSL */ +#define HAVE_RAND_SCREEN 1 + +/* Define if you have the `RAND_status' function. */ +#define HAVE_RAND_STATUS 1 + +/* Define this to if in_addr_t is not an available typedefed type */ +#define in_addr_t unsigned long + +/* use ioctlsocket() for non-blocking sockets */ +#define HAVE_IOCTLSOCKET + +/************************************************* + * This section is for compiler specific defines.* + *************************************************/ +/* Borland and MS don't have this */ +#if defined(MINGW32) || defined(__WATCOMC__) || defined(__LCC__) + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H 1 + +#else + +#endif + +/* WinCE */ + +#define CURL_DISABLE_FILE + +#define CURL_DISABLE_TELNET +#define CURL_DISABLE_LDAP +#define WITHOUT_MM_LIB + +#include +#include + +extern int errno; + +#define ENOSPC 1 +#define ENOMEM 2 + +extern int stat(const char *path,struct stat *buffer ); + +#endif diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/connect.c E:\Projects\curl-7.12.1/lib/connect.c --- C:\Downloads\curl-7.12.1_orig/lib/connect.c 2004-08-04 14:45:50.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/connect.c 2004-11-01 14:48:23.109375000 -0800 @@ -156,6 +156,7 @@ /* Windows? */ unsigned long flags; flags = nonblock; + return ioctlsocket(sockfd, FIONBIO, &flags); #define SETBLOCK 3 #endif @@ -405,13 +406,25 @@ * * Someone got to verify this on Win-NT 4.0, 2000." */ + +#ifdef _WIN32_WCE + Sleep(0); +#else SleepEx(0, FALSE); #endif +#endif + if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) err = Curl_ourerrno(); +#ifdef _WIN32_WCE + /* Always returns this error, bug in CE? */ + if(WSAENOPROTOOPT==err) + err=0; +#endif + if ((0 == err) || (EISCONN == err)) /* we are connected, awesome! */ rc = TRUE; diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/easy.c E:\Projects\curl-7.12.1/lib/easy.c --- C:\Downloads\curl-7.12.1_orig/lib/easy.c 2004-07-24 23:31:02.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/easy.c 2004-11-01 14:16:03.234375000 -0800 @@ -167,6 +167,11 @@ * If a memory-using function (like curl_getenv) is used before * curl_global_init() is called, we need to have these pointers set already. */ + +#ifdef _WIN32_WCE +#define strdup _strdup +#endif + curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc; curl_free_callback Curl_cfree = (curl_free_callback)free; curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc; diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/ftp.c E:\Projects\curl-7.12.1/lib/ftp.c --- C:\Downloads\curl-7.12.1_orig/lib/ftp.c 2004-08-10 10:44:14.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/ftp.c 2004-11-01 14:48:23.187500000 -0800 @@ -472,7 +472,7 @@ char *buf = data->state.buffer; /* this is our buffer */ struct FTP *ftp; CURLcode result; - int ftpcode, try; + int ftpcode, trynum; ftp = (struct FTP *)malloc(sizeof(struct FTP)); if(!ftp) @@ -541,9 +541,9 @@ if(data->set.ftp_ssl && !conn->ssl[FIRSTSOCKET].use) { /* we don't have a SSL/TLS connection, try a FTPS connection now */ - for (try = 0; ftpauth[try]; try++) { + for (trynum = 0; ftpauth[trynum]; trynum++) { - FTPSENDF(conn, "AUTH %s", ftpauth[try]); + FTPSENDF(conn, "AUTH %s", ftpauth[trynum]); result = Curl_GetFTPResponse(&nread, conn, &ftpcode); @@ -814,8 +814,15 @@ #ifdef HAVE_KRB4 Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]); #endif + /* shut down the socket to inform the server we're done */ + +#ifdef _WIN32_WCE + shutdown(conn->sock[SECONDARYSOCKET],2); /* SD_BOTH */ +#endif + sclose(conn->sock[SECONDARYSOCKET]); + conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; if(!ftp->no_transfer && !status) { diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/getenv.c E:\Projects\curl-7.12.1/lib/getenv.c --- C:\Downloads\curl-7.12.1_orig/lib/getenv.c 2004-06-26 12:58:56.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/getenv.c 2004-09-22 17:12:22.109375000 -0700 @@ -43,6 +43,9 @@ static char *GetEnv(const char *variable) { +#ifdef _WIN32_WCE + return NULL; +#else #ifdef WIN32 /* This shit requires windows.h (HUGE) to be included */ char env[MAX_PATH]; /* MAX_PATH is from windef.h */ @@ -62,6 +65,7 @@ #endif #endif return (env && env[0])?strdup(env):NULL; +#endif } char *curl_getenv(const char *v) diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/hostthre.c E:\Projects\curl-7.12.1/lib/hostthre.c --- C:\Downloads\curl-7.12.1_orig/lib/hostthre.c 2004-06-26 12:58:56.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/hostthre.c 2004-09-22 21:49:26.093750000 -0700 @@ -180,7 +180,9 @@ * hopefully make printouts synchronised. I'm not sure it works * with a static runtime lib (MSVC's libc.lib). */ +#ifndef _WIN32_WCE *stderr = *td->stderr_file; +#endif WSASetLastError (conn->async.status = NO_DATA); /* pending status */ he = gethostbyname (conn->async.hostname); @@ -291,8 +293,15 @@ td->dummy_sock = CURL_SOCKET_BAD; td->stderr_file = stderr; + +#ifdef _WIN32_WCE + td->thread_hnd=(HANDLE) CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) THREAD_FUNC,conn,0,&td->thread_id); +#else + td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC, conn, 0, &td->thread_id); +#endif + #ifdef CURLRES_IPV6 curlassert(hints); td->hints = *hints; diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/if2ip.c E:\Projects\curl-7.12.1/lib/if2ip.c --- C:\Downloads\curl-7.12.1_orig/lib/if2ip.c 2004-07-04 11:35:50.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/if2ip.c 2004-09-21 02:53:07.406250000 -0700 @@ -127,9 +127,9 @@ /* -- end of if2ip() -- */ #else -char *Curl_if2ip(const char *interface, char *buf, int buf_size) +char *Curl_if2ip(const char *interfaceisareservedkeyword, char *buf, int buf_size) { - (void) interface; + (void) interfaceisareservedkeyword; (void) buf; (void) buf_size; return NULL; diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/memory.h E:\Projects\curl-7.12.1/lib/memory.h --- C:\Downloads\curl-7.12.1_orig/lib/memory.h 2004-06-26 12:58:58.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/memory.h 2004-11-01 14:46:40.750000000 -0800 @@ -46,5 +46,4 @@ #define free(ptr) Curl_cfree(ptr) #endif - #endif /* _CURL_MEMORY_H */ diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/mprintf.c E:\Projects\curl-7.12.1/lib/mprintf.c --- C:\Downloads\curl-7.12.1_orig/lib/mprintf.c 2004-06-26 12:58:58.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/mprintf.c 2004-09-21 14:12:08.625000000 -0700 @@ -40,6 +40,12 @@ #include +#ifdef _WIN32_WCE +#define CURL_CDECL __cdecl +#else +#define CURL_CDECL +#endif + #ifndef SIZEOF_LONG_DOUBLE #define SIZEOF_LONG_DOUBLE 0 #endif @@ -583,7 +589,12 @@ void *data, /* untouched by format(), just sent to the stream() function in the second argument */ /* function pointer called for each output character */ + +#if _WIN32_WCE + int (__cdecl *stream) (int, FILE *), +#else int (*stream)(int, FILE *), +#endif const char *format, /* %-formatted string */ va_list ap_save) /* list of parameters */ { @@ -979,7 +990,7 @@ } /* fputc() look-alike */ -static int addbyter(int output, FILE *data) +static int CURL_CDECL addbyter(int output, FILE *data) { struct nsprintf *infop=(struct nsprintf *)data; unsigned char outc = (unsigned char)output; @@ -1027,7 +1038,7 @@ } /* fputc() look-alike */ -static int alloc_addbyter(int output, FILE *data) +static int CURL_CDECL alloc_addbyter(int output, FILE *data) { struct asprintf *infop=(struct asprintf *)data; unsigned char outc = (unsigned char)output; @@ -1113,7 +1124,7 @@ return strdup(""); } -static int storebuffer(int output, FILE *data) +static int CURL_CDECL storebuffer(int output, FILE *data) { char **buffer = (char **)data; unsigned char outc = (unsigned char)output; @@ -1142,6 +1153,7 @@ int retcode; va_list ap_save; /* argument pointer */ va_start(ap_save, format); + retcode = dprintf_formatf(stdout, fputc, format, ap_save); va_end(ap_save); return retcode; diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/setup.h E:\Projects\curl-7.12.1/lib/setup.h --- C:\Downloads\curl-7.12.1_orig/lib/setup.h 2004-07-04 23:42:34.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/setup.h 2004-09-21 03:34:53.203125000 -0700 @@ -40,11 +40,15 @@ #ifdef HAVE_CONFIG_H #include "config.h" /* the configure script results */ #else +#ifdef _WIN32_WCE +#include "config-win32ce.h" +#else #ifdef WIN32 /* hand-modified win32 config.h! */ #include "config-win32.h" #endif #endif +#endif #ifdef macintosh /* hand-modified MacOS config.h! */ @@ -172,7 +176,9 @@ #define _WIN32_WINNT 0x0501 #endif +#if HAVE_WINSOCK2_H #include /* required by telnet.c */ +#endif #if defined(ENABLE_IPV6) || defined(USE_SSLEAY) #include diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/strerror.c E:\Projects\curl-7.12.1/lib/strerror.c --- C:\Downloads\curl-7.12.1_orig/lib/strerror.c 2004-06-26 12:58:58.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/strerror.c 2004-11-01 14:25:05.578125000 -0800 @@ -511,6 +511,21 @@ *buf = '\0'; #if defined(WIN32) && !defined(__CYGWIN__) + +#if _WIN32_WCE + buf[0]=0; // no strerror + + { + wchar_t wbuf[256]; + + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, + LANG_NEUTRAL, wbuf, 256, NULL); + + wcstombs(buf,wbuf,max); + } + +#else + /* 'sys_nerr' is the maximum errno number, it is not widely portable */ if (err >= 0 && err < sys_nerr) strncpy(buf, strerror(err), max); @@ -520,6 +535,7 @@ LANG_NEUTRAL, buf, max, NULL)) snprintf(buf, max, "Unknown error %d (%#x)", err, err); } +#endif #else /* not native Windows coming up */ /* These should be atomic and hopefully thread-safe */ diff -ru -N -x'*.o' C:\Downloads\curl-7.12.1_orig/lib/urldata.h E:\Projects\curl-7.12.1/lib/urldata.h --- C:\Downloads\curl-7.12.1_orig/lib/urldata.h 2004-07-04 23:36:14.000000000 -0700 +++ E:\Projects\curl-7.12.1/lib/urldata.h 2004-09-21 01:28:08.000000000 -0700 @@ -151,7 +151,7 @@ char *egdsocket; /* path to file containing the EGD daemon socket */ char *cipher_list; /* list of ciphers to use */ long numsessions; /* SSL session id cache size */ - curl_ssl_ctx_callback fsslctx; /* function to initialize ssl ctx */ + struct curl_ssl_ctx_callback *fsslctx; /* function to initialize ssl ctx */ void *fsslctxp; /*parameter for call back */ };