cvs server: Diffing .
cvs server: Diffing build
cvs server: Diffing docs
cvs server: Diffing dso
cvs server: Diffing dso/aix
cvs server: Diffing dso/beos
cvs server: Diffing dso/netware
cvs server: Diffing dso/os2
cvs server: Diffing dso/os390
cvs server: Diffing dso/unix
cvs server: Diffing dso/win32
Index: dso/win32/dso.c
===================================================================
RCS file: /home/cvspublic/apr/dso/win32/dso.c,v
retrieving revision 1.27
diff -u -r1.27 dso.c
--- dso/win32/dso.c 28 Jan 2002 15:56:08 -0000  1.27
+++ dso/win32/dso.c 29 Jan 2002 14:42:38 -0000
@@ -86,7 +86,9 @@
 {
     HINSTANCE os_handle;
     apr_status_t rv;
+#if SEM_FAILCRITICALERRORS
     UINT em;
+#endif
 
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE 
@@ -99,13 +101,17 @@
             return ((*res_handle)->load_error = rv);
         }
         /* Prevent ugly popups from killing our app */
+#if SEM_FAILCRITICALERRORS
         em = SetErrorMode(SEM_FAILCRITICALERRORS);
+#endif
         os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
         if (!os_handle)
             os_handle = LoadLibraryExW(wpath, NULL, 0);
         if (!os_handle)
             rv = apr_get_os_error();
+#if SEM_FAILCRITICALERRORS
         SetErrorMode(em);
+#endif
     }
 #endif
 #if APR_HAS_ANSI_FS
@@ -158,8 +164,16 @@
                          struct apr_dso_handle_t *handle, 
                          const char *symname)
 {
+#ifdef _WIN32_WCE
+    apr_wchar_t wsymname[APR_PATH_MAX];
+    if (utf8_to_unicode_path(wsymname, sizeof(wsymname) 
+                                            / sizeof(apr_wchar_t), symname)
+                == APR_SUCCESS) {
+        *ressym = (apr_dso_handle_sym_t)GetProcAddressW(handle->handle, wsymname);
+    }
+#else
     *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname);
-
+#endif
     if (!*ressym) {
         return apr_get_os_error();
     }
cvs server: Diffing file_io
cvs server: Diffing file_io/netware
cvs server: Diffing file_io/os2
cvs server: Diffing file_io/unix
Index: file_io/unix/mktemp.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/unix/mktemp.c,v
retrieving revision 1.20
diff -u -r1.20 mktemp.c
--- file_io/unix/mktemp.c   18 Jan 2002 19:16:29 -0000  1.20
+++ file_io/unix/mktemp.c   29 Jan 2002 14:42:39 -0000
@@ -106,9 +106,15 @@
 #define seedrandom(a) srandom(a)
 #endif
 
+#if APR_HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#if APR_HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
+#if APR_HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -130,7 +136,7 @@
     apr_uint32_t randnum;
 
     if (randseed==0) {
-        randseed = time(NULL);
+        randseed = (int)apr_time_now();
         seedrandom(randseed);
     }
 
cvs server: Diffing file_io/win32
Index: file_io/win32/filedup.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/filedup.c,v
retrieving revision 1.39
diff -u -r1.39 filedup.c
--- file_io/win32/filedup.c 24 Jan 2002 06:12:24 -0000  1.39
+++ file_io/win32/filedup.c 29 Jan 2002 14:42:39 -0000
@@ -62,6 +62,9 @@
 APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
                                        apr_file_t *old_file, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     HANDLE hproc = GetCurrentProcess();
     HANDLE newhand = NULL;
 
@@ -83,12 +86,16 @@
                         apr_pool_cleanup_null);
 
     return APR_SUCCESS;
+#endif
 }
 
 
 APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                                         apr_file_t *old_file, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     DWORD stdhandle = -1;
     HANDLE hproc = GetCurrentProcess();
     HANDLE newhand = NULL;
@@ -139,5 +146,6 @@
     new_file->buffered = FALSE;
 
     return APR_SUCCESS;
+#endif
 }
 
Index: file_io/win32/filestat.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/filestat.c,v
retrieving revision 1.61
diff -u -r1.61 filestat.c
--- file_io/win32/filestat.c    28 Jan 2002 15:56:08 -0000  1.61
+++ file_io/win32/filestat.c    29 Jan 2002 14:42:41 -0000
@@ -53,15 +53,19 @@
  */
 
 #include <windows.h>
-#include <aclapi.h>
 #include "apr_private.h"
+#if HAVE_ACLAPI
+#include <aclapi.h>
+#endif
 #include "win32/fileio.h"
 #include "apr_file_io.h"
 #include "apr_general.h"
 #include "apr_strings.h"
 #include "apr_errno.h"
 #include "apr_time.h"
+#if APR_HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 #include "atime.h"
 #include "misc.h"
 
@@ -75,7 +79,9 @@
 static void free_world(void)
 {
     if (worldid) {
+#if HAVE_ACLAPI
         FreeSid(worldid);
+#endif
         worldid = NULL;
     }
 }
@@ -103,6 +109,7 @@
     return (prot << scope);
 }
 
+#if HAVE_ACLAPI
 static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl)
 {
     TRUSTEE_W ident = {NULL, NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_SID};
@@ -202,13 +209,13 @@
 
     return rv;
 }
+#endif /* HAVE_ACLAPI */
 
 apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, 
                         apr_int32_t wanted, int whatfile)
 {
     PSID user = NULL, grp = NULL;
     PACL dacl = NULL;
-    apr_status_t rv;
 
     if (apr_os_level < APR_WIN_NT) 
     {
@@ -226,7 +233,8 @@
                            | (finfo->protection << prot_scope_user);
 
         finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT;
-    }    
+    } 
+#if HAVE_ACLAPI
     else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
     {
         /* On NT this request is incredibly expensive, but accurate.
@@ -235,6 +243,7 @@
          * tests, but remember GetNamedSecurityInfo & GetSecurityInfo
          * are not supported on 9x.
          */
+        apr_status_t rv;
         SECURITY_INFORMATION sinf = 0;
         PSECURITY_DESCRIPTOR pdesc = NULL;
         if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT))
@@ -297,7 +306,7 @@
             resolve_prot(finfo, wanted, dacl);
         }
     }
-
+#endif
     return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS);
 }
 
@@ -388,6 +397,8 @@
 
     fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1, wanted);
 
+/* WCE has only regular files */
+#ifndef _WIN32_WCE
     if (finfo->filetype == APR_REG)
     {
         /* Go the extra mile to be -certain- that we have a real, regular
@@ -407,7 +418,7 @@
              */
         }
     }
-
+#endif
     finfo->cntxt = thefile->cntxt;
  
     /* Extra goodies known only by GetFileInformationByHandle() */
@@ -460,6 +471,7 @@
         return APR_ENAMETOOLONG;
     }
 
+#ifndef _WIN32_WCE
     if ((apr_os_level >= APR_WIN_NT) 
             && (wanted & (APR_FINFO_IDENT | APR_FINFO_NLINK))) {
         /* FindFirstFile and GetFileAttributesEx can't figure the inode,
@@ -474,7 +486,7 @@
         else if (ident_rv == APR_INCOMPLETE)
             wanted &= ~finfo->valid;
     }
-
+#endif
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
@@ -565,6 +577,7 @@
             IF_WIN_OS_IS_UNICODE
             {
 #if APR_HAS_UNICODE_FS
+#ifndef _WIN32_WCE
                 apr_wchar_t tmpname[APR_FILE_MAX];
                 apr_wchar_t *tmpoff;
                 if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t),
@@ -574,6 +587,9 @@
                         && !wcsncmp(tmpname, L"\\\\.\\", 4))
                         finfo->filetype = APR_CHR;
                 }
+#else
+    /* WCE lacks GetFullPathName */
+#endif
 #else
                 char tmpname[APR_FILE_MAX];
                 char *tmpoff;
Index: file_io/win32/filesys.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/filesys.c,v
retrieving revision 1.6
diff -u -r1.6 filesys.c
--- file_io/win32/filesys.c 28 Jan 2002 15:56:08 -0000  1.6
+++ file_io/win32/filesys.c 29 Jan 2002 14:42:41 -0000
@@ -95,9 +95,13 @@
 
 apr_status_t filepath_root_test(char *path, apr_pool_t *p)
 {
+/* WCE has no drives */
+#ifdef _WIN32_WCE
+    return APR_SUCCESS;
+#else
     apr_status_t rv;
 #if APR_HAS_UNICODE_FS
-    if (apr_os_level >= APR_WIN_NT)
+    IF_WIN_OS_IS_UNICODE
     {
         apr_wchar_t wpath[APR_PATH_MAX];
         if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) 
@@ -105,13 +109,15 @@
             return rv;
         rv = GetDriveTypeW(wpath);
     }
-    else
 #endif
+#if APR_HAS_ANSI_FS
+    ELSE_WIN_OS_IS_ANSI
         rv = GetDriveType(path);
-
+#endif
     if (rv == DRIVE_UNKNOWN || rv == DRIVE_NO_ROOT_DIR)
         return APR_EBADPATH;
     return APR_SUCCESS;
+#endif
 }
 
 
@@ -122,10 +128,11 @@
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
-        apr_wchar_t *ignored;
-        apr_wchar_t wdrive[8];
         apr_wchar_t wpath[APR_PATH_MAX];
         apr_status_t rv;
+#ifndef _WIN32_WCE
+        apr_wchar_t *ignored;
+        apr_wchar_t wdrive[8];
         /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" 
          * as if that is useful for anything.
          */
@@ -133,6 +140,9 @@
         wdrive[0] = (apr_wchar_t)(unsigned char)drive;
         if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored))
             return apr_get_os_error();
+#else
+        wcscpy(wpath, L"\\\\");
+#endif
         if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath)))
             return rv;
     }
@@ -176,9 +186,14 @@
         if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) 
                                            / sizeof(apr_wchar_t), root))
             return rv;
+#ifndef _WIN32_WCE
         if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored))
             return apr_get_os_error();
-
+#else
+        /* XXX: WCE lacks GetFullPathName
+         *
+         */
+#endif
         /* Borrow wroot as a char buffer (twice as big as necessary) 
          */
         if ((rv = unicode_to_utf8_path((char*)wroot, sizeof(wroot), wpath)))
@@ -199,6 +214,9 @@
     return APR_SUCCESS;
 }
 
+#if defined(_WIN32_WCE)
+static apr_wchar_t wce_curr_wpath[APR_PATH_MAX] = {0};
+#endif
 
 APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags,
                                            apr_pool_t *p)
@@ -207,11 +225,17 @@
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
-        apr_wchar_t wpath[APR_PATH_MAX];
         apr_status_t rv;
+#ifndef _WIN32_WCE
+        apr_wchar_t wpath[APR_PATH_MAX];
         if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(apr_wchar_t), wpath))
             return apr_get_os_error();
         if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath)))
+#else
+        if (!wcslen(wce_curr_wpath))
+            wcscpy(wce_curr_wpath, L"\\\\");
+        if ((rv = unicode_to_utf8_path(path, sizeof(path), wce_curr_wpath)))
+#endif
             return rv;
     }
 #endif
@@ -244,8 +268,12 @@
         if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) 
                                            / sizeof(apr_wchar_t), rootpath))
             return rv;
+#ifndef _WIN32_WCE
         if (!SetCurrentDirectoryW(wpath))
             return apr_get_os_error();
+#else
+        wcscpy(wce_curr_wpath, wpath);
+#endif
     }
 #endif
 #if APR_HAS_ANSI_FS
Index: file_io/win32/flock.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/flock.c,v
retrieving revision 1.8
diff -u -r1.8 flock.c
--- file_io/win32/flock.c   5 Jan 2002 08:02:39 -0000   1.8
+++ file_io/win32/flock.c   29 Jan 2002 14:42:42 -0000
@@ -56,6 +56,10 @@
 
 APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
 {
+#ifdef _WIN32_WCE
+    /* The File locking is unsuported on WCE */
+    return APR_ENOTIMPL;
+#else
     const DWORD len = 0xffffffff;
     DWORD flags; 
 
@@ -80,10 +84,14 @@
     }
 
     return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     DWORD len = 0xffffffff;
 
     if (apr_os_level >= APR_WIN_NT) {
@@ -99,4 +107,5 @@
     }
 
     return APR_SUCCESS;
+#endif
 }
Index: file_io/win32/open.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/open.c,v
retrieving revision 1.92
diff -u -r1.92 open.c
--- file_io/win32/open.c    29 Jan 2002 05:49:21 -0000  1.92
+++ file_io/win32/open.c    29 Jan 2002 14:42:43 -0000
@@ -59,10 +59,14 @@
 #include "apr_strings.h"
 #include "apr_portable.h"
 #include "apr_thread_mutex.h"
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <winbase.h>
 #include <string.h>
+#if APR_HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 #include "misc.h"
 
 #if APR_HAS_UNICODE_FS
@@ -466,8 +470,12 @@
                                              / sizeof(apr_wchar_t), topath)) {
             return rv;
         }
+#ifndef _WIN32_WCE
         if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING |
                                             MOVEFILE_COPY_ALLOWED))
+#else
+        if (MoveFileW(wfrompath, wtopath))
+#endif
             return APR_SUCCESS;
 #else
         if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING |
@@ -530,6 +538,9 @@
 
 APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     apr_os_file_t file_handle;
 
     file_handle = GetStdHandle(STD_ERROR_HANDLE);
@@ -537,10 +548,14 @@
         return apr_get_os_error();
 
     return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     apr_os_file_t file_handle;
 
     file_handle = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -548,10 +563,14 @@
         return apr_get_os_error();
 
     return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     apr_os_file_t file_handle;
 
     file_handle = GetStdHandle(STD_INPUT_HANDLE);
@@ -559,6 +578,7 @@
         return apr_get_os_error();
 
     return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
 }
 
 APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);
Index: file_io/win32/pipe.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/pipe.c,v
retrieving revision 1.40
diff -u -r1.40 pipe.c
--- file_io/win32/pipe.c    28 Dec 2001 23:50:48 -0000  1.40
+++ file_io/win32/pipe.c    29 Jan 2002 14:42:44 -0000
@@ -56,11 +56,17 @@
 #include "apr_file_io.h"
 #include "apr_general.h"
 #include "apr_strings.h"
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <string.h>
 #include <stdio.h>
+#if APR_HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#if APR_HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 #include "misc.h"
 
 APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
@@ -83,6 +89,9 @@
 
 APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     SECURITY_ATTRIBUTES sa;
 
     sa.nLength = sizeof(sa);
@@ -122,6 +131,7 @@
     apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup,
                         apr_pool_cleanup_null);
     return APR_SUCCESS;
+#endif
 }
 
 /* apr_create_nt_pipe()
@@ -148,6 +158,9 @@
                                 BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, 
                                 apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     SECURITY_ATTRIBUTES sa;
     static unsigned long id = 0;
     DWORD dwPipeMode;
@@ -234,4 +247,5 @@
     apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup,
                         apr_pool_cleanup_null);
     return APR_SUCCESS;
+#endif /* _WIN32_WCE */
 }
Index: file_io/win32/readwrite.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/readwrite.c,v
retrieving revision 1.64
diff -u -r1.64 readwrite.c
--- file_io/win32/readwrite.c   28 Dec 2001 23:50:48 -0000  1.64
+++ file_io/win32/readwrite.c   29 Jan 2002 14:42:45 -0000
@@ -76,6 +76,7 @@
         /* Peek at the pipe. If there is no data available, return APR_EAGAIN.
          * If data is available, go ahead and read it.
          */
+#ifndef _WIN32_WCE
         if (file->pipe) {
             char tmpbuf[5];
             DWORD dwBytesRead;
@@ -103,6 +104,7 @@
              * timeout file i/o (which means setting file i/o non-blocking)
              */
         }
+#endif
     }
 
     if (file->pOverlapped && !file->pipe) {
@@ -123,10 +125,12 @@
                 rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE);
             }
             switch (rv) {
+#ifndef _WIN32_WCE
             case WAIT_OBJECT_0:
                 GetOverlappedResult(file->filehand, file->pOverlapped, nbytes, TRUE);
                 rv = APR_SUCCESS;
                 break;
+#endif
             case WAIT_TIMEOUT:
                 rv = APR_TIMEUP;
                 break;
@@ -136,10 +140,12 @@
             default:
                 break;
             }
+#ifndef _WIN32_WCE
             if (rv != APR_SUCCESS) {
                 if (apr_os_level >= APR_WIN_98)
                     CancelIo(file->filehand);
             }
+#endif
         }
         else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) {
             /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */
@@ -291,10 +297,12 @@
                 /* Wait for the pending i/o (put a timeout here?) */
                 rv = WaitForSingleObject(thefile->pOverlapped->hEvent, INFINITE);
                 switch (rv) {
+#ifndef _WIN32_WCE
                     case WAIT_OBJECT_0:
                         GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE);
                         rv = APR_SUCCESS;
                         break;
+#endif
                     case WAIT_TIMEOUT:
                         rv = APR_TIMEUP;
                         break;
@@ -304,10 +312,12 @@
                     default:
                         break;
                 }
+#ifndef _WIN32_WCE
                 if (rv != APR_SUCCESS) {
                     if (apr_os_level >= APR_WIN_98)
                         CancelIo(thefile->filehand);
                 }
+#endif
             }
         }
         if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe) {
Index: file_io/win32/seek.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/seek.c,v
retrieving revision 1.21
diff -u -r1.21 seek.c
--- file_io/win32/seek.c    28 Aug 2001 16:41:14 -0000  1.21
+++ file_io/win32/seek.c    29 Jan 2002 14:42:45 -0000
@@ -54,7 +54,9 @@
 
 #include "win32/fileio.h"
 #include "apr_file_io.h"
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <string.h>
 
 static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
cvs server: Diffing i18n
cvs server: Diffing i18n/unix
cvs server: Diffing images
cvs server: Diffing include
Index: include/apr.hw
===================================================================
RCS file: /home/cvspublic/apr/include/apr.hw,v
retrieving revision 1.85
diff -u -r1.85 apr.hw
--- include/apr.hw  29 Jan 2002 07:11:25 -0000  1.85
+++ include/apr.hw  29 Jan 2002 14:42:46 -0000
@@ -127,7 +127,7 @@
 #define APR_HAVE_TIME_H         1
 #else
 #define APR_HAVE_ARPA_INET_H    0
-#define APR_HAVE_CONIO_H        1
+#define APR_HAVE_CONIO_H        0
 #define APR_HAVE_CRYPT_H        0
 #define APR_HAVE_CTYPE_H        0
 #define APR_HAVE_DIRENT_H       0
@@ -195,14 +195,19 @@
 #define APR_HAVE_SIGWAIT        0
 #define APR_HAVE_STRCASECMP     0
 #define APR_HAVE_STRDUP         1
-#define APR_HAVE_STRICMP        1
 #define APR_HAVE_STRNCASECMP    0
-#define APR_HAVE_STRNICMP       1
 #define APR_HAVE_STRSTR         1
 #define APR_HAVE_MEMCHR         1
 #define APR_HAVE_STRUCT_RLIMIT  0
 #define APR_HAVE_UNION_SEMUN    0
 
+#ifndef _WIN32_WCE
+#define APR_HAVE_STRICMP        1
+#define APR_HAVE_STRNICMP       1
+#else
+#define APR_HAVE_STRICMP        0
+#define APR_HAVE_STRNICMP       0
+#endif
 
 /* Has windows.h already been included?  If so, our preferences don't matter,
  * but we will still need the winsock things no matter what was included.
@@ -267,7 +272,6 @@
 /*  APR Feature Macros */
 #define APR_HAS_SHARED_MEMORY     1
 #define APR_HAS_THREADS           1
-#define APR_HAS_SENDFILE          1
 #define APR_HAS_MMAP              1
 #define APR_HAS_FORK              0
 #define APR_HAS_RANDOM            1
@@ -277,10 +281,12 @@
 #define APR_HAS_SO_ACCEPTFILTER   0
 #define APR_HAS_UNICODE_FS        1
 #ifndef _WIN32_WCE
+#define APR_HAS_SENDFILE          1
 #define APR_HAS_USER              1
 #define APR_HAS_LARGE_FILES       1
 #define APR_HAS_XTHREAD_FILES     1
 #else
+#define APR_HAS_SENDFILE          0
 #define APR_HAS_USER              0
 #define APR_HAS_LARGE_FILES       0
 #define APR_HAS_XTHREAD_FILES     0
cvs server: Diffing include/arch
cvs server: Diffing include/arch/aix
cvs server: Diffing include/arch/beos
cvs server: Diffing include/arch/netware
cvs server: Diffing include/arch/os2
cvs server: Diffing include/arch/os390
cvs server: Diffing include/arch/unix
cvs server: Diffing include/arch/win32
Index: include/arch/win32/apr_private.h
===================================================================
RCS file: /home/cvspublic/apr/include/arch/win32/apr_private.h,v
retrieving revision 1.29
diff -u -r1.29 apr_private.h
--- include/arch/win32/apr_private.h    29 Jan 2002 07:11:25 -0000  1.29
+++ include/arch/win32/apr_private.h    29 Jan 2002 14:42:50 -0000
@@ -82,6 +82,7 @@
  * not with APR itself, until some GUI-related security is introduced.]
  */
 #ifndef _WIN32_WCE
+#define HAVE_ACLAPI 1
 #ifdef __wtypes_h__
 #include <accctrl.h>
 #else
@@ -89,6 +90,8 @@
 #include <accctrl.h>
 #undef __wtypes_h__
 #endif
+#else
+#define HAVE_ACLAPI 0
 #endif
 
 #if APR_HAVE_SYS_TYPES_H
@@ -168,6 +171,11 @@
 
 unsigned __stdcall SignalHandling(void *);
 int thread_ready(void);
+
+#if !APR_HAVE_ERRNO_H
+APR_DECLARE_DATA int errno;
+#define ENOSPC 1
+#endif
 
 #endif  /*APR_PRIVATE_H*/
 #endif  /*WIN32*/
Index: include/arch/win32/fileio.h
===================================================================
RCS file: /home/cvspublic/apr/include/arch/win32/fileio.h,v
retrieving revision 1.63
diff -u -r1.63 fileio.h
--- include/arch/win32/fileio.h 28 Jan 2002 15:56:08 -0000  1.63
+++ include/arch/win32/fileio.h 29 Jan 2002 14:42:50 -0000
@@ -87,7 +87,6 @@
 
 #if APR_HAS_UNICODE_FS
 #include "i18n.h"
-#include <wchar.h>
 
 typedef apr_uint16_t apr_wchar_t;
 
Index: include/arch/win32/networkio.h
===================================================================
RCS file: /home/cvspublic/apr/include/arch/win32/networkio.h,v
retrieving revision 1.20
diff -u -r1.20 networkio.h
--- include/arch/win32/networkio.h  16 Jul 2001 20:37:00 -0000  1.20
+++ include/arch/win32/networkio.h  29 Jan 2002 14:42:51 -0000
@@ -78,9 +78,18 @@
     int numread;
     fd_set *write;
     int numwrite;
-    fd_set *except;
+    fd_set *exception;
     int numexcept;    
 };
+
+#ifdef _WIN32_WCE
+#ifndef WSABUF
+typedef struct _WSABUF {
+    u_long      len;     /* the length of the buffer */
+    char FAR *  buf;     /* the pointer to the buffer */
+} WSABUF, FAR * LPWSABUF;
+#endif
+#endif
 
 apr_status_t status_from_res_error(int);
 
cvs server: Diffing locks
cvs server: Diffing locks/beos
cvs server: Diffing locks/netware
cvs server: Diffing locks/os2
cvs server: Diffing locks/unix
cvs server: Diffing locks/win32
Index: locks/win32/locks.c
===================================================================
RCS file: /home/cvspublic/apr/locks/win32/locks.c,v
retrieving revision 1.48
diff -u -r1.48 locks.c
--- locks/win32/locks.c 29 Dec 2001 23:14:22 -0000  1.48
+++ locks/win32/locks.c 29 Jan 2002 14:42:51 -0000
@@ -59,6 +59,7 @@
 #include "win32/locks.h"
 #include "apr_portable.h"
 #include "misc.h"
+#include "fileio.h"
 
 static apr_status_t lock_cleanup(void *lock_)
 {
@@ -132,8 +133,18 @@
             newlock->fname = apr_pstrcat(pool, "Global\\", fname, NULL);
         else
             newlock->fname = apr_pstrdup(pool, fname);
-
+#ifndef _WIN32_WCE
         newlock->mutex = CreateMutex(&sec, FALSE, newlock->fname);
+#else
+        {
+            apr_wchar_t wfname[APR_PATH_MAX];
+           if (utf8_to_unicode_path(wfname, sizeof(wfname) 
+                                    / sizeof(apr_wchar_t), newlock->fname)
+                == APR_SUCCESS) {
+                newlock->mutex = CreateMutexW(&sec, FALSE, wfname);
+           }            
+        }
+#endif
         if (!newlock->mutex) {
        return apr_get_os_error();
         }
@@ -151,6 +162,9 @@
     /* This routine should not be called (and OpenMutex will fail if called) 
      * on a INTRAPROCESS lock
      */
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
 
     if ((*lock) == NULL) {
@@ -163,6 +177,7 @@
         return apr_get_os_error();
     }
     return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock)
Index: locks/win32/proc_mutex.c
===================================================================
RCS file: /home/cvspublic/apr/locks/win32/proc_mutex.c,v
retrieving revision 1.5
diff -u -r1.5 proc_mutex.c
--- locks/win32/proc_mutex.c    8 Jan 2002 05:58:38 -0000   1.5
+++ locks/win32/proc_mutex.c    29 Jan 2002 14:42:52 -0000
@@ -59,6 +59,7 @@
 #include "apr_portable.h"
 #include "proc_mutex.h"
 #include "misc.h"
+#include "fileio.h"
 
 static apr_status_t proc_mutex_cleanup(void *mutex_)
 {
@@ -92,7 +93,18 @@
     else
         fname = apr_pstrdup(pool, fname);
 
+#ifndef _WIN32_WCE
     hMutex = CreateMutex(&sec, FALSE, fname);
+#else
+    {
+       apr_wchar_t wfname[APR_PATH_MAX];
+       if (utf8_to_unicode_path(wfname, sizeof(wfname) 
+                                    / sizeof(apr_wchar_t), fname)
+                == APR_SUCCESS) {
+           hMutex = CreateMutexW(&sec, FALSE, wfname);
+       }            
+    }
+#endif
     if (!hMutex) {
    return apr_get_os_error();
     }
@@ -110,6 +122,9 @@
                                                     const char *fname,
                                                     apr_pool_t *pool)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     HANDLE hMutex;
 
     if (apr_os_level >= APR_WIN_2000)
@@ -129,6 +144,7 @@
     apr_pool_cleanup_register((*mutex)->pool, *mutex, 
                               proc_mutex_cleanup, apr_pool_cleanup_null);
     return APR_SUCCESS;
+#endif
 }
     
 APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex)
cvs server: Diffing memory
cvs server: Diffing memory/unix
cvs server: Diffing misc
cvs server: Diffing misc/netware
cvs server: Diffing misc/os2
cvs server: Diffing misc/unix
Index: misc/unix/errorcodes.c
===================================================================
RCS file: /home/cvspublic/apr/misc/unix/errorcodes.c,v
retrieving revision 1.46
diff -u -r1.46 errorcodes.c
--- misc/unix/errorcodes.c  14 Dec 2001 00:15:50 -0000  1.46
+++ misc/unix/errorcodes.c  29 Jan 2002 14:42:53 -0000
@@ -393,7 +393,13 @@
 static char *native_strerror(apr_status_t statcode, char *buf,
                              apr_size_t bufsize)
 {
+#ifdef _WIN32_WCE
+    static char err[32];
+    sprintf(err, "Native Error #%d", statcode);
+    return stuffbuffer(buf, bufsize, err);
+#else
     return stuffbuffer(buf, bufsize, strerror(statcode));
+#endif
 }
 #endif
 
cvs server: Diffing misc/win32
Index: misc/win32/getuuid.c
===================================================================
RCS file: /home/cvspublic/apr/misc/win32/getuuid.c,v
retrieving revision 1.6
diff -u -r1.6 getuuid.c
--- misc/win32/getuuid.c    13 Apr 2001 15:31:31 -0000  1.6
+++ misc/win32/getuuid.c    29 Jan 2002 14:42:53 -0000
@@ -76,6 +76,16 @@
      * is therefore not only a uniqifier, but an identity (which might not
      * be appropriate in all cases.
      */
+#ifndef _WIN32_WCE
     (void) CoCreateGuid(&guid);
+#else
+    /* WCE lacks CoCreateGuid. So make something simple
+     * for now.
+     */ 
+    guid.Data1 = rand();
+    guid.Data2 = rand();
+    guid.Data3 = rand();
+    sprintf(guid.Data4, "%08X", rand());
+#endif
     memcpy(uuid->data, &guid, sizeof(uuid->data));
 }
Index: misc/win32/misc.c
===================================================================
RCS file: /home/cvspublic/apr/misc/win32/misc.c,v
retrieving revision 1.8
diff -u -r1.8 misc.c
--- misc/win32/misc.c   28 Jan 2002 15:56:08 -0000  1.8
+++ misc/win32/misc.c   29 Jan 2002 14:42:54 -0000
@@ -54,6 +54,7 @@
 
 #include "apr_private.h"
 #include "misc.h"
+#include "fileio.h"
 
 apr_oslevel_e apr_os_level = APR_WIN_UNK;
 
@@ -64,7 +65,7 @@
         static OSVERSIONINFO oslev;
         oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
         GetVersionEx(&oslev);
-
+#ifndef _WIN32_WCE
         if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) 
         {
             static unsigned int servpack = 0;
@@ -149,8 +150,9 @@
             }
         }
 #endif
-#ifdef _WIN32_WCE
-        else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) 
+        else 
+#else /* _WIN32_WCE */
+        if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) 
         {
             if (oslev.dwMajorVersion < 3) {
                 apr_os_level = APR_WIN_UNSUP;
@@ -159,8 +161,9 @@
                 apr_os_level = APR_WIN_CE_3;
             }
         }
+        else
 #endif
-        else {
+        {
             apr_os_level = APR_WIN_UNSUP;
         }
     }
@@ -179,20 +182,47 @@
  * missing from one or more releases of the Win32 API
  */
 
+#ifndef _WIN32_WCE
 static const char* const lateDllName[DLL_defined] = {
     "kernel32", "advapi32", "mswsock",  "ws2_32"  };
 static HMODULE lateDllHandle[DLL_defined] = {
     NULL,       NULL,       NULL,       NULL      };
+#else
+static const apr_wchar_t* const lateDllName[DLL_defined] = {
+    TEXT("coredll"), TEXT("winsockm")};
+static HMODULE lateDllHandle[DLL_defined] = {
+    NULL,       NULL};
+
+#endif
+#ifndef APR_HAVE_ERRNO_H
+APR_DECLARE_DATA int errno;
+#endif
 
 FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal)
 {
+#ifdef _WIN32_WCE
+    apr_wchar_t uname[APR_PATH_MAX];
+#endif
     if (!lateDllHandle[fnLib]) { 
         lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
         if (!lateDllHandle[fnLib])
             return NULL;
     }
+#ifndef _WIN32_WCE
     if (ordinal)
         return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
     else
         return GetProcAddress(lateDllHandle[fnLib], fnName);
+#else
+    if (ordinal)
+        return GetProcAddressW(lateDllHandle[fnLib], (apr_wchar_t *) ordinal);
+    else {
+        if (utf8_to_unicode_path(uname, sizeof(uname) 
+                                            / sizeof(apr_wchar_t), fnName)
+                == APR_SUCCESS) {
+            return GetProcAddressW(lateDllHandle[fnLib], uname);
+        }
+    }
+    return NULL;
+#endif
 }
Index: misc/win32/rand.c
===================================================================
RCS file: /home/cvspublic/apr/misc/win32/rand.c,v
retrieving revision 1.12
diff -u -r1.12 rand.c
--- misc/win32/rand.c   30 Dec 2001 19:50:46 -0000  1.12
+++ misc/win32/rand.c   29 Jan 2002 14:42:54 -0000
@@ -59,9 +59,9 @@
 APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
                                                     int length)
 {
-    HCRYPTPROV hProv;
     apr_status_t res = APR_SUCCESS;
-
+#if !defined(_WIN32_WCE_EMULATION) || defined(_i386_)
+    HCRYPTPROV hProv;
     /* 0x40 bit = CRYPT_SILENT, only introduced in more recent PSDKs 
      */
     if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
@@ -72,5 +72,12 @@
        res = apr_get_os_error();
     }
     CryptReleaseContext(hProv, 0);
+#else
+    /* Pocket PC 2002 emulator has CryptoApi in coredll */
+    int i;
+    for (i = 0; i < length; i++)
+        *(buf + i) = rand() % 256;
+
+#endif
     return res;
 }
cvs server: Diffing mmap
cvs server: Diffing mmap/unix
cvs server: Diffing mmap/win32
cvs server: Diffing network_io
cvs server: Diffing network_io/beos
cvs server: Diffing network_io/os2
cvs server: Diffing network_io/unix
Index: network_io/unix/inet_ntop.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/unix/inet_ntop.c,v
retrieving revision 1.12
diff -u -r1.12 inet_ntop.c
--- network_io/unix/inet_ntop.c 25 Jul 2001 19:47:50 -0000  1.12
+++ network_io/unix/inet_ntop.c 29 Jan 2002 14:42:55 -0000
@@ -31,7 +31,9 @@
 #include <arpa/inet.h>
 #endif
 #include <string.h>
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <stdio.h>
 
 #ifndef IN6ADDRSZ
Index: network_io/unix/inet_pton.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/unix/inet_pton.c,v
retrieving revision 1.5
diff -u -r1.5 inet_pton.c
--- network_io/unix/inet_pton.c 16 Mar 2001 03:22:04 -0000  1.5
+++ network_io/unix/inet_pton.c 29 Jan 2002 14:42:56 -0000
@@ -30,7 +30,9 @@
 #include <arpa/inet.h>
 #endif
 #include <string.h>
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 
 #ifndef IN6ADDRSZ
 #define IN6ADDRSZ   16
cvs server: Diffing network_io/win32
Index: network_io/win32/poll.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/win32/poll.c,v
retrieving revision 1.28
diff -u -r1.28 poll.c
--- network_io/win32/poll.c 6 Aug 2001 16:15:04 -0000   1.28
+++ network_io/win32/poll.c 29 Jan 2002 14:42:56 -0000
@@ -56,9 +56,12 @@
 #include "apr_network_io.h"
 #include "apr_general.h"
 #include "apr_lib.h"
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
+#if APR_HAVE_TIME_H
 #include <time.h>
-
+#endif
 
 APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num,
                                          apr_pool_t *cont)
@@ -70,12 +73,12 @@
     (*new)->cntxt = cont;
     (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set));
     (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set));
-    (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set));
+    (*new)->exception = (fd_set *)apr_palloc(cont, sizeof(fd_set));
     FD_ZERO((*new)->read);
     (*new)->numread = 0;
     FD_ZERO((*new)->write);
     (*new)->numwrite = 0;
-    FD_ZERO((*new)->except);
+    FD_ZERO((*new)->exception);
     (*new)->numexcept = 0;
     return APR_SUCCESS;
 }
@@ -115,7 +118,7 @@
         newwrite = aprset->write;
     }
     if (aprset->numexcept != 0) {
-        newexcept = aprset->except;
+        newexcept = aprset->exception;
     }
 
     if (newread == NULL && newwrite == NULL && newexcept == NULL) {
@@ -164,8 +167,13 @@
 
     if (FD_ISSET(sock->sock, aprset->read)) {
         revents |= APR_POLLIN;
+#ifdef _WIN32_WCE
+        if (recv(sock->sock, data.buf, data.len, 0) == SOCKET_ERROR) 
+#else
         if (WSARecv(sock->sock, &data, 1, &dummy, &flags, NULL, 
-                    NULL) == SOCKET_ERROR) {
+                    NULL) == SOCKET_ERROR) 
+#endif
+            {
             /* This is only legit since we don't return the error */
             dummy = WSAGetLastError();
             switch (dummy) {
@@ -195,7 +203,7 @@
      * connection on a non-blocking socket.  Might be a bad assumption, but
      * it works for now. rbb.
      */
-    if (FD_ISSET(sock->sock, aprset->except)) {
+    if (FD_ISSET(sock->sock, aprset->exception)) {
         revents |= APR_POLLPRI;
     }
 
@@ -225,7 +233,7 @@
         aprset->numread--;
     }
     if (events & APR_POLLPRI) {
-        FD_CLR(sock->sock, aprset->except);
+        FD_CLR(sock->sock, aprset->exception);
         aprset->numexcept--;
     }
     if (events & APR_POLLOUT) {
Index: network_io/win32/sendrecv.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/win32/sendrecv.c,v
retrieving revision 1.45
diff -u -r1.45 sendrecv.c
--- network_io/win32/sendrecv.c 28 Dec 2001 23:50:49 -0000  1.45
+++ network_io/win32/sendrecv.c 29 Jan 2002 14:42:58 -0000
@@ -58,7 +58,9 @@
 #include "apr_network_io.h"
 #include "apr_lib.h"
 #include "fileio.h"
+#if APR_HAVE_TIME_H
 #include <time.h>
+#endif
 
 /* MAX_SEGMENT_SIZE is the maximum amount of data that will be sent to a client
  * in one call of TransmitFile. This number must be small enough to give the 
@@ -82,7 +84,12 @@
     wsaData.len = *len;
     wsaData.buf = (char*) buf;
 
+#ifndef _WIN32_WCE
     rv = WSASend(sock->sock, &wsaData, 1, &dwBytes, 0, NULL, NULL);
+#else
+    rv = send(sock->sock, wsaData.buf, wsaData.len, 0);
+    dwBytes = rv;
+#endif
     if (rv == SOCKET_ERROR) {
         lasterror = apr_get_netos_error();
         return lasterror;
@@ -106,7 +113,12 @@
     wsaData.len = *len;
     wsaData.buf = (char*) buf;
 
+#ifndef _WIN32_WCE
     rv = WSARecv(sock->sock, &wsaData, 1, &dwBytes, &flags, NULL, NULL);
+#else
+    rv = recv(sock->sock, wsaData.buf, wsaData.len, 0);
+    dwBytes = rv;
+#endif
     if (rv == SOCKET_ERROR) {
         lasterror = apr_get_netos_error();
         *len = 0;
@@ -139,12 +151,21 @@
         pWsaBuf[i].buf = vec[i].iov_base;
         pWsaBuf[i].len = vec[i].iov_len;
     }
-
+#ifndef _WIN32_WCE
     rv = WSASend(sock->sock, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL);
     if (rv == SOCKET_ERROR) {
         rc = apr_get_netos_error();
     }
-
+#else
+    for (i = 0; i < nvec; i++) {
+        rv = send(sock->sock, pWsaBuf[i].buf, pWsaBuf[i].len, 0);
+        if (rv == SOCKET_ERROR) {
+            rc = apr_get_netos_error();
+            break;
+        }
+        dwBytes += rv;
+    }
+#endif
     if (nvec > WSABUF_ON_STACK) 
         free(pWsaBuf);
 
Index: network_io/win32/sockaddr.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/win32/sockaddr.c,v
retrieving revision 1.25
diff -u -r1.25 sockaddr.c
--- network_io/win32/sockaddr.c 16 Feb 2001 04:16:04 -0000  1.25
+++ network_io/win32/sockaddr.c 29 Jan 2002 14:42:58 -0000
@@ -57,6 +57,7 @@
 #include "apr_general.h"
 #include "apr_strings.h"
 #include "apr_lib.h"
+#include "apr_private.h"
 #include <string.h>
 
 static apr_status_t get_local_addr(apr_socket_t *sock)
@@ -72,6 +73,14 @@
     }
 }
 
+#ifdef _WIN32_WCE
+/* WCE lacks getservbyname */
+static void *getservbyname(const char *name, const char *proto)
+{
+    return NULL;
+}
+
+#endif
 /* Include this here so we have get_local_addr defined... */
 #include "../unix/sa_common.c"
 
Index: network_io/win32/sockets.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/win32/sockets.c,v
retrieving revision 1.70
diff -u -r1.70 sockets.c
--- network_io/win32/sockets.c  4 Jan 2002 21:28:56 -0000   1.70
+++ network_io/win32/sockets.c  29 Jan 2002 14:42:59 -0000
@@ -167,8 +167,9 @@
 APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket,
                                        apr_shutdown_how_e how)
 {
-    int winhow;
+    int winhow = 0;
 
+#if SD_RECEIVE
     switch (how) {
         case APR_SHUTDOWN_READ: {
             winhow = SD_RECEIVE;
@@ -185,6 +186,7 @@
         default:
             return APR_BADARG;
     }
+#endif
     if (shutdown(thesocket->sock, winhow) == 0) {
         return APR_SUCCESS;
     }
cvs server: Diffing passwd
Index: passwd/apr_getpass.c
===================================================================
RCS file: /home/cvspublic/apr/passwd/apr_getpass.c,v
retrieving revision 1.18
diff -u -r1.18 apr_getpass.c
--- passwd/apr_getpass.c    10 Jun 2001 17:48:46 -0000  1.18
+++ passwd/apr_getpass.c    29 Jan 2002 14:42:59 -0000
@@ -61,8 +61,12 @@
 #include "apr_strings.h"
 #include "apr_lib.h"
 #include "apr_errno.h"
+#if APR_HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>
@@ -165,6 +169,13 @@
 
 static char *getpass(const char *prompt)
 {
+/* WCE lacks console. So the getpass is unsuported
+ * The only way is to use the GUI so the getpass should be implemented
+ * on per-application basis.
+*/ 
+#ifdef _WIN32_WCE
+    return NULL;
+#else
     static char password[MAX_STRING_LEN];
     int n = 0;
 
@@ -190,6 +201,7 @@
     }
 
     return (char *) &password;
+#endif
 }
 
 #endif /* no getchar or _getch */
cvs server: Diffing shmem
cvs server: Diffing shmem/beos
cvs server: Diffing shmem/os2
cvs server: Diffing shmem/unix
cvs server: Diffing shmem/win32
Index: shmem/win32/shm.c
===================================================================
RCS file: /home/cvspublic/apr/shmem/win32/shm.c,v
retrieving revision 1.9
diff -u -r1.9 shm.c
--- shmem/win32/shm.c   28 Jan 2002 15:56:08 -0000  1.9
+++ shmem/win32/shm.c   29 Jan 2002 14:43:00 -0000
@@ -118,12 +118,16 @@
 
     if (!file) {
         /* Do Anonymous, which will be an inherited handle */
+        if (apr_os_level == APR_WIN_CE_3)
+            psec = NULL;
+        else {
+            sec.nLength = sizeof(SECURITY_ATTRIBUTES);
+            sec.lpSecurityDescriptor = NULL;
+            sec.bInheritHandle = TRUE;
+            psec = &sec;
+        }
         hFile = INVALID_HANDLE_VALUE;
-        sec.nLength = sizeof(SECURITY_ATTRIBUTES);
-        sec.lpSecurityDescriptor = NULL;
-        sec.bInheritHandle = TRUE;
         mapkey = NULL;
-        psec = &sec;
     }
     else {
         /* Do file backed, which is not an inherited handle 
@@ -218,7 +222,15 @@
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
+#ifndef _WIN32_WCE
         hMap = OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey);
+#else
+        /* The WCE 3.0 lacks OpenFileMapping. So we emulate one with
+         * opening the existing shmem and reading its size from the header 
+         */
+        hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, 
+                                  PAGE_READWRITE, 0, sizeof(apr_shm_t), mapkey);
+#endif
     }
 #endif
 #if APR_HAS_ANSI_FS
@@ -240,13 +252,28 @@
     
     *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t));
     (*m)->pool = pool;
-    (*m)->hMap = hMap;
     (*m)->memblk = base;
-    (*m)->usrmem = (char*)base + sizeof(memblock_t);
     /* Real (*m)->mem->size could be recovered with VirtualQuery */
     (*m)->size = (*m)->memblk->size;
-    (*m)->length = (*m)->memblk->length;
+#if _WIN32_WCE
+    /* Reopen with real size  */
+    UnmapViewOfFile(base);
+    CloseHandle(hMap);
 
+    hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, 
+                              PAGE_READWRITE, 0, (*m)->size, mapkey);
+    if (!hMap) {
+        return apr_get_os_error();
+    }
+    base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
+    if (!base) {
+        CloseHandle(hMap);
+        return apr_get_os_error();
+    }    
+#endif
+    (*m)->hMap = hMap;
+    (*m)->length = (*m)->memblk->length;
+    (*m)->usrmem = (char*)base + sizeof(memblock_t);
     apr_pool_cleanup_register((*m)->pool, *m, 
                               shm_cleanup, apr_pool_cleanup_null);
     return APR_SUCCESS;
cvs server: Diffing strings
Index: strings/apr_strnatcmp.c
===================================================================
RCS file: /home/cvspublic/apr/strings/apr_strnatcmp.c,v
retrieving revision 1.7
diff -u -r1.7 apr_strnatcmp.c
--- strings/apr_strnatcmp.c 13 Dec 2001 17:26:15 -0000  1.7
+++ strings/apr_strnatcmp.c 29 Jan 2002 14:43:01 -0000
@@ -22,10 +22,12 @@
 
 #include <ctype.h>
 #include <string.h>
-#include <assert.h>
-
 #include "apr_strings.h"
 #include "apr_lib.h"            /* for apr_is*() */
+#if APR_HAVE_ERRNO_H
+/* Do we realy need the assert here ? */
+#include <assert.h>
+#endif
 
 #if defined(__GNUC__)
 #  define UNUSED __attribute__((__unused__))
@@ -92,8 +94,9 @@
      int ai, bi;
      char ca, cb;
      int fractional, result;
-     
+#if APR_HAVE_ERRNO_H     
      assert(a && b);
+#endif
      ai = bi = 0;
      while (1) {
      ca = a[ai]; cb = b[bi];
cvs server: Diffing tables
cvs server: Diffing test
cvs server: Diffing threadproc
cvs server: Diffing threadproc/beos
cvs server: Diffing threadproc/netware
cvs server: Diffing threadproc/os2
cvs server: Diffing threadproc/unix
cvs server: Diffing threadproc/win32
Index: threadproc/win32/proc.c
===================================================================
RCS file: /home/cvspublic/apr/threadproc/win32/proc.c,v
retrieving revision 1.63
diff -u -r1.63 proc.c
--- threadproc/win32/proc.c 29 Jan 2002 05:49:21 -0000  1.63
+++ threadproc/win32/proc.c 29 Jan 2002 14:43:02 -0000
@@ -61,10 +61,28 @@
 #include "apr_strings.h"
 #include "apr_portable.h"
 #include <stdlib.h>
+#if APR_HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 #include <string.h>
+#if APR_HAVE_PROCESS_H
 #include <process.h>
+#endif
 
+#ifdef _WIN32_WCE
+#ifndef DETACHED_PROCESS
+#define DETACHED_PROCESS 0
+#endif
+#ifndef CREATE_UNICODE_ENVIRONMENT
+#define CREATE_UNICODE_ENVIRONMENT 0
+#endif
+#ifndef STARTF_USESHOWWINDOW
+#define STARTF_USESHOWWINDOW 0
+#endif
+#ifndef SW_HIDE
+#define SW_HIDE 0
+#endif
+#endif
 /* 
  * some of the ideas expressed herein are based off of Microsoft
  * Knowledge Base article: Q190351
@@ -112,6 +130,9 @@
 
 static apr_status_t make_handle_private(apr_file_t *file)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     HANDLE hproc = GetCurrentProcess();
     HANDLE filehand = file->filehand;
 
@@ -129,11 +150,15 @@
      */
     CloseHandle(filehand);
     return APR_SUCCESS;
+#endif
 }
 
 static apr_status_t make_inheritable_duplicate(apr_file_t *original,
                                                apr_file_t *duplicate)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     if (original == NULL)
         return APR_SUCCESS;
 
@@ -153,6 +178,7 @@
     }
 
     return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
@@ -344,7 +370,7 @@
     }
 
     /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */
-
+#ifndef _WIN32_WCE
     if (attr->cmdtype == APR_SHELLCMD) {
         char *shellcmd = getenv("COMSPEC");
         if (!shellcmd)
@@ -355,7 +381,9 @@
             shellcmd = apr_pstrcat(cont, "\"", shellcmd, "\"", NULL);
         cmdline = apr_pstrcat(cont, shellcmd, " /C \"", cmdline, "\"", NULL);
     } 
-    else {
+    else 
+#endif
+    {
         /* Win32 is _different_ than unix.  While unix will find the given
          * program since it's already chdir'ed, Win32 cannot since the parent
          * attempts to open the program with it's own path.
@@ -467,6 +495,7 @@
             si.dwFlags |= STARTF_USESHOWWINDOW;
             si.wShowWindow = SW_HIDE;
         }
+#ifndef _WIN32_WCE
         if ((attr->child_in && attr->child_in->filehand)
             || (attr->child_out && attr->child_out->filehand)
             || (attr->child_err && attr->child_err->filehand))
@@ -479,7 +508,6 @@
             if (attr->child_err)
                 si.hStdError = attr->child_err->filehand;
         }
-
         rv = CreateProcessW(wprg, wcmd,        /* Executable & Command line */
                             NULL, NULL,        /* Proc & thread security attributes */
                             TRUE,              /* Inherit handles */
@@ -487,6 +515,16 @@
                             pEnvBlock,         /* Environment block */
                             wcwd,              /* Current directory name */
                             &si, &pi);
+#else
+        rv = CreateProcessW(wprg, wcmd,        /* Executable & Command line */
+                            NULL, NULL,        /* Proc & thread security attributes */
+                            FALSE,             /* must be 0 */
+                            dwCreationFlags,   /* Creation flags */
+                            NULL,              /* Environment block must be NULL */
+                            NULL,              /* Current directory name must be NULL*/
+                            NULL,              /* STARTUPINFO not supported */
+                            &pi);
+#endif
     }
 #endif /* APR_HAS_UNICODE_FS */
 #if APR_HAS_ANSI_FS
Index: threadproc/win32/signals.c
===================================================================
RCS file: /home/cvspublic/apr/threadproc/win32/signals.c,v
retrieving revision 1.17
diff -u -r1.17 signals.c
--- threadproc/win32/signals.c  20 Sep 2001 20:25:11 -0000  1.17
+++ threadproc/win32/signals.c  29 Jan 2002 14:43:02 -0000
@@ -57,7 +57,9 @@
 #include "apr_thread_proc.h"
 #include "apr_file_io.h"
 #include "apr_general.h"
+#if APR_HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 #include <string.h>
 #if APR_HAVE_SYS_WAIT
 #include <sys/wait.h>
Index: threadproc/win32/thread.c
===================================================================
RCS file: /home/cvspublic/apr/threadproc/win32/thread.c,v
retrieving revision 1.42
diff -u -r1.42 thread.c
--- threadproc/win32/thread.c   28 Dec 2001 23:58:39 -0000  1.42
+++ threadproc/win32/thread.c   29 Jan 2002 14:43:03 -0000
@@ -58,7 +58,9 @@
 #include "apr_general.h"
 #include "apr_lib.h"
 #include "apr_portable.h"
+#if APR_HAVE_PROCESS_H
 #include <process.h>
+#endif
 #include "misc.h"   
 
 APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
@@ -121,12 +123,19 @@
     /* Use 0 for Thread Stack Size, because that will default the stack to the
      * same size as the calling thread. 
      */
+#ifndef _WIN32_WCE
     if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, 
                         (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
                         (*new), 0, &temp)) == 0) {
         return APR_FROM_OS_ERROR(_doserrno);
     }
-
+#else
+   if (((*new)->td = (HANDLE *)CreateThread(NULL, 0, 
+                        (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
+                        (*new), 0, &temp)) == 0) {
+        return APR_FROM_OS_ERROR(GetLastError());
+    }
+#endif
     if (attr && attr->detach) {
         CloseHandle((*new)->td);
     }
@@ -139,7 +148,11 @@
 {
     thd->exitval = retval;
     apr_pool_destroy(thd->cntxt);
+#ifndef _WIN32_WCE
     _endthreadex(0);
+#else
+    ExitThread(0);
+#endif
    return APR_SUCCESS;
 }
 
@@ -174,9 +187,11 @@
      * providing more critical threads a bit larger timeslice)
      * we won't worry too much if it's not available.
      */
+#ifndef _WIN32_WCE
     if (apr_os_level >= APR_WIN_NT) {
         SwitchToThread();
     }
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key,
cvs server: Diffing time
cvs server: Diffing time/unix
cvs server: Diffing time/win32
Index: time/win32/time.c
===================================================================
RCS file: /home/cvspublic/apr/time/win32/time.c,v
retrieving revision 1.24
diff -u -r1.24 time.c
--- time/win32/time.c   30 Jun 2001 09:50:30 -0000  1.24
+++ time/win32/time.c   29 Jan 2002 14:43:04 -0000
@@ -57,8 +57,12 @@
 #include "apr_general.h"
 #include "apr_lib.h"
 #include "apr_portable.h"
+#if APR_HAVE_TIME_H
 #include <time.h>
+#endif
+#if APR_HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <string.h>
 #include <winbase.h>
 
@@ -131,7 +135,13 @@
 {
     LONGLONG aprtime = 0;
     FILETIME time;
+#ifndef _WIN32_WCE
     GetSystemTimeAsFileTime(&time);
+#else
+    SYSTEMTIME st;
+    GetSystemTime(&st);
+    SystemTimeToFileTime(&st, &time);
+#endif
     FileTimeToAprTime(&aprtime, &time);
     return aprtime; 
 }
Index: time/win32/timestr.c
===================================================================
RCS file: /home/cvspublic/apr/time/win32/timestr.c,v
retrieving revision 1.15
diff -u -r1.15 timestr.c
--- time/win32/timestr.c    29 Jan 2002 06:50:50 -0000  1.15
+++ time/win32/timestr.c    29 Jan 2002 14:43:04 -0000
@@ -155,6 +155,7 @@
     return APR_SUCCESS;
 }
 
+#ifndef _WIN32_WCE
 int win32_strftime_extra(char *s, size_t max, const char *format,
                          const struct tm *tm) {
    /* If the new format string is bigger than max, the result string won't fit
@@ -218,10 +219,15 @@
     return return_value;
  }
 
+#endif
+
 APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
                                        apr_size_t max, const char *format,
                                        apr_exploded_time_t *xt)
 {
+#ifdef _WIN32_WCE
+    *retsize = 0;
+#else
     struct tm tm;
     memset(&tm, 0, sizeof tm);
     tm.tm_sec  = xt->tm_sec;
@@ -234,5 +240,6 @@
     tm.tm_yday = xt->tm_yday;
     tm.tm_isdst = xt->tm_isdst;
     (*retsize) = win32_strftime_extra(s, max, format, &tm);
+#endif
     return APR_SUCCESS;
 }
cvs server: Diffing user
cvs server: Diffing user/netware
cvs server: Diffing user/unix
cvs server: Diffing user/win32
Index: user/win32/groupinfo.c
===================================================================
RCS file: /home/cvspublic/apr/user/win32/groupinfo.c,v
retrieving revision 1.6
diff -u -r1.6 groupinfo.c
--- user/win32/groupinfo.c  24 Nov 2001 21:15:43 -0000  1.6
+++ user/win32/groupinfo.c  29 Jan 2002 14:43:05 -0000
@@ -63,6 +63,9 @@
 APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, 
                                          const char *groupname, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     SID_NAME_USE sidtype;
     char anydomain[256];
     char *domain;
@@ -98,10 +101,14 @@
         return apr_get_os_error();
     }
     return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    *groupname = apr_pstrdup(p, "Administrators");
+#else
     SID_NAME_USE type;
     char name[MAX_PATH], domain[MAX_PATH];
     DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
@@ -113,6 +120,7 @@
                              && type != SidTypeAlias)
         return APR_EINVAL;
     *groupname = apr_pstrdup(p, name);
+#endif
     return APR_SUCCESS;
 }
   
@@ -120,9 +128,11 @@
 {
     if (!left || !right)
         return APR_EINVAL;
+#ifndef _WIN32_WCE
     if (!IsValidSid(left) || !IsValidSid(right))
         return APR_EINVAL;
     if (!EqualSid(left, right))
         return APR_EMISMATCH;
+#endif
     return APR_SUCCESS;
 }
Index: user/win32/userinfo.c
===================================================================
RCS file: /home/cvspublic/apr/user/win32/userinfo.c,v
retrieving revision 1.17
diff -u -r1.17 userinfo.c
--- user/win32/userinfo.c   28 Jan 2002 15:56:08 -0000  1.17
+++ user/win32/userinfo.c   29 Jan 2002 14:43:05 -0000
@@ -61,6 +61,7 @@
 #include <sys/types.h>
 #endif
 
+#ifndef _WIN32_WCE
 /* Internal sid binary to string translation, see MSKB Q131320.
  * Several user related operations require our SID to access
  * the registry, but in a string format.  All error handling
@@ -97,12 +98,16 @@
                              *GetSidSubAuthority(id, sa));
     }
 } 
-
+#endif
 /* Query the ProfileImagePath from the version-specific branch, where the
  * regkey uses the user's name on 9x, and user's sid string on NT.
  */
 APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    *dirname = apr_pstrdup(p, "\\My Documents");
+    return APR_SUCCESS;
+#else
     apr_status_t rv;
     char regkey[MAX_PATH * 2];
     char *fixch;
@@ -189,12 +194,16 @@
         if (*fixch == '\\')
             *fixch = '/';
     return APR_SUCCESS;
+#endif /* _WIN32_WCE */
 }
 
 APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid,
                                              apr_gid_t *gid,
                                              apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     HANDLE threadtok;
     DWORD needed;
     TOKEN_USER *usr;
@@ -222,11 +231,15 @@
         return apr_get_os_error();
 
     return APR_SUCCESS;
+#endif 
 }
 
 APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
                                          const char *username, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    return APR_ENOTIMPL;
+#else
     SID_NAME_USE sidtype;
     char anydomain[256];
     char *domain;
@@ -265,10 +278,15 @@
      */
     *gid = NULL;
     return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p)
 {
+#ifdef _WIN32_WCE
+    *username = apr_pstrdup(p, "Administrator");
+    return APR_SUCCESS;
+#else
     SID_NAME_USE type;
     char name[MAX_PATH], domain[MAX_PATH];
     DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
@@ -280,15 +298,18 @@
         return APR_EINVAL;
     *username = apr_pstrdup(p, name);
     return APR_SUCCESS;
+#endif
 }
   
 APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right)
 {
     if (!left || !right)
         return APR_EINVAL;
+#ifndef _WIN32_WCE
     if (!IsValidSid(left) || !IsValidSid(right))
         return APR_EINVAL;
     if (!EqualSid(left, right))
         return APR_EMISMATCH;
+#endif
     return APR_SUCCESS;
 }
