home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rcs567s.zip / rcs / src / ms / conf.h next >
C/C++ Source or Header  |  1995-05-01  |  15KB  |  446 lines

  1. /* RCS compile-time configuration for DOS and OS/2 */
  2.  
  3.     /* $Id: conf.h,v 1.10 1992/07/28 16:12:44 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. #define readlink_isreg_errno EINVAL /* errno after readlink on regular file */
  40.  
  41. #if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
  42. #    if has_sys_param_h
  43. #        include <sys/param.h>
  44. #        define included_sys_param_h 1
  45. #    endif
  46. #    ifndef PATH_MAX
  47. #        ifndef MAXPATHLEN
  48. #            define MAXPATHLEN 1024
  49. #        endif
  50. #        define PATH_MAX (MAXPATHLEN-1)
  51. #    endif
  52. #endif
  53. #if has_readlink && !defined(MAXSYMLINKS)
  54. #    if has_sys_param_h && !included_sys_param_h
  55. #        include <sys/param.h>
  56. #    endif
  57. #    ifndef MAXSYMLINKS
  58. #        define MAXSYMLINKS 20 /* BSD; not standard yet */
  59. #    endif
  60. #endif
  61.  
  62. /* Comment out the typedefs below if the types are already declared.  */
  63. /* Fix any uncommented typedefs that are wrong.  */
  64. #ifndef _MODE_T
  65. typedef int mode_t;
  66. #endif
  67. /* typedef int pid_t; */
  68. /* typedef int sig_atomic_t; */
  69. /* typedef unsigned size_t; */
  70. #ifndef __EMX__
  71. typedef int ssize_t;
  72. #endif
  73. /* typedef long time_t; */
  74. /* typedef int uid_t; */
  75.  
  76. /* Comment out the keyword definitions below if the keywords work.  */
  77. #ifndef __EMX__
  78. #define const
  79. #endif
  80. /* #define volatile */
  81.  
  82. /* Define the following symbols to be 1 or 0.  */
  83. #define has_prototypes 1 /* Do function prototypes work?  */
  84. #define has_stdarg 1 /* Does <stdarg.h> work?  */
  85. #define has_varargs 0 /* Does <varargs.h> work?  */
  86. #define va_start_args 2 /* How many args does va_start() take?  */
  87. #if has_prototypes
  88. #    define P(params) params
  89. #else
  90. #    define P(params) ()
  91. #endif
  92. #if has_stdarg
  93. #    include <stdarg.h>
  94. #else
  95. #    if has_varargs
  96. #        include <varargs.h>
  97. #    else
  98.         typedef char *va_list;
  99. #        define va_dcl int va_alist;
  100. #        define va_start(ap) ((ap) = (va_list)&va_alist)
  101. #        define va_arg(ap,t) (((t*) ((ap)+=sizeof(t)))  [-1])
  102. #        define va_end(ap)
  103. #    endif
  104. #endif
  105. #if va_start_args == 2
  106. #    define vararg_start va_start
  107. #else
  108. #    define vararg_start(ap,p) va_start(ap)
  109. #endif
  110.  
  111. #define text_equals_binary_stdio 0 /* Does stdio treat text like binary?  */
  112. #define text_work_stdio 1 /* Text i/o for working file, binary for RCS file?  */
  113. #if text_equals_binary_stdio
  114.     /* Text and binary i/o behave the same, or binary i/o does not work.  */
  115. #    define FOPEN_R "r"
  116. #    define FOPEN_W "w"
  117. #    define FOPEN_WPLUS "w+"
  118. #    define OPEN_O_BINARY 0
  119. #else
  120.     /* Text and binary i/o behave differently.  */
  121.     /* This is incompatible with Posix and Unix.  */
  122. #    define FOPEN_R "rb"
  123. #    define FOPEN_W "wb"
  124. #    define FOPEN_WPLUS "w+b"
  125. #    define OPEN_O_BINARY O_BINARY
  126. #    ifndef O_BINARY
  127. #    define O_BINARY 0
  128. #    endif
  129. #endif
  130. #if text_work_stdio
  131. #    define FOPEN_R_WORK "r"
  132. #    define FOPEN_W_WORK "w"
  133. #    define FOPEN_WPLUS_WORK "w+"
  134. #    define OPEN_O_WORK 0
  135. #else
  136. #    define FOPEN_R_WORK FOPEN_R
  137. #    define FOPEN_W_WORK FOPEN_W
  138. #    define FOPEN_WPLUS_WORK FOPEN_WPLUS
  139. #    define OPEN_O_WORK OPEN_O_BINARY
  140. #endif
  141.  
  142. /* This may need changing on non-Unix systems (notably DOS).  */
  143. #define OPEN_CREAT_READONLY (S_IREAD) /* lock file mode */
  144. #define OPEN_O_LOCK 0 /* extra open flags for creating lock file */
  145.  
  146. /* Define or comment out the following symbols as needed.  */
  147. #if defined(__OS2__)
  148. #define OPEN_O_WRONLY O_WRONLY
  149. #define bad_chmod_close 0 /* Can chmod() close file descriptors?  */
  150. #define bad_creat0 0 /* Do writes fail after creat(f,0)?  */
  151. #else /* __MSDOS__ */
  152. #define OPEN_O_WRONLY O_RDWR
  153. #define bad_chmod_close 1 /* Can chmod() close file descriptors?  */
  154. #define bad_creat0 1 /* Do writes fail after creat(f,0)?  */
  155. #endif
  156. #define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f?  */
  157. #define getlogin_is_secure 1 /* Is getlogin() secure?  Usually it's not.  */
  158. #ifdef __EMX__
  159. #define has_attribute_noreturn 1 /* Does __attribute__((noreturn)) work?  */
  160. #else
  161. #define has_attribute_noreturn 0 /* Does __attribute__((noreturn)) work?  */
  162. #endif
  163. #if has_attribute_noreturn
  164. #    define exiting __attribute__((noreturn))
  165. #else
  166. #    define exiting
  167. #endif
  168. #define has_dirent 0 /* Do opendir(), readdir(), closedir() work?  */
  169. #define void_closedir 0 /* Does closedir() yield void?  */
  170. #define has_fchmod 0 /* Does fchmod() work?  */
  171. #define has_fflush_input 1 /* Does fflush() work on input files?  */
  172. #define has_fputs 1 /* Does fputs() work?  */
  173. #define has_ftruncate 0 /* Does ftruncate() work?  */
  174. #define has_getuid 0 /* Does getuid() work?  */
  175. #define has_getpwuid 0 /* Does getpwuid() work?  */
  176. #define has_memcmp 1 /* Does memcmp() work?  */
  177. #define has_memcpy 1 /* Does memcpy() work?  */
  178. #define has_memmove 1 /* Does memmove() work?  */
  179. #define has_madvise 0 /* Does madvise() work?  */
  180. #define has_mmap 0 /* Does mmap() work on regular files?  */
  181. /* typedef char *caddr_t; */ /* mmap argument type */
  182. #define mmap_signal SIGBUS /* signal received if you reference nonexistent part of mmapped file */
  183. #define has_rename 1 /* Does rename() work?  */
  184. #define bad_a_rename 1 /* Does rename(A,B) fail if A is unwritable?  */
  185. #define bad_b_rename 1 /* Does rename(A,B) fail if B is unwritable?  */
  186. /* typedef int void; */ /* Some ancient compilers need this.  */
  187. #define VOID (void) /* 'VOID e;' discards the value of an expression 'e'.  */
  188. #define has_seteuid 0 /* Does seteuid() work?  See README.  */
  189. #define has_setreuid 0 /* Does setreuid() work?  See INSTALL.  */
  190. #define has_setuid 0 /* Does setuid() exist?  */
  191. #define has_sigaction 0 /* Does struct sigaction work?  */
  192. #define has_signal 1 /* Does signal() work?  */
  193. #define signal_type void /* type returned by signal handlers */
  194. #define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()?  */
  195. #define has_sigblock 0 /* Does sigblock() work?  */
  196. /* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number.  */
  197. typedef ssize_t fread_type; /* type returned by fread() and fwrite() */
  198. typedef size_t freadarg_type; /* type of their size arguments */
  199. typedef void *malloc_type; /* type returned by malloc() */
  200. #define has_getcwd 1 /* Does getcwd() work?  */
  201. #define has_getwd 0 /* Does getwd() work?  */
  202. #define needs_getabsname 0 /* Must we define getabsname?  */
  203. #define has_mktemp 1 /* Does mktemp() work?  */
  204. #define has_NFS 1 /* Might NFS be used?  */
  205. #define has_psiginfo 0 /* Does psiginfo() work?  */
  206. #define has_psignal 0 /* Does psignal() work?  */
  207. #define has_sys_siglist 0 /* Does sys_siglist[] work?  */
  208. /* #define strchr index */ /* Use old-fashioned name for strchr()?  */
  209. /* #define strrchr rindex */ /* Use old-fashioned name for strrchr()?  */
  210. #define bad_unlink 1 /* Does unlink() fail on unwritable files?  */
  211. #define has_vfork 0 /* Does vfork() work?  */
  212. #define has_fork 0 /* Does fork() work?  */
  213. #define has_spawn 1 /* Does spawn*() work?  */
  214. #define has_waitpid 0 /* Does waitpid() work?  */
  215. /* #define RCS_SHELL getenv("COMSPEC") */ /* shell to run RCS subprograms */
  216. #define has_printf_dot 1 /* Does "%.2d" print leading 0?  */
  217. #define has_vfprintf 1 /* Does vfprintf() work?  */
  218. #ifdef __EMX__
  219. #define has_attribute_format_printf 1 /* emx uses gcc! */
  220. #else
  221. #define has_attribute_format_printf 0 /* Does __attribute__((format(printf,N,N+1))) work?  */
  222. #endif
  223. #if has_attribute_format_printf
  224. #    define printf_string(m, n) __attribute__((format(printf, m, n)))
  225. #else
  226. #    define printf_string(m, n)
  227. #endif
  228. #if has_attribute_format_printf && has_attribute_noreturn
  229.     /* Work around a bug in GCC 2.5.x.  */
  230. #    define printf_string_exiting(m, n) __attribute__((format(printf, m, n), noreturn))
  231. #else
  232. #    define printf_string_exiting(m, n) printf_string(m, n) exiting
  233. #endif
  234. #define has__doprintf 0 /* Does _doprintf() work?  */
  235. #define has__doprnt 0 /* Does _doprnt() work?  */
  236. /* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken.  */
  237. #ifdef __EMX__
  238. #define large_memory 1 /* Can main memory hold entire RCS files?  */
  239. #else
  240. #define large_memory 0 /* Can main memory hold entire RCS files?  */
  241. #endif
  242. #ifndef LONG_MAX
  243. #define LONG_MAX 2147483647L /* long maximum */
  244. #endif
  245. /* Do struct stat s and t describe the same file?  Answer d if unknown.  */
  246. #define same_file(s,t,d) (d)
  247. #define has_utimbuf 0 /* Does struct utimbuf work?  */
  248. #define CO "co.exe" /* name of 'co' program */
  249. #define COMPAT2 0 /* Are version 2 files supported?  */
  250. #define DIFF "diff.exe" /* name of 'diff' program */
  251. #define DIFF3 "diff3.exe" /* name of 'diff3' program */
  252. #define DIFF3_A 1 /* Does diff3 -A work?  */
  253. #define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)?  */
  254. #define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS.  */
  255. #define DIFF_L 1 /* Does diff -L work? */
  256. #define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
  257. #define DIFF_FAILURE 1 /* DIFF status if differences are found */
  258. #define DIFF_TROUBLE 2 /* DIFF status if trouble */
  259. /* #define ED "/bin/ed" */ /* name of 'ed' program (used only if !DIFF3_BIN) */
  260. #define MERGE "merge.exe" /* name of 'merge' program */
  261. #define TMPDIR "c:" /* default directory for temporary files */
  262. #define SLASH '/' /* principal pathname separator */
  263. #define SLASHes SLASH: case '\\' /* `case SLASHes:' labels all pathname separators */
  264. int isSLASH P((int));
  265. #define ROOTPATH(p) (isSLASH((p)[0]) || (p)[0] && (p)[1]==':') /* Is p an absolute pathname?  */
  266. #define X_DEFAULT "" /* default value for -x option */
  267. #define SLASHSLASH_is_SLASH 0 /* Are // and / the same directory?  */
  268. #define ALL_ABSOLUTE 0 /* Do all subprograms satisfy ROOTPATH?  */
  269. #define DIFF_ABSOLUTE 0 /* Is ROOTPATH(DIFF) true?  */
  270. /* #define SENDMAIL "/bin/mail" */ /* how to send mail */
  271. #define TZ_must_be_set 1 /* Must TZ be set for gmtime() to work?  */
  272.  
  273.  
  274.  
  275. /* Adjust the following declarations as needed.  */
  276.  
  277.  
  278. /* The rest is for the benefit of non-standard, traditional hosts.  */
  279. /* Don't bother to declare functions that in traditional hosts do not appear, */
  280. /* or are declared in .h files, or return int or void.  */
  281.  
  282.  
  283. /* traditional BSD */
  284.  
  285. #if has_sys_siglist && !defined(sys_siglist)
  286.     extern char const * const sys_siglist[];
  287. #endif
  288.  
  289.  
  290. /* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
  291.  
  292. /* <fcntl.h> */
  293. #ifdef O_CREAT
  294. #    define open_can_creat 1
  295. #else
  296. #    define open_can_creat 0
  297. #    define O_RDONLY 0
  298. #    define O_WRONLY 1
  299. #    define O_RDWR 2
  300. #    define O_CREAT 01000
  301. #    define O_TRUNC 02000
  302. #endif
  303. #ifndef O_EXCL
  304. #define O_EXCL 0
  305. #endif
  306.  
  307. /* <sys/stat.h> */
  308. #ifndef S_IRUSR
  309. #    ifdef S_IREAD
  310. #        define S_IRUSR S_IREAD
  311. #    else
  312. #        define S_IRUSR 0400
  313. #    endif
  314. #    ifdef S_IWRITE
  315. #        define S_IWUSR S_IWRITE
  316. #    else
  317. #        define S_IWUSR (S_IRUSR/2)
  318. #    endif
  319. #endif
  320. #ifndef S_IRGRP
  321. #    if has_getuid
  322. #        define S_IRGRP (S_IRUSR / 0010)
  323. #        define S_IWGRP (S_IWUSR / 0010)
  324. #        define S_IROTH (S_IRUSR / 0100)
  325. #        define S_IWOTH (S_IWUSR / 0100)
  326. #    else
  327.         /* single user OS -- not Posix or Unix */
  328. #        define S_IRGRP 0
  329. #        define S_IWGRP 0
  330. #        define S_IROTH 0
  331. #        define S_IWOTH 0
  332. #    endif
  333. #endif
  334. #ifndef S_ISREG
  335. #define S_ISREG(n) (! ((n)&S_IFDIR))
  336. #endif
  337.  
  338. /* <sys/wait.h> */
  339. #ifndef WEXITSTATUS
  340. #define WEXITSTATUS(stat_val) (stat_val)
  341. #undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  342. #endif
  343. #ifndef WIFEXITED
  344. #define WIFEXITED(stat_val) ((stat_val) != -1)
  345. #endif
  346. #ifndef WTERMSIG
  347. #define WTERMSIG(stat_val) ((stat_val) & 0177)
  348. #undef WIFSIGNALED /* Avoid 4.3BSD incompatibility with Posix.  */
  349. #endif
  350. #ifndef WIFSIGNALED
  351. #define WIFSIGNALED(stat_val) ((unsigned)(stat_val) - 1  <  0377)
  352. #endif
  353.  
  354. /* <unistd.h> */
  355. char *getlogin P((void));
  356. #ifndef STDIN_FILENO
  357. #    define STDIN_FILENO 0
  358. #    define STDOUT_FILENO 1
  359. #    define STDERR_FILENO 2
  360. #endif
  361. #if has_fork && !has_vfork
  362. #    undef vfork
  363. #    define vfork fork
  364. #endif
  365. #if has_getcwd || !has_getwd
  366. #    define getcwd(p,s) getcwdsl(p,s)
  367.     char *getcwdsl P((char*,size_t));
  368. #else
  369.     char *getwd P((char*));
  370. #endif
  371. #if has_setuid && !has_seteuid
  372. #    undef seteuid
  373. #    define seteuid setuid
  374. #endif
  375. #if has_spawn
  376. #    if ALL_ABSOLUTE
  377. #        define spawn_RCS spawnv
  378. #    else
  379. #           if defined(__EMX__) && defined(__OS2__)
  380. #        define spawn_RCS spawnvp
  381. #           else
  382. #        define spawn_RCS spawnvpq
  383.         int spawnvpq P((int,char const*,char*const*));
  384. #           endif
  385. #    endif
  386. #else
  387. #    if ALL_ABSOLUTE
  388. #        define exec_RCS execv
  389. #    else
  390. #        define exec_RCS execvp
  391. #    endif
  392. #endif
  393.  
  394. /* utime.h */
  395. #if !has_utimbuf
  396.     struct utimbuf { time_t actime, modtime; };
  397. #endif
  398.  
  399.  
  400. /* Standard C library */
  401.  
  402. /* <stdio.h> */
  403. #ifndef L_tmpnam
  404. #define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  405. #endif
  406. #ifndef SEEK_SET
  407. #define SEEK_SET 0
  408. #endif
  409. #ifndef SEEK_CUR
  410. #define SEEK_CUR 1
  411. #endif
  412. #if has_mktemp
  413.     char *mktemp P((char*)); /* traditional */
  414. #else
  415.     char *tmpnam P((char*));
  416. #endif
  417.  
  418. /* <stdlib.h> */
  419. /* char *getenv P((char const*)); */
  420. /* exiting void _exit P((int)); */
  421. /* exiting void exit P((int)); */
  422. malloc_type malloc P((size_t));
  423. malloc_type realloc P((malloc_type,size_t));
  424. void free P((malloc_type));
  425. #ifndef EXIT_FAILURE
  426. #define EXIT_FAILURE 1
  427. #endif
  428. #ifndef EXIT_SUCCESS
  429. #define EXIT_SUCCESS 0
  430. #endif
  431. #if !has_fork && !has_spawn
  432.     int system P((char const*));
  433. #endif
  434.  
  435. /* <string.h> */
  436. /* char *strcpy P((char*,char const*)); */
  437. /* char *strchr P((char const*,int)); */
  438. /* char *strrchr P((char const*,int)); */
  439. /* void *memcpy P((void*,void const*,size_t)); */
  440. #if has_memmove
  441. /*   void *memmove P((void*,void const*,size_t)); */
  442. #endif
  443.  
  444. /* <time.h> */
  445. time_t time P((time_t*));
  446.