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

  1. #ifndef APACHE_OS_H
  2. #define APACHE_OS_H
  3.  
  4. #define PLATFORM "Win32"
  5.  
  6. /*
  7.  * This file in included in all Apache source code. It contains definitions
  8.  * of facilities available on _this_ operating system (HAVE_* macros),
  9.  * and prototypes of OS specific functions defined in os.c
  10.  */
  11.  
  12. /* temporarily replace crypt */
  13. /* char *crypt(const char *pw, const char *salt); */
  14. #define crypt(buf,salt)        (buf)
  15.  
  16. /* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for
  17.    chdir() */
  18. #include <direct.h>
  19.  
  20. #define STATUS
  21. #define WIN32_LEAN_AND_MEAN
  22. #ifndef STRICT
  23.  #define STRICT
  24. #endif
  25. #define CASE_BLIND_FILESYSTEM
  26. #define NO_WRITEV
  27. #define NO_SETSID
  28. #define NO_USE_SIGACTION
  29. #define NO_TIMES
  30. #define NO_GETTIMEOFDAY
  31. //#define NEED_PROCESS_H    although we do, this is specially handled in ap_config.h
  32. #define USE_LONGJMP
  33. #define HAVE_MMAP
  34. #define USE_MMAP_SCOREBOARD
  35. #define MULTITHREAD
  36. #define HAVE_CANONICAL_FILENAME
  37. typedef int uid_t;
  38. typedef int gid_t;
  39. typedef int pid_t;
  40. typedef int mode_t;
  41. typedef char * caddr_t;
  42.  
  43. /*
  44. Define export types. API_EXPORT_NONSTD is a nasty hack to avoid having to declare
  45. every configuration function as __stdcall.
  46. */
  47.  
  48. #ifdef SHARED_MODULE
  49. # define API_VAR_EXPORT        __declspec(dllimport)
  50. # define API_EXPORT(type)    __declspec(dllimport) type __stdcall
  51. # define API_EXPORT_NONSTD(type)    __declspec(dllimport) type
  52. #else
  53. # define API_VAR_EXPORT        __declspec(dllexport)
  54. # define API_EXPORT(type)    __declspec(dllexport) type __stdcall
  55. # define API_EXPORT_NONSTD(type)    __declspec(dllexport) type
  56. #endif
  57. #define MODULE_VAR_EXPORT   __declspec(dllexport)
  58.  
  59. #define strcasecmp(s1, s2) stricmp(s1, s2)
  60. #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
  61. #define lstat(x, y) stat(x, y)
  62. #define S_ISLNK(m) (0)
  63. #define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG)
  64. #ifndef S_ISDIR
  65. #define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
  66. #endif
  67. #ifndef S_ISREG
  68. #define S_ISREG(m)      (((m)&(S_IFREG)) == (S_IFREG))
  69. #endif
  70. #define STDIN_FILENO  0
  71. #define STDOUT_FILENO 1
  72. #define STDERR_FILENO 2
  73. #define JMP_BUF jmp_buf
  74. #define sleep(t) Sleep(t*1000)
  75. #define O_CREAT _O_CREAT
  76. #define O_RDWR _O_RDWR
  77. #define SIGPIPE 17
  78. /* Seems Windows is not a subgenius */
  79. #define NO_SLACK
  80. #include <stddef.h>
  81.  
  82. #define NO_OTHER_CHILD
  83. #define NO_RELIABLE_PIPED_LOGS
  84.  
  85. __inline int ap_os_is_path_absolute(const char *file)
  86. {
  87.   /* For now, just do the same check that http_request.c and mod_alias.c
  88.    * do. 
  89.    */
  90.   return file[0] == '/' || file[1] == ':';
  91. }
  92.  
  93. #define stat(f,ps)  os_stat(f,ps)
  94. API_EXPORT(int) os_stat(const char *szPath,struct stat *pStat);
  95.  
  96. API_EXPORT(int) os_strftime(char *s, size_t max, const char *format, const struct tm *tm);
  97.  
  98. #define _spawnv(mode,cmdname,argv)        os_spawnv(mode,cmdname,argv)
  99. #define spawnv(mode,cmdname,argv)        os_spawnv(mode,cmdname,argv)
  100. API_EXPORT(int) os_spawnv(int mode,const char *cmdname,const char *const *argv);
  101. #define _spawnve(mode,cmdname,argv,envp)    os_spawnve(mode,cmdname,argv,envp)
  102. #define spawnve(mode,cmdname,argv,envp)        os_spawnve(mode,cmdname,argv,envp)
  103. API_EXPORT(int) os_spawnve(int mode,const char *cmdname,const char *const *argv,const char *const *envp);
  104. #define _spawnle                os_spawnle
  105. #define spawnle                    os_spawnle
  106. API_EXPORT(int) os_spawnle(int mode,const char *cmdname,...);
  107.  
  108. /* OS-dependent filename routines in util_win32.c */
  109.  
  110. API_EXPORT(int) ap_os_is_filename_valid(const char *file);
  111.  
  112. /* Abstractions for dealing with shared object files (DLLs on Win32).
  113.  * These are used by mod_so.c
  114.  */
  115. #define ap_os_dso_handle_t  HINSTANCE
  116. #define ap_os_dso_init()
  117. #define ap_os_dso_load(l)   LoadLibraryEx(l, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
  118. #define ap_os_dso_unload(l) FreeLibrary(l)
  119. #define ap_os_dso_sym(h,s)  GetProcAddress(h,s)
  120. #define ap_os_dso_error()   ""    /* for now */
  121.  
  122. #endif   /* ! APACHE_OS_H */
  123.