home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / sources / conf.heg < prev    next >
Text File  |  1992-02-17  |  16KB  |  503 lines

  1. /* example RCS compile-time configuration */
  2.  
  3.     /* $Id: conf.heg,v 1.11 1992/02/17 23:02:09 eggert Exp $ */
  4.  
  5. /*
  6.  * This example RCS compile-time configuration describes a host that conforms
  7.  * to Standard C (1990) and Posix 1003.1-1990 and has GNU diff.
  8.  * If you can't get conf.sh to work as described in the Makefile,
  9.  * copy this file to conf.h and edit conf.h by hand; see README.
  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 1 /* Does stdio treat text like binary?  */
  118. #define text_work_stdio 0 /* 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 0 /* Is getlogin() secure?  Usually it's not.  */
  153. #define has_dirent 1 /* 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 1 /* Does getuid() work?  */
  158. #define has_getpwuid 1 /* 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 0 /* Does rename(A,B) fail if A is unwritable?  */
  166. #define bad_b_rename 0 /* 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 1 /* 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 1 /* 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 0 /* Does mktemp() work?  */
  184. #define has_NFS 0 /* 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 0 /* Does unlink() fail on unwritable files?  */
  188. #define has_vfork 0 /* Does vfork() work?  */
  189. #define has_fork 1 /* Does fork() work?  */
  190. #define has_spawn 0 /* Does spawn*() work?  */
  191. #define has_wait 1 /* Does wait() work?  */
  192. #define has_waitpid 1 /* Does waitpid() work?  */
  193. #define RCS_SHELL "/bin/sh" /* 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 1 /* Does struct utimbuf work?  */
  205. #define CO "/usr/local/bin/co" /* 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 "/usr/local/bin/diff" /* name of 'diff' program */
  209. #define DIFF3 "/usr/local/bin/diff3" /* 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 "/usr/local/bin/merge" /* name of 'merge' program */
  218. #define TMPDIR "/tmp" /* default directory for temporary files */
  219. #define SLASH '/' /* principal pathname separator */
  220. #define SLASHes '/' /* `case SLASHes:' labels all pathname separators */
  221. #define isSLASH(c) ((c) == SLASH) /* Is arg a pathname separator?  */
  222. #define ROOTPATH(p) isSLASH((p)[0]) /* Is p an absolute pathname?  */
  223. #define X_DEFAULT ",v/" /* default value for -x option */
  224. #define ALL_ABSOLUTE 1 /* Do all subprograms satisfy ROOTPATH?  */
  225. #define DIFF_ABSOLUTE 1 /* Is ROOTPATH(DIFF) true?  */
  226. #define SENDMAIL "/bin/mail" /* how to send mail */
  227. #define TZ_must_be_set 0 /* 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. FILE *fdopen P((int,char const*));
  303. int fileno P((FILE*));
  304.  
  305. /* <sys/stat.h> */
  306. int chmod P((char const*,mode_t));
  307. int fstat P((int,struct stat*));
  308. int stat P((char const*,struct stat*));
  309. #if has_fchmod
  310.     int fchmod P((int,mode_t));
  311. #endif
  312. #ifndef S_IRUSR
  313. #    ifdef S_IREAD
  314. #        define S_IRUSR S_IREAD
  315. #    else
  316. #        define S_IRUSR 0400
  317. #    endif
  318. #    ifdef S_IWRITE
  319. #        define S_IWUSR S_IWRITE
  320. #    else
  321. #        define S_IWUSR (S_IRUSR/2)
  322. #    endif
  323. #endif
  324. #ifndef S_IRGRP
  325. #    if has_getuid
  326. #        define S_IRGRP (S_IRUSR / 0010)
  327. #        define S_IWGRP (S_IWUSR / 0010)
  328. #        define S_IROTH (S_IRUSR / 0100)
  329. #        define S_IWOTH (S_IWUSR / 0100)
  330. #    else
  331.         /* single user OS -- not Posix or Unix */
  332. #        define S_IRGRP 0
  333. #        define S_IWGRP 0
  334. #        define S_IROTH 0
  335. #        define S_IWOTH 0
  336. #    endif
  337. #endif
  338. #ifndef S_ISREG
  339. #define S_ISREG(n) (((n) & S_IFMT) == S_IFREG)
  340. #endif
  341.  
  342. /* <sys/wait.h> */
  343. #if has_wait
  344.     pid_t wait P((int*));
  345. #endif
  346. #ifndef WEXITSTATUS
  347. #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  348. #undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  349. #endif
  350. #ifndef WIFEXITED
  351. #define WIFEXITED(stat_val) (!((stat_val) & 255))
  352. #endif
  353.  
  354. /* <unistd.h> */
  355. char *getlogin P((void));
  356. int close P((int));
  357. int isatty P((int));
  358. int link P((char const*,char const*));
  359. int open P((char const*,int,...));
  360. int unlink P((char const*));
  361. /* int _filbuf P((FILE*)); *//* keeps lint quiet in traditional C */
  362. /* int _flsbuf P((int,FILE*)); *//* keeps lint quiet in traditional C */
  363. long pathconf P((char const*,int));
  364. ssize_t write P((int,void const*,size_t));
  365. #ifndef STDIN_FILENO
  366. #    define STDIN_FILENO 0
  367. #    define STDOUT_FILENO 1
  368. #    define STDERR_FILENO 2
  369. #endif
  370. #if has_fork
  371. #    if !has_vfork
  372. #        undef vfork
  373. #        define vfork fork
  374. #    endif
  375.     pid_t vfork P((void)); /* vfork is nonstandard but faster */
  376. #endif
  377. #if has_getcwd || !has_getwd
  378.     char *getcwd P((char*,size_t));
  379. #else
  380.     char *getwd P((char*));
  381. #endif
  382. #if has_getuid
  383.     uid_t getuid P((void));
  384. #endif
  385. #if has_readlink
  386.     ssize_t readlink P((char const*,char*,size_t)); /* BSD; not standard yet */
  387. #endif
  388. #if has_setuid
  389. #    if !has_seteuid
  390. #        undef seteuid
  391. #        define seteuid setuid
  392. #    endif
  393.     int seteuid P((uid_t));
  394.     uid_t geteuid P((void));
  395. #endif
  396. #if has_spawn
  397.     int spawnv P((int,char const*,char*const*));
  398. #    if ALL_ABSOLUTE
  399. #        define spawn_RCS spawnv
  400. #    else
  401. #        define spawn_RCS spawnvp
  402.         int spawnvp P((int,char const*,char*const*));
  403. #    endif
  404. #else
  405.     int execv P((char const*,char*const*));
  406. #    if ALL_ABSOLUTE
  407. #        define exec_RCS execv
  408. #    else
  409. #        define exec_RCS execvp
  410.         int execvp P((char const*,char*const*));
  411. #    endif
  412. #endif
  413.  
  414. /* utime.h */
  415. #if !has_utimbuf
  416.     struct utimbuf { time_t actime, modtime; };
  417. #endif
  418. int utime P((char const*,struct utimbuf const*));
  419.  
  420.  
  421. /* Standard C library */
  422. /* These definitions are for the benefit of hosts that have */
  423. /* traditional C include files, possibly with Standard C compilers.  */
  424. /* Unfortunately, mixed-up hosts are all too common.  */
  425.  
  426. /* <errno.h> */
  427. extern int errno;
  428.  
  429. /* <signal.h> */
  430. #if has_signal
  431.     signal_type (*signal P((int,signal_type(*)signal_args)))signal_args;
  432. #endif
  433.  
  434. /* <stdio.h> */
  435. FILE *fopen P((char const*,char const*));
  436. fread_type fread P((void*,freadarg_type,freadarg_type,FILE*));
  437. fread_type fwrite P((void const*,freadarg_type,freadarg_type,FILE*));
  438. int fclose P((FILE*));
  439. int feof P((FILE*));
  440. int ferror P((FILE*));
  441. int fflush P((FILE*));
  442. int fprintf P((FILE*,char const*,...));
  443. int fputs P((char const*,FILE*));
  444. int fseek P((FILE*,long,int));
  445. int printf P((char const*,...));
  446. int rename P((char const*,char const*));
  447. int sprintf P((char*,char const*,...));
  448. long ftell P((FILE*));
  449. void clearerr P((FILE*));
  450. void perror P((char const*));
  451. #ifndef L_tmpnam
  452. #define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  453. #endif
  454. #ifndef SEEK_SET
  455. #define SEEK_SET 0
  456. #endif
  457. #if has_mktemp
  458.     char *mktemp P((char*)); /* traditional */
  459. #else
  460.     char *tmpnam P((char*));
  461. #endif
  462. #if has_vfprintf
  463.     int vfprintf P((FILE*,char const*,va_list));
  464. #else
  465. #if has__doprintf
  466.     void _doprintf P((FILE*,char const*,va_list)); /* Minix */
  467. #else
  468.     void _doprnt P((char const*,va_list,FILE*)); /* BSD */
  469. #endif
  470. #endif
  471.  
  472. /* <stdlib.h> */
  473. char *getenv P((char const*));
  474. exiting void _exit P((int));
  475. exiting void exit P((int));
  476. malloc_type malloc P((size_t));
  477. malloc_type realloc P((malloc_type,size_t));
  478. void free P((malloc_type));
  479. #ifndef EXIT_FAILURE
  480. #define EXIT_FAILURE 1
  481. #endif
  482. #ifndef EXIT_SUCCESS
  483. #define EXIT_SUCCESS 0
  484. #endif
  485. #if !has_fork && !has_spawn
  486.     int system P((char const*));
  487. #endif
  488.  
  489. /* <string.h> */
  490. char *strcpy P((char*,char const*));
  491. char *strchr P((char const*,int));
  492. char *strrchr P((char const*,int));
  493. int memcmp P((void const*,void const*,size_t));
  494. int strcmp P((char const*,char const*));
  495. size_t strlen P((char const*));
  496. void *memcpy P((void*,void const*,size_t));
  497. #if has_memmove
  498.     void *memmove P((void*,void const*,size_t));
  499. #endif
  500.  
  501. /* <time.h> */
  502. time_t time P((time_t*));
  503.