httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/include apr_errno.h
Date Wed, 05 Apr 2000 03:14:12 GMT
trawick     00/04/04 20:14:12

  Modified:    src/lib/apr/include apr_errno.h
  Log:
  allow OS-specific errors to be stored in ap_status_t (and
  later recognized)
  
  Revision  Changes    Path
  1.20      +30 -8     apache-2.0/src/lib/apr/include/apr_errno.h
  
  Index: apr_errno.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_errno.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- apr_errno.h	2000/04/03 18:40:39	1.19
  +++ apr_errno.h	2000/04/05 03:14:12	1.20
  @@ -62,11 +62,25 @@
   extern "C" {
   #endif /* __cplusplus */
   
  -/* Define four layers of status code offsets so that we don't interfere
  - * with the predefined errno codes on the operating system.  Codes beyond
  - * APR_OS_START_USEERR are reserved for applications that use APR that
  - * layer their own error codes along with APR's.
  +typedef int ap_status_t;
  +
  +/* Define five layers of status code offsets so that we don't interfere
  + * with the predefined errno codes on the operating system.  
  + * 
  + * For platforms such as Windows and OS/2 which have OS-specific error 
  + * codes:
  + * 
  + * Codes between APR_OS_START_USEERR and APR_OS_START_OSERR are reserved 
  + * for applications that use APR that layer their own error codes along 
  + * with APR's.
  + *
  + * For platforms such as UNIX where the system uses errno:
  + *
  + * APR_OS_START_OSERR is not used, so codes beyond APR_OS_START_USEERR are 
  + * reserved for applications that use APR that layer their own error codes 
  + * along with APR's.
    */
  +
   #ifndef APR_OS_START_ERROR
   #define APR_OS_START_ERROR   4000
   #endif
  @@ -79,11 +93,19 @@
   #ifndef APR_OS_START_USEERR
   #define APR_OS_START_USEERR  (APR_OS_START_SYSERR + 500)
   #endif
  +#ifndef APR_OS_START_OSERR      
  +#define APR_OS_START_OSERR   (APR_START_USEERR + 29500)
  +#endif
   
  -/* If this definition of APRStatus changes, then we can remove this, but right
  - * now, the decision was to use an errno-like implementation.
  - */
  -typedef int ap_status_t;
  +#ifndef APR_STATUS_FROM_OSERR
  +#define APR_STATUS_FROM_OSERR(err) \
  +((err) ? (err) + APR_OS_START_OSERR : APR_SUCCESS)
  +#endif
  +
  +#ifndef APR_OSERR_FROM_STATUS
  +#define APR_OSERR_FROM_STATUS(st) \
  +((st) > APR_OS_START_OSERR ? (st) - APR_OS_START_OSERR : APR_SUCCESS)
  +#endif
   
   #define APR_SUCCESS 0
   
  
  
  

Mime
View raw message