summaryrefslogtreecommitdiff
path: root/include/apr_errno.h
diff options
context:
space:
mode:
authorkfogel <kfogel@13f79535-47bb-0310-9956-ffa450edef68>2002-08-15 17:56:04 +0000
committerkfogel <kfogel@13f79535-47bb-0310-9956-ffa450edef68>2002-08-15 17:56:04 +0000
commitd4292d55f3d09b865b9899a02950e093e18074e9 (patch)
treef101e51228cfa8da59083c7371628dc48f776069 /include/apr_errno.h
parent2340dee2fe612dcb5288dd7c241a965f504c0685 (diff)
downloadlibapr-d4292d55f3d09b865b9899a02950e093e18074e9.tar.gz
Expand the error code spaces:
* include/apr_errno.h (APR_OS_ERRSPACE_SIZE): New #defined constant, init to 50000. (APR_OS_START_USERERR): New name for APR_OS_START_USEERR. Leave the old name defined for compatibility, but mark as obsolete. (APR_OS_START_STATUS, APR_OS_START_USERERR, APR_OS_START_CANONERR, APR_OS_START_EAIERR, APR_OS_START_SYSERR): Expand ranges as per above, and give USERERR a range ten times larger than the others. * misc/unix/errorcodes.c (apr_strerror): Adjust for the rename. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63814 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_errno.h')
-rw-r--r--include/apr_errno.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/include/apr_errno.h b/include/apr_errno.h
index 2a372ffd1..0b87233e6 100644
--- a/include/apr_errno.h
+++ b/include/apr_errno.h
@@ -149,29 +149,44 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
*/
#define APR_OS_START_ERROR 20000
/**
+ * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
+ * into one of the error/status ranges below -- except for
+ * APR_OS_START_USERERR, which see.
+ */
+#define APR_OS_ERRSPACE_SIZE 50000
+/**
* APR_OS_START_STATUS is where the APR specific status codes start.
*/
-#define APR_OS_START_STATUS (APR_OS_START_ERROR + 500)
+#define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
+/**
+ * APR_OS_START_USERERR are reserved for applications that use APR that
+ * layer their own error codes along with APR'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.
+ */
+#define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
/**
- * APR_OS_START_USEERR are reserved for applications that use APR that
- * layer their own error codes along with APR's.
+ * APR_OS_START_USEERR is obsolete, defined for compatibility only.
+ * Use APR_OS_START_USERERR instead.
*/
-#define APR_OS_START_USEERR (APR_OS_START_STATUS + 500)
+#define APR_OS_START_USEERR APR_OS_START_USERERR
/**
* APR_OS_START_CANONERR is where APR versions of errno values are defined
* on systems which don't have the corresponding errno.
*/
-#define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500)
+#define APR_OS_START_CANONERR (APR_OS_START_USERERR \
+ + (APR_OS_ERRSPACE_SIZE * 10))
/**
* APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into
* apr_status_t values.
*/
-#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + 500)
+#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
/**
* APR_OS_START_SYSERR folds platform-specific system error values into
* apr_status_t values.
*/
-#define APR_OS_START_SYSERR (APR_OS_START_EAIERR + 500)
+#define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
/** no error. @see APR_STATUS_IS_SUCCESS */
#define APR_SUCCESS 0