home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / os2 / apach134.arj / APACH134.ZIP / src / os / tpf / os.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-08  |  2.4 KB  |  112 lines

  1. #ifndef APACHE_OS_H
  2. #define APACHE_OS_H
  3.  
  4. #define PLATFORM "TPF"
  5.  
  6. #ifdef errno
  7. #undef errno
  8. #endif
  9.  
  10. /*
  11.  * This file in included in all Apache source code. It contains definitions
  12.  * of facilities available on _this_ operating system (HAVE_* macros),
  13.  * and prototypes of OS specific functions defined in os.c or os-inline.c
  14.  */
  15.  
  16. #include "ap_config.h"
  17.  
  18. #if !defined(INLINE) && defined(USE_GNU_INLINE)
  19. /* Compiler supports inline, so include the inlineable functions as
  20.  * part of the header
  21.  */
  22. #define INLINE extern ap_inline
  23.  
  24. INLINE int ap_os_is_path_absolute(const char *file);
  25.  
  26. #include "os-inline.c"
  27. #endif
  28.  
  29. #ifndef INLINE
  30. /* Compiler does not support inline, so prototype the inlineable functions
  31.  * as normal
  32.  */
  33. extern int ap_os_is_path_absolute(const char *file);
  34. #endif
  35.  
  36. /* Other ap_os_ routines not used by this platform */
  37.  
  38. #define ap_os_is_filename_valid(f)          (1)
  39.  
  40. /* Sorry if this is ugly, but the include order doesn't allow me
  41.  * to use request_rec here... */
  42. struct request_rec;
  43. extern int ap_checkconv(struct request_rec *r);
  44.  
  45. #ifdef FD_SETSIZE
  46. #undef FD_SETSIZE 
  47. #endif
  48.  
  49. #define FD_SETSIZE    2048 
  50.  
  51. #ifdef __FD_MASK
  52. #undef __FD_MASK 
  53. #endif
  54.  
  55. typedef long __FD_MASK;
  56.  
  57. #ifdef __NBBY
  58. #undef __NBBY 
  59. #endif
  60.  
  61. #define __NBBY    8    /* number of bits in a byte */
  62.  
  63. #ifdef __NFDBITS
  64. #undef __NFDBITS 
  65. #endif
  66.  
  67. #define __NFDBITS (sizeof(__FD_MASK) * __NBBY)
  68.  
  69. #ifndef __howmany
  70. #define  __howmany(x, y)  (((x)+((y)-1))/(y))
  71. #endif 
  72.  
  73. typedef struct fd_set { 
  74.         __FD_MASK fds_bits [__howmany(FD_SETSIZE, __NFDBITS)]; 
  75. } fd_set; 
  76.  
  77. #define  FD_SET(n, p)((p)->fds_bits[(n)/__NFDBITS] |= (1 <<((n) % __NFDBITS)))
  78.  
  79. #define  FD_CLR(n, p)((p)->fds_bits[(n)/__NFDBITS] &= ~(1 << ((n) % __NFDBITS)))
  80.  
  81. #define  FD_ISSET(n, p)((p)->fds_bits[(n)/__NFDBITS] & (1 <<((n) % __NFDBITS)))
  82.  
  83. #define  FD_ZERO(p)   memset((char *)(p), 0, sizeof(*(p)))
  84.     
  85.  
  86. #define  SIGPIPE  13
  87. #define  SIGQUIT  24
  88. #define  SO_KEEPALIVE  0x0008
  89.  
  90. /* TPF doesn't have, or need, tzset (it is used in mod_expires.c) */
  91. #define tzset()
  92.  
  93. #include <stdarg.h>
  94. #undef va_list
  95. #undef va_start
  96. #undef va_arg
  97. #undef va_end
  98.  
  99. typedef char *va_list;
  100.  
  101. #define __va_promote(type) (((sizeof(type) + sizeof(int) - 1) \
  102.                            / sizeof(int)) * sizeof(int))
  103.  
  104. #define va_start(ap, last) (ap = ((char *)&(last) + __va_promote(last)))
  105.  
  106. #define va_arg(ap, type) ((type *)(ap += sizeof(type) < sizeof(int) ? \
  107.                          (abort(), 0) : sizeof(type)))[-1]
  108.  
  109. #define va_end(ap)
  110.  
  111. #endif /*! APACHE_OS_H*/
  112.