commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1084288 [2/15] - in /commons/sandbox/runtime/trunk/src/main/native: ./ include/acr/ os/ os/aix/ os/bsdx/ os/darwin/ os/hpux/ os/linux/ os/solaris/ os/unix/ os/win32/ port/ srclib/ srclib/bzip2/ srclib/zlib/ srclib/zlib/unix/ srclib/zlib/wi...
Date Tue, 22 Mar 2011 18:36:21 GMT
Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h Tue Mar 22 18:36:19 2011
@@ -0,0 +1,1592 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_ERROR_H_
+#define _ACR_ERROR_H_
+
+#include <opencpr/stdtypes.h>
+
+/**
+ * @file error.h
+ * @brief
+ *
+ * ACR error functions
+ *
+ */
+
+
+/**
+ * @defgroup error Error Codes
+ * @ingroup ACR
+ * @{
+ */
+
+/**
+ * ACR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
+ *    into one of the error/status ranges below -- except for
+ *    ACR_OS_START_USERERR, which see.
+ */
+#define ACR_OS_ERRSPACE_SIZE        50000
+/**
+ * ACR_OS_START_ERROR is where the ACR specific error values start.
+ */
+#define ACR_OS_START_ERROR         200000
+/**
+ * ACR_OS_START_STATUS is where the ACR specific status codes start.
+ */
+#define ACR_OS_START_STATUS        300000
+/**
+ * ACR_OS_START_USERERR are reserved for applications that use ACR that
+ *     layer their own error codes along with ACR's.  Note that the
+ *     error immediately following this one is set ten times farther
+ *     away than usual, so that users of apr have a lot of room in
+ *     which to declare custom error codes.
+ *
+ * In general applications should try and create unique error codes. To try
+ * and assist in finding suitable ranges of numbers to use, the following
+ * ranges are known to be used by the listed applications. If your
+ * application defines error codes please advise the range of numbers it
+ * uses to dev@apr.apache.org for inclusion in this list.
+ *
+ * Ranges shown are in relation to ACR_OS_START_USERERR
+ *
+ * Subversion - Defined ranges, of less than 100, at intervals of 5000
+ *              starting at an offset of 5000, e.g.
+ *               +5000 to 5100,  +10000 to 10100
+ */
+#define ACR_OS_START_USERERR        400000
+/**
+ * ACR_OS_START_CANONERR is where ACR versions of errno values are defined
+ *     on systems which don't have the corresponding errno.
+ */
+#define ACR_OS_START_CANONERR       500000
+/**
+ * ACR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into
+ *     apr_status_t values.
+ */
+#define ACR_OS_START_EAIERR         600000
+/**
+ * ACR_OS_START_SYSERR folds platform-specific system error values into
+ *     apr_status_t values.
+ */
+#define ACR_OS_START_SYSERR         700000
+
+/**
+ * @defgroup ACR_ERROR_map ACR Error Space
+ * <PRE>
+ * The following attempts to show the relation of the various constants
+ * used for mapping ACR Status codes.
+ *
+ *       0
+ *
+ * 100,000      ACR_OS_START_ERROR
+ *
+ *         + ACR_OS_ERRSPACE_SIZE (50,000)
+ *
+ * 200,000      ACR_OS_START_STATUS
+ *
+ *         + ACR_OS_ERRSPACE_SIZE (50,000)
+ *
+ * 300,000      ACR_OS_START_USERERR
+ *
+ *         + ACR_OS_ERRSPACE_SIZE (50,000)
+ *
+ * 400,000      ACR_OS_START_CANONERR
+ *
+ *         + ACR_OS_ERRSPACE_SIZE (50,000)
+ *
+ * 500,000      ACR_OS_START_EAIERR
+ *
+ *         + ACR_OS_ERRSPACE_SIZE (50,000)
+ *
+ * 600,000      ACR_OS_START_SYSERR
+ *
+ * </PRE>
+ */
+
+/** no error. */
+#define ACR_SUCCESS 0
+
+/**
+ * @defgroup ACR_Error ACR Error Values
+ * <PRE>
+ * <b>ACR ERROR VALUES</b>
+ * ACR_ENOSTAT      ACR was unable to perform a stat on the file
+ * ACR_ENOPOOL      ACR was not provided a pool with which to allocate memory
+ * ACR_EBADDATE     ACR was given an invalid date
+ * ACR_EINVALSOCK   ACR was given an invalid socket
+ * ACR_ENOPROC      ACR was not given a process structure
+ * ACR_ENOTIME      ACR was not given a time structure
+ * ACR_ENODIR       ACR was not given a directory structure
+ * ACR_ENOLOCK      ACR was not given a lock structure
+ * ACR_ENOPOLL      ACR was not given a poll structure
+ * ACR_ENOSOCKET    ACR was not given a socket
+ * ACR_ENOTHREAD    ACR was not given a thread structure
+ * ACR_ENOTHDKEY    ACR was not given a thread key structure
+ * ACR_ENOSHMAVAIL  There is no more shared memory available
+ * ACR_EDSOOPEN     ACR was unable to open the dso object.  For more
+ *                  information call apr_dso_error().
+ * ACR_EGENERAL     General failure (specific information not available)
+ * ACR_EBADIP       The specified IP address is invalid
+ * ACR_EBADMASK     The specified netmask is invalid
+ * ACR_ESYMNOTFOUND Could not find the requested symbol
+ * ACR_ENOTENOUGHENTROPY Not enough entropy to continue
+ * </PRE>
+ *
+ * <PRE>
+ * <b>ACR STATUS VALUES</b>
+ * ACR_INCHILD        Program is currently executing in the child
+ * ACR_INPARENT       Program is currently executing in the parent
+ * ACR_DETACH         The thread is detached
+ * ACR_NOTDETACH      The thread is not detached
+ * ACR_CHILD_DONE     The child has finished executing
+ * ACR_CHILD_NOTDONE  The child has not finished executing
+ * ACR_TIMEUP         The operation did not finish before the timeout
+ * ACR_INCOMPLETE     The operation was incomplete although some processing
+ *                    was performed and the results are partially valid
+ * ACR_INSHUTDOWN     Program is currently in shutdown mode
+ * ACR_BADCH          Getopt found an option not in the option string
+ * ACR_BADARG         Getopt found an option that is missing an argument
+ *                    and an argument was specified in the option string
+ * ACR_EOF            ACR has encountered the end of the file
+ * ACR_NOTFOUND       ACR was unable to find the socket in the poll structure
+ * ACR_ANONYMOUS      ACR is using anonymous shared memory
+ * ACR_FILEBASED      ACR is using a file name as the key to the shared memory
+ * ACR_KEYBASED       ACR is using a shared key as the key to the shared memory
+ * ACR_EINIT          Ininitalizer value.  If no option has been found, but
+ *                    the status variable requires a value, this should be used
+ * ACR_ENOTIMPL       The ACR function has not been implemented on this
+ *                    platform, either because nobody has gotten to it yet,
+ *                    or the function is impossible on this platform.
+ * ACR_EMISMATCH      Two passwords do not match.
+ * ACR_EABSOLUTE      The given path was absolute.
+ * ACR_ERELATIVE      The given path was relative.
+ * ACR_EINCOMPLETE    The given path was neither relative nor absolute.
+ * ACR_EABOVEROOT     The given path was above the root path.
+ * ACR_EBUSY          The given lock was busy.
+ * ACR_EPROC_UNKNOWN  The given process wasn't recognized by ACR
+ * </PRE>
+ * @{
+ */
+/** @see ACR_STATUS_IS_ENOSTAT */
+#define ACR_ENOSTAT        (ACR_OS_START_ERROR + 1)
+/** @see ACR_STATUS_IS_ENOPOOL */
+#define ACR_ENOPOOL        (ACR_OS_START_ERROR + 2)
+/* empty slot: +3 */
+/** @see ACR_STATUS_IS_EBADDATE */
+#define ACR_EBADDATE       (ACR_OS_START_ERROR + 4)
+/** @see ACR_STATUS_IS_EINVALSOCK */
+#define ACR_EINVALSOCK     (ACR_OS_START_ERROR + 5)
+/** @see ACR_STATUS_IS_ENOPROC */
+#define ACR_ENOPROC        (ACR_OS_START_ERROR + 6)
+/** @see ACR_STATUS_IS_ENOTIME */
+#define ACR_ENOTIME        (ACR_OS_START_ERROR + 7)
+/** @see ACR_STATUS_IS_ENODIR */
+#define ACR_ENODIR         (ACR_OS_START_ERROR + 8)
+/** @see ACR_STATUS_IS_ENOLOCK */
+#define ACR_ENOLOCK        (ACR_OS_START_ERROR + 9)
+/** @see ACR_STATUS_IS_ENOPOLL */
+#define ACR_ENOPOLL        (ACR_OS_START_ERROR + 10)
+/** @see ACR_STATUS_IS_ENOSOCKET */
+#define ACR_ENOSOCKET      (ACR_OS_START_ERROR + 11)
+/** @see ACR_STATUS_IS_ENOTHREAD */
+#define ACR_ENOTHREAD      (ACR_OS_START_ERROR + 12)
+/** @see ACR_STATUS_IS_ENOTHDKEY */
+#define ACR_ENOTHDKEY      (ACR_OS_START_ERROR + 13)
+/** @see ACR_STATUS_IS_EGENERAL */
+#define ACR_EGENERAL       (ACR_OS_START_ERROR + 14)
+/** @see ACR_STATUS_IS_ENOSHMAVAIL */
+#define ACR_ENOSHMAVAIL    (ACR_OS_START_ERROR + 15)
+/** @see ACR_STATUS_IS_EBADIP */
+#define ACR_EBADIP         (ACR_OS_START_ERROR + 16)
+/** @see ACR_STATUS_IS_EBADMASK */
+#define ACR_EBADMASK       (ACR_OS_START_ERROR + 17)
+/* empty slot: +18 */
+/** @see ACR_STATUS_IS_EDSOPEN */
+#define ACR_EDSOOPEN       (ACR_OS_START_ERROR + 19)
+/** @see ACR_STATUS_IS_EABSOLUTE */
+#define ACR_EABSOLUTE      (ACR_OS_START_ERROR + 20)
+/** @see ACR_STATUS_IS_ERELATIVE */
+#define ACR_ERELATIVE      (ACR_OS_START_ERROR + 21)
+/** @see ACR_STATUS_IS_EINCOMPLETE */
+#define ACR_EINCOMPLETE    (ACR_OS_START_ERROR + 22)
+/** @see ACR_STATUS_IS_EABOVEROOT */
+#define ACR_EABOVEROOT     (ACR_OS_START_ERROR + 23)
+/** @see ACR_STATUS_IS_EBADPATH */
+#define ACR_EBADPATH       (ACR_OS_START_ERROR + 24)
+/** @see ACR_STATUS_IS_EPATHWILD */
+#define ACR_EPATHWILD      (ACR_OS_START_ERROR + 25)
+/** @see ACR_STATUS_IS_ESYMNOTFOUND */
+#define ACR_ESYMNOTFOUND   (ACR_OS_START_ERROR + 26)
+/** @see ACR_STATUS_IS_EPROC_UNKNOWN */
+#define ACR_EPROC_UNKNOWN  (ACR_OS_START_ERROR + 27)
+/** @see ACR_STATUS_IS_ENOTENOUGHENTROPY */
+#define ACR_ENOTENOUGHENTROPY (ACR_OS_START_ERROR + 28)
+/** @} */
+
+/** ACR private errors added to the std APR errors */
+#define ACR_EISNULL         (ACR_OS_START_ERROR + 100)
+#define ACR_EINVALSIZ       (ACR_OS_START_ERROR + 101)
+#define ACR_ERDONLY         (ACR_OS_START_ERROR + 102)
+
+/**
+ * @defgroup ACR_STATUS_IS Status Value Tests
+ * @warning For any particular error condition, more than one of these tests
+ *      may match. This is because platform-specific error codes may not
+ *      always match the semantics of the POSIX codes these tests (and the
+ *      corresponding ACR error codes) are named after. A notable example
+ *      are the ACR_STATUS_IS_ENOENT and ACR_STATUS_IS_ENOTDIR tests on
+ *      Win32 platforms. The programmer should always be aware of this and
+ *      adjust the order of the tests accordingly.
+ * @{
+ */
+/**
+ * ACR was unable to perform a stat on the file
+ * @warning always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_ENOSTAT(s)        ((s) == ACR_ENOSTAT)
+/**
+ * ACR was not provided a pool with which to allocate memory
+ * @warning always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_ENOPOOL(s)        ((s) == ACR_ENOPOOL)
+/** ACR was given an invalid date  */
+#define ACR_STATUS_IS_EBADDATE(s)       ((s) == ACR_EBADDATE)
+/** ACR was given an invalid socket */
+#define ACR_STATUS_IS_EINVALSOCK(s)     ((s) == ACR_EINVALSOCK)
+/** ACR was not given a process structure */
+#define ACR_STATUS_IS_ENOPROC(s)        ((s) == ACR_ENOPROC)
+/** ACR was not given a time structure */
+#define ACR_STATUS_IS_ENOTIME(s)        ((s) == ACR_ENOTIME)
+/** ACR was not given a directory structure */
+#define ACR_STATUS_IS_ENODIR(s)         ((s) == ACR_ENODIR)
+/** ACR was not given a lock structure */
+#define ACR_STATUS_IS_ENOLOCK(s)        ((s) == ACR_ENOLOCK)
+/** ACR was not given a poll structure */
+#define ACR_STATUS_IS_ENOPOLL(s)        ((s) == ACR_ENOPOLL)
+/** ACR was not given a socket */
+#define ACR_STATUS_IS_ENOSOCKET(s)      ((s) == ACR_ENOSOCKET)
+/** ACR was not given a thread structure */
+#define ACR_STATUS_IS_ENOTHREAD(s)      ((s) == ACR_ENOTHREAD)
+/** ACR was not given a thread key structure */
+#define ACR_STATUS_IS_ENOTHDKEY(s)      ((s) == ACR_ENOTHDKEY)
+/** Generic Error which can not be put into another spot */
+#define ACR_STATUS_IS_EGENERAL(s)       ((s) == ACR_EGENERAL)
+/** There is no more shared memory available */
+#define ACR_STATUS_IS_ENOSHMAVAIL(s)    ((s) == ACR_ENOSHMAVAIL)
+/** The specified IP address is invalid */
+#define ACR_STATUS_IS_EBADIP(s)         ((s) == ACR_EBADIP)
+/** The specified netmask is invalid */
+#define ACR_STATUS_IS_EBADMASK(s)       ((s) == ACR_EBADMASK)
+/* empty slot: +18 */
+/**
+ * ACR was unable to open the dso object.
+ * For more information call apr_dso_error().
+ */
+#if defined(_WINDOWS)
+#define ACR_STATUS_IS_EDSOOPEN(s)       ((s) == ACR_EDSOOPEN \
+                                      || (s) == ERROR_MOD_NOT_FOUND)
+#else
+#define ACR_STATUS_IS_EDSOOPEN(s)       ((s) == ACR_EDSOOPEN)
+#endif
+/** The given path was absolute. */
+#define ACR_STATUS_IS_EABSOLUTE(s)      ((s) == ACR_EABSOLUTE)
+/** The given path was relative. */
+#define ACR_STATUS_IS_ERELATIVE(s)      ((s) == ACR_ERELATIVE)
+/** The given path was neither relative nor absolute. */
+#define ACR_STATUS_IS_EINCOMPLETE(s)    ((s) == ACR_EINCOMPLETE)
+/** The given path was above the root path. */
+#define ACR_STATUS_IS_EABOVEROOT(s)     ((s) == ACR_EABOVEROOT)
+/** The given path was bad. */
+#define ACR_STATUS_IS_EBADPATH(s)       ((s) == ACR_EBADPATH)
+/** The given path contained wildcards. */
+#define ACR_STATUS_IS_EPATHWILD(s)      ((s) == ACR_EPATHWILD)
+/** Could not find the requested symbol.
+ * For more information call apr_dso_error().
+ */
+#if defined(_WINDOWS)
+#define ACR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == ACR_ESYMNOTFOUND \
+                       || (s) == ERROR_PROC_NOT_FOUND)
+#else
+#define ACR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == ACR_ESYMNOTFOUND)
+#endif
+/** The given process was not recognized by ACR. */
+#define ACR_STATUS_IS_EPROC_UNKNOWN(s)  ((s) == ACR_EPROC_UNKNOWN)
+/** ACR could not gather enough entropy to continue. */
+#define ACR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == ACR_ENOTENOUGHENTROPY)
+
+/** @} */
+
+/**
+ * @addtogroup ACR_Error
+ * @{
+ */
+/** @see ACR_STATUS_IS_INCHILD */
+#define ACR_INCHILD        (ACR_OS_START_STATUS + 1)
+/** @see ACR_STATUS_IS_INPARENT */
+#define ACR_INPARENT       (ACR_OS_START_STATUS + 2)
+/** @see ACR_STATUS_IS_DETACH */
+#define ACR_DETACH         (ACR_OS_START_STATUS + 3)
+/** @see ACR_STATUS_IS_NOTDETACH */
+#define ACR_NOTDETACH      (ACR_OS_START_STATUS + 4)
+/** @see ACR_STATUS_IS_CHILD_DONE */
+#define ACR_CHILD_DONE     (ACR_OS_START_STATUS + 5)
+/** @see ACR_STATUS_IS_CHILD_NOTDONE */
+#define ACR_CHILD_NOTDONE  (ACR_OS_START_STATUS + 6)
+/** @see ACR_STATUS_IS_TIMEUP */
+#define ACR_TIMEUP         (ACR_OS_START_STATUS + 7)
+/** @see ACR_STATUS_IS_INCOMPLETE */
+#define ACR_INCOMPLETE     (ACR_OS_START_STATUS + 8)
+/** @see ACR_STATUS_IS_INSHUTDOWN */
+#define ACR_INSHUTDOWN     (ACR_OS_START_STATUS + 9)
+/* empty slot: +10 */
+/* empty slot: +11 */
+/** @see ACR_STATUS_IS_BADCH */
+#define ACR_BADCH          (ACR_OS_START_STATUS + 12)
+/** @see ACR_STATUS_IS_BADARG */
+#define ACR_BADARG         (ACR_OS_START_STATUS + 13)
+/** @see ACR_STATUS_IS_EOF */
+#define ACR_EOF            (ACR_OS_START_STATUS + 14)
+/** @see ACR_STATUS_IS_NOTFOUND */
+#define ACR_NOTFOUND       (ACR_OS_START_STATUS + 15)
+/* empty slot: +16 */
+/* empty slot: +17 */
+/* empty slot: +18 */
+/** @see ACR_STATUS_IS_ANONYMOUS */
+#define ACR_ANONYMOUS      (ACR_OS_START_STATUS + 19)
+/** @see ACR_STATUS_IS_FILEBASED */
+#define ACR_FILEBASED      (ACR_OS_START_STATUS + 20)
+/** @see ACR_STATUS_IS_KEYBASED */
+#define ACR_KEYBASED       (ACR_OS_START_STATUS + 21)
+/** @see ACR_STATUS_IS_EINIT */
+#define ACR_EINIT          (ACR_OS_START_STATUS + 22)
+/** @see ACR_STATUS_IS_ENOTIMPL */
+#define ACR_ENOTIMPL       (ACR_OS_START_STATUS + 23)
+/** @see ACR_STATUS_IS_EMISMATCH */
+#define ACR_EMISMATCH      (ACR_OS_START_STATUS + 24)
+
+/** @see ACR_STATUS_IS_CHILD_SIGNAL */
+#define ACR_CHILD_SIGNAL        (ACR_OS_START_STATUS + 50)
+/** @see ACR_STATUS_IS_CHILD_SIGNAL_CORE */
+#define ACR_CHILD_SIGNAL_CORE   (ACR_OS_START_STATUS + 51)
+/** @see ACR_STATUS_IS_CHILD_ERROR */
+#define ACR_CHILD_ERROR         (ACR_OS_START_STATUS + 52)
+/** @see ACR_STATUS_IS_PARENT_ERROR */
+#define ACR_PARENT_ERROR        (ACR_OS_START_STATUS + 53)
+
+/** @} */
+
+/**
+ * @addtogroup ACR_STATUS_IS
+ * @{
+ */
+/**
+ * Program is currently executing in the child
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code */
+#define ACR_STATUS_IS_INCHILD(s)        ((s) == ACR_INCHILD)
+/**
+ * Program is currently executing in the parent
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_INPARENT(s)       ((s) == ACR_INPARENT)
+/**
+ * The thread is detached
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_DETACH(s)         ((s) == ACR_DETACH)
+/**
+ * The thread is not detached
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_NOTDETACH(s)      ((s) == ACR_NOTDETACH)
+/**
+ * The child has finished executing
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_CHILD_DONE(s)     ((s) == ACR_CHILD_DONE)
+/**
+ * The child has not finished executing
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_CHILD_NOTDONE(s)  ((s) == ACR_CHILD_NOTDONE)
+/**
+ * The operation did not finish before the timeout
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_TIMEUP(s)         ((s) == ACR_TIMEUP)
+/**
+ * The operation was incomplete although some processing was performed
+ * and the results are partially valid.
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_INCOMPLETE(s)     ((s) == ACR_INCOMPLETE)
+/**
+ * Process is in shutdown mode.
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_INSHUTDOWN(s)     ((s) == ACR_INSHUTDOWN)
+
+/* empty slot: +10 */
+/* empty slot: +11 */
+/**
+ * Getopt found an option not in the option string
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_BADCH(s)          ((s) == ACR_BADCH)
+/**
+ * Getopt found an option not in the option string and an argument was
+ * specified in the option string
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_BADARG(s)         ((s) == ACR_BADARG)
+/**
+ * ACR has encountered the end of the file
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_EOF(s)            ((s) == ACR_EOF)
+/**
+ * ACR was unable to find the socket in the poll structure
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_NOTFOUND(s)       ((s) == ACR_NOTFOUND)
+/* empty slot: +16 */
+/* empty slot: +17 */
+/* empty slot: +18 */
+/**
+ * ACR is using anonymous shared memory
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_ANONYMOUS(s)      ((s) == ACR_ANONYMOUS)
+/**
+ * ACR is using a file name as the key to the shared memory
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_FILEBASED(s)      ((s) == ACR_FILEBASED)
+/**
+ * ACR is using a shared key as the key to the shared memory
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_KEYBASED(s)       ((s) == ACR_KEYBASED)
+/**
+ * Ininitalizer value.  If no option has been found, but
+ * the status variable requires a value, this should be used
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_EINIT(s)          ((s) == ACR_EINIT)
+/**
+ * The ACR function has not been implemented on this
+ * platform, either because nobody has gotten to it yet,
+ * or the function is impossible on this platform.
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_ENOTIMPL(s)       ((s) == ACR_ENOTIMPL)
+/**
+ * Two passwords do not match.
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_EMISMATCH(s)      ((s) == ACR_EMISMATCH)
+/**
+ * The given lock was busy
+ * @warning always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_EBUSY(s)          ((s) == ACR_EBUSY)
+
+/**
+ * The child exited by signal
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_CHILD_SIGNAL(s)  ((s) == ACR_CHILD_SIGNAL)
+
+/**
+ * The child exited by core signal
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_CHILD_SIGNAL_CORE(s)  ((s) == ACR_CHILD_SIGNAL_CORE)
+
+/**
+ * The child exited with unspecified error
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_CHILD_ERROR(s)    ((s) == ACR_CHILD_ERROR)
+
+/**
+ * The child didnt executed because of parent error
+ * @warning
+ * always use this test, as platform-specific variances may meet this
+ * more than one error code
+ */
+#define ACR_STATUS_IS_PARENT_ERROR(s)   ((s) == ACR_PARENT_ERROR)
+
+/** @} */
+
+/**
+ * @addtogroup ACR_Error ACR Error Values
+ * @{
+ */
+#if defined(_WINDOWS)
+/* Windows ACR CANONICAL ERROR VALUES */
+#define ACR_EPERM               (ACR_OS_START_CANONERR + EPERM)
+/** No such file or directory */
+#define ACR_ENOENT              (ACR_OS_START_CANONERR + ENOENT)
+/** No such process */
+#define ACR_ESRCH               (ACR_OS_START_CANONERR + ESRCH)
+/** Interrupted system call */
+#define ACR_EINTR               (ACR_OS_START_CANONERR + EINTR)
+/** Input/output error */
+#define ACR_EIO                 (ACR_OS_START_CANONERR + EIO)
+/** Device not configured */
+#define ACR_ENXIO               (ACR_OS_START_CANONERR + ENXIO)
+/** Argument list too long */
+#define ACR_E2BIG               (ACR_OS_START_CANONERR + E2BIG)
+/** Exec format error */
+#define ACR_ENOEXEC             (ACR_OS_START_CANONERR + ENOEXEC)
+/** Bad file descriptor */
+#define ACR_EBADF               (ACR_OS_START_CANONERR + EBADF)
+/** No child processes */
+#define ACR_ECHILD              (ACR_OS_START_CANONERR + ECHILD)
+/** Resource deadlock avoided */
+#define ACR_EDEADLK             (ACR_OS_START_CANONERR + EDEADLK)
+/** Cannot allocate memory */
+#define ACR_ENOMEM              (ACR_OS_START_CANONERR + ENOMEM)
+/** Permission denied */
+#define ACR_EACCES              (ACR_OS_START_CANONERR + EACCES)
+/** Bad address */
+#define ACR_EFAULT              (ACR_OS_START_CANONERR + EFAULT)
+/** Device busy */
+#define ACR_EBUSY               (ACR_OS_START_CANONERR + EBUSY)
+/** File exists */
+#define ACR_EEXIST              (ACR_OS_START_CANONERR + EEXIST)
+/** Cross-device link */
+#define ACR_EXDEV               (ACR_OS_START_CANONERR + EXDEV)
+/** Operation not supported by device */
+#define ACR_ENODEV              (ACR_OS_START_CANONERR + ENODEV)
+/** Not a directory */
+#define ACR_ENOTDIR             (ACR_OS_START_CANONERR + ENOTDIR)
+/** Is a directory */
+#define ACR_EISDIR              (ACR_OS_START_CANONERR + EISDIR)
+/** Invalid argument */
+#define ACR_EINVAL              (ACR_OS_START_CANONERR + EINVAL)
+/** Too many open files in system */
+#define ACR_ENFILE              (ACR_OS_START_CANONERR + ENFILE)
+/** Too many open files */
+#define ACR_EMFILE              (ACR_OS_START_CANONERR + EMFILE)
+/** Inappropriate ioctl for device */
+#define ACR_ENOTTY              (ACR_OS_START_CANONERR + ENOTTY)
+/** File name too long */
+#define ACR_ENAMETOOLONG        (ACR_OS_START_CANONERR + ENAMETOOLONG)
+/** File too large */
+#define ACR_EFBIG               (ACR_OS_START_CANONERR + EFBIG)
+/** No space left on device */
+#define ACR_ENOSPC              (ACR_OS_START_CANONERR + ENOSPC)
+/** Illegal seek */
+#define ACR_ESPIPE              (ACR_OS_START_CANONERR + ESPIPE)
+/** Read-only file system */
+#define ACR_EROFS               (ACR_OS_START_CANONERR + EROFS)
+/** Too many links */
+#define ACR_EMLINK              (ACR_OS_START_CANONERR + EMLINK)
+/** Broken pipe */
+#define ACR_EPIPE               (ACR_OS_START_CANONERR + EPIPE)
+/** Numerical argument out of domain */
+#define ACR_EDOM                (ACR_OS_START_CANONERR + EDOM)
+/** Result too large */
+#define ACR_ERANGE              (ACR_OS_START_CANONERR + ERANGE)
+/** Resource temporarily unavailable */
+#define ACR_EAGAIN              (ACR_OS_START_CANONERR + EAGAIN)
+/** No locks available */
+#define ACR_ENOLCK              (ACR_OS_START_CANONERR + ENOLCK)
+/** Function not implemented */
+#define ACR_ENOSYS              (ACR_OS_START_CANONERR + ENOSYS)
+/** Illegal byte sequence */
+#define ACR_EILSEQ              (ACR_OS_START_CANONERR + EILSEQ)
+
+/** Conversion overflow */
+#define ACR_EOVERFLOW           (ACR_OS_START_CANONERR + 46)
+/** Operation canceled */
+#define ACR_ECANCELED           (ACR_OS_START_CANONERR + 47)
+/** Identifier removed */
+#define ACR_EIDRM               (ACR_OS_START_CANONERR + 48)
+/** No message of desired type */
+#define ACR_ENOMSG              (ACR_OS_START_CANONERR + 49)
+/** Block device required */
+#define ACR_ENOTBLK             (ACR_OS_START_CANONERR + 50)
+/** Text file busy */
+#define ACR_ETXTBSY             (ACR_OS_START_CANONERR + 51)
+/** Operation would block */
+#define ACR_EWOULDBLOCK         (ACR_OS_START_CANONERR + 52)
+/** Operation now in progress */
+#define ACR_EINPROGRESS         (ACR_OS_START_CANONERR + 53)
+/** Operation already in progress */
+#define ACR_EALREADY            (ACR_OS_START_CANONERR + 54)
+/** Socket operation on non-socket */
+#define ACR_ENOTSOCK            (ACR_OS_START_CANONERR + 55)
+/** Destination address required */
+#define ACR_EDESTADDRREQ        (ACR_OS_START_CANONERR + 56)
+/** Message too long */
+#define ACR_EMSGSIZE            (ACR_OS_START_CANONERR + 57)
+/** Protocol wrong type for socket */
+#define ACR_EPROTOTYPE          (ACR_OS_START_CANONERR + 58)
+/** Protocol not available */
+#define ACR_ENOPROTOOPT         (ACR_OS_START_CANONERR + 59)
+/** Protocol not supported */
+#define ACR_EPROTONOSUPPORT     (ACR_OS_START_CANONERR + 60)
+/** Socket type not supported */
+#define ACR_ESOCKTNOSUPPORT     (ACR_OS_START_CANONERR + 61)
+/** Operation not supported */
+#define ACR_EOPNOTSUPP          (ACR_OS_START_CANONERR + 62)
+/** Protocol family not supported */
+#define ACR_EPFNOSUPPORT        (ACR_OS_START_CANONERR + 63)
+/** Address family not supported by protocol family */
+#define ACR_EAFNOSUPPORT        (ACR_OS_START_CANONERR + 64)
+/** Address already in use */
+#define ACR_EADDRINUSE          (ACR_OS_START_CANONERR + 65)
+/** Can't assign requested address */
+#define ACR_EADDRNOTAVAIL       (ACR_OS_START_CANONERR + 66)
+/** Network is down */
+#define ACR_ENETDOWN            (ACR_OS_START_CANONERR + 67)
+/** Network is unreachable */
+#define ACR_ENETUNREACH         (ACR_OS_START_CANONERR + 68)
+/** Network dropped connection on reset */
+#define ACR_ENETRESET           (ACR_OS_START_CANONERR + 69)
+/** Software caused connection abort */
+#define ACR_ECONNABORTED        (ACR_OS_START_CANONERR + 70)
+/** Connection reset by peer */
+#define ACR_ECONNRESET          (ACR_OS_START_CANONERR + 71)
+/** No buffer space available */
+#define ACR_ENOBUFS             (ACR_OS_START_CANONERR + 72)
+/** Socket is already connected */
+#define ACR_EISCONN             (ACR_OS_START_CANONERR + 73)
+/** Socket is not connected */
+#define ACR_ENOTCONN            (ACR_OS_START_CANONERR + 74)
+/** Can't send after socket shutdown */
+#define ACR_ESHUTDOWN           (ACR_OS_START_CANONERR + 75)
+/** Too many references: can't splice */
+#define ACR_ETOOMANYREFS        (ACR_OS_START_CANONERR + 76)
+/** Operation timed out */
+#define ACR_ETIMEDOUT           (ACR_OS_START_CANONERR + 77)
+/** Connection refused */
+#define ACR_ECONNREFUSED        (ACR_OS_START_CANONERR + 78)
+/** Too many levels of symbolic links */
+#define ACR_ELOOP               (ACR_OS_START_CANONERR + 79)
+/** Host is down */
+#define ACR_EHOSTDOWN           (ACR_OS_START_CANONERR + 80)
+/** No route to host */
+#define ACR_EHOSTUNREACH        (ACR_OS_START_CANONERR + 81)
+/** Directory not empty */
+#define ACR_ENOTEMPTY           (ACR_OS_START_CANONERR + 82)
+/** Too many processes */
+#define ACR_EPROCLIM            (ACR_OS_START_CANONERR + 83)
+/** Too many users */
+#define ACR_EUSERS              (ACR_OS_START_CANONERR + 84)
+/** Disk quota exceeded */
+#define ACR_EDQUOT              (ACR_OS_START_CANONERR + 85)
+/** Stale NFS file handle */
+#define ACR_ESTALE              (ACR_OS_START_CANONERR + 86)
+/** Too many levels of remote in path */
+#define ACR_EREMOTE             (ACR_OS_START_CANONERR + 87)
+/** RPC struct is bad */
+#define ACR_EBADRPC             (ACR_OS_START_CANONERR + 88)
+/** RPC version wrong */
+#define ACR_ERPCMISMATCH        (ACR_OS_START_CANONERR + 89)
+/** RPC prog. not avail */
+#define ACR_EPROGUNAVAIL        (ACR_OS_START_CANONERR + 90)
+/** Program version wrong */
+#define ACR_EPROGMISMATCH       (ACR_OS_START_CANONERR + 91)
+/** Bad procedure for program */
+#define ACR_EPROCUNAVAIL        (ACR_OS_START_CANONERR + 92)
+/** Inappropriate file type or format */
+#define ACR_EFTYPE              (ACR_OS_START_CANONERR + 93)
+/** Authentication error */
+#define ACR_EAUTH               (ACR_OS_START_CANONERR + 94)
+/** Need authenticator */
+#define ACR_ENEEDAUTH           (ACR_OS_START_CANONERR + 95)
+/** IPsec processing failure */
+#define ACR_EIPSEC              (ACR_OS_START_CANONERR + 96)
+/** Attribute not found */
+#define ACR_ENOATTR             (ACR_OS_START_CANONERR + 97)
+/** No medium found */
+#define ACR_ENOMEDIUM           (ACR_OS_START_CANONERR + 98)
+/** Wrong Medium Type */
+#define ACR_EMEDIUMTYPE         (ACR_OS_START_CANONERR + 99)
+
+#else
+/* Posix ACR CANONICAL ERROR VALUES */
+/** Operation not permitted */
+#ifndef EPERM
+#define ACR_EPERM               (ACR_OS_START_CANONERR +  1)
+#else
+#define ACR_EPERM EPERM
+#endif
+/** No such file or directory */
+#ifndef ENOENT
+#define ACR_ENOENT              (ACR_OS_START_CANONERR +  2)
+#else
+#define ACR_ENOENT ENOENT
+#endif
+/** No such process */
+#ifndef ESRCH
+#define ACR_ESRCH               (ACR_OS_START_CANONERR +  3)
+#else
+#define ACR_ESRCH ESRCH
+#endif
+/** Interrupted system call */
+#ifndef EINTR
+#define ACR_EINTR               (ACR_OS_START_CANONERR +  4)
+#else
+#define ACR_EINTR EINTR
+#endif
+/** Input/output error */
+#ifndef EIO
+#define ACR_EIO                 (ACR_OS_START_CANONERR +  5)
+#else
+#define ACR_EIO EIO
+#endif
+/** Device not configured */
+#ifndef ENXIO
+#define ACR_ENXIO               (ACR_OS_START_CANONERR +  6)
+#else
+#define ACR_ENXIO ENXIO
+#endif
+/** Argument list too long */
+#ifndef E2BIG
+#define ACR_E2BIG               (ACR_OS_START_CANONERR +  7)
+#else
+#define ACR_E2BIG E2BIG
+#endif
+/** Exec format error */
+#ifndef ENOEXEC
+#define ACR_ENOEXEC             (ACR_OS_START_CANONERR +  8)
+#else
+#define ACR_ENOEXEC ENOEXEC
+#endif
+/** Bad file descriptor */
+#ifndef EBADF
+#define ACR_EBADF               (ACR_OS_START_CANONERR +  9)
+#else
+#define ACR_EBADF EBADF
+#endif
+/** No child processes */
+#ifndef ECHILD
+#define ACR_ECHILD              (ACR_OS_START_CANONERR + 10)
+#else
+#define ACR_ECHILD ECHILD
+#endif
+/** Resource deadlock avoided */
+#ifndef EDEADLK
+#define ACR_EDEADLK             (ACR_OS_START_CANONERR + 11)
+#else
+#define ACR_EDEADLK EDEADLK
+#endif
+/** Cannot allocate memory */
+#ifndef ENOMEM
+#define ACR_ENOMEM              (ACR_OS_START_CANONERR + 12)
+#else
+#define ACR_ENOMEM ENOMEM
+#endif
+/** Permission denied */
+#ifndef EACCES
+#define ACR_EACCES              (ACR_OS_START_CANONERR + 13)
+#else
+#define ACR_EACCES EACCES
+#endif
+/** Bad address */
+#ifndef EFAULT
+#define ACR_EFAULT              (ACR_OS_START_CANONERR + 14)
+#else
+#define ACR_EFAULT EFAULT
+#endif
+/** Block device required */
+#ifndef ENOTBLK
+#define ACR_ENOTBLK             (ACR_OS_START_CANONERR + 15)
+#else
+#define ACR_ENOTBLK ENOTBLK
+#endif
+/** Device busy */
+#ifndef EBUSY
+#define ACR_EBUSY               (ACR_OS_START_CANONERR + 16)
+#else
+#define ACR_EBUSY EBUSY
+#endif
+/** File exists */
+#ifndef EEXIST
+#define ACR_EEXIST              (ACR_OS_START_CANONERR + 17)
+#else
+#define ACR_EEXIST EEXIST
+#endif
+/** Cross-device link */
+#ifndef EXDEV
+#define ACR_EXDEV               (ACR_OS_START_CANONERR + 18)
+#else
+#define ACR_EXDEV EXDEV
+#endif
+/** Operation not supported by device */
+#ifndef ENODEV
+#define ACR_ENODEV              (ACR_OS_START_CANONERR + 19)
+#else
+#define ACR_ENODEV ENODEV
+#endif
+/** Not a directory */
+#ifndef ENOTDIR
+#define ACR_ENOTDIR             (ACR_OS_START_CANONERR + 20)
+#else
+#define ACR_ENOTDIR ENOTDIR
+#endif
+/** Is a directory */
+#ifndef EISDIR
+#define ACR_EISDIR              (ACR_OS_START_CANONERR + 21)
+#else
+#define ACR_EISDIR EISDIR
+#endif
+/** Invalid argument */
+#ifndef EINVAL
+#define ACR_EINVAL              (ACR_OS_START_CANONERR + 22)
+#else
+#define ACR_EINVAL EINVAL
+#endif
+/** Too many open files in system */
+#ifndef ENFILE
+#define ACR_ENFILE              (ACR_OS_START_CANONERR + 23)
+#else
+#define ACR_ENFILE ENFILE
+#endif
+/** Too many open files */
+#ifndef EMFILE
+#define ACR_EMFILE              (ACR_OS_START_CANONERR + 24)
+#else
+#define ACR_EMFILE EMFILE
+#endif
+/** Inappropriate ioctl for device */
+#ifndef ENOTTY
+#define ACR_ENOTTY              (ACR_OS_START_CANONERR + 25)
+#else
+#define ACR_ENOTTY ENOTTY
+#endif
+/** Text file busy */
+#ifndef ETXTBSY
+#define ACR_ETXTBSY             (ACR_OS_START_CANONERR + 26)
+#else
+#define ACR_ETXTBSY ETXTBSY
+#endif
+/** File too large */
+#ifndef EFBIG
+#define ACR_EFBIG               (ACR_OS_START_CANONERR + 27)
+#else
+#define ACR_EFBIG EFBIG
+#endif
+/** No space left on device */
+#ifndef ENOSPC
+#define ACR_ENOSPC              (ACR_OS_START_CANONERR + 28)
+#else
+#define ACR_ENOSPC ENOSPC
+#endif
+/** Illegal seek */
+#ifndef ESPIPE
+#define ACR_ESPIPE              (ACR_OS_START_CANONERR + 29)
+#else
+#define ACR_ESPIPE ESPIPE
+#endif
+/** Read-only file system */
+#ifndef EROFS
+#define ACR_EROFS               (ACR_OS_START_CANONERR + 30)
+#else
+#define ACR_EROFS EROFS
+#endif
+/** Too many links */
+#ifndef EMLINK
+#define ACR_EMLINK              (ACR_OS_START_CANONERR + 31)
+#else
+#define ACR_EMLINK EMLINK
+#endif
+/** Broken pipe */
+#ifndef EPIPE
+#define ACR_EPIPE               (ACR_OS_START_CANONERR + 32)
+#else
+#define ACR_EPIPE EPIPE
+#endif
+/** Numerical argument out of domain */
+#ifndef EDOM
+#define ACR_EDOM                (ACR_OS_START_CANONERR + 33)
+#else
+#define ACR_EDOM EDOM
+#endif
+/** Result too large */
+#ifndef ERANGE
+#define ACR_ERANGE              (ACR_OS_START_CANONERR + 34)
+#else
+#define ACR_ERANGE ERANGE
+#endif
+/** Resource temporarily unavailable */
+#ifndef EAGAIN
+#define ACR_EAGAIN              (ACR_OS_START_CANONERR + 35)
+#else
+#define ACR_EAGAIN EAGAIN
+#endif
+/** Operation would block */
+#ifndef EWOULDBLOCK
+#define ACR_EWOULDBLOCK         (ACR_OS_START_CANONERR + 35)
+#else
+#define ACR_EWOULDBLOCK EWOULDBLOCK
+#endif
+/** Operation now in progress */
+#ifndef EINPROGRESS
+#define ACR_EINPROGRESS         (ACR_OS_START_CANONERR + 36)
+#else
+#define ACR_EINPROGRESS EINPROGRESS
+#endif
+/** Operation already in progress */
+#ifndef EALREADY
+#define ACR_EALREADY            (ACR_OS_START_CANONERR + 37)
+#else
+#define ACR_EALREADY EALREADY
+#endif
+/** Socket operation on non-socket */
+#ifndef ENOTSOCK
+#define ACR_ENOTSOCK            (ACR_OS_START_CANONERR + 38)
+#else
+#define ACR_ENOTSOCK ENOTSOCK
+#endif
+/** Destination address required */
+#ifndef EDESTADDRREQ
+#define ACR_EDESTADDRREQ        (ACR_OS_START_CANONERR + 39)
+#else
+#define ACR_EDESTADDRREQ EDESTADDRREQ
+#endif
+/** Message too long */
+#ifndef EMSGSIZE
+#define ACR_EMSGSIZE            (ACR_OS_START_CANONERR + 40)
+#else
+#define ACR_EMSGSIZE EMSGSIZE
+#endif
+/** Protocol wrong type for socket */
+#ifndef EPROTOTYPE
+#define ACR_EPROTOTYPE          (ACR_OS_START_CANONERR + 41)
+#else
+#define ACR_EPROTOTYPE EPROTOTYPE
+#endif
+/** Protocol not available */
+#ifndef ENOPROTOOPT
+#define ACR_ENOPROTOOPT         (ACR_OS_START_CANONERR + 42)
+#else
+#define ACR_ENOPROTOOPT ENOPROTOOPT
+#endif
+/** Protocol not supported */
+#ifndef EPROTONOSUPPORT
+#define ACR_EPROTONOSUPPORT     (ACR_OS_START_CANONERR + 43)
+#else
+#define ACR_EPROTONOSUPPORT EPROTONOSUPPORT
+#endif
+/** Socket type not supported */
+#ifndef ESOCKTNOSUPPORT
+#define ACR_ESOCKTNOSUPPORT     (ACR_OS_START_CANONERR + 44)
+#else
+#define ACR_ESOCKTNOSUPPORT ESOCKTNOSUPPORT
+#endif
+/** Operation not supported */
+#ifndef EOPNOTSUPP
+#define ACR_EOPNOTSUPP          (ACR_OS_START_CANONERR + 45)
+#else
+#define ACR_EOPNOTSUPP EOPNOTSUPP
+#endif
+/** Protocol family not supported */
+#ifndef EPFNOSUPPORT
+#define ACR_EPFNOSUPPORT        (ACR_OS_START_CANONERR + 46)
+#else
+#define ACR_EPFNOSUPPORT EPFNOSUPPORT
+#endif
+/** Address family not supported by protocol family */
+#ifndef EAFNOSUPPORT
+#define ACR_EAFNOSUPPORT        (ACR_OS_START_CANONERR + 47)
+#else
+#define ACR_EAFNOSUPPORT EAFNOSUPPORT
+#endif
+/** Address already in use */
+#ifndef EADDRINUSE
+#define ACR_EADDRINUSE          (ACR_OS_START_CANONERR + 48)
+#else
+#define ACR_EADDRINUSE EADDRINUSE
+#endif
+/** Can't assign requested address */
+#ifndef EADDRNOTAVAIL
+#define ACR_EADDRNOTAVAIL       (ACR_OS_START_CANONERR + 49)
+#else
+#define ACR_EADDRNOTAVAIL EADDRNOTAVAIL
+#endif
+/** Network is down */
+#ifndef ENETDOWN
+#define ACR_ENETDOWN            (ACR_OS_START_CANONERR + 50)
+#else
+#define ACR_ENETDOWN ENETDOWN
+#endif
+/** Network is unreachable */
+#ifndef ENETUNREACH
+#define ACR_ENETUNREACH         (ACR_OS_START_CANONERR + 51)
+#else
+#define ACR_ENETUNREACH ENETUNREACH
+#endif
+/** Network dropped connection on reset */
+#ifndef ENETRESET
+#define ACR_ENETRESET           (ACR_OS_START_CANONERR + 52)
+#else
+#define ACR_ENETRESET ENETRESET
+#endif
+/** Software caused connection abort */
+#ifndef ECONNABORTED
+#define ACR_ECONNABORTED        (ACR_OS_START_CANONERR + 53)
+#else
+#define ACR_ECONNABORTED ECONNABORTED
+#endif
+/** Connection reset by peer */
+#ifndef ECONNRESET
+#define ACR_ECONNRESET          (ACR_OS_START_CANONERR + 54)
+#else
+#define ACR_ECONNRESET ECONNRESET
+#endif
+/** No buffer space available */
+#ifndef ENOBUFS
+#define ACR_ENOBUFS             (ACR_OS_START_CANONERR + 55)
+#else
+#define ACR_ENOBUFS ENOBUFS
+#endif
+/** Socket is already connected */
+#ifndef EISCONN
+#define ACR_EISCONN             (ACR_OS_START_CANONERR + 56)
+#else
+#define ACR_EISCONN EISCONN
+#endif
+/** Socket is not connected */
+#ifndef ENOTCONN
+#define ACR_ENOTCONN            (ACR_OS_START_CANONERR + 57)
+#else
+#define ACR_ENOTCONN ENOTCONN
+#endif
+/** Can't send after socket shutdown */
+#ifndef ESHUTDOWN
+#define ACR_ESHUTDOWN           (ACR_OS_START_CANONERR + 58)
+#else
+#define ACR_ESHUTDOWN ESHUTDOWN
+#endif
+/** Too many references: can't splice */
+#ifndef ETOOMANYREFS
+#define ACR_ETOOMANYREFS        (ACR_OS_START_CANONERR + 59)
+#else
+#define ACR_ETOOMANYREFS ETOOMANYREFS
+#endif
+/** Operation timed out */
+#ifndef ETIMEDOUT
+#define ACR_ETIMEDOUT           (ACR_OS_START_CANONERR + 60)
+#else
+#define ACR_ETIMEDOUT ETIMEDOUT
+#endif
+/** Connection refused */
+#ifndef ECONNREFUSED
+#define ACR_ECONNREFUSED        (ACR_OS_START_CANONERR + 61)
+#else
+#define ACR_ECONNREFUSED ECONNREFUSED
+#endif
+/** Too many levels of symbolic links */
+#ifndef ELOOP
+#define ACR_ELOOP               (ACR_OS_START_CANONERR + 62)
+#else
+#define ACR_ELOOP ELOOP
+#endif
+/** File name too long */
+#ifndef ENAMETOOLONG
+#define ACR_ENAMETOOLONG        (ACR_OS_START_CANONERR + 63)
+#else
+#define ACR_ENAMETOOLONG ENAMETOOLONG
+#endif
+/** Host is down */
+#ifndef EHOSTDOWN
+#define ACR_EHOSTDOWN           (ACR_OS_START_CANONERR + 64)
+#else
+#define ACR_EHOSTDOWN EHOSTDOWN
+#endif
+/** No route to host */
+#ifndef EHOSTUNREACH
+#define ACR_EHOSTUNREACH        (ACR_OS_START_CANONERR + 65)
+#else
+#define ACR_EHOSTUNREACH EHOSTUNREACH
+#endif
+/** Directory not empty */
+#ifndef ENOTEMPTY
+#define ACR_ENOTEMPTY           (ACR_OS_START_CANONERR + 66)
+#else
+#define ACR_ENOTEMPTY ENOTEMPTY
+#endif
+/** Too many processes */
+#ifndef EPROCLIM
+#define ACR_EPROCLIM            (ACR_OS_START_CANONERR + 67)
+#else
+#define ACR_EPROCLIM EPROCLIM
+#endif
+/** Too many users */
+#ifndef EUSERS
+#define ACR_EUSERS              (ACR_OS_START_CANONERR + 68)
+#else
+#define ACR_EUSERS EUSERS
+#endif
+/** Disk quota exceeded */
+#ifndef EDQUOT
+#define ACR_EDQUOT              (ACR_OS_START_CANONERR + 69)
+#else
+#define ACR_EDQUOT EDQUOT
+#endif
+/** Stale NFS file handle */
+#ifndef ESTALE
+#define ACR_ESTALE              (ACR_OS_START_CANONERR + 70)
+#else
+#define ACR_ESTALE ESTALE
+#endif
+/** Too many levels of remote in path */
+#ifndef EREMOTE
+#define ACR_EREMOTE             (ACR_OS_START_CANONERR + 71)
+#else
+#define ACR_EREMOTE EREMOTE
+#endif
+/** RPC struct is bad */
+#ifndef EBADRPC
+#define ACR_EBADRPC             (ACR_OS_START_CANONERR + 72)
+#else
+#define ACR_EBADRPC EBADRPC
+#endif
+/** RPC version wrong */
+#ifndef ERPCMISMATCH
+#define ACR_ERPCMISMATCH        (ACR_OS_START_CANONERR + 73)
+#else
+#define ACR_ERPCMISMATCH ERPCMISMATCH
+#endif
+/** RPC prog. not avail */
+#ifndef EPROGUNAVAIL
+#define ACR_EPROGUNAVAIL        (ACR_OS_START_CANONERR + 74)
+#else
+#define ACR_EPROGUNAVAIL EPROGUNAVAIL
+#endif
+/** Program version wrong */
+#ifndef EPROGMISMATCH
+#define ACR_EPROGMISMATCH       (ACR_OS_START_CANONERR + 75)
+#else
+#define ACR_EPROGMISMATCH EPROGMISMATCH
+#endif
+/** Bad procedure for program */
+#ifndef EPROCUNAVAIL
+#define ACR_EPROCUNAVAIL        (ACR_OS_START_CANONERR + 76)
+#else
+#define ACR_EPROCUNAVAIL EPROCUNAVAIL
+#endif
+/** No locks available */
+#ifndef ENOLCK
+#define ACR_ENOLCK              (ACR_OS_START_CANONERR + 77)
+#else
+#define ACR_ENOLCK ENOLCK
+#endif
+/** Function not implemented */
+#ifndef ENOSYS
+#define ACR_ENOSYS              (ACR_OS_START_CANONERR + 78)
+#else
+#define ACR_ENOSYS ENOSYS
+#endif
+/** Inappropriate file type or format */
+#ifndef EFTYPE
+#define ACR_EFTYPE              (ACR_OS_START_CANONERR + 79)
+#else
+#define ACR_EFTYPE EFTYPE
+#endif
+/** Authentication error */
+#ifndef EAUTH
+#define ACR_EAUTH               (ACR_OS_START_CANONERR + 80)
+#else
+#define ACR_EAUTH EAUTH
+#endif
+/** Need authenticator */
+#ifndef ENEEDAUTH
+#define ACR_ENEEDAUTH           (ACR_OS_START_CANONERR + 81)
+#else
+#define ACR_ENEEDAUTH ENEEDAUTH
+#endif
+/** IPsec processing failure */
+#ifndef EIPSEC
+#define ACR_EIPSEC              (ACR_OS_START_CANONERR + 82)
+#else
+#define ACR_EIPSEC EIPSEC
+#endif
+/** Attribute not found */
+#ifndef ENOATTR
+#define ACR_ENOATTR             (ACR_OS_START_CANONERR + 83)
+#else
+#define ACR_ENOATTR ENOATTR
+#endif
+/** Illegal byte sequence */
+#ifndef EILSEQ
+#define ACR_EILSEQ              (ACR_OS_START_CANONERR + 84)
+#else
+#define ACR_EILSEQ EILSEQ
+#endif
+/** No medium found */
+#ifndef ENOMEDIUM
+#define ACR_ENOMEDIUM           (ACR_OS_START_CANONERR + 85)
+#else
+#define ACR_ENOMEDIUM ENOMEDIUM
+#endif
+/** Wrong Medium Type */
+#ifndef EMEDIUMTYPE
+#define ACR_EMEDIUMTYPE         (ACR_OS_START_CANONERR + 86)
+#else
+#define ACR_EMEDIUMTYPE EMEDIUMTYPE
+#endif
+/** Conversion overflow */
+#ifndef EOVERFLOW
+#define ACR_EOVERFLOW           (ACR_OS_START_CANONERR + 87)
+#else
+#define ACR_EOVERFLOW EOVERFLOW
+#endif
+/** Operation canceled */
+#ifndef ECANCELED
+#define ACR_ECANCELED           (ACR_OS_START_CANONERR + 88)
+#else
+#define ACR_ECANCELED ECANCELED
+#endif
+/** Identifier removed */
+#ifndef EIDRM
+#define ACR_EIDRM               (ACR_OS_START_CANONERR + 89)
+#else
+#define ACR_EIDRM EIDRM
+#endif
+/** No message of desired type */
+#ifndef ENOMSG
+#define ACR_ENOMSG              (ACR_OS_START_CANONERR + 90)
+#else
+#define ACR_ENOMSG ENOMSG
+#endif
+
+#endif
+
+#define ACR_OS_LAST_CANONERR    (ACR_OS_START_CANONERR + 91)
+/** @} */
+
+#if defined(_WINDOWS)
+/**
+ * Special version of GetLastError that never returns 0
+ * If GetLastError is zero, ERROR_RETRY (EAGAIN) is returned instead.
+ * Make sure you call ACR_GET_OS_ERROR only when error happens.
+ */
+static __inline DWORD _pr_get_os_error()
+{
+    DWORD  err =  GetLastError();
+    return err == ERROR_SUCCESS ? ERROR_RETRY : err;
+}
+
+/**
+ * Special version of WSAGetLastError that never returns 0
+ * If WSAGetLastError is zero, WSAEWOULDBLOCK (EAGAIN) is returned instead.
+ * Make sure you call ACR_GET_NETOS_ERROR only when error happens.
+ */
+static __inline DWORD _pr_net_os_error()
+{
+    DWORD  err =  WSAGetLastError();
+    return err == ERROR_SUCCESS ? WSAEWOULDBLOCK : err;
+}
+
+ACR_API(void) pr_set_crt_error(int);
+ACR_API(int)  pr_get_crt_error(void);
+
+#define ACR_GET_OS_ERROR()   _pr_get_os_error()
+#define ACR_SET_OS_ERROR(e)  SetLastError((e))
+#define ACR_SET_ERRNO_IF(e)  if ((e) != 0) SetLastError((e))
+
+/* A special case, only socket calls require this:
+ */
+#define ACR_GET_NETOS_ERROR()    (_pr_net_os_error())
+#define ACR_SET_NETOS_ERROR(e)   (WSASetLastError((e)))
+
+/* ACR CANONICAL ERROR TESTS */
+#define ACR_STATUS_IS_EACCES(s)         ((s) == ACR_EACCES \
+                || (s) == ERROR_ACCESS_DENIED \
+                || (s) == ERROR_CANNOT_MAKE \
+                || (s) == ERROR_CURRENT_DIRECTORY \
+                || (s) == ERROR_DRIVE_LOCKED \
+                || (s) == ERROR_FAIL_I24 \
+                || (s) == ERROR_LOCK_VIOLATION \
+                || (s) == ERROR_LOCK_FAILED \
+                || (s) == ERROR_NOT_LOCKED \
+                || (s) == ERROR_NETWORK_ACCESS_DENIED \
+                || (s) == ERROR_SHARING_VIOLATION)
+#define ACR_STATUS_IS_EEXIST(s)         ((s) == ACR_EEXIST \
+                || (s) == ERROR_FILE_EXISTS \
+                || (s) == ERROR_ALREADY_EXISTS)
+#define ACR_STATUS_IS_ENAMETOOLONG(s)   ((s) == ACR_ENAMETOOLONG \
+                || (s) == ERROR_FILENAME_EXCED_RANGE \
+                || (s) == WSAENAMETOOLONG)
+#define ACR_STATUS_IS_ENOENT(s)         ((s) == ACR_ENOENT \
+                || (s) == ERROR_FILE_NOT_FOUND \
+                || (s) == ERROR_PATH_NOT_FOUND \
+                || (s) == ERROR_OPEN_FAILED \
+                || (s) == ERROR_NONE_MAPPED \
+                || (s) == ERROR_NO_MORE_FILES)
+#define ACR_STATUS_IS_ENOTDIR(s)        ((s) == ACR_ENOTDIR \
+                || (s) == ERROR_PATH_NOT_FOUND \
+                || (s) == ERROR_BAD_NETPATH \
+                || (s) == ERROR_BAD_NET_NAME \
+                || (s) == ERROR_BAD_PATHNAME \
+                || (s) == ERROR_INVALID_DRIVE \
+                || (s) == ERROR_DIRECTORY)
+#define ACR_STATUS_IS_ENOSPC(s)         ((s) == ACR_ENOSPC \
+                || (s) == ERROR_DISK_FULL)
+#define ACR_STATUS_IS_ENOMEM(s)         ((s) == ACR_ENOMEM \
+                || (s) == ERROR_ARENA_TRASHED \
+                || (s) == ERROR_NOT_ENOUGH_MEMORY \
+                || (s) == ERROR_INVALID_BLOCK \
+                || (s) == ERROR_NOT_ENOUGH_QUOTA \
+                || (s) == ERROR_OUTOFMEMORY)
+#define ACR_STATUS_IS_EMFILE(s)         ((s) == ACR_EMFILE \
+                || (s) == ERROR_TOO_MANY_OPEN_FILES)
+#define ACR_STATUS_IS_ENFILE(s)         ((s) == ACR_ENFILE)
+#define ACR_STATUS_IS_EBADF(s)          ((s) == ACR_EBADF \
+                || (s) == ERROR_INVALID_HANDLE \
+                || (s) == ERROR_INVALID_TARGET_HANDLE)
+#define ACR_STATUS_IS_EINVAL(s)         ((s) == ACR_EINVAL \
+                || (s) == ERROR_INVALID_ACCESS \
+                || (s) == ERROR_INVALID_DATA \
+                || (s) == ERROR_INVALID_FUNCTION \
+                || (s) == ERROR_INVALID_HANDLE \
+                || (s) == ERROR_INVALID_PARAMETER \
+                || (s) == ERROR_NEGATIVE_SEEK)
+#define ACR_STATUS_IS_ESPIPE(s)         ((s) == ACR_ESPIPE \
+                || (s) == ERROR_SEEK_ON_DEVICE \
+                || (s) == ERROR_NEGATIVE_SEEK)
+#define ACR_STATUS_IS_EAGAIN(s)         ((s) == ACR_EAGAIN \
+                || (s) == ERROR_NO_DATA \
+                || (s) == ERROR_NO_PROC_SLOTS \
+                || (s) == ERROR_NESTING_NOT_ALLOWED \
+                || (s) == ERROR_MAX_THRDS_REACHED \
+                || (s) == ERROR_LOCK_VIOLATION \
+                || (s) == ERROR_RETRY \
+                || (s) == ERROR_IO_PENDING \
+                || (s) == WSAEWOULDBLOCK)
+#define ACR_STATUS_IS_EINTR(s)          ((s) == ACR_EINTR \
+                || (s) == WSAEINTR)
+#define ACR_STATUS_IS_ENOTSOCK(s)       ((s) == ACR_ENOTSOCK \
+                || (s) == WSAENOTSOCK)
+#define ACR_STATUS_IS_ECONNREFUSED(s)   ((s) == ACR_ECONNREFUSED \
+                || (s) == WSAECONNREFUSED)
+#define ACR_STATUS_IS_EINPROGRESS(s)    ((s) == ACR_EINPROGRESS \
+                || (s) == WSAEINPROGRESS)
+#define ACR_STATUS_IS_ECONNABORTED(s)   ((s) == ACR_ECONNABORTED \
+                || (s) == WSAECONNABORTED)
+#define ACR_STATUS_IS_ECONNRESET(s)     ((s) == ACR_ECONNRESET \
+                || (s) == ERROR_NETNAME_DELETED \
+                || (s) == WSAECONNRESET)
+/* Include WSA codes in TIMEUP */
+#undef ACR_STATUS_IS_TIMEUP
+#define ACR_STATUS_IS_TIMEUP(s)         ((s) == ACR_TIMEUP \
+                || (s) == WSAETIMEDOUT \
+                || (s) == ACR_OS_START_SYSERR + WAIT_TIMEOUT)
+#define ACR_STATUS_IS_EHOSTUNREACH(s)   ((s) == ACR_EHOSTUNREACH \
+                || (s) == WSAEHOSTUNREACH)
+#define ACR_STATUS_IS_ENETUNREACH(s)    ((s) == ACR_ENETUNREACH \
+                || (s) == WSAENETUNREACH)
+#define ACR_STATUS_IS_EFTYPE(s)         ((s) == ACR_EFTYPE \
+                || (s) == ERROR_EXE_MACHINE_TYPE_MISMATCH \
+                || (s) == ERROR_INVALID_DLL \
+                || (s) == ERROR_INVALID_MODULETYPE \
+                || (s) == ERROR_BAD_EXE_FORMAT \
+                || (s) == ERROR_INVALID_EXE_SIGNATURE \
+                || (s) == ERROR_FILE_CORRUPT \
+                || (s) == ERROR_BAD_FORMAT)
+#define ACR_STATUS_IS_EPIPE(s)          ((s) == ACR_EPIPE \
+                || (s) == ERROR_BROKEN_PIPE)
+#define ACR_STATUS_IS_EXDEV(s)          ((s) == ACR_EXDEV \
+                || (s) == ERROR_NOT_SAME_DEVICE)
+#define ACR_STATUS_IS_ENOTEMPTY(s)      ((s) == ACR_ENOTEMPTY \
+                || (s) == ERROR_DIR_NOT_EMPTY)
+#define ACR_STATUS_IS_EAFNOSUPPORT(s)   ((s) == ACR_EAFNOSUPPORT \
+                || (s) == WSAEAFNOSUPPORT)
+
+#else /* !defined(_WINDOWS) */
+
+#define ACR_GET_OS_ERROR()    (errno ? errno : EAGAIN)
+#define ACR_SET_OS_ERROR(e)   (errno = (e))
+#define ACR_SET_ERRNO_IF(e)   if ((e) != 0) (errno = (e))
+
+/* A special case, only socket calls require this:
+ */
+#define ACR_GET_NETOS_ERROR() (errno ? errno : EAGAIN)
+#define ACR_SET_NETOS_ERROR(e) (errno = (e))
+
+/**
+ * @addtogroup ACR_STATUS_IS
+ * @{
+ */
+
+/** permission denied */
+#define ACR_STATUS_IS_EACCES(s)         ((s) == ACR_EACCES)
+/** file exists */
+#define ACR_STATUS_IS_EEXIST(s)         ((s) == ACR_EEXIST)
+/** path name is too long */
+#define ACR_STATUS_IS_ENAMETOOLONG(s)   ((s) == ACR_ENAMETOOLONG)
+/**
+ * no such file or directory
+ * @remark
+ * EMVSCATLG can be returned by the automounter on z/OS for
+ * paths which do not exist.
+ */
+#ifdef EMVSCATLG
+#define ACR_STATUS_IS_ENOENT(s)         ((s) == ACR_ENOENT \
+                                      || (s) == EMVSCATLG)
+#else
+#define ACR_STATUS_IS_ENOENT(s)         ((s) == ACR_ENOENT)
+#endif
+/** not a directory */
+#define ACR_STATUS_IS_ENOTDIR(s)        ((s) == ACR_ENOTDIR)
+/** no space left on device */
+#ifdef EDQUOT
+#define ACR_STATUS_IS_ENOSPC(s)         ((s) == ACR_ENOSPC \
+                                      || (s) == EDQUOT)
+#else
+#define ACR_STATUS_IS_ENOSPC(s)         ((s) == ACR_ENOSPC)
+#endif
+/** not enough memory */
+#define ACR_STATUS_IS_ENOMEM(s)         ((s) == ACR_ENOMEM)
+/** too many open files */
+#define ACR_STATUS_IS_EMFILE(s)         ((s) == ACR_EMFILE)
+/** file table overflow */
+#define ACR_STATUS_IS_ENFILE(s)         ((s) == ACR_ENFILE)
+/** bad file # */
+#define ACR_STATUS_IS_EBADF(s)          ((s) == ACR_EBADF)
+/** invalid argument */
+#define ACR_STATUS_IS_EINVAL(s)         ((s) == ACR_EINVAL)
+/** illegal seek */
+#define ACR_STATUS_IS_ESPIPE(s)         ((s) == ACR_ESPIPE)
+
+/** operation would block */
+#if !defined(EWOULDBLOCK) || !defined(EAGAIN)
+#define ACR_STATUS_IS_EAGAIN(s)         ((s) == ACR_EAGAIN)
+#elif (EWOULDBLOCK == EAGAIN)
+#define ACR_STATUS_IS_EAGAIN(s)         ((s) == ACR_EAGAIN)
+#else
+#define ACR_STATUS_IS_EAGAIN(s)         ((s) == ACR_EAGAIN \
+                                      || (s) == EWOULDBLOCK)
+#endif
+
+/** interrupted system call */
+#define ACR_STATUS_IS_EINTR(s)          ((s) == ACR_EINTR)
+/** socket operation on a non-socket */
+#define ACR_STATUS_IS_ENOTSOCK(s)       ((s) == ACR_ENOTSOCK)
+/** Connection Refused */
+#define ACR_STATUS_IS_ECONNREFUSED(s)   ((s) == ACR_ECONNREFUSED)
+/** operation now in progress */
+#define ACR_STATUS_IS_EINPROGRESS(s)    ((s) == ACR_EINPROGRESS)
+
+/**
+ * Software caused connection abort
+ * @remark
+ * EPROTO on certain older kernels really means ECONNABORTED, so we need to
+ * ignore it for them.  See discussion in new-httpd archives nh.9701 & nh.9603
+ *
+ * There is potentially a bug in Solaris 2.x x<6, and other boxes that
+ * implement tcp sockets in userland (i.e. on top of STREAMS).  On these
+ * systems, EPROTO can actually result in a fatal loop.  See PR#981 for
+ * example.  It's hard to handle both uses of EPROTO.
+ */
+#ifdef EPROTO
+#define ACR_STATUS_IS_ECONNABORTED(s)    ((s) == ACR_ECONNABORTED \
+                                       || (s) == EPROTO)
+#else
+#define ACR_STATUS_IS_ECONNABORTED(s)    ((s) == ACR_ECONNABORTED)
+#endif
+
+/** Connection Reset by peer */
+#define ACR_STATUS_IS_ECONNRESET(s)      ((s) == ACR_ECONNRESET)
+/** no route to host */
+#define ACR_STATUS_IS_EHOSTUNREACH(s)    ((s) == ACR_EHOSTUNREACH)
+/** network is unreachable */
+#define ACR_STATUS_IS_ENETUNREACH(s)     ((s) == ACR_ENETUNREACH)
+/** inappropiate file type or format */
+#define ACR_STATUS_IS_EFTYPE(s)          ((s) == ACR_EFTYPE)
+/** broken pipe */
+#define ACR_STATUS_IS_EPIPE(s)           ((s) == ACR_EPIPE)
+/** cross device link */
+#define ACR_STATUS_IS_EXDEV(s)           ((s) == ACR_EXDEV)
+/** Directory Not Empty */
+#define ACR_STATUS_IS_ENOTEMPTY(s)       ((s) == ACR_ENOTEMPTY || \
+                                          (s) == ACR_EEXIST)
+/** Address Family not supported */
+#define ACR_STATUS_IS_EAFNOSUPPORT(s)    ((s) == ACR_EAFNOSUPPORT)
+/** @} */
+
+#endif /* !defined(_WINDOWS) */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Return a human readable string describing the specified error.
+ * @param statcode The error code the get a string for.
+ * @param buf A buffer to hold the error string.
+ * @param bufsize Size of the buffer to hold the string.
+ */
+char * cr_strerror_r(int statcode, char *buf, size_t bufsize);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _ACR_ERROR_H */

Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h Tue Mar 22 18:36:19 2011
@@ -0,0 +1,42 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _ACR_PORT_H_
+#define _ACR_PORT_H_
+
+#include "acr/stdtypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+size_t  _bsd_strlcat(char *, const char *, size_t);
+size_t  _bsd_strlcpy(char *, const char *, size_t);
+#if !HAVE_STRLCAT
+# define strlcat        _bsd_strlcat
+#endif
+#if !HAVE_STRLCPY
+# define strlcpy        _bsd_strlcpy
+#endif
+char   *_bsd_strsignal(int);
+#if !HAVE_STRSIGNAL
+# define strsignal      _bsd_strsignal
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ACR_PORT_H_ */

Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h Tue Mar 22 18:36:19 2011
@@ -0,0 +1,244 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_STDDEFS_H_
+#define _ACR_STDDEFS_H_
+
+/**
+ * @file stddefs.h
+ * @brief ACR Macro definitions
+ */
+
+#include "acr/stdinc.h"
+
+#if HAVE_THREAD_LOCAL
+# if defined (_MSC_VER)
+#  define ACR_THREAD            __declspec (thread)
+# else
+#  define ACR_THREAD            __thread
+# endif
+#else
+# define ACR_THREAD
+#endif
+#if defined(__GNUC__)
+# define PRINTF_LIKE(_F1, _F2)  __attribute__ ((format (printf, _F1, _F2)))
+#else
+# define PRINTF_LIKE(_F1, _F2)
+#endif
+
+#define ACR_STRINGIFY(n)        ACR_STRINGIFY_HLP(n)
+#define ACR_STRINGIFY_HLP(n)    #n
+
+#if HAVE_PRETTY_FUNCTION
+# define __REAL_FUNCSIG__       __PRETTY_FUNCTION__
+#elif HAVE_FUNC
+# define __REAL_FUNCSIG__       __func__
+#elif HAVE_FUNCTION
+# define __REAL_FUNCSIG__       __FUNCTION__
+#elif HAVE_FUNCSIG
+# define __REAL_FUNCSIG__       __FUNCSIG__
+#else
+# define __REAL_FUNCSIG__       "???"
+#endif
+#define __FILE_LINE__           __FILE__, __LINE__
+#define __FILE_FUNC_LINE__      __FILE__, __REAL_FUNCSIG__, __LINE__
+
+#if defined(_MSC_VER)
+# define ACR_THREAD_FUNC        __stdcall
+#else
+# define ACR_THREAD_FUNC
+#endif
+
+#if defined(_MSC_VER)
+# define ACR_I64_C(val)          val ## I64
+# define ACR_U64_C(val)          val ## UI64
+# define ACR_U64_MAX             0xffffffffffffffffUI64
+# define ACR_I64_MAX             0x7fffffffffffffffI64
+# define ACR_I64_MIN            (-0x7fffffffffffffffI64-1)
+#else /* !_MSC_VER */
+# if defined(__INT64_C)
+#  define ACR_I64_C              __INT64_C
+#  define ACR_U64_C              __UINT64_C
+# else
+#  if CC_SIZEOF_LONG == 8
+#   define ACR_I64_C(val)        val ## L
+#   define ACR_U64_C(val)        val ## UL
+#  else
+#   define ACR_I64_C(val)        val ## LL
+#   define ACR_U64_C(val)        val ## ULL
+#  endif
+# endif
+# define ACR_U64_MAX             0xffffffffffffffffULL
+# define ACR_I64_MAX             0x7fffffffffffffffLL
+# define ACR_I64_MIN            (-0x7fffffffffffffffLL-1)
+#endif
+
+/*
+ * Some systems lack full limit definitions.
+ */
+#if !defined(INT_MAX)
+# define INT_MAX                0x7fffffff
+#endif
+#if !defined(INT_MIN)
+# define INT_MIN               (-0x7fffffff-1)
+#endif
+#if !defined(UINT_MAX)
+# define UINT_MAX               0xffffffff
+#endif
+#if !defined(SIZE_T_MAX)
+# if CC_SIZEOF_SIZE_T == 8
+#  define SIZE_T_MAX            ACR_I64_MAX
+# else
+#  define SIZE_T_MAX            INT_MAX
+# endif
+#endif
+#if !defined(SSIZE_T_MAX)
+# if CC_SIZEOF_SIZE_T == 8
+#  define SSIZE_T_MAX           ACR_I64_MAX
+# else
+#  define SSIZE_T_MAX           INT_MAX
+# endif
+#endif
+#if !defined(OPEN_MAX)
+# define OPEN_MAX               256
+#endif
+#if !defined(MAXHOSTNAMELEN)
+# define MAXHOSTNAMELEN         64
+#endif
+#if !defined(PATH_MAX)
+# if defined(MAXPATHLEN)
+#  define PATH_MAX              MAXPATHLEN
+# else
+#  if defined(_POSIX_PATH_MAX)
+#   define PATH_MAX             _POSIX_PATH_MAX
+#  else
+#   define PATH_MAX             1024
+#  endif
+# endif
+#endif
+#if !defined(STDIN_FILENO)
+# define STDIN_FILENO           0
+#endif
+#if !defined(STDOUT_FILENO)
+# define STDOUT_FILENO          1
+#endif
+#if !defined(STDERR_FILENO)
+# define STDERR_FILENO          2
+#endif
+
+/*
+ * BSD defines these in <sys/param.h> but others may not.
+ */
+#if !defined(MIN)
+# define MIN(a,b)               (((a) < (b)) ? (a) : (b))
+#endif
+#if !defined(MAX)
+# define MAX(a,b)               (((a) > (b)) ? (a) : (b))
+#endif
+
+#if !defined(HUGE_VALF)
+# define HUGE_VALF              +(HUGE_VAL)
+#endif
+#if !defined(HUGE_VALL)
+# define HUGE_VALL              -(HUGE_VAL)
+#endif
+
+#if defined(offsetof) && !defined(__cplusplus)
+# define ACR_OFFSETOF(T, F)  offsetof(T, F)
+#else
+# define ACR_OFFSETOF(T, F) \
+            ((size_t)(((char *)(&(((T *)0)->F))) - ((char *)0)))
+#endif
+/** Number of elements in static array */
+#define ACR_COUNTOF(a)      (sizeof((a)) / sizeof((a)[0]))
+
+#if defined(HPUX)
+# define _CR_INLINE         __inline
+# define _CR_FORCEINLINE    __inline
+#elif defined(_MSC_VER)
+# define _CR_INLINE         __inline
+# if (_MSC_VER >= 1200)
+#  define _CR_FORCEINLINE   __forceinline
+# else
+#  define _CR_FORCEINLINE   __inline
+# endif
+#else
+# define _CR_INLINE         inline
+# if defined(__GNUC__)
+#  define _CR_FORCEINLINE   __attribute__((always_inline)) __inline__
+# else
+#  define _CR_FORCEINLINE   inline
+# endif
+#endif
+
+#define ACR_INLINE(type)        static _CR_INLINE type
+#define ACR_FORCEINLINE(type)   static _CR_FORCEINLINE type
+
+#define  ACR_NOT_YET            0
+
+#if defined(_WINDOWS)
+# define snprintf               _snprintf
+# define strcasecmp             _stricmp
+# define wcscasecmp             _wcsicmp
+# define strncasecmp            _strnicmp
+# define wcsncasecmp            _wcsnicmp
+# define vsnprintf              _vsnprintf
+# define isinf(x)               (!_finite(x))
+# define isnan                  _isnan
+# if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#  define strdup                _strdup
+# endif
+# define va_copy(d, s)          (d) = (s)
+#endif
+
+#ifndef FALSE
+#define FALSE                   0
+#endif
+
+#ifndef TRUE
+#define TRUE                    1
+#endif
+
+#if defined(_WINDOWS)
+# define RLIMIT_VMEM            1
+#endif
+
+/* PR_ALIGN() is only to be used to align on a power of 2 boundary */
+#define ACR_ALIGN(size, boundary) \
+    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
+
+/** Default alignment */
+#define ACR_ALIGN_DEFAULT(size) ACR_ALIGN(size, 8)
+/** Struct alignment */
+
+#if defined(__GNUC__)
+# define ALIGNED_PFX(S)
+# define ALIGNED_SFX(S)         __attribute__((aligned (S)))
+#define ACR_ALIGN_STRUCT(S)     sizeof(S)
+#elif defined(_MSC_VER)
+# define ALIGNED_PFX(S)         __declspec(align(S))
+# define ALIGNED_SFX(S)
+#define ACR_ALIGN_STRUCT(S)     (pr_size_t)sizeof(S)
+#else
+# define ALIGNED_PFX(S)
+# define ALIGNED_SFX(S)
+#define ACR_ALIGN_STRUCT(S)     ACR_ALIGN_DEFAULT((ap_size_t)sizeof(S))
+#endif
+/** Default type alignment 8 bytes */
+#define ALIGNED__               ALIGNED_PFX(8)
+#define __ALIGNED               ALIGNED_SFX(8)
+
+#endif /* _ACR_STDDEFS_H_ */

Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/stdinc.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/stdinc.h?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/stdinc.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/stdinc.h Tue Mar 22 18:36:19 2011
@@ -0,0 +1,223 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_STDINC_H_
+#define _ACR_STDINC_H_
+
+/**
+ * @file stdinc.h
+ * @brief ACR Standard OS includes
+ */
+
+#include "acr/api.h"
+#if defined(WIN32)
+# if !defined(WIN32_LEAN_AND_MEAN)
+#  define WIN32_LEAN_AND_MEAN
+# endif
+# if !defined(_WIN32_WINNT)
+#  define _WIN32_WINNT 0x0501
+# endif
+
+/* Ignore most warnings (back down to /W3) for poorly constructed headers
+ */
+# if defined(_MSC_VER) && _MSC_VER >= 1200
+#  pragma warning(push, 3)
+# endif
+
+/* disable or reduce the frequency of...
+ * C4057: indirection to slightly different base types
+ * C4075: slight indirection changes (unsigned short* vs short[])
+ * C4244: int to char/short - precision loss
+ */
+# pragma warning(once: 4057 4075 4244)
+
+# pragma warning(disable: 4053)    /* An expression of type VOID was used as an operand      */
+# pragma warning(disable: 4100)    /* Unreferenced formal parameter                          */
+# pragma warning(disable: 4115)    /* Named type definition in parentheses                   */
+# pragma warning(disable: 4127)    /* Conditional expression is a constant                   */
+# pragma warning(disable: 4163)    /* '_rotl64' : not available as an intrinsic function     */
+# pragma warning(disable: 4189)    /* Local Variable is initialized but not referenced       */
+# pragma warning(disable: 4201)    /* Nameless struct/union (MS C/C++ specific)              */
+# pragma warning(disable: 4514)    /* unreferenced inline function removed                   */
+# pragma warning(disable: 4706)    /* Assignment within conditional expression               */
+
+/* Ignore Microsoft's interpretation of secure development
+ * and the POSIX string handling API
+ */
+# if defined(_MSC_VER) && _MSC_VER >= 1400
+#  if !defined(_CRT_SECURE_NO_DEPRECATE)
+#   define _CRT_SECURE_NO_DEPRECATE
+#  endif
+#  pragma warning(disable: 4996)
+# endif
+
+# include <windows.h>
+
+# if defined(_M_IA64)
+/* Fix bug in PlatforSDK headers */
+#  define TMP_IA64 _M_IA64
+#  undef _M_IA64
+#  include <winternl.h>
+#  define _M_IA64 TMP_IA64
+# else
+#  include <winternl.h>
+# endif
+# include <winsock2.h>
+# include <mswsock.h>
+# include <ws2tcpip.h>
+# include <wincrypt.h>
+#endif /* WIN32 */
+
+/* GNU libc requires __STDC_LIMIT_MACROS
+ * defined for INT_MAX/INT_MIN
+ */
+#if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS 1
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <errno.h>
+#include <math.h>
+#include <time.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_STDBOOL_H
+# include <stdbool.h>
+#endif
+
+#if HAVE_WTYPES_H
+#include <wtypes.h>
+#endif
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+#if HAVE_LINK_H
+#include <link.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+/* Header files for PATH_MAX, _POSIX_PATH_MAX */
+#if HAVE_LIMITS_H
+#include <limits.h>
+#else
+#if HAVE_SYS_SYSLIMITS_H
+#include <sys/syslimits.h>
+#endif
+#endif
+#include <ctype.h>
+#include <wchar.h>
+#include <wctype.h>
+#if HAVE_AIO_H
+#include <aio.h>
+#endif
+#if HAVE_LIBAIO_H
+#include <libaio.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+#if HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#if HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
+#if defined(WIN32)
+/* Add MSVCRT specific includes
+ */
+# include <io.h>
+# include <fcntl.h>
+# include <process.h>    /* getpid() */
+# include <sys/stat.h>
+# include <float.h>
+#else
+/* Add POSIX specific includes
+ */
+# include <signal.h>
+# include <setjmp.h>
+# if HAVE_UCONTEXT_H
+#  include <ucontext.h>
+# endif
+# if defined(SOLARIS) && defined(HAS_NATIVE_THREADS)
+#  include <thread.h>
+# else
+#  include <pthread.h>
+# endif
+#endif
+
+#include <jni.h>
+
+#endif /* _ACR_STDINC_H_ */

Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/stdinc.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/stdtypes.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/stdtypes.h?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/stdtypes.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/stdtypes.h Tue Mar 22 18:36:19 2011
@@ -0,0 +1,165 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_STDTYPES_H_
+#define _ACR_STDTYPES_H_
+
+#include "acr/stddefs.h"
+
+/**
+ * @file stdtypes.h
+ * @brief ACR Standard type definitions.
+ */
+
+#if !HAVE_STDBOOL_H
+# ifndef __cplusplus
+typedef enum {
+    false = 0,
+    true  = 1
+} _bool_t;
+
+/* And those constants must also be available as macros. */
+#  define false     false
+#  define true      true
+/* User visible type `bool' is provided as a macro which may be redefined */
+#  define bool      _bool_t
+# else
+#  define _bool_t   bool
+#  define bool      bool
+#  define false     false
+#  define true      true
+# endif
+#endif
+
+/* Typedefs that ACR needs. */
+typedef  unsigned char      cr_byte_t;
+typedef  unsigned short     cr_uint16_t;
+typedef  unsigned short     cr_u16_t;
+typedef  short              cr_i16_t;
+typedef  unsigned int       cr_uint32_t;
+typedef  unsigned int       cr_u32_t;
+typedef  int                cr_i32_t;
+typedef  unsigned int       cr_size_t;
+typedef  int                cr_ssize_t;
+
+#if defined(_MSC_VER)
+typedef  ptrdiff_t          ssize_t;
+typedef  __int64            cr_i64_t;
+typedef  unsigned __int64   cr_u64_t;
+typedef  cr_i64_t           cr_off_t;
+typedef  int                cr_socklen_t;
+typedef  DWORD              mode_t;
+/* API char type on windows is always WCHAR */
+typedef  wchar_t            cr_pchar_t;
+typedef  int                uid_t;
+typedef  int                gid_t;
+typedef  int                cr_uid_t;
+typedef  int                cr_gid_t;
+typedef  HANDLE             cr_osd_t;
+typedef  DWORD              cr_pid_t;
+typedef  DWORD              cr_threadkey_t;
+typedef  unsigned __int64   cr_ino_t;
+typedef  DWORD              cr_dev_t;
+# if HAVE_INTPTR_T
+typedef  intptr_t           cr_intptr_t;
+# else
+#  if defined(_WIN64)
+typedef  cr_i64_t           intptr_t;
+typedef  cr_i64_t           cr_intptr_t;
+#  else
+typedef  int                intptr_t;
+typedef  int                cr_intptr_t;
+#  endif
+# endif
+# if HAVE_UINTPTR_T
+typedef  uintptr_t          cr_uintptr_t;
+# else
+#  if defined(_WIN64)
+typedef  cr_u64_t           uintptr_t;
+typedef  cr_u64_t           cr_uintptr_t;
+#  else
+typedef  unsigned int       uintptr_t;
+typedef  unsigned int       cr_uintptr_t;
+#  endif
+# endif
+typedef  long               cr_atomic32_t;
+typedef  __int64            cr_atomic64_t;
+#else /* !_MSC_VER */
+typedef  long long          cr_i64_t;
+typedef  unsigned long long cr_u64_t;
+# if HAVE_OFF64_T
+typedef  off64_t            cr_off_t;
+# else
+#  if CC_SIZEOF_OFF_T == 8
+typedef  off_t              cr_off_t;
+#  else
+typedef  cr_i64_t           cr_off_t;
+#  endif
+# endif
+# if HAVE_INTPTR_T
+typedef  intptr_t           cr_intptr_t;
+# else
+typedef  long               cr_intptr_t;
+# endif
+# if HAVE_UINTPTR_T
+typedef  uintptr_t          cr_uintptr_t;
+# else
+typedef  unsigned long      cr_uintptr_t;
+# endif
+typedef  socklen_t          cr_socklen_t;
+/* API char type on POSIX is always char (UTF-8) */
+typedef  char               cr_pchar_t;
+typedef  uid_t              cr_uid_t;
+typedef  gid_t              cr_gid_t;
+typedef  int                cr_osd_t;
+typedef  pid_t              cr_pid_t;
+typedef  pthread_key_t      cr_threadkey_t;
+typedef  ino_t              cr_ino_t;
+typedef  dev_t              cr_dev_t;
+# if defined(_SOLARIS)
+typedef  uint_t             cr_atomic32_t;
+typedef  uint64_t           cr_atomic64_t;
+# else
+typedef  int                cr_atomic32_t;
+typedef  long long          cr_atomic64_t;
+# endif
+#endif
+
+typedef  cr_i64_t           cr_time_t;
+typedef  cr_i64_t           cr_int64_t;
+typedef  cr_u64_t           cr_uint64_t;
+typedef  cr_uint16_t        cr_word_t;
+
+typedef  jchar              cr_wchar_t;
+typedef  jint               cr_int_t;
+typedef  jlong              cr_long_t;
+
+#if defined(_MSC_VER)
+struct iovec {
+    void    *iov_base;
+    size_t   iov_len;
+};
+
+typedef cr_uint64_t         rlim_t; /* LARGEFILE64 */
+struct rlimit {
+    rlim_t  rlim_cur;       /* Soft limit */
+    rlim_t  rlim_max;       /* Hard limit (ceiling for rlim_cur) */
+};
+# define RLIMIT_VMEM    1
+# define IOV_MAX        1024
+#endif
+
+#endif /* _ACR_STDTYPES_H_ */

Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/stdtypes.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c?rev=1084288&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c Tue Mar 22 18:36:19 2011
@@ -0,0 +1,142 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "acr/port.h"
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left).  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+_bsd_strlcat(char *dst, const char *src, size_t siz)
+{
+    char *d = dst;
+    const char *s = src;
+    size_t n = siz;
+    size_t dlen;
+
+    /* Find the end of dst and adjust bytes left but don't go past end */
+    while (n-- != 0 && *d != '\0')
+        d++;
+    dlen = d - dst;
+    n = siz - dlen;
+
+    if (n == 0)
+        return (dlen + strlen(s));
+    while (*s != '\0') {
+        if (n != 1) {
+            *d++ = *s;
+            n--;
+        }
+        s++;
+    }
+    *d = '\0';
+
+    return (dlen + (s - src));  /* count does not include NUL */
+}
+/*
+ * Copy src to string dst of size siz.  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+_bsd_strlcpy(char *dst, const char *src, size_t siz)
+{
+    char *d = dst;
+    const char *s = src;
+    size_t n = siz;
+
+    /* Copy as many bytes as will fit */
+    if (n != 0) {
+        while (--n != 0) {
+            if ((*d++ = *s++) == '\0')
+                break;
+        }
+    }
+
+    /* Not enough room in dst, add NUL and traverse rest of src */
+    if (n == 0) {
+        if (siz != 0)
+            *d = '\0';      /* NUL-terminate dst */
+        while (*s++)
+            ;
+    }
+
+    return (s - src - 1);   /* count does not include NUL */
+}
+
+#define _NUM_SIGSNALS 32
+/*
+ * This table presumes that all signals have
+ * the same number, whuch should be true
+ * for any posix system.
+ * TODO: Create a mapping table from real signal
+ *       number to our description table if that's a problem.
+ */
+static const char *const _posix_siglist[] = {
+    "Signal 0",
+    "Hangup",                   /* SIGHUP       */
+    "Interrupt",                /* SIGINT       */
+    "Quit",                     /* SIGQUIT      */
+    "Illegal instruction",      /* SIGILL       */
+    "Trace/BPT trap",           /* SIGTRAP      */
+    "Abort trap",               /* SIGABRT      */
+    "EMT trap",                 /* SIGEMT       */
+    "Floating point exception", /* SIGFPE       */
+    "Killed",                   /* SIGKILL      */
+    "Bus error",                /* SIGBUS       */
+    "Segmentation fault",       /* SIGSEGV      */
+    "Bad system call",          /* SIGSYS       */
+    "Broken pipe",              /* SIGPIPE      */
+    "Alarm clock",              /* SIGALRM      */
+    "Terminated",               /* SIGTERM      */
+    "Urgent I/O condition",     /* SIGURG       */
+    "Suspended (signal)",       /* SIGSTOP      */
+    "Suspended",                /* SIGTSTP      */
+    "Continued",                /* SIGCONT      */
+    "Child exited",             /* SIGCHLD      */
+    "Stopped (tty input)",      /* SIGTTIN      */
+    "Stopped (tty output)",     /* SIGTTOU      */
+    "I/O possible",             /* SIGIO        */
+    "Cputime limit exceeded",   /* SIGXCPU      */
+    "Filesize limit exceeded",  /* SIGXFSZ      */
+    "Virtual timer expired",    /* SIGVTALRM    */
+    "Profiling timer expired",  /* SIGPROF      */
+    "Window size changes",      /* SIGWINCH     */
+    "Information request",      /* SIGINFO      */
+    "User defined signal 1",    /* SIGUSR1      */
+    "User defined signal 2",    /* SIGUSR2      */
+    0
+};
+
+static ACR_THREAD char _strsignal_buf[_NUM_SIGSNALS];
+char *_bsd_strsignal(int signum)
+{
+    int saved = errno;
+    if (signum >= 0 && signum < _NUM_SIGSNALS)
+        strncpy(_strsignal_buf, _posix_siglist[signum],
+                sizeof(_strsignal_buf));
+    else
+        snprintf(_strsignal_buf, sizeof(_strsignal_buf),
+                 "Unknown signal (%d)", signum);
+
+    errno = saved;
+    return _strsignal_buf;
+}
+

Propchange: commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message