home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / sources / conf.h < prev    next >
C/C++ Source or Header  |  1992-03-06  |  16KB  |  505 lines

  1. /* RCS compile-time configuration for DOS and OS/2 */
  2.  
  3.     /* $Id: conf.h,v 1.9 1992/03/01 23:26:11 eggert Exp $ */
  4.  
  5. /*
  6.  * This RCS compile-time configuration describes DOS and OS/2 hosts.
  7.  * It differs from ../conf.heg as little as possible.
  8.  * Copy this file to ../conf.h.
  9.  * You may have to edit it for your configuration.
  10.  */
  11.  
  12. #define exitmain(n) return n /* how to exit from main() */
  13. /* #define _POSIX_SOURCE */ /* Define this if Posix + strict Standard C.  */
  14.  
  15. #include <errno.h>
  16. #include <stdio.h>
  17. #include <time.h>
  18.  
  19. /* Comment out #include lines below that do not work.  */
  20. #include <sys/types.h>
  21. #include <sys/stat.h>
  22. /* #include <dirent.h> */
  23. #include <fcntl.h>
  24. #include <limits.h>
  25. /* #include <pwd.h> */
  26. #include <signal.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. /* #include <sys/mman.h> */
  30. /* #include <sys/wait.h> */
  31. /* #include <unistd.h> */
  32. /* #include <utime.h> */
  33. /* #include <vfork.h> */
  34.  
  35. /* Define the following symbols to be 1 or 0.  */
  36. #define has_sys_dir_h 0 /* Does #include <sys/dir.h> work?  */
  37. #define has_sys_param_h 0 /* Does #include <sys/param.h> work?  */
  38. #define has_readlink 0 /* Does readlink() work?  */
  39.  
  40. /* #undef NAME_MAX */ /* Uncomment this if NAME_MAX is broken.  */
  41.  
  42. #if !defined(NAME_MAX) && !defined(_POSIX_NAME_MAX)
  43. #    if has_sys_dir_h
  44. #        include <sys/dir.h>
  45. #    endif
  46. #    ifndef NAME_MAX
  47. #        ifndef MAXNAMLEN
  48. #            define MAXNAMLEN 14
  49. #        endif
  50. #        define NAME_MAX MAXNAMLEN
  51. #    endif
  52. #endif
  53. #if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
  54. #    if has_sys_param_h
  55. #        include <sys/param.h>
  56. #        define included_sys_param_h 1
  57. #    endif
  58. #    ifndef PATH_MAX
  59. #        ifndef MAXPATHLEN
  60. #            define MAXPATHLEN 1024
  61. #        endif
  62. #        define PATH_MAX (MAXPATHLEN-1)
  63. #    endif
  64. #endif
  65. #if has_readlink && !defined(MAXSYMLINKS)
  66. #    if has_sys_param_h && !included_sys_param_h
  67. #        include <sys/param.h>
  68. #    endif
  69. #    ifndef MAXSYMLINKS
  70. #        define MAXSYMLINKS 20 /* BSD; not standard yet */
  71. #    endif
  72. #endif
  73.  
  74. /* Comment out the typedefs below if the types are already declared.  */
  75. /* Fix any uncommented typedefs that are wrong.  */
  76. typedef int mode_t;
  77. /* typedef int pid_t; */
  78. /* typedef int sig_atomic_t; */
  79. /* typedef unsigned size_t; */
  80. typedef int ssize_t;
  81. /* typedef long time_t; */
  82. /* typedef int uid_t; */
  83.  
  84. /* Comment out the keyword definitions below if the keywords work.  */
  85. #define const
  86. /* #define volatile */
  87.  
  88. /* Define the following symbols to be 1 or 0.  */
  89. #define has_prototypes 1 /* Do function prototypes work?  */
  90. #define has_stdarg 1 /* Does <stdarg.h> work?  */
  91. #define has_varargs 0 /* Does <varargs.h> work?  */
  92. #define va_start_args 2 /* How many args does va_start() take?  */
  93. #if has_prototypes
  94. #    define P(params) params
  95. #else
  96. #    define P(params) ()
  97. #endif
  98. #if has_stdarg
  99. #    include <stdarg.h>
  100. #else
  101. #    if has_varargs
  102. #        include <varargs.h>
  103. #    else
  104.         typedef char *va_list;
  105. #        define va_dcl int va_alist;
  106. #        define va_start(ap) ((ap) = (va_list)&va_alist)
  107. #        define va_arg(ap,t) (((t*) ((ap)+=sizeof(t)))  [-1])
  108. #        define va_end(ap)
  109. #    endif
  110. #endif
  111. #if va_start_args == 2
  112. #    define vararg_start va_start
  113. #else
  114. #    define vararg_start(ap,p) va_start(ap)
  115. #endif
  116.  
  117. #define text_equals_binary_stdio 0 /* Does stdio treat text like binary?  */
  118. #define text_work_stdio 1 /* Text i/o for working file, binary for RCS file?  */
  119. #if text_equals_binary_stdio
  120.     /* Text and binary i/o behave the same, or binary i/o does not work.  */
  121. #    define FOPEN_R "r"
  122. #    define FOPEN_W "w"
  123. #    define FOPEN_WPLUS "w+"
  124. #    define OPEN_O_BINARY 0
  125. #else
  126.     /* Text and binary i/o behave differently.  */
  127.     /* This is incompatible with Posix and Unix.  */
  128. #    define FOPEN_R "rb"
  129. #    define FOPEN_W "wb"
  130. #    define FOPEN_WPLUS "w+b"
  131. #    define OPEN_O_BINARY O_BINARY
  132. #    ifndef O_BINARY
  133. #    define O_BINARY 0
  134. #    endif
  135. #endif
  136. #if text_work_stdio
  137. #    define FOPEN_R_WORK "r"
  138. #    define FOPEN_W_WORK "w"
  139. #    define FOPEN_WPLUS_WORK "w+"
  140. #    define OPEN_O_WORK 0
  141. #else
  142. #    define FOPEN_R_WORK FOPEN_R
  143. #    define FOPEN_W_WORK FOPEN_W
  144. #    define FOPEN_WPLUS_WORK FOPEN_WPLUS
  145. #    define OPEN_O_WORK OPEN_O_BINARY
  146. #endif
  147.  
  148. /* Define or comment out the following symbols as needed.  */
  149. /* #define bad_chmod_close 0 */ /* Can chmod() close file descriptors?  */
  150. /* #define bad_creat0 0 */ /* Do writes fail after creat(f,0)?  */
  151. #define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f?  */
  152. #define getlogin_is_secure 1 /* Is getlogin() secure?  Usually it's not.  */
  153. #define has_dirent 0 /* Do opendir(), readdir(), closedir() work?  */
  154. #define has_fchmod 0 /* Does fchmod() work?  */
  155. #define has_fputs 1 /* Does fputs() work?  */
  156. #define has_ftruncate 0 /* Does ftruncate() work?  */
  157. #define has_getuid 0 /* Does getuid() work?  */
  158. #define has_getpwuid 0 /* Does getpwuid() work?  */
  159. #define has_memcmp 1 /* Does memcmp() work?  */
  160. #define has_memcpy 1 /* Does memcpy() work?  */
  161. #define has_memmove 1 /* Does memmove() work?  */
  162. #define has_madvise 0 /* Does madvise() work?  */
  163. #define has_mmap 0 /* Does mmap() work on regular files?  */
  164. #define has_rename 1 /* Does rename() work?  */
  165. #define bad_a_rename 1 /* Does rename(A,B) fail if A is unwritable?  */
  166. #define bad_b_rename 1 /* Does rename(A,B) fail if B is unwritable?  */
  167. #define VOID (void) /* 'VOID e;' discards the value of an expression 'e'.  */
  168. #define has_seteuid 0 /* Does seteuid() work?  See README.  */
  169. #define has_setuid 0 /* Does setuid() exist?  */
  170. #define has_signal 1 /* Does signal() work?  */
  171. #define signal_args P((int)) /* arguments of signal handlers */
  172. #define signal_type void /* type returned by signal handlers */
  173. #define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()?  */
  174. #define has_sigaction 0 /* Does struct sigaction work?  */
  175. #define has_sigblock 0 /* Does sigblock() work?  */
  176. /* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number.  */
  177. #define has_sys_siglist 0 /* Does sys_siglist[] work?  */
  178. typedef ssize_t fread_type; /* type returned by fread() and fwrite() */
  179. typedef size_t freadarg_type; /* type of their size arguments */
  180. typedef void *malloc_type; /* type returned by malloc() */
  181. #define has_getcwd 1 /* Does getcwd() work?  */
  182. #define has_getwd 0 /* Does getwd() work?  */
  183. #define has_mktemp 1 /* Does mktemp() work?  */
  184. #define has_NFS 1 /* Might NFS be used?  */
  185. /* #define strchr index */ /* Use old-fashioned name for strchr()?  */
  186. /* #define strrchr rindex */ /* Use old-fashioned name for strrchr()?  */
  187. #define bad_unlink 1 /* Does unlink() fail on unwritable files?  */
  188. #define has_vfork 0 /* Does vfork() work?  */
  189. #define has_fork 0 /* Does fork() work?  */
  190. #define has_spawn 1 /* Does spawn*() work?  */
  191. #define has_wait 0 /* Does wait() work?  */
  192. #define has_waitpid 0 /* Does waitpid() work?  */
  193. /* #define RCS_SHELL getenv("COMSPEC") */ /* shell to run RCS subprograms */
  194. #define has_vfprintf 1 /* Does vfprintf() work?  */
  195. #define has__doprintf 0 /* Does _doprintf() work?  */
  196. #define has__doprnt 0 /* Does _doprnt() work?  */
  197. /* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken.  */
  198. #define large_memory 0 /* Can main memory hold entire RCS files?  */
  199. /* #undef ULONG_MAX */ /* Uncomment this if ULONG_MAX is wrong.  */
  200. #ifndef ULONG_MAX
  201. #define ULONG_MAX 4294967295 /* unsigned long maximum */
  202. #endif
  203. #define ULONG_MAX_OVER_10 (ULONG_MAX/10) /* ULONG_MAX/10, discarding remainder */
  204. #define has_utimbuf 0 /* Does struct utimbuf work?  */
  205. #define CO "co.exe" /* name of 'co' program */
  206. #define COMPAT2 0 /* Are version 2 files supported?  */
  207. #define DATEFORM "%.2d.%.2d.%.2d.%.2d.%.2d.%.2d" /* e.g. 01.01.01.01.01.01 */
  208. #define DIFF "diff.exe" /* name of 'diff' program */
  209. #define DIFF3 "diff3.exe" /* name of 'diff3' program */
  210. #define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)?  */
  211. #define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS.  */
  212. #define DIFF_L 1 /* Does diff -L work? */
  213. #define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
  214. #define DIFF_FAILURE 1 /* DIFF status if differences are found */
  215. #define DIFF_TROUBLE 2 /* DIFF status if trouble */
  216. /* #define ED "/bin/ed" */ /* name of 'ed' program (used only if !DIFF3_BIN) */
  217. #define MERGE "merge.exe" /* name of 'merge' program */
  218. #define TMPDIR "c:" /* default directory for temporary files */
  219. #define SLASH '\\' /* principal pathname separator */
  220. #define SLASHes SLASH: case '/': case ':' /* `case SLASHes:' labels all pathname separators */
  221. int isSLASH P((int));
  222. #define ROOTPATH(p) (isSLASH((p)[0]) || (p)[0] && (p)[1]==':') /* Is p an absolute pathname?  */
  223. #define X_DEFAULT "" /* default value for -x option */
  224. #define ALL_ABSOLUTE 0 /* Do all subprograms satisfy ROOTPATH?  */
  225. #define DIFF_ABSOLUTE 0 /* Is ROOTPATH(DIFF) true?  */
  226. /* #define SENDMAIL "/bin/mail" */ /* how to send mail */
  227. #define TZ_must_be_set 1 /* Must TZ be set for gmtime() to work?  */
  228.  
  229.  
  230.  
  231. /* Adjust the following declarations as needed.  */
  232.  
  233.  
  234. #ifndef exiting
  235. #    if __GNUC__ && !__STRICT_ANSI__
  236. #        define exiting volatile /* GCC extension: function cannot return */
  237. #    else
  238. #        define exiting
  239. #    endif
  240. #endif
  241.  
  242. #if has_ftruncate
  243.     int ftruncate P((int,off_t));
  244. #endif
  245.  
  246. /* <sys/mman.h> */
  247. #if has_madvise
  248.     int madvise P((caddr_t,size_t,int));
  249. #endif
  250. #if has_mmap
  251.     caddr_t mmap P((caddr_t,size_t,int,int,int,off_t));
  252.     int munmap P((caddr_t,size_t));
  253. #endif
  254.  
  255.  
  256. /* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
  257. /* These definitions are for the benefit of non-Posix hosts, and */
  258. /* Posix hosts that have Standard C compilers but traditional include files.  */
  259. /* Unfortunately, mixed-up hosts are all too common.  */
  260.  
  261. /* <fcntl.h> */
  262. #ifdef F_DUPFD
  263.     int fcntl P((int,int,...));
  264. #else
  265.     int dup2 P((int,int));
  266. #endif
  267. #ifdef O_CREAT
  268. #    define open_can_creat 1
  269. #else
  270. #    define open_can_creat 0
  271. #    define O_RDONLY 0
  272. #    define O_WRONLY 1
  273. #    define O_RDWR 2
  274. #    define O_CREAT 01000
  275. #    define O_TRUNC 02000
  276.     int creat P((char const*,mode_t));
  277. #endif
  278. #ifndef O_EXCL
  279. #define O_EXCL 0
  280. #endif
  281.  
  282. /* <pwd.h> */
  283. #if has_getpwuid
  284.     struct passwd *getpwuid P((uid_t));
  285. #endif
  286.  
  287. /* <signal.h> */
  288. #if has_sigaction
  289.     int sigaction P((int,struct sigaction const*,struct sigaction*));
  290.     int sigaddset P((sigset_t*,int));
  291.     int sigemptyset P((sigset_t*));
  292. #else
  293. #if has_sigblock
  294.     /* BSD */
  295.     int sigblock P((int));
  296.     int sigmask P((int));
  297.     int sigsetmask P((int));
  298. #endif
  299. #endif
  300.  
  301. /* <stdio.h> */
  302. #if declare_fdopen
  303. FILE *fdopen P((int,char const*));
  304. #endif
  305. /* int fileno P((FILE*)); */
  306.  
  307. /* <sys/stat.h> */
  308. int chmod P((char const*,mode_t));
  309. int fstat P((int,struct stat*));
  310. int stat P((char const*,struct stat*));
  311. #if has_fchmod
  312.     int fchmod P((int,mode_t));
  313. #endif
  314. #ifndef S_IRUSR
  315. #    ifdef S_IREAD
  316. #        define S_IRUSR S_IREAD
  317. #    else
  318. #        define S_IRUSR 0400
  319. #    endif
  320. #    ifdef S_IWRITE
  321. #        define S_IWUSR S_IWRITE
  322. #    else
  323. #        define S_IWUSR (S_IRUSR/2)
  324. #    endif
  325. #endif
  326. #ifndef S_IRGRP
  327. #    if has_getuid
  328. #        define S_IRGRP (S_IRUSR / 0010)
  329. #        define S_IWGRP (S_IWUSR / 0010)
  330. #        define S_IROTH (S_IRUSR / 0100)
  331. #        define S_IWOTH (S_IWUSR / 0100)
  332. #    else
  333.         /* single user OS -- not Posix or Unix */
  334. #        define S_IRGRP 0
  335. #        define S_IWGRP 0
  336. #        define S_IROTH 0
  337. #        define S_IWOTH 0
  338. #    endif
  339. #endif
  340. #ifndef S_ISREG
  341. #define S_ISREG(n) (! ((n)&S_IFDIR))
  342. #endif
  343.  
  344. /* <sys/wait.h> */
  345. #if has_wait
  346.     pid_t wait P((int*));
  347. #endif
  348. #ifndef WEXITSTATUS
  349. #define WEXITSTATUS(stat_val) (stat_val)
  350. #undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  351. #endif
  352. #ifndef WIFEXITED
  353. #define WIFEXITED(stat_val) ((stat_val) != -1)
  354. #endif
  355.  
  356. /* <unistd.h> */
  357. char *getlogin P((void));
  358. int close P((int));
  359. int isatty P((int));
  360. int link P((char const*,char const*));
  361. int open P((char const*,int,...));
  362. /* int unlink P((char const*)); */
  363. /* int _filbuf P((FILE*)); *//* keeps lint quiet in traditional C */
  364. /* int _flsbuf P((int,FILE*)); *//* keeps lint quiet in traditional C */
  365. long pathconf P((char const*,int));
  366. ssize_t write P((int,void const*,size_t));
  367. #ifndef STDIN_FILENO
  368. #    define STDIN_FILENO 0
  369. #    define STDOUT_FILENO 1
  370. #    define STDERR_FILENO 2
  371. #endif
  372. #if has_fork
  373. #    if !has_vfork
  374. #        undef vfork
  375. #        define vfork fork
  376. #    endif
  377.     pid_t vfork P((void)); /* vfork is nonstandard but faster */
  378. #endif
  379. #if has_getcwd || !has_getwd
  380.     char *getcwd P((char*,size_t));
  381. #else
  382.     char *getwd P((char*));
  383. #endif
  384. #if has_getuid
  385.     uid_t getuid P((void));
  386. #endif
  387. #if has_readlink
  388.     ssize_t readlink P((char const*,char*,size_t)); /* BSD; not standard yet */
  389. #endif
  390. #if has_setuid
  391. #    if !has_seteuid
  392. #        undef seteuid
  393. #        define seteuid setuid
  394. #    endif
  395.     int seteuid P((uid_t));
  396.     uid_t geteuid P((void));
  397. #endif
  398. #if has_spawn
  399.     int spawnv P((int,char const*,char*const*));
  400. #    if ALL_ABSOLUTE
  401. #        define spawn_RCS spawnv
  402. #    else
  403. #        define spawn_RCS spawnvpq
  404.         int spawnvpq P((int,char const*,char*const*));
  405. #    endif
  406. #else
  407.     int execv P((char const*,char*const*));
  408. #    if ALL_ABSOLUTE
  409. #        define exec_RCS execv
  410. #    else
  411. #        define exec_RCS execvp
  412.         int execvp P((char const*,char*const*));
  413. #    endif
  414. #endif
  415.  
  416. /* utime.h */
  417. #if !has_utimbuf
  418.     struct utimbuf { time_t actime, modtime; };
  419. #endif
  420. int utime P((char const*,struct utimbuf const*));
  421.  
  422.  
  423. /* Standard C library */
  424. /* These definitions are for the benefit of hosts that have */
  425. /* traditional C include files, possibly with Standard C compilers.  */
  426. /* Unfortunately, mixed-up hosts are all too common.  */
  427.  
  428. /* <errno.h> */
  429. /* extern int errno; */
  430.  
  431. /* <signal.h> */
  432. #if has_signal
  433. /*     signal_type (*signal P((int,signal_type(*)signal_args)))signal_args; */
  434. #endif
  435.  
  436. /* <stdio.h> */
  437. /* FILE *fopen P((char const*,char const*)); */
  438. /* fread_type fread P((void*,freadarg_type,freadarg_type,FILE*)); */
  439. /* fread_type fwrite P((void const*,freadarg_type,freadarg_type,FILE*)); */
  440. int fclose P((FILE*));
  441. /* int feof P((FILE*)); */
  442. /* int ferror P((FILE*)); */
  443. int fflush P((FILE*));
  444. /* int fprintf P((FILE*,char const*,...)); */
  445. /* int fputs P((char const*,FILE*)); */
  446. int fseek P((FILE*,long,int));
  447. /* int printf P((char const*,...)); */
  448. /* int rename P((char const*,char const*)); */
  449. /* int sprintf P((char*,char const*,...)); */
  450. long ftell P((FILE*));
  451. /* void clearerr P((FILE*)); */
  452. /* void perror P((char const*)); */
  453. #ifndef L_tmpnam
  454. #define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  455. #endif
  456. #ifndef SEEK_SET
  457. #define SEEK_SET 0
  458. #endif
  459. #if has_mktemp
  460.     char *mktemp P((char*)); /* traditional */
  461. #else
  462.     char *tmpnam P((char*));
  463. #endif
  464. #if has_vfprintf
  465. /*     int vfprintf P((FILE*,char const*,va_list)); */
  466. #else
  467. #if has__doprintf
  468.     void _doprintf P((FILE*,char const*,va_list)); /* Minix */
  469. #else
  470.     void _doprnt P((char const*,va_list,FILE*)); /* BSD */
  471. #endif
  472. #endif
  473.  
  474. /* <stdlib.h> */
  475. /* char *getenv P((char const*)); */
  476. exiting void _exit P((int));
  477. exiting void exit P((int));
  478. malloc_type malloc P((size_t));
  479. malloc_type realloc P((malloc_type,size_t));
  480. void free P((malloc_type));
  481. #ifndef EXIT_FAILURE
  482. #define EXIT_FAILURE 1
  483. #endif
  484. #ifndef EXIT_SUCCESS
  485. #define EXIT_SUCCESS 0
  486. #endif
  487. #if !has_fork && !has_spawn
  488.     int system P((char const*));
  489. #endif
  490.  
  491. /* <string.h> */
  492. /* char *strcpy P((char*,char const*)); */
  493. /* char *strchr P((char const*,int)); */
  494. /* char *strrchr P((char const*,int)); */
  495. /* int memcmp P((void const*,void const*,size_t)); */
  496. /* int strcmp P((char const*,char const*)); */
  497. /* size_t strlen P((char const*)); */
  498. /* void *memcpy P((void*,void const*,size_t)); */
  499. #if has_memmove
  500. /*   void *memmove P((void*,void const*,size_t)); */
  501. #endif
  502.  
  503. /* <time.h> */
  504. time_t time P((time_t*));
  505.