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