1 /************************************************************************ 2 * This program is Copyright (C) 1986-1996 by Jonathan Payne. JOVE is * 3 * provided to you without charge, and with no warranty. You may give * 4 * away copies of JOVE, including sources, provided that this notice is * 5 * included in all the files. * 6 ************************************************************************/ 7 8 /* 9 * System Feature Selection: describe OS and C system to JOVE. See sysdep.doc 10 * for a better description of what the different #define feature symbols 11 * mean. If you add new ones, please keep the syntax of the first #ifdef, so 12 * that "grep System: sysdep.h" catches the first line of all symbols. 13 */ 14 15 /* System: Solaris 2.0, SunOS 5.0 -- use SYSVR4 and GRANTPT_BUG */ 16 17 /* System: Solaris 2.x, SunOS 5.x -- use SYSVR4 */ 18 19 #ifdef SUNOS41 /* System: SunOS4.1 to 4.1.3 */ 20 # define TERMIOS 1 21 # define USE_GETCWD 1 22 # define POSIX_UNISTD 1 23 # define USE_SELECT 1 24 # define PTYPROCS 1 25 # define BSD_PTYS 1 26 # define POSIX_PROCS 1 27 # define BSD_SIGS 1 28 # define JOB_CONTROL 1 29 # define BSD_SETPGRP 1 30 # define USE_KILLPG 1 31 # define USE_GETPWNAM 1 32 # define USE_GETHOSTNAME 1 33 # define NO_STRERROR 1 34 # define USE_FSYNC 1 35 # define USE_FSTAT 1 36 # define USE_FCHMOD 1 37 # define USE_CTYPE 1 38 #endif 39 40 #ifdef SUNOS40 /* System: SunOS4.0 to 4.0.3c */ 41 /* Almost identical to SUNOS41, main difference is that SUNOS41 uses 42 * POSIX_PROCS, this one uses BSD_WAIT/WAIT3, USE_MEMORY_H. 43 * Beware: TERMIO under SunOS 4.0 does not allow VSUSP to be changed, 44 * so we cannot use it. 45 */ 46 /* try to patch over <termios.h> problems */ 47 # define TERMIOS 1 48 # define setsid() /* SunOS 4.0 apparently has no concept of session */ 49 # define cfgetospeed(p) (CBAUD & (p)->c_cflag) 50 # define tcgetattr(fd, p) ioctl((fd), TCGETS, (UnivPtr)(p)) 51 # define tcsetattr(fd, oa, p) ioctl((fd), (oa), (UnivPtr)(p)) 52 /* fake values for "optional_actions" (oa) arg to tcsetattr */ 53 # define TCSANOW TCSETS 54 # define TCSADRAIN TCSETSW 55 # define TCSAFLUSH TCSETSF 56 /* end of <termios.h> patches */ 57 58 # define USE_GETCWD 1 59 # define USE_SELECT 1 60 # define PTYPROCS 1 61 # define BSD_PTYS 1 62 # define BSD_WAIT 1 63 # define WAIT3 1 64 # define BSD_SIGS 1 65 # define JOB_CONTROL 1 66 # define USE_VFORK 1 67 # define BSD_SETPGRP 1 68 # define USE_KILLPG 1 69 # define USE_GETPWNAM 1 70 # define USE_GETHOSTNAME 1 71 # define NO_STRERROR 1 72 # define USE_FSYNC 1 73 # define USE_FSTAT 1 74 # define USE_FCHMOD 1 75 # define USE_MEMORY_H 1 76 #endif 77 78 #ifdef SUNOS3 /* System: SunOS before 4.0, eg. 3.5. not recently tested */ 79 /* This is very close to BSD4 */ 80 # define SGTTY 1 81 # define USE_GETWD 1 82 # define USE_SELECT 1 83 # define PTYPROCS 1 84 # define BSD_PTYS 1 85 # define BSD_WAIT 1 86 # define WAIT3 1 87 # define BSD_SIGS 1 88 # define JOB_CONTROL 1 89 # define USE_VFORK 1 90 # define BSD_SETPGRP 1 91 # define USE_KILLPG 1 92 # define BSD_DIR 1 93 # define USE_GETPWNAM 1 94 # define SIGRESTYPE int 95 # define SIGRESVALUE 0 96 # define USE_GETHOSTNAME 1 97 # define NO_STRERROR 1 98 # define USE_FSYNC 1 99 # define USE_FSTAT 1 100 # define USE_FCHMOD 1 101 /* # define USE_BCOPY 1 */ 102 /* # define USE_INDEX 1 */ 103 #endif 104 105 #ifdef AIX3_2 /* System: IBM RS6000 running AIX 3.2 */ 106 # define AIX 1 107 # define FULL_UNISTD 1 108 # define USE_GETWD 1 109 # define TERMIOS 1 /* uses termio struct for terminal modes */ 110 # define USE_UNAME 1 111 # define USE_SELECT 1 112 # define USE_SELECT_H 1 113 # define PTYPROCS 1 114 # define BSD_PTYS 1 115 # define NO_EOF_FROM_PTY 1 /* BUG! */ 116 # define POSIX_PROCS 1 117 # define WAIT3 1 118 # define POSIX_SIGS 1 119 # define JOB_CONTROL 1 120 # define USE_GETPWNAM 1 121 # define USE_UNAME 1 122 # define USE_FSYNC 1 123 # define USE_FSTAT 1 124 # define USE_FCHMOD 1 125 # define USE_CTYPE 1 126 #endif 127 128 #ifdef __QNX__ /* System: QNX OS for x86 family */ 129 /* Note: this must be placed before BSDPOSIX ifdef (we define BSDPOSIX). */ 130 # define BSDPOSIX 1 131 # define ONLCR OPOST /* how to do ONLCR */ 132 # define USE_SELECT_H 1 133 #endif 134 135 #ifdef BSDPOSIX /* System: Posix system with BSD flavouring for ptys */ 136 /* System: BSDI, 386BSD, BSD4.4, NetBSD -- BSDPOSIX */ 137 /* System: DEC Ultrix 4.2 -- BSDPOSIX */ 138 /* System: DEC OSF/1 V1.3 -- BSDPOSIX + NO_TIOCREMOTE + NO_TIOCSIGNAL */ 139 /* System: LINUX (MCC-Interim release) -- BSDPOSIX */ 140 /* Also seems to work for SunOS4.1.3! */ 141 # define TERMIOS 1 142 # define USE_GETCWD 1 143 # define FULL_UNISTD 1 144 # define USE_SELECT 1 145 # define PTYPROCS 1 146 # define BSD_PTYS 1 147 # define POSIX_PROCS 1 148 # define POSIX_SIGS 1 149 # define JOB_CONTROL 1 150 # define BSD_SETPGRP 1 151 # define USE_KILLPG 1 152 # define USE_GETPWNAM 1 153 # define USE_GETHOSTNAME 1 154 # define USE_FSYNC 1 155 # define USE_FSTAT 1 156 # define USE_FCHMOD 1 157 # define USE_CTYPE 1 158 #endif 159 160 #ifdef IRIX 161 # define _BSD_COMPAT 1 /* Turn on BSD setpgrp and other neat things */ 162 # define TERMIOS 1 163 # define USE_GETCWD 1 164 # define FULL_UNISTD 1 165 # define USE_SELECT 1 166 # define PTYPROCS 1 167 # define POSIX_PROCS 1 168 # define POSIX_SIGS 1 169 # define JOB_CONTROL 1 170 # ifdef IRIX4 171 /* Should work for IRIX 4.0.4 back to 3.2 or 3.3. This is a Posix system 172 * with its own way of doing PTYS. Older versions may need MIPS_CC_BUG 173 * defined as well. 174 */ 175 # define IRIX_PTYS 1 176 # define NO_TIOCREMOTE 1 177 # define SIGRESTYPE int 178 # define SIGRESVALUE 0 179 # else 180 /* IRIX 5 and later */ 181 # define SVR4_PTYS 1 182 # define NO_TIOCREMOTE 1 183 # define NO_TIOCSIGNAL 1 184 # define SIGRESTYPE void 185 # define SIGRESVALUE /*void!*/ 186 # endif 187 # define BSD_SETPGRP 1 188 # define USE_GETPWNAM 1 189 # define USE_KILLPG 1 190 # define USE_GETHOSTNAME 1 191 # define USE_CTYPE 1 192 #endif 193 194 #ifdef SYSVR4 /* System: System V, Release 4 and derivatives */ 195 /* System: Consensys V4 -- use SYSVR4 and GRANTPT_BUG */ 196 /* System: DEC OSF/1 V2.0 or later -- use SYSVR4 */ 197 /* System: DEC OSF R1.3MK -- use SYSVR4 */ 198 /* System: Solaris 2.0, SunOS 5.0 -- use SYSVR4 and GRANTPT_BUG */ 199 /* System: Solaris 2.x, SunOS 5.x -- use SYSVR4 */ 200 /* Note: some versions of System V Release 4 have a bug in that affects 201 * interactive processes. Examples include Consensys V4 and SunOS 5.0 202 * also known as Solaris 5.0. See the description of GRANTPT_BUG in 203 * sysdep.doc 204 */ 205 # define TERMIOS 1 206 # define USE_GETCWD 1 207 # define FULL_UNISTD 1 208 # define USE_SELECT 1 209 # define PTYPROCS 1 210 # define SVR4_PTYS 1 211 # define POSIX_PROCS 1 212 # define POSIX_SIGS 1 213 # define JOB_CONTROL 1 214 # define USE_UNAME 1 215 # define USE_GETPWNAM 1 216 # define USE_FSYNC 1 217 # define USE_FSTAT 1 218 # define USE_FCHMOD 1 219 # define REALSTDC 1 220 # define USE_CTYPE 1 221 #endif 222 223 #ifdef HPUX /* System: Hewlett-Packard HP-UX 9.01 */ 224 # define TERMIOS 1 225 # define USE_BSDTTYINCLUDE 1 /* No other way to turn off ^Y */ 226 # define USE_GETCWD 1 227 # define FULL_UNISTD 1 228 # define USE_SELECT 1 229 # define PTYPROCS 1 230 # define BSD_PTYS 1 231 # define POSIX_PROCS 1 232 # define NO_EOF_FROM_PTY 1 /* BUG! */ 233 # define POSIX_SIGS 1 234 # define JOB_CONTROL 1 235 # define USE_UNAME 1 236 # define DEFINE_PC_BC_UP_OSPEED 1 /* May be needed for all SYSVR2 */ 237 #endif 238 239 #ifdef BSD4 /* System: Berkeley BSD4.x, 2.9, 2.10, MIPS RiscOS 4.x */ 240 /* MIPS needs -systype bsd43, older releases (before 4.50?) may need 241 * MIPS_CC_BUG defined as well. 242 */ 243 # define SGTTY 1 244 # define USE_GETWD 1 245 # define USE_SELECT 1 246 # define PTYPROCS 1 247 # define BSD_PTYS 1 248 # define BSD_WAIT 1 249 # define WAIT3 1 250 # define BSD_SIGS 1 251 # define JOB_CONTROL 1 252 # define USE_VFORK 1 253 # define BSD_SETPGRP 1 254 # define USE_KILLPG 1 255 # define BSD_DIR 1 256 # define SIGRESTYPE int 257 # define SIGRESVALUE 0 258 # define USE_GETHOSTNAME 1 259 # define NO_STRERROR 1 260 # define USE_FSYNC 1 261 # define USE_FSTAT 1 262 # define USE_FCHMOD 1 263 # define USE_BCOPY 1 264 # define USE_INDEX 1 265 #endif 266 267 #ifdef SCO /* System: SCO ODT 3.0 */ 268 # define TERMIOS 1 269 # define FULLUNISTD 1 270 # define USE_GETCWD 1 271 # define POSIX_UNISTD 1 272 # define USE_SELECT 1 273 # define PTYPROCS 1 274 # define BSD_PTYS 1 275 # define POSIX_PROCS 1 276 # define JOB_CONTROL 1 277 # define USE_UNAME 1 278 /* In SCO ODT 3.0, a wait() will never finish if SIGCHLD is being held. 279 * We think that this is a bug. It's rumoured to be "fixed" in the next 280 * release. JOVE's IPROCS code no longer triggers this bug. 281 */ 282 # define PTYPROCS 1 283 # define USE_CTYPE 1 284 #endif 285 286 #ifdef _MSC_VER /* System: Microsoft C for the IBM-PC under MSDOS or WIN32 */ 287 # if defined(_WIN32) && !defined(WIN32) 288 # define WIN32 _WIN32 289 # endif 290 # ifdef WIN32 291 # define WINRESIZE 1 292 # else /* ! WIN32 => MSDOS */ 293 # define IBMPCDOS 1 294 # define MALLOC_CACHE 1 /* DGROUP gets full otherwise */ 295 # if defined(M_I86LM) /* large memory model */ 296 # define NBUF 62 /* NBUF*JBUFSIZ must be less than 64 kB */ 297 # else 298 # define NBUF 3 299 # define FAR_LINES 1 /* to squeeze larger files, distance Lines */ 300 # endif 301 # endif 302 # define REALSTDC 1 /* MS C only defines __STDC__ if you use /Za */ 303 #endif 304 305 #ifdef ZTCDOS /* System: Zortech C V3.0 for the IBM-PC under MSDOS */ 306 # define IBMPCDOS 1 307 # define getch jgetch /* UGH! Zortech steals from our namespace. */ 308 # define MALLOC_CACHE 1 /* DGROUP gets full otherwise */ 309 # define REALSTDC 1 /* close enough for us, but ZTCDOS doesn't define __STDC__ */ 310 # ifdef M_I86LM /* large memory model */ 311 # define NBUF 62 /* NBUF*JBUFSIZ must be less than 64 kB */ 312 # else 313 # define NBUF 3 314 # define FAR_LINES 1 /* to squeeze larger files, distance Lines */ 315 # endif 316 /* (1) specify stack size, and 317 * (2) request support of wildcards in command-line args (UGH!) 318 */ 319 # define STACK_DECL unsigned int _stack = 0x2000; WILDCARDS 320 # define dostime_t dos_time_t /* is Zortech out of step? */ 321 # define _dos_gettime dos_gettime 322 #endif 323 324 #if defined(__WATCOMC__) && defined(MSDOS) /* System: Watcom C V10.0 for the IBM-PC under MSDOS */ 325 # define IBMPCDOS 1 326 # define MALLOC_CACHE 1 /* DGROUP gets full otherwise */ 327 # define REALSTDC 1 /* close enough for us, but ZTCDOS doesn't define __STDC__ */ 328 # ifdef M_I86LM /* large memory model */ 329 # define NBUF 62 /* NBUF*JBUFSIZ must be less than 64 kB */ 330 # else 331 # define NBUF 3 332 # define FAR_LINES 1 /* to squeeze larger files, distance Lines */ 333 # endif 334 #endif 335 336 #ifdef __BORLANDC__ /* System: Borland C/C++ (v3.1) for the IBM-PC under MSDOS */ 337 # define IBMPCDOS 1 338 # define MALLOC_CACHE 1 /* DGROUP gets full otherwise */ 339 # define REALSTDC 1 /* close enough for us, but not strict ANSI */ 340 # ifdef __LARGE__ 341 # define NBUF 62 /* NBUF*JBUFSIZ must be less than 64 kB */ 342 # define FAR_LINES 1 /* to squeeze larger files, distance Lines */ 343 # else 344 # ifdef __MEDIUM__ 345 # define NBUF 3 346 # define FAR_LINES 1 /* to squeeze larger files, distance Lines */ 347 # endif 348 # endif 349 # define STACK_DECL unsigned int _stklen = 0x2000; /* Borland's way of specifying stack size */ 350 #endif 351 352 /* All the systems marked with XXX_ are ones that this version of Jove (4.16) 353 * has not been tested on. 4.15 was the transition from implicit #ifdefs 354 * scattered throughout the code to feature-based ifdefs that MUST be 355 * enabled in sysdep.h. The #ifdef XXX_* below have been left in to provide a 356 * guide to re-porting this version to those architectures. If you do so 357 * successfully, please send a copy of these changes to 358 * jovehacks@cs.toronto.edu and we'll try to incorporate those changes above 359 * and get rid of the XXX_. 360 */ 361 362 #ifdef XXX_M_XENIX /* System: Microsoft or SCO Xenix */ 363 /* #define NBUF 48 */ /* if we are on a 286, NBUF*JBUFSIZ must be less than 64 kB */ 364 # define BSD_DIR 1 365 #endif 366 367 #ifdef XXX_SYSV /* System: System V Rel. 2, System III */ 368 # define TERMIO 1 369 # define USE_PWD 370 # define NONBLOCKINGREAD 1 371 # define USE_MEMORY_H 1 372 # define DIRENT_EMULATE 1 /* for truly old versions? */ 373 #endif 374 375 #ifdef XXX_A_UX /* System: A/UX on a MacII (Do *not* define "MAC") */ 376 /* It might be better to try BSDPOSIX for newer A/UX. */ 377 # define BSD_WAIT 1 378 # define BSD_DIR 1 379 # define WAIT3 1 380 # define BSD_SIGS 1 /* ??? */ 381 # define USE_KILLPG 1 382 # define TERMIO 1 /* uses termio struct for terminal modes */ 383 # define USE_GETHOSTNAME 1 384 # define USE_SELECT 1 385 #endif 386 387 #ifdef XXX_OLDMIPS /* System: MIPS-SYSV, Irix before 3.3. */ 388 /* Older MIPS (UMIPS-SYSV, anything other than their 4.3 port before 389 * RISCOS4.x) and SGI 4D OSes (anything before Irix3.3) have BSD style wait, 390 * and directory routines if you link -lbsd and define -I/usr/include/bsd on 391 * the compile line. But they have SysV style signals. Jove was ported to the 392 * SGI 68K boxes once, but it the mods seem to have been lost. 393 */ 394 # define BSD_WAIT 1 /* Berkeley style sys/wait.h */ 395 # define BSD_DIR 1 /* Berkeley style dirent routines */ 396 #endif 397 398 #ifdef XXX_MSC51 /* System: Microsoft C 5.1 on IBM PC under DOS*/ 399 /* This hasn't been tested recently. Consider stealing ZTCDOS settings. */ 400 # define IBMPCDOS 1 401 # define NO_PTRPROTO 1 402 # define REALSTDC 1 /* well, almost */ 403 # ifdef M_I86LM /* large memory model */ 404 # define NBUF 62 /* NBUF*JBUFSIZ must be less than 64 kB */ 405 # else 406 # define SMALL 1 407 # endif 408 #endif 409 410 #ifdef THINK_C /* System: Think C version 5.0 on the Macintosh */ 411 # define MAC 1 412 # define REALSTDC 1 /* we hope */ 413 # define MALLOC_CACHE 1 /* Only 32K of static space on Mac, so... */ 414 typedef long off_t; 415 # define USE_GETCWD 1 416 # define USE_INO 1 /* we fake it */ 417 typedef int dev_t; 418 typedef int ino_t; 419 # define DIRECTORY_ADD_SLASH 1 420 # define EOL '\r' /* end-of-line character for files */ 421 # define WINRESIZE 1 422 # define AUTO_BUFS 1 /* slim down data segment */ 423 #endif 424 425 /**************** Common Characteristics ****************/ 426 427 #ifdef pdp11 428 /* On the PDP-11, UNIX allocates at least 8K for the stack. 429 * In order not to waste this space, we allocate 430 * a bunch of buffers as autos. 431 */ 432 # define AUTO_BUFS 1 433 #endif 434 435 #ifdef IBMPCDOS /* Common characteristics for IBM-PC MS-DOS systems. */ 436 # ifndef MSDOS 437 # define MSDOS 1 438 # endif 439 # define PCNONASCII 0xFF /* prefix for peculiar IBM PC key codes */ 440 # define NO_JSTDOUT 1 /* don't use jstdout */ 441 # define CODEPAGE437 1 /* Code Page 437 English display characters */ 442 # define PCSCRATTR 1 /* exploit IBMPC screen attributes */ 443 # define HIGHLIGHTING 1 /* highlighting is used for mark and scrollbar */ 444 #endif 445 446 #ifdef MSDOS /* Common characteristics for MS-DOS systems. */ 447 # define MSDOS_PROCS 1 /* spawn et al */ 448 # define FILENAME_CASEINSENSITIVE 1 449 # define USE_CRLF 1 450 # define DIRECTORY_ADD_SLASH 1 451 # define MSFILESYSTEM 1 452 #endif 453 454 #ifdef WIN32 /* Common characteristics for WIN32 systems. */ 455 # define PCNONASCII 0xFF /* prefix for peculiar IBM PC key codes */ 456 # define NO_JSTDOUT 1 /* don't use jstdout */ 457 # define CODEPAGE437 1 /* Code Page 437 English display characters */ 458 # define PCSCRATTR 1 /* exploit IBMPC screen attributes */ 459 # define HIGHLIGHTING 1 /* highlighting is used for mark and scrollbar */ 460 # define MSDOS_PROCS 1 /* spawn et al */ 461 # define FILENAME_CASEINSENSITIVE 1 462 # define USE_CRLF 1 463 # define DIRECTORY_ADD_SLASH 1 464 # define MSFILESYSTEM 1 465 #endif 466 467 /* The operating system (MSDOS, WIN32, or MAC) must be defined by this point. */ 468 #if !(defined(MSDOS) || defined(WIN32) || defined(MAC)) 469 # define UNIX 1 /* default to UNIX */ 470 #endif 471 472 #ifdef UNIX /* Common characteristics for UNIX systems. */ 473 /* Our defaults tend to be conservative and lean towards pure SYSV */ 474 # define USE_INO 1 475 # define TERMCAP 1 476 # define WINRESIZE 1 477 # define MOUSE 1 478 # if !(defined(NO_IPROCS) || defined(PIPEPROCS) || defined(PTYPROCS)) 479 # define PIPEPROCS 1 /* use pipes */ 480 # endif 481 # if !defined(TERMIOS) && !defined(SGTTY) 482 # define TERMIO 1 /* uses termio struct for terminal modes */ 483 # endif 484 /* At the moment, the PTY code mandates having select(). One day, this might 485 * change. 486 */ 487 # if defined(PTYPROCS) && !defined(USE_SELECT) 488 sysdep.h: Sorry, PTYPROCS requires the select() system call. You must 489 either define USE_SELECT or undefine PTYPROCS. 490 # endif 491 # if defined(SIGCLD) && !defined(SIGCHLD) 492 # define SIGCHLD SIGCLD 493 # endif 494 #endif /* UNIX */ 495 496 /************************************************************************* 497 * 498 * The things below here aren't meant to be tuned, but are included here 499 * because they're dependent on the things defined earlier in the file. 500 */ 501 #ifdef USE_BCOPY 502 # define byte_copy(from, to, len) bcopy((UnivConstPtr)(from), (UnivPtr)(to), (size_t)(len)) 503 # define byte_zero(s, n) bzero((UnivPtr)(s), (size_t)(n)) 504 #endif 505 506 #ifndef byte_copy 507 # ifdef USE_MEMORY_H 508 # include <memory.h> 509 # endif 510 # define byte_copy(from, to, count) memcpy((UnivPtr)(to), (UnivConstPtr)(from), (size_t)(count)) 511 # define byte_zero(s, n) memset((UnivPtr)(s), 0, (size_t)(n)) 512 #endif 513 514 #ifdef USE_INDEX 515 # define strchr index 516 # define strrchr rindex 517 #endif 518 519 #ifdef FULL_UNISTD 520 # define POSIX_UNISTD 1 521 #endif 522 523 /* SSIZE_T: result type of read() and write() */ 524 #ifdef FULL_UNISTD 525 # define SSIZE_T ssize_t 526 #endif 527 528 #ifndef SSIZE_T 529 # define SSIZE_T int 530 #endif 531 532 /* Determine if really ANSI C */ 533 #ifdef __STDC__ 534 # if __STDC__ > 0 535 # define REALSTDC 1 536 # endif 537 #endif 538 539 /* Determine number of buffers and the size of a buffer 540 * (and hence the maximum length of a line, among other things). 541 */ 542 543 #ifdef SMALL 544 # ifndef NBUF 545 # define NBUF 3 546 # endif 547 # ifndef JLGBUFSIZ 548 # define JLGBUFSIZ 9 549 # endif 550 #endif 551 552 #ifndef NBUF 553 # define NBUF 64 554 #endif 555 556 #ifndef JLGBUFSIZ 557 # define JLGBUFSIZ 10 558 #endif 559 560 #define JBUFSIZ (1<<JLGBUFSIZ) 561 562 563 #ifndef NCHARS 564 # define NCHARS 0400 565 #endif 566 567 #ifndef EOL 568 # define EOL '\n' /* end-of-line character for files */ 569 #endif 570 571 #ifndef MSDOS /* maximum path length (including '\0') */ 572 # define FILESIZE 256 573 #else /* MSDOS */ 574 # define FILESIZE 128 /* currently, 2+1+64+3+1+3+1 == 80 ought to be OK */ 575 #endif /* MSDOS */ 576 577 #ifndef SIGRESTYPE /* default to void, correct for most modern systems */ 578 # define SIGRESTYPE void 579 # define SIGRESVALUE /*void!*/ 580 #endif 581 582 /* daddr: tmp file index type (see temp.h) 583 * 584 * On a system which limits JOVE to a very small data segment, 585 * it may be worthwhile limiting daddr to a short. This reduces 586 * the size of a Line descriptor, but reduces the addressable size 587 * of the temp file. This is reasonable on a PDP-11 and perhaps 588 * an iAPX*86. 589 * NOTE: logically, daddr is unsigned, but a signed type will work 590 * if you cannot use an unsigned type. 591 */ 592 593 #ifdef SMALL 594 typedef unsigned short daddr; 595 #else 596 typedef unsigned long daddr; 597 #endif /* SMALL */ 598 599 #define NULL_DADDR ((daddr) 0) 600 601 #ifndef CHAR_BITS 602 # define CHAR_BITS 8 /* factor to convert sizeof => bits */ 603 #endif 604 605 #define DDIRTY ((daddr)1 << (sizeof(daddr)*CHAR_BITS - 1)) /* daddr dirty flag */ 606