COMPLETE.T
资源名称:os_source.zip [点击查看]
上传用户:datang2001
上传日期:2007-02-01
资源大小:53269k
文件大小:2535k
源码类别:
操作系统开发
开发平台:
C/C++
- .fp 5 CW LucidaT ." To use a font other than Lucida, change 'LucidaT'
- .po .9i
- .lg 0
- .nf
- .ec `
- .ps 7
- .vs 9
- .lt 5.25i
- `f5
- .nr Tb `w'0'
- .nr Fp 0
- .ta 9u*`n(Tbu 17u*`n(Tbu 25u*`n(Tbu 33u*`n(Tbu 41u*`n(Tbu 49u*`n(Tbu 57u*`n(Tbu 65u*`n(Tbu 73u*`n(Tbu 81u*`n(Tbu
- .de Op
- .if ``n(Fp>0 .bp
- .nr Fp 1
- .sp 0.75i
- .tl '``fR``s10MINIX SOURCE CODE``s0'``s11File: ``$2``s0``fP'``fB``s12``n%``s0``fP'
- .sp 0.25i
- ..
- .de Ep
- .if ``n(Fp>0 .bp
- .sp 0.75i
- .tl '``fB``s12``n%``s0``fP``fR'``s11File: ``$2'``s0``s10MINIX SOURCE CODE``s0``fP'
- .nr Fp 1
- .sp 0.25i
- ..
- .Op 1 include/a.out.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/a.out.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00000 /* The <a.out> header file describes the format of executable files. */
- 00001
- 00002 #ifndef _AOUT_H
- 00003 #define _AOUT_H
- 00004
- 00005 struct exec { /* a.out header */
- 00006 unsigned char a_magic[2]; /* magic number */
- 00007 unsigned char a_flags; /* flags, see below */
- 00008 unsigned char a_cpu; /* cpu id */
- 00009 unsigned char a_hdrlen; /* length of header */
- 00010 unsigned char a_unused; /* reserved for future use */
- 00011 unsigned short a_version; /* version stamp (not used at present) */
- 00012 long a_text; /* size of text segement in bytes */
- 00013 long a_data; /* size of data segment in bytes */
- 00014 long a_bss; /* size of bss segment in bytes */
- 00015 long a_entry; /* entry point */
- 00016 long a_total; /* total memory allocated */
- 00017 long a_syms; /* size of symbol table */
- 00018
- 00019 /* SHORT FORM ENDS HERE */
- 00020 long a_trsize; /* text relocation size */
- 00021 long a_drsize; /* data relocation size */
- 00022 long a_tbase; /* text relocation base */
- 00023 long a_dbase; /* data relocation base */
- 00024 };
- 00025
- 00026 #define A_MAGIC0 (unsigned char) 0x01
- 00027 #define A_MAGIC1 (unsigned char) 0x03
- 00028 #define BADMAG(X) ((X).a_magic[0] != A_MAGIC0 ||(X).a_magic[1] != A_MAGIC1)
- 00029
- 00030 /* CPU Id of TARGET machine (byte order coded in low order two bits) */
- 00031 #define A_NONE 0x00 /* unknown */
- 00032 #define A_I8086 0x04 /* intel i8086/8088 */
- 00033 #define A_M68K 0x0B /* motorola m68000 */
- 00034 #define A_NS16K 0x0C /* national semiconductor 16032 */
- 00035 #define A_I80386 0x10 /* intel i80386 */
- 00036 #define A_SPARC 0x17 /* Sun SPARC */
- 00037
- 00038 #define A_BLR(cputype) ((cputype&0x01)!=0) /* TRUE if bytes left-to-right */
- 00039 #define A_WLR(cputype) ((cputype&0x02)!=0) /* TRUE if words left-to-right */
- 00040
- 00041 /* Flags. */
- 00042 #define A_UZP 0x01 /* unmapped zero page (pages) */
- 00043 #define A_PAL 0x02 /* page aligned executable */
- 00044 #define A_NSYM 0x04 /* new style symbol table */
- 00045 #define A_EXEC 0x10 /* executable */
- 00046 #define A_SEP 0x20 /* separate I/D */
- 00047 #define A_PURE 0x40 /* pure text */ /* not used */
- 00048 #define A_TOVLY 0x80 /* text overlay */ /* not used */
- 00049
- 00050 /* Offsets of various things. */
- 00051 #define A_MINHDR 32
- 00052 #define A_TEXTPOS(X) ((long)(X).a_hdrlen)
- 00053 #define A_DATAPOS(X) (A_TEXTPOS(X) + (X).a_text)
- 00054 #define A_HASRELS(X) ((X).a_hdrlen > (unsigned char) A_MINHDR)
- .Ep 2 include/a.out.h
- 00055 #define A_HASEXT(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 8))
- 00056 #define A_HASLNS(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 16))
- 00057 #define A_HASTOFF(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 24))
- 00058 #define A_TRELPOS(X) (A_DATAPOS(X) + (X).a_data)
- 00059 #define A_DRELPOS(X) (A_TRELPOS(X) + (X).a_trsize)
- 00060 #define A_SYMPOS(X) (A_TRELPOS(X) + (A_HASRELS(X) ?
- 00061 ((X).a_trsize + (X).a_drsize) : 0))
- 00062
- 00063 struct reloc {
- 00064 long r_vaddr; /* virtual address of reference */
- 00065 unsigned short r_symndx; /* internal segnum or extern symbol num */
- 00066 unsigned short r_type; /* relocation type */
- 00067 };
- 00068
- 00069 /* r_tyep values: */
- 00070 #define R_ABBS 0
- 00071 #define R_RELLBYTE 2
- 00072 #define R_PCRBYTE 3
- 00073 #define R_RELWORD 4
- 00074 #define R_PCRWORD 5
- 00075 #define R_RELLONG 6
- 00076 #define R_PCRLONG 7
- 00077 #define R_REL3BYTE 8
- 00078 #define R_KBRANCHE 9
- 00079
- 00080 /* r_symndx for internal segments */
- 00081 #define S_ABS ((unsigned short)-1)
- 00082 #define S_TEXT ((unsigned short)-2)
- 00083 #define S_DATA ((unsigned short)-3)
- 00084 #define S_BSS ((unsigned short)-4)
- 00085
- 00086 struct nlist { /* symbol table entry */
- 00087 char n_name[8]; /* symbol name */
- 00088 long n_value; /* value */
- 00089 unsigned char n_sclass; /* storage class */
- 00090 unsigned char n_numaux; /* number of auxiliary entries (not used) */
- 00091 unsigned short n_type; /* language base and derived type (not used) */
- 00092 };
- 00093
- 00094 /* Low bits of storage class (section). */
- 00095 #define N_SECT 07 /* section mask */
- 00096 #define N_UNDF 00 /* undefined */
- 00097 #define N_ABS 01 /* absolute */
- 00098 #define N_TEXT 02 /* text */
- 00099 #define N_DATA 03 /* data */
- 00100 #define N_BSS 04 /* bss */
- 00101 #define N_COMM 05 /* (common) */
- 00102
- 00103 /* High bits of storage class. */
- 00104 #define N_CLASS 0370 /* storage class mask */
- 00105 #define C_NULL
- 00106 #define C_EXT 0020 /* external symbol */
- 00107 #define C_STAT 0030 /* static */
- 00108
- 00109 /* Function prototypes. */
- 00110 #ifndef _ANSI_H
- 00111 #include <ansi.h>
- 00112 #endif
- 00113
- 00114 _PROTOTYPE( int nlist, (char *_file, struct nlist *_nl) );
- .Op 3 include/a.out.h
- 00115
- 00116 #endif /* _AOUT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/alloca.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00200 /* alloca.h - The dreaded alloca() function.
- 00201 */
- 00202
- 00203 #ifndef _ALLOCA_H
- 00204 #define _ALLOCA_H
- 00205
- 00206 #if __GNUC__
- 00207
- 00208 /* The compiler recognizes this special keyword, and inlines the code. */
- 00209 #define alloca(size) __builtin_alloca(size)
- 00210
- 00211 #endif /* __GCC__ */
- 00212
- 00213 #if __ACK__ || __CCC__
- 00214
- 00215 #ifndef _ANSI_H
- 00216 #include <ansi.h>
- 00217 #endif
- 00218
- 00219 _PROTOTYPE(void *alloca, (size_t _size) );
- 00220
- 00221 #endif /* __ACK__ || __CCC__ */
- 00222
- 00223 #endif /* _ALLOCA_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ansi.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00300 /* The <ansi.h> header attempts to decide whether the compiler has enough
- 00301 * conformance to Standard C for Minix to take advantage of. If so, the
- 00302 * symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined
- 00303 * here, but it may be defined by applications that want to bend the rules.
- 00304 * The magic number in the definition is to inhibit unnecessary bending
- 00305 * of the rules. (For consistency with the new '#ifdef _ANSI" tests in
- 00306 * the headers, _ANSI should really be defined as nothing, but that would
- 00307 * break many library routines that use "#if _ANSI".)
- 00308
- 00309 * If _ANSI ends up being defined, a macro
- 00310 *
- 00311 * _PROTOTYPE(function, params)
- 00312 *
- 00313 * is defined. This macro expands in different ways, generating either
- 00314 * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
- 00315 * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
- 00316 * in such a way that they are portable over both ANSI and K&R compilers.
- 00317 * The appropriate macros are defined here.
- 00318 */
- 00319
- .Ep 4 include/ansi.h
- 00320 #ifndef _ANSI_H
- 00321 #define _ANSI_H
- 00322
- 00323 #if __STDC__ == 1
- 00324 #define _ANSI 31459 /* compiler claims full ANSI conformance */
- 00325 #endif
- 00326
- 00327 #ifdef __GNUC__
- 00328 #define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
- 00329 #endif
- 00330
- 00331 #ifdef _ANSI
- 00332
- 00333 /* Keep everything for ANSI prototypes. */
- 00334 #define _PROTOTYPE(function, params) function params
- 00335 #define _ARGS(params) params
- 00336
- 00337 #define _VOIDSTAR void *
- 00338 #define _VOID void
- 00339 #define _CONST const
- 00340 #define _VOLATILE volatile
- 00341 #define _SIZET size_t
- 00342
- 00343 #else
- 00344
- 00345 /* Throw away the parameters for K&R prototypes. */
- 00346 #define _PROTOTYPE(function, params) function()
- 00347 #define _ARGS(params) ()
- 00348
- 00349 #define _VOIDSTAR void *
- 00350 #define _VOID void
- 00351 #define _CONST
- 00352 #define _VOLATILE
- 00353 #define _SIZET int
- 00354
- 00355 #endif /* _ANSI */
- 00356
- 00357 #endif /* ANSI_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/assert.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00400 /* The <assert.h> header contains a macro called "assert" that allows
- 00401 * programmers to put assertions in the code. These assertions can be verified
- 00402 * at run time. If an assertion fails, an error message is printed and the
- 00403 * program aborts.
- 00404 * Assertion checking can be disabled by adding the statement
- 00405 *
- 00406 * #define NDEBUG
- 00407 *
- 00408 * to the program before the
- 00409 *
- 00410 * #include <assert.h>
- 00411 *
- 00412 * statement.
- 00413 */
- 00414
- .Op 5 include/assert.h
- 00415 #undef assert
- 00416
- 00417 #ifndef _ANSI_H
- 00418 #include <ansi.h>
- 00419 #endif
- 00420
- 00421
- 00422 #ifdef NDEBUG
- 00423 /* Debugging disabled -- do not evaluate assertions. */
- 00424 #define assert(expr) ((void) 0)
- 00425 #else
- 00426 /* Debugging enabled -- verify assertions at run time. */
- 00427 #ifdef _ANSI
- 00428 #define __str(x) # x
- 00429 #define __xstr(x) __str(x)
- 00430
- 00431 _PROTOTYPE( void __bad_assertion, (const char *_mess) );
- 00432 #define assert(expr) ((expr)? (void)0 :
- 00433 __bad_assertion("Assertion "" #expr
- 00434 "" failed, file " __xstr(__FILE__)
- 00435 ", line " __xstr(__LINE__) "n"))
- 00436 #else
- 00437 #define assert(expr) ((void) ((expr) ? 0 : __assert( __FILE__, __LINE__)))
- 00438 #endif /* _ANSI */
- 00439 #endif
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ctype.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00500 /* The <ctype.h> header file defines some macros used to identify characters.
- 00501 * It works by using a table stored in chartab.c. When a character is presented
- 00502 * to one of these macros, the character is used as an index into the table
- 00503 * (__ctype) to retrieve a byte. The relevant bit is then extracted.
- 00504 */
- 00505
- 00506 #ifndef _CTYPE_H
- 00507 #define _CTYPE_H
- 00508
- 00509 extern char __ctype[]; /* property array defined in chartab.c */
- 00510
- 00511 #define _U 0x01 /* this bit is for upper-case letters [A-Z] */
- 00512 #define _L 0x02 /* this bit is for lower-case letters [a-z] */
- 00513 #define _N 0x04 /* this bit is for numbers [0-9] */
- 00514 #define _S 0x08 /* this bit is for white space t n f etc */
- 00515 #define _P 0x10 /* this bit is for punctuation characters */
- 00516 #define _C 0x20 /* this bit is for control characters */
- 00517 #define _X 0x40 /* this bit is for hex digits [a-f] and [A-F]*/
- 00518
- 00519 /* Function Prototypes (have to go before the macros). */
- 00520 #ifndef _ANSI_H
- 00521 #include <ansi.h>
- 00522 #endif
- 00523
- 00524 _PROTOTYPE( int isalnum, (int _c) ); /* alphanumeric [a-z], [A-Z], [0-9] */
- .Ep 6 include/ctype.h
- 00525 _PROTOTYPE( int isalpha, (int _c) ); /* alphabetic */
- 00526 _PROTOTYPE( int iscntrl, (int _c) ); /* control characters */
- 00527 _PROTOTYPE( int isdigit, (int _c) ); /* digit [0-9] */
- 00528 _PROTOTYPE( int isgraph, (int _c) ); /* graphic character */
- 00529 _PROTOTYPE( int islower, (int _c) ); /* lower-case letter [a-z] */
- 00530 _PROTOTYPE( int isprint, (int _c) ); /* printable character */
- 00531 _PROTOTYPE( int ispunct, (int _c) ); /* punctuation mark */
- 00532 _PROTOTYPE( int isspace, (int _c) ); /* white space sp, f, n, r, t, v*/
- 00533 _PROTOTYPE( int isupper, (int _c) ); /* upper-case letter [A-Z] */
- 00534 _PROTOTYPE( int isxdigit,(int _c) ); /* hex digit [0-9], [a-f], [A-F] */
- 00535 _PROTOTYPE( int tolower, (int _c) ); /* convert to lower-case */
- 00536 _PROTOTYPE( int toupper, (int _c) ); /* convert to upper-case */
- 00537
- 00538 /* Macros for identifying character classes. */
- 00539 #define isalnum(c) ((__ctype+1)[c]&(_U|_L|_N))
- 00540 #define isalpha(c) ((__ctype+1)[c]&(_U|_L))
- 00541 #define iscntrl(c) ((__ctype+1)[c]&_C)
- 00542 #define isgraph(c) ((__ctype+1)[c]&(_P|_U|_L|_N))
- 00543 #define ispunct(c) ((__ctype+1)[c]&_P)
- 00544 #define isspace(c) ((__ctype+1)[c]&_S)
- 00545 #define isxdigit(c) ((__ctype+1)[c]&(_N|_X))
- 00546
- 00547 #define isdigit(c) ((unsigned) ((c)-'0') < 10)
- 00548 #define islower(c) ((unsigned) ((c)-'a') < 26)
- 00549 #define isupper(c) ((unsigned) ((c)-'A') < 26)
- 00550 #define isprint(c) ((unsigned) ((c)-' ') < 95)
- 00551 #define isascii(c) ((unsigned) (c) < 128)
- 00552
- 00553 #endif /* _CTYPE_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/curses.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00600 /* curses.h - defines macros and prototypes for curses */
- 00601
- 00602 #ifndef _CURSES_H
- 00603 #define _CURSES_H
- 00604
- 00605 #include <termios.h>
- 00606 #include <stdarg.h>
- 00607 #include <stdio.h>
- 00608
- 00609 typedef int bool;
- 00610
- 00611 #ifndef TRUE
- 00612 #define TRUE 1
- 00613 #endif
- 00614 #ifndef FALSE
- 00615 #define FALSE 0
- 00616 #endif
- 00617 #ifndef ERR
- 00618 #define ERR (-1) /* general error flag */
- 00619 #endif
- 00620 #ifndef OK
- 00621 #define OK 0 /* general OK flag */
- 00622 #endif
- 00623
- 00624 /* Macros. */
- .Op 7 include/curses.h
- 00625 #define box(win,vc,hc) wbox(win,0,0,0,0,vc,hc)
- 00626 #define addch(ch) waddch(stdscr,ch)
- 00627 #define mvaddch(y,x,ch) (wmove(stdscr,y,x)==ERR?ERR:waddch(stdscr,ch))
- 00628 #define mvwaddch(win,y,x,ch) (wmove(win,y,x)==ERR?ERR:waddch(win,ch))
- 00629 #define getch() wgetch(stdscr)
- 00630 #define mvgetch(y,x) (wmove(stdscr,y,x)==ERR?ERR:wgetch(stdscr))
- 00631 #define mvwgetch(win,y,x) (wmove(win,y,x)==ERR?ERR:wgetch(win))
- 00632 #define addstr(str) waddstr(stdscr,str)
- 00633 #define mvaddstr(y,x,str) (wmove(stdscr,y,x)==ERR?ERR:waddstr(stdscr,str))
- 00634 #define mvwaddstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:waddstr(win,str))
- 00635 #define getstr(str) wgetstr(stdscr,str)
- 00636 #define mvgetstr(y,x,str) (wmove(stdscr,y,x)==ERR?ERR:wgetstr(stdscr,str))
- 00637 #define mvwgetstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
- 00638 #define move(y,x) wmove(stdscr,y,x)
- 00639 #define clear() wclear(stdscr)
- 00640 #define erase() werase(stdscr)
- 00641 #define clrtobot() wclrtobot(stdscr)
- 00642 #define mvclrtobot(y,x) (wmove(stdscr,y,x)==ERR?ERR:wclrtobot(stdscr))
- 00643 #define mvwclrtobot(win,y,x) (wmove(win,y,x)==ERR?ERR:wclrtobot(win))
- 00644 #define clrtoeol() wclrtoeol(stdscr)
- 00645 #define mvclrtoeol(y,x) (wmove(stdscr,y,x)==ERR?ERR:wclrtoeol(stdscr))
- 00646 #define mvwclrtoeol(win,y,x) (wmove(win,y,x)==ERR?ERR:wclrtoeol(win))
- 00647 #define insertln() winsertln(stdscr)
- 00648 #define mvinsertln(y,x) (wmove(stdscr,y,x)==ERR?ERR:winsertln(stdscr))
- 00649 #define mvwinsertln(win,y,x) (wmove(win,y,x)==ERR?ERR:winsertln(win))
- 00650 #define deleteln() wdeleteln(stdscr)
- 00651 #define mvdeleteln(y,x) (wmove(stdscr,y,x)==ERR?ERR:wdeleteln(stdscr))
- 00652 #define mvwdeleteln(win,y,x) (wmove(win,y,x)==ERR?ERR:wdeleteln(win))
- 00653 #define refresh() wrefresh(stdscr)
- 00654 #define inch() winch(stdscr)
- 00655 #define insch(ch) winsch(stdscr,ch)
- 00656 #define mvinsch(y,x,ch) (wmove(stdscr,y,x)==ERR?ERR:winsch(stdscr,ch))
- 00657 #define mvwinsch(win,y,x,ch) (wmove(win,y,x)==ERR?ERR:winsch(win,ch))
- 00658 #define delch() wdelch(stdscr)
- 00659 #define mvdelch(y,x) (wmove(stdscr,y,x)==ERR?ERR:wdelch(stdscr))
- 00660 #define mvwdelch(win,y,x) (wmove(win,y,x)==ERR?ERR:wdelch(win))
- 00661 #define standout() wstandout(stdscr)
- 00662 #define wstandout(win) ((win)->_attrs |= A_STANDOUT)
- 00663 #define standend() wstandend(stdscr)
- 00664 #define wstandend(win) ((win)->_attrs &= ~A_STANDOUT)
- 00665 #define attrset(attrs) wattrset(stdscr, attrs)
- 00666 #define wattrset(win, attrs) ((win)->_attrs = (attrs))
- 00667 #define attron(attrs) wattron(stdscr, attrs)
- 00668 #define wattron(win, attrs) ((win)->_attrs |= (attrs))
- 00669 #define attroff(attrs) wattroff(stdscr,attrs)
- 00670 #define wattroff(win, attrs) ((win)->_attrs &= ~(attrs))
- 00671 #define resetty() tcsetattr(1, TCSANOW, &_orig_tty)
- 00672 #define getyx(win,y,x) (y = (win)->_cury, x = (win)->_curx)
- 00673
- 00674 /* Video attribute definitions. */
- 00675 #define A_BLINK 0x0100
- 00676 #define A_BLANK 0
- 00677 #define A_BOLD 0x0200
- 00678 #define A_DIM 0
- 00679 #define A_PROTECT 0
- 00680 #define A_REVERSE 0x0400
- 00681 #define A_STANDOUT 0x0800
- 00682 #define A_UNDERLINE 0x1000
- 00683 #define A_ALTCHARSET 0x2000
- 00684
- .Ep 8 include/curses.h
- 00685 /* Type declarations. */
- 00686 typedef struct {
- 00687 int _cury; /* current pseudo-cursor */
- 00688 int _curx;
- 00689 int _maxy; /* max coordinates */
- 00690 int _maxx;
- 00691 int _begy; /* origin on screen */
- 00692 int _begx;
- 00693 int _flags; /* window properties */
- 00694 int _attrs; /* attributes of written characters */
- 00695 int _tabsize; /* tab character size */
- 00696 bool _clear; /* causes clear at next refresh */
- 00697 bool _leave; /* leaves cursor as it happens */
- 00698 bool _scroll; /* allows window scrolling */
- 00699 bool _nodelay; /* input character wait flag */
- 00700 bool _keypad; /* flags keypad key mode active */
- 00701 int **_line; /* pointer to line pointer array */
- 00702 int *_minchng; /* First changed character in line */
- 00703 int *_maxchng; /* Last changed character in line */
- 00704 int _regtop; /* Top/bottom of scrolling region */
- 00705 int _regbottom;
- 00706 } WINDOW;
- 00707
- 00708 /* External variables */
- 00709 extern int LINES; /* terminal height */
- 00710 extern int COLS; /* terminal width */
- 00711 extern bool NONL; /* n causes CR too ? */
- 00712 extern WINDOW *curscr; /* the current screen image */
- 00713 extern WINDOW *stdscr; /* the default screen window */
- 00714 extern struct termios _orig_tty, _tty;
- 00715
- 00716 extern unsigned int ACS_ULCORNER; /* terminal dependent block grafic */
- 00717 extern unsigned int ACS_LLCORNER; /* charcters. Forget IBM, we are */
- 00718 extern unsigned int ACS_URCORNER; /* independent of their charset. :-) */
- 00719 extern unsigned int ACS_LRCORNER;
- 00720 extern unsigned int ACS_RTEE;
- 00721 extern unsigned int ACS_LTEE;
- 00722 extern unsigned int ACS_BTEE;
- 00723 extern unsigned int ACS_TTEE;
- 00724 extern unsigned int ACS_HLINE;
- 00725 extern unsigned int ACS_VLINE;
- 00726 extern unsigned int ACS_PLUS;
- 00727 extern unsigned int ACS_S1;
- 00728 extern unsigned int ACS_S9;
- 00729 extern unsigned int ACS_DIAMOND;
- 00730 extern unsigned int ACS_CKBOARD;
- 00731 extern unsigned int ACS_DEGREE;
- 00732 extern unsigned int ACS_PLMINUS;
- 00733 extern unsigned int ACS_BULLET;
- 00734 extern unsigned int ACS_LARROW;
- 00735 extern unsigned int ACS_RARROW;
- 00736 extern unsigned int ACS_DARROW;
- 00737 extern unsigned int ACS_UARROW;
- 00738 extern unsigned int ACS_BOARD;
- 00739 extern unsigned int ACS_LANTERN;
- 00740 extern unsigned int ACS_BLOCK;
- 00741
- 00742 _PROTOTYPE( char *unctrl, (int _c) );
- 00743 _PROTOTYPE( int baudrate, (void));
- 00744 _PROTOTYPE( void beep, (void));
- .Op 9 include/curses.h
- 00745 _PROTOTYPE( void cbreak, (void));
- 00746 _PROTOTYPE( void clearok, (WINDOW *_win, bool _flag) );
- 00747 _PROTOTYPE( void clrscr, (void));
- 00748 _PROTOTYPE( void curs_set, (int _visibility) );
- 00749 _PROTOTYPE( void delwin, (WINDOW *_win) );
- 00750 _PROTOTYPE( void doupdate, (void));
- 00751 _PROTOTYPE( void echo, (void));
- 00752 _PROTOTYPE( int endwin, (void));
- 00753 _PROTOTYPE( int erasechar, (void));
- 00754 _PROTOTYPE( void fatal, (char *_s) );
- 00755 _PROTOTYPE( int fixterm, (void));
- 00756 _PROTOTYPE( void flash, (void));
- 00757 _PROTOTYPE( void gettmode, (void));
- 00758 _PROTOTYPE( void idlok, (WINDOW *_win, bool _flag) );
- 00759 _PROTOTYPE( WINDOW *initscr, (void));
- 00760 _PROTOTYPE( void keypad, (WINDOW *_win, bool _flag) );
- 00761 _PROTOTYPE( int killchar, (void));
- 00762 _PROTOTYPE( void leaveok, (WINDOW *_win, bool _flag) );
- 00763 _PROTOTYPE( char *longname, (void));
- 00764 _PROTOTYPE( void meta, (WINDOW *_win, bool _flag) );
- 00765 _PROTOTYPE( int mvcur, (int _oldy, int _oldx, int _newy, int _newx) );
- 00766 _PROTOTYPE( int mvinch, (int _y, int _x) );
- 00767 _PROTOTYPE( int mvprintw, (int _y, int _x, const char *_fmt, ...) );
- 00768 _PROTOTYPE( int mvscanw, (int _y, int _x, const char *_fmt, ...) );
- 00769 _PROTOTYPE( int mvwin, (WINDOW *_win, int _begy, int _begx) );
- 00770 _PROTOTYPE( int mvwinch, (WINDOW *_win, int _y, int _x) );
- 00771 _PROTOTYPE( int mvwprintw, (WINDOW *_win, int _y, int _x, const char *_fmt,
- 00772 ...) );
- 00773 _PROTOTYPE( int mvwscanw, (WINDOW *_win, int _y, int _x, const char *_fmt,
- 00774 ...) );
- 00775 _PROTOTYPE( WINDOW *newwin, (int _num_lines, int _num_cols, int _y, int _x));
- 00776 _PROTOTYPE( void nl, (void));
- 00777 _PROTOTYPE( void nocbreak, (void));
- 00778 _PROTOTYPE( void nodelay, (WINDOW *_win, bool _flag) );
- 00779 _PROTOTYPE( void noecho, (void));
- 00780 _PROTOTYPE( void nonl, (void));
- 00781 _PROTOTYPE( void noraw, (void));
- 00782 _PROTOTYPE( void outc, (int _c) );
- 00783 _PROTOTYPE( void overlay, (WINDOW *_win1, WINDOW *_win2) );
- 00784 _PROTOTYPE( void overwrite, (WINDOW *_win1, WINDOW *_win2) );
- 00785 _PROTOTYPE( void poscur, (int _r, int _c) );
- 00786 _PROTOTYPE( int printw, (const char *_fmt, ...) );
- 00787 _PROTOTYPE( void raw, (void));
- 00788 _PROTOTYPE( int resetterm, (void));
- 00789 _PROTOTYPE( int saveoldterm, (void));
- 00790 _PROTOTYPE( int saveterm, (void));
- 00791 _PROTOTYPE( int savetty, (void));
- 00792 _PROTOTYPE( int scanw, (const char *_fmt, ...) );
- 00793 _PROTOTYPE( void scroll, (WINDOW *_win) );
- 00794 _PROTOTYPE( void scrollok, (WINDOW *_win, bool _flag) );
- 00795 _PROTOTYPE( int setscrreg, (int _top, int _bottom) );
- 00796 _PROTOTYPE( int setterm, (char *_type) );
- 00797 _PROTOTYPE( int setupterm, (void));
- 00798 _PROTOTYPE( WINDOW *subwin, (WINDOW *_orig, int _nlines, int _ncols, int _y,
- 00799 int _x));
- 00800 _PROTOTYPE( int tabsize, (int _ts) );
- 00801 _PROTOTYPE( void touchwin, (WINDOW *_win) );
- 00802 _PROTOTYPE( int waddch, (WINDOW *_win, int _c) );
- 00803 _PROTOTYPE( int waddstr, (WINDOW *_win, char *_str) );
- 00804 _PROTOTYPE( int wbox, (WINDOW *_win, int _ymin, int _xmin, int _ymax,
- .Ep 10 include/curses.h
- 00805 int _xmax, unsigned int _v, unsigned int _h) );
- 00806 _PROTOTYPE( void wclear, (WINDOW *_win) );
- 00807 _PROTOTYPE( int wclrtobot, (WINDOW *_win) );
- 00808 _PROTOTYPE( int wclrtoeol, (WINDOW *_win) );
- 00809 _PROTOTYPE( int wdelch, (WINDOW *_win) );
- 00810 _PROTOTYPE( int wdeleteln, (WINDOW *_win) );
- 00811 _PROTOTYPE( void werase, (WINDOW *_win) );
- 00812 _PROTOTYPE( int wgetch, (WINDOW *_win) );
- 00813 _PROTOTYPE( int wgetstr, (WINDOW *_win, char *_str) );
- 00814 _PROTOTYPE( int winch, (WINDOW *_win) );
- 00815 _PROTOTYPE( int winsch, (WINDOW *_win, int _c) );
- 00816 _PROTOTYPE( int winsertln, (WINDOW *_win) );
- 00817 _PROTOTYPE( int wmove, (WINDOW *_win, int _y, int _x) );
- 00818 _PROTOTYPE( void wnoutrefresh, (WINDOW *_win) );
- 00819 _PROTOTYPE( int wprintw, (WINDOW *_win, const char *_fmt, ...));
- 00820 _PROTOTYPE( void wrefresh, (WINDOW *_win) );
- 00821 _PROTOTYPE( int wscanw, (WINDOW *_win, const char *_fmt, ...));
- 00822 _PROTOTYPE( int wsetscrreg, (WINDOW *_win, int _top, int _bottom) );
- 00823 _PROTOTYPE( int wtabsize, (WINDOW *_win, int _ts) );
- 00824
- 00825 #endif /* _CURSES_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/dirent.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00900 /* dirent.h - Declarations for directory reading routines.
- 00901 * Author: Kees J. Bot
- 00902 * 24 Apr 1989
- 00903 *
- 00904 * Note: The V7 format directory entries used under Minix must be transformed
- 00905 * into a struct dirent with a d_name of at least 15 characters. Given that
- 00906 * we have to transform V7 entries anyhow it is little trouble to let the
- 00907 * routines understand the so-called "flex" directory format too.
- 00908 */
- 00909
- 00910 #ifndef _DIRENT_H
- 00911 #define _DIRENT_H
- 00912
- 00913 /* _fl_direct is a flexible directory entry. Actually it's a union of 8
- 00914 * characters and the 3 fields defined below.
- 00915 */
- 00916
- 00917 /* Flexible directory entry: */
- 00918 struct _fl_direct { /* First slot in an entry */
- 00919 ino_t d_ino;
- 00920 unsigned char d_extent;
- 00921 char d_name[5]; /* Four characters for the shortest name */
- 00922 };
- 00923
- 00924 /* Name of length len needs _EXTENT(len) extra slots. */
- 00925 #define _EXTENT(len) (((len) + 3) >> 3)
- 00926
- 00927 /* Version 7 directory entry: */
- 00928 struct _v7_direct {
- 00929 ino_t d_ino;
- .Op 11 include/dirent.h
- 00930 char d_name[14];
- 00931 };
- 00932
- 00933 /* Definitions for the directory(3) routines: */
- 00934 typedef struct {
- 00935 char _fd; /* Filedescriptor of open directory */
- 00936 char _v7; /* Directory is Version 7 */
- 00937 short _count; /* This many objects in buf */
- 00938 off_t _pos; /* Position in directory file */
- 00939 struct _fl_direct *_ptr; /* Next slot in buf */
- 00940 struct _fl_direct _buf[128]; /* One block of a directory file */
- 00941 struct _fl_direct _v7f[3]; /* V7 entry transformed to flex */
- 00942 } DIR;
- 00943
- 00944 struct dirent { /* Largest entry (8 slots) */
- 00945 ino_t d_ino; /* I-node number */
- 00946 unsigned char d_extent; /* Extended with this many slots */
- 00947 char d_name[61]; /* Null terminated name */
- 00948 };
- 00949
- 00950 /* Function Prototypes. */
- 00951 #ifndef _ANSI_H
- 00952 #include <ansi.h>
- 00953 #endif
- 00954
- 00955 _PROTOTYPE( int closedir, (DIR *_dirp) );
- 00956 _PROTOTYPE( DIR *opendir, (const char *_dirname) );
- 00957 _PROTOTYPE( struct dirent *readdir, (DIR *_dirp) );
- 00958 _PROTOTYPE( void rewinddir, (DIR *_dirp) );
- 00959
- 00960 #ifdef _MINIX
- 00961 _PROTOTYPE( int seekdir, (DIR *_dirp, off_t _loc) );
- 00962 _PROTOTYPE( off_t telldir, (DIR *_dirp) );
- 00963 #endif
- 00964
- 00965 #endif /* _DIRENT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/errno.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01000 /* The <errno.h> header defines the numbers of the various errors that can
- 01001 * occur during program execution. They are visible to user programs and
- 01002 * should be small positive integers. However, they are also used within
- 01003 * MINIX, where they must be negative. For example, the READ system call is
- 01004 * executed internally by calling do_read(). This function returns either a
- 01005 * (negative) error number or a (positive) number of bytes actually read.
- 01006 *
- 01007 * To solve the problem of having the error numbers be negative inside the
- 01008 * the system and positive outside, the following mechanism is used. All the
- 01009 * definitions are are the form:
- 01010 *
- 01011 * #define EPERM (_SIGN 1)
- 01012 *
- 01013 * If the macro _SYSTEM is defined, then _SIGN is set to "-", otherwise it is
- 01014 * set to "". Thus when compiling the operating system, the macro _SYSTEM
- .Ep 12 include/errno.h
- 01015 * will be defined, setting EPERM to (- 1), whereas when when this
- 01016 * file is included in an ordinary user program, EPERM has the value ( 1).
- 01017 */
- 01018
- 01019 #ifndef _ERRNO_H /* check if <errno.h> is already included */
- 01020 #define _ERRNO_H /* it is not included; note that fact */
- 01021
- 01022 /* Now define _SIGN as "" or "-" depending on _SYSTEM. */
- 01023 #ifdef _SYSTEM
- 01024 # define _SIGN -
- 01025 # define OK 0
- 01026 #else
- 01027 # define _SIGN
- 01028 #endif
- 01029
- 01030 extern int errno; /* place where the error numbers go */
- 01031
- 01032 /* Here are the numerical values of the error numbers. */
- 01033 #define _NERROR 70 /* number of errors */
- 01034
- 01035 #define EGENERIC (_SIGN 99) /* generic error */
- 01036 #define EPERM (_SIGN 1) /* operation not permitted */
- 01037 #define ENOENT (_SIGN 2) /* no such file or directory */
- 01038 #define ESRCH (_SIGN 3) /* no such process */
- 01039 #define EINTR (_SIGN 4) /* interrupted function call */
- 01040 #define EIO (_SIGN 5) /* input/output error */
- 01041 #define ENXIO (_SIGN 6) /* no such device or address */
- 01042 #define E2BIG (_SIGN 7) /* arg list too long */
- 01043 #define ENOEXEC (_SIGN 8) /* exec format error */
- 01044 #define EBADF (_SIGN 9) /* bad file descriptor */
- 01045 #define ECHILD (_SIGN 10) /* no child process */
- 01046 #define EAGAIN (_SIGN 11) /* resource temporarily unavailable */
- 01047 #define ENOMEM (_SIGN 12) /* not enough space */
- 01048 #define EACCES (_SIGN 13) /* permission denied */
- 01049 #define EFAULT (_SIGN 14) /* bad address */
- 01050 #define ENOTBLK (_SIGN 15) /* Extension: not a block special file */
- 01051 #define EBUSY (_SIGN 16) /* resource busy */
- 01052 #define EEXIST (_SIGN 17) /* file exists */
- 01053 #define EXDEV (_SIGN 18) /* improper link */
- 01054 #define ENODEV (_SIGN 19) /* no such device */
- 01055 #define ENOTDIR (_SIGN 20) /* not a directory */
- 01056 #define EISDIR (_SIGN 21) /* is a directory */
- 01057 #define EINVAL (_SIGN 22) /* invalid argument */
- 01058 #define ENFILE (_SIGN 23) /* too many open files in system */
- 01059 #define EMFILE (_SIGN 24) /* too many open files */
- 01060 #define ENOTTY (_SIGN 25) /* inappropriate I/O control operation */
- 01061 #define ETXTBSY (_SIGN 26) /* no longer used */
- 01062 #define EFBIG (_SIGN 27) /* file too large */
- 01063 #define ENOSPC (_SIGN 28) /* no space left on device */
- 01064 #define ESPIPE (_SIGN 29) /* invalid seek */
- 01065 #define EROFS (_SIGN 30) /* read-only file system */
- 01066 #define EMLINK (_SIGN 31) /* too many links */
- 01067 #define EPIPE (_SIGN 32) /* broken pipe */
- 01068 #define EDOM (_SIGN 33) /* domain error (from ANSI C std) */
- 01069 #define ERANGE (_SIGN 34) /* result too large (from ANSI C std) */
- 01070 #define EDEADLK (_SIGN 35) /* resource deadlock avoided */
- 01071 #define ENAMETOOLONG (_SIGN 36) /* file name too long */
- 01072 #define ENOLCK (_SIGN 37) /* no locks available */
- 01073 #define ENOSYS (_SIGN 38) /* function not implemented */
- 01074 #define ENOTEMPTY (_SIGN 39) /* directory not empty */
- .Op 13 include/errno.h
- 01075
- 01076 /* The following errors relate to networking. */
- 01077 #define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */
- 01078 #define EOUTOFBUFS (_SIGN 51) /* not enough buffers left */
- 01079 #define EBADIOCTL (_SIGN 52) /* illegal ioctl for device */
- 01080 #define EBADMODE (_SIGN 53) /* badmode in ioctl */
- 01081 #define EWOULDBLOCK (_SIGN 54)
- 01082 #define EBADDEST (_SIGN 55) /* not a valid destination address */
- 01083 #define EDSTNOTRCH (_SIGN 56) /* destination not reachable */
- 01084 #define EISCONN (_SIGN 57) /* all ready connected */
- 01085 #define EADDRINUSE (_SIGN 58) /* address in use */
- 01086 #define ECONNREFUSED (_SIGN 59) /* connection refused */
- 01087 #define ECONNRESET (_SIGN 60) /* connection reset */
- 01088 #define ETIMEDOUT (_SIGN 61) /* connection timed out */
- 01089 #define EURG (_SIGN 62) /* urgent data present */
- 01090 #define ENOURG (_SIGN 63) /* no urgent data present */
- 01091 #define ENOTCONN (_SIGN 64) /* no connection (yet or anymore) */
- 01092 #define ESHUTDOWN (_SIGN 65) /* a write call to a shutdown connection */
- 01093 #define ENOCONN (_SIGN 66) /* no such connection */
- 01094
- 01095 /* The following are not POSIX errors, but they can still happen. */
- 01096 #define ELOCKED (_SIGN 101) /* can't send message */
- 01097 #define EBADCALL (_SIGN 102) /* error on send/receive */
- 01098
- 01099 /* The following error codes are generated by the kernel itself. */
- 01100 #ifdef _SYSTEM
- 01101 #define E_BAD_DEST -1001 /* destination address illegal */
- 01102 #define E_BAD_SRC -1002 /* source address illegal */
- 01103 #define E_TRY_AGAIN -1003 /* can't send-- tables full */
- 01104 #define E_OVERRUN -1004 /* interrupt for task that is not waiting */
- 01105 #define E_BAD_BUF -1005 /* message buf outside caller's addr space */
- 01106 #define E_TASK -1006 /* can't send to task */
- 01107 #define E_NO_MESSAGE -1007 /* RECEIVE failed: no message present */
- 01108 #define E_NO_PERM -1008 /* ordinary users can't send to tasks */
- 01109 #define E_BAD_FCN -1009 /* only valid fcns are SEND, RECEIVE, BOTH */
- 01110 #define E_BAD_ADDR -1010 /* bad address given to utility routine */
- 01111 #define E_BAD_PROC -1011 /* bad proc number given to utility */
- 01112 #endif /* _SYSTEM */
- 01113
- 01114 #endif /* _ERRNO_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/fcntl.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01200 /* The <fcntl.h> header is needed by the open() and fcntl() system calls,
- 01201 * which have a variety of parameters and flags. They are described here.
- 01202 * The formats of the calls to each of these are:
- 01203 *
- 01204 * open(path, oflag [,mode]) open a file
- 01205 * fcntl(fd, cmd [,arg]) get or set file attributes
- 01206 *
- 01207 */
- 01208
- 01209 #ifndef _FCNTL_H
- .Ep 14 include/fcntl.h
- 01210 #define _FCNTL_H
- 01211
- 01212 /* These values are used for cmd in fcntl(). POSIX Table 6-1. */
- 01213 #define F_DUPFD 0 /* duplicate file descriptor */
- 01214 #define F_GETFD 1 /* get file descriptor flags */
- 01215 #define F_SETFD 2 /* set file descriptor flags */
- 01216 #define F_GETFL 3 /* get file status flags */
- 01217 #define F_SETFL 4 /* set file status flags */
- 01218 #define F_GETLK 5 /* get record locking information */
- 01219 #define F_SETLK 6 /* set record locking information */
- 01220 #define F_SETLKW 7 /* set record locking info; wait if blocked */
- 01221
- 01222 /* File descriptor flags used for fcntl(). POSIX Table 6-2. */
- 01223 #define FD_CLOEXEC 1 /* close on exec flag for third arg of fcntl */
- 01224
- 01225 /* L_type values for record locking with fcntl(). POSIX Table 6-3. */
- 01226 #define F_RDLCK 1 /* shared or read lock */
- 01227 #define F_WRLCK 2 /* exclusive or write lock */
- 01228 #define F_UNLCK 3 /* unlock */
- 01229
- 01230 /* Oflag values for open(). POSIX Table 6-4. */
- 01231 #define O_CREAT 00100 /* creat file if it doesn't exist */
- 01232 #define O_EXCL 00200 /* exclusive use flag */
- 01233 #define O_NOCTTY 00400 /* do not assign a controlling terminal */
- 01234 #define O_TRUNC 01000 /* truncate flag */
- 01235
- 01236 /* File status flags for open() and fcntl(). POSIX Table 6-5. */
- 01237 #define O_APPEND 02000 /* set append mode */
- 01238 #define O_NONBLOCK 04000 /* no delay */
- 01239
- 01240 /* File access modes for open() and fcntl(). POSIX Table 6-6. */
- 01241 #define O_RDONLY 0 /* open(name, O_RDONLY) opens read only */
- 01242 #define O_WRONLY 1 /* open(name, O_WRONLY) opens write only */
- 01243 #define O_RDWR 2 /* open(name, O_RDWR) opens read/write */
- 01244
- 01245 /* Mask for use with file access modes. POSIX Table 6-7. */
- 01246 #define O_ACCMODE 03 /* mask for file access modes */
- 01247
- 01248 /* Struct used for locking. POSIX Table 6-8. */
- 01249 struct flock {
- 01250 short l_type; /* type: F_RDLCK, F_WRLCK, or F_UNLCK */
- 01251 short l_whence; /* flag for starting offset */
- 01252 off_t l_start; /* relative offset in bytes */
- 01253 off_t l_len; /* size; if 0, then until EOF */
- 01254 pid_t l_pid; /* process id of the locks' owner */
- 01255 };
- 01256
- 01257
- 01258 /* Function Prototypes. */
- 01259 #ifndef _ANSI_H
- 01260 #include <ansi.h>
- 01261 #endif
- 01262
- 01263 _PROTOTYPE( int creat, (const char *_path, Mode_t _mode) );
- 01264 _PROTOTYPE( int fcntl, (int _filedes, int _cmd, ...) );
- 01265 _PROTOTYPE( int open, (const char *_path, int _oflag, ...) );
- 01266
- 01267 #endif /* _FCNTL_H */
- .Op 15 include/float.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/float.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01300 /* The <float.h> header defines some implementation limits for (IEEE) floating
- 01301 * point. Application programs can use it to find out how big and small
- 01302 * floating-point numbers can be, what epsilon to use for iteration, etc.
- 01303 */
- 01304
- 01305 #ifndef _FLOAT_H
- 01306 #define _FLOAT_H
- 01307
- 01308 #define FLT_DIG 6
- 01309 #define FLT_EPSILON 1.19209290e-07F
- 01310 #define FLT_MANT_DIG 24
- 01311 #define FLT_MAX 3.40282347e+38F
- 01312 #define FLT_MAX_10_EXP 38
- 01313 #define FLT_MAX_EXP 128
- 01314 #define FLT_MIN 1.17549435e-38F
- 01315 #define FLT_MIN_10_EXP -37
- 01316 #define FLT_MIN_EXP -125
- 01317
- 01318 #define DBL_DIG 15
- 01319 #define DBL_EPSILON 2.2204460492503131e-16
- 01320 #define DBL_MANT_DIG 53
- 01321 #define DBL_MAX 1.7976931348623157e+308
- 01322 #define DBL_MAX_10_EXP 308
- 01323 #define DBL_MAX_EXP 1024
- 01324 #define DBL_MIN 2.2250738585072014e-308
- 01325 #define DBL_MIN_10_EXP -307
- 01326 #define DBL_MIN_EXP -1021
- 01327
- 01328 #define LDBL_DIG 15
- 01329 #define LDBL_EPSILON 2.2204460492503131e-16L
- 01330 #define LDBL_MANT_DIG 53
- 01331 #define LDBL_MAX 1.7976931348623157e+308L
- 01332 #define LDBL_MAX_10_EXP 308
- 01333 #define LDBL_MAX_EXP 1024
- 01334 #define LDBL_MIN 2.2250738585072014e-308L
- 01335 #define LDBL_MIN_10_EXP -307
- 01336 #define LDBL_MIN_EXP -1021
- 01337
- 01338 #define FLT_ROUNDS 1
- 01339 #define FLT_RADIX 2
- 01340
- 01341 #endif /* _FLOAT_H */
- .Ep 16 include/grp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/grp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01400 /* The <grp.h> header is used for the getgrid() and getgrnam() calls. */
- 01401
- 01402 #ifndef _GRP_H
- 01403 #define _GRP_H
- 01404
- 01405 struct group {
- 01406 char *gr_name; /* the name of the group */
- 01407 char *gr_passwd; /* the group passwd */
- 01408 gid_t gr_gid; /* the numerical group ID */
- 01409 char **gr_mem; /* a vector of pointers to the members */
- 01410 };
- 01411
- 01412 /* Function Prototypes. */
- 01413 #ifndef _ANSI_H
- 01414 #include <ansi.h>
- 01415 #endif
- 01416
- 01417 _PROTOTYPE( struct group *getgrgid, (Gid_t _gid) );
- 01418 _PROTOTYPE( struct group *getgrnam, (const char *_name) );
- 01419
- 01420 #ifdef _MINIX
- 01421 _PROTOTYPE( void endgrent, (void) );
- 01422 _PROTOTYPE( struct group *getgrent, (void) );
- 01423 _PROTOTYPE( int setgrent, (void) );
- 01424 _PROTOTYPE( void setgrfile, (const char *_file) );
- 01425 #endif
- 01426
- 01427 #endif /* _GRP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/lib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01500 /* The <lib.h> header is the master header used by the library.
- 01501 * All the C files in the lib subdirectories include it.
- 01502 */
- 01503
- 01504 #ifndef _LIB_H
- 01505 #define _LIB_H
- 01506
- 01507 /* First come the defines. */
- 01508 #define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
- 01509 #define _MINIX 1 /* tell headers to include MINIX stuff */
- 01510
- 01511 /* The following are so basic, all the lib files get them automatically. */
- 01512 #include <minix/config.h> /* must be first */
- 01513 #include <sys/types.h>
- 01514 #include <limits.h>
- 01515 #include <errno.h>
- 01516 #include <ansi.h>
- 01517
- 01518 #include <minix/const.h>
- 01519 #include <minix/type.h>
- .Op 17 include/lib.h
- 01520 #include <minix/callnr.h>
- 01521
- 01522 #define MM 0
- 01523 #define FS 1
- 01524
- 01525 _PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
- 01526 char *const _envp[], int _nargs, int _nenvps) );
- 01527 _PROTOTYPE( int _syscall, (int _who, int _syscallnr, message *_msgptr) );
- 01528 _PROTOTYPE( void _loadname, (const char *_name, message *_msgptr) );
- 01529 _PROTOTYPE( int _len, (const char *_s) );
- 01530 _PROTOTYPE( void panic, (const char *_message, int _errnum) );
- 01531 _PROTOTYPE( int _sendrec, (int _src_dest, message *_m_ptr) );
- 01532 _PROTOTYPE( void _begsig, (int _dummy) );
- 01533
- 01534 #endif /* _LIB_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/limits.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01600 /* The <limits.h> header defines some basic sizes, both of the language types
- 01601 * (e.g., the number of bits in an integer), and of the operating system (e.g.
- 01602 * the number of characters in a file name.
- 01603 */
- 01604
- 01605 #ifndef _LIMITS_H
- 01606 #define _LIMITS_H
- 01607
- 01608 /* Definitions about chars (8 bits in MINIX, and signed). */
- 01609 #define CHAR_BIT 8 /* # bits in a char */
- 01610 #define CHAR_MIN -128 /* minimum value of a char */
- 01611 #define CHAR_MAX 127 /* maximum value of a char */
- 01612 #define SCHAR_MIN -128 /* minimum value of a signed char */
- 01613 #define SCHAR_MAX 127 /* maximum value of a signed char */
- 01614 #define UCHAR_MAX 255 /* maximum value of an unsigned char */
- 01615 #define MB_LEN_MAX 1 /* maximum length of a multibyte char */
- 01616
- 01617 /* Definitions about shorts (16 bits in MINIX). */
- 01618 #define SHRT_MIN (-32767-1) /* minimum value of a short */
- 01619 #define SHRT_MAX 32767 /* maximum value of a short */
- 01620 #define USHRT_MAX 0xFFFF /* maximum value of unsigned short */
- 01621
- 01622 /* _EM_WSIZE is a compiler-generated symbol giving the word size in bytes. */
- 01623 #if _EM_WSIZE == 2
- 01624 #define INT_MIN (-32767-1) /* minimum value of a 16-bit int */
- 01625 #define INT_MAX 32767 /* maximum value of a 16-bit int */
- 01626 #define UINT_MAX 0xFFFF /* maximum value of an unsigned 16-bit int */
- 01627 #endif
- 01628
- 01629 #if _EM_WSIZE == 4
- 01630 #define INT_MIN (-2147483647-1) /* minimum value of a 32-bit int */
- 01631 #define INT_MAX 2147483647 /* maximum value of a 32-bit int */
- 01632 #define UINT_MAX 0xFFFFFFFF /* maximum value of an unsigned 32-bit int */
- 01633 #endif
- 01634
- .Ep 18 include/limits.h
- 01635 /*Definitions about longs (32 bits in MINIX). */
- 01636 #define LONG_MIN (-2147483647L-1)/* minimum value of a long */
- 01637 #define LONG_MAX 2147483647L /* maximum value of a long */
- 01638 #define ULONG_MAX 0xFFFFFFFFL /* maximum value of an unsigned long */
- 01639
- 01640 /* Minimum sizes required by the POSIX P1003.1 standard (Table 2-3). */
- 01641 #ifdef _POSIX_SOURCE /* these are only visible for POSIX */
- 01642 #define _POSIX_ARG_MAX 4096 /* exec() may have 4K worth of args */
- 01643 #define _POSIX_CHILD_MAX 6 /* a process may have 6 children */
- 01644 #define _POSIX_LINK_MAX 8 /* a file may have 8 links */
- 01645 #define _POSIX_MAX_CANON 255 /* size of the canonical input queue */
- 01646 #define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */
- 01647 #define _POSIX_NAME_MAX 14 /* a file name may have 14 chars */
- 01648 #define _POSIX_NGROUPS_MAX 0 /* supplementary group IDs are optional */
- 01649 #define _POSIX_OPEN_MAX 16 /* a process may have 16 files open */
- 01650 #define _POSIX_PATH_MAX 255 /* a pathname may contain 255 chars */
- 01651 #define _POSIX_PIPE_BUF 512 /* pipes writes of 512 bytes must be atomic */
- 01652 #define _POSIX_STREAM_MAX 8 /* at least 8 FILEs can be open at once */
- 01653 #define _POSIX_TZNAME_MAX 3 /* time zone names can be at least 3 chars */
- 01654 #define _POSIX_SSIZE_MAX 32767 /* read() must support 32767 byte reads */
- 01655
- 01656 /* Values actually implemented by MINIX (Tables 2-4, 2-5, 2-6, and 2-7). */
- 01657 /* Some of these old names had better be defined when not POSIX. */
- 01658 #define _NO_LIMIT 100 /* arbitrary number; limit not enforced */
- 01659
- 01660 #define NGROUPS_MAX 0 /* supplemental group IDs not available */
- 01661 #if _EM_WSIZE > 2
- 01662 #define ARG_MAX 16384 /* # bytes of args + environ for exec() */
- 01663 #else
- 01664 #define ARG_MAX 4096 /* args + environ on small machines */
- 01665 #endif
- 01666 #define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */
- 01667 #define OPEN_MAX 20 /* # open files a process may have */
- 01668 #define LINK_MAX 127 /* # links a file may have */
- 01669 #define MAX_CANON 255 /* size of the canonical input queue */
- 01670 #define MAX_INPUT 255 /* size of the type-ahead buffer */
- 01671 #define NAME_MAX 14 /* # chars in a file name */
- 01672 #define PATH_MAX 255 /* # chars in a path name */
- 01673 #define PIPE_BUF 7168 /* # bytes in atomic write to a pipe */
- 01674 #define STREAM_MAX 20 /* must be the same as FOPEN_MAX in stdio.h */
- 01675 #define TZNAME_MAX 3 /* maximum bytes in a time zone name is 3 */
- 01676 #define SSIZE_MAX 32767 /* max defined byte count for read() */
- 01677
- 01678 #endif /* _POSIX_SOURCE */
- 01679
- 01680 #endif /* _LIMITS_H */
- .Op 19 include/locale.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/locale.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01700 /* The <locale.h> header is used to custom tailor currency symbols, decimal
- 01701 * points, and other items to the local style. It is ANSI's attempt at
- 01702 * avoiding cultural imperialism. The locale given below is for C.
- 01703 */
- 01704
- 01705 #ifndef _LOCALE_H
- 01706 #define _LOCALE_H
- 01707
- 01708 struct lconv {
- 01709 char *decimal_point; /* "." */
- 01710 char *thousands_sep; /* "" */
- 01711 char *grouping; /* "" */
- 01712 char *int_curr_symbol; /* "" */
- 01713 char *currency_symbol; /* "" */
- 01714 char *mon_decimal_point; /* "" */
- 01715 char *mon_thousands_sep; /* "" */
- 01716 char *mon_grouping; /* "" */
- 01717 char *positive_sign; /* "" */
- 01718 char *negative_sign; /* "" */
- 01719 char int_frac_digits; /* CHAR_MAX */
- 01720 char frac_digits; /* CHAR_MAX */
- 01721 char p_cs_precedes; /* CHAR_MAX */
- 01722 char p_sep_by_space; /* CHAR_MAX */
- 01723 char n_cs_precedes; /* CHAR_MAX */
- 01724 char n_sep_by_space; /* CHAR_MAX */
- 01725 char p_sign_posn; /* CHAR_MAX */
- 01726 char n_sign_posn; /* CHAR_MAX */
- 01727 };
- 01728
- 01729 #define NULL ((void *)0)
- 01730
- 01731 #define LC_ALL 1
- 01732 #define LC_COLLATE 2
- 01733 #define LC_CTYPE 3
- 01734 #define LC_MONETARY 4
- 01735 #define LC_NUMERIC 5
- 01736 #define LC_TIME 6
- 01737
- 01738 /* Function Prototypes. */
- 01739 #ifndef _ANSI_H
- 01740 #include <ansi.h>
- 01741 #endif
- 01742
- 01743 _PROTOTYPE( char *setlocale, (int _category, const char *_locale) );
- 01744 _PROTOTYPE( struct lconv *localeconv, (void) );
- 01745
- 01746 #endif /* _LOCALE_H */
- .Ep 20 include/math.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/math.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01800 /* The <math.h> header contains prototypes for mathematical functions. */
- 01801
- 01802 #ifndef _MATH_H
- 01803 #define _MATH_H
- 01804
- 01805 #define HUGE_VAL (__huge_val()) /* may be infinity */
- 01806
- 01807 /* Function Prototypes. */
- 01808 #ifndef _ANSI_H
- 01809 #include <ansi.h>
- 01810 #endif
- 01811
- 01812 _PROTOTYPE( double __huge_val, (void) );
- 01813 _PROTOTYPE( int __IsNan, (double _x) );
- 01814
- 01815 _PROTOTYPE( double acos, (double _x) );
- 01816 _PROTOTYPE( double asin, (double _x) );
- 01817 _PROTOTYPE( double atan, (double _x) );
- 01818 _PROTOTYPE( double atan2, (double _y, double _x) );
- 01819 _PROTOTYPE( double ceil, (double _x) );
- 01820 _PROTOTYPE( double cos, (double _x) );
- 01821 _PROTOTYPE( double cosh, (double _x) );
- 01822 _PROTOTYPE( double exp, (double _x) );
- 01823 _PROTOTYPE( double fabs, (double _x) );
- 01824 _PROTOTYPE( double floor, (double _x) );
- 01825 _PROTOTYPE( double fmod, (double _x, double _y) );
- 01826 _PROTOTYPE( double frexp, (double _x, int *_exp) );
- 01827 _PROTOTYPE( double ldexp, (double _x, int _exp) );
- 01828 _PROTOTYPE( double log, (double _x) );
- 01829 _PROTOTYPE( double log10, (double _x) );
- 01830 _PROTOTYPE( double modf, (double _x, double *_iptr) );
- 01831 _PROTOTYPE( double pow, (double _x, double _y) );
- 01832 _PROTOTYPE( double sin, (double _x) );
- 01833 _PROTOTYPE( double sinh, (double _x) );
- 01834 _PROTOTYPE( double sqrt, (double _x) );
- 01835 _PROTOTYPE( double tan, (double _x) );
- 01836 _PROTOTYPE( double tanh, (double _x) );
- 01837
- 01838 #endif /* _MATH_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/mathconst.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01900 /*
- 01901 * mathconst.h - mathematic constants
- 01902 */
- 01903 /* $Header: mathconst.h,v 1.3 89/12/18 13:59:33 eck Exp $ */
- 01904
- 01905 #ifndef _MATHCONST_H
- 01906 #define _MATHCONST_H
- 01907
- 01908 /* Some constants (Hart & Cheney) */
- 01909 #define M_PI 3.14159265358979323846264338327950288
- .Op 21 include/mathconst.h
- 01910 #define M_2PI 6.28318530717958647692528676655900576
- 01911 #define M_3PI_4 2.35619449019234492884698253745962716
- 01912 #define M_PI_2 1.57079632679489661923132169163975144
- 01913 #define M_3PI_8 1.17809724509617246442349126872981358
- 01914 #define M_PI_4 0.78539816339744830961566084581987572
- 01915 #define M_PI_8 0.39269908169872415480783042290993786
- 01916 #define M_1_PI 0.31830988618379067153776752674502872
- 01917 #define M_2_PI 0.63661977236758134307553505349005744
- 01918 #define M_4_PI 1.27323954473516268615107010698011488
- 01919 #define M_E 2.71828182845904523536028747135266250
- 01920 #define M_LOG2E 1.44269504088896340735992468100189213
- 01921 #define M_LOG10E 0.43429448190325182765112891891660508
- 01922 #define M_LN2 0.69314718055994530941723212145817657
- 01923 #define M_LN10 2.30258509299404568401799145468436421
- 01924 #define M_SQRT2 1.41421356237309504880168872420969808
- 01925 #define M_1_SQRT2 0.70710678118654752440084436210484904
- 01926 #define M_EULER 0.57721566490153286060651209008240243
- 01927
- 01928 #endif /* _MATHCONST_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/pwd.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02000 /* The <pwd.h> header defines the items in the password file. */
- 02001
- 02002 #ifndef _PWD_H
- 02003 #define _PWD_H
- 02004
- 02005 struct passwd {
- 02006 char *pw_name; /* login name */
- 02007 uid_t pw_uid; /* uid corresponding to the name */
- 02008 gid_t pw_gid; /* gid corresponding to the name */
- 02009 char *pw_dir; /* user's home directory */
- 02010 char *pw_shell; /* name of the user's shell */
- 02011
- 02012 /* The following members are not defined by POSIX. */
- 02013 char *pw_passwd; /* password information */
- 02014 char *pw_gecos; /* just in case you have a GE 645 around */
- 02015 };
- 02016
- 02017
- 02018 /* Function Prototypes. */
- 02019 #ifndef _ANSI_H
- 02020 #include <ansi.h>
- 02021 #endif
- 02022
- 02023 _PROTOTYPE( struct passwd *getpwnam, (const char *_name) );
- 02024 _PROTOTYPE( struct passwd *getpwuid, (Uid_t _uid) );
- 02025
- 02026 #ifdef _MINIX
- 02027 _PROTOTYPE( void endpwent, (void) );
- 02028 _PROTOTYPE( struct passwd *getpwent, (void) );
- 02029 _PROTOTYPE( int setpwent, (void) );
- 02030 _PROTOTYPE( void setpwfile, (const char *_file) );
- 02031 #endif
- 02032
- 02033 #endif /* _PWD_H */
- .Ep 22 include/regexp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/regexp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02100 /* The <regexp.h> header is used by the (V8-compatible) regexp(3) routines. */
- 02101
- 02102 #ifndef _REGEXP_H
- 02103 #define _REGEXP_H
- 02104
- 02105 #define CHARBITS 0377
- 02106 #define NSUBEXP 10
- 02107 typedef struct regexp {
- 02108 char *startp[NSUBEXP];
- 02109 char *endp[NSUBEXP];
- 02110 char regstart; /* Internal use only. */
- 02111 char reganch; /* Internal use only. */
- 02112 char *regmust; /* Internal use only. */
- 02113 int regmlen; /* Internal use only. */
- 02114 char program[1]; /* Unwarranted chumminess with compiler. */
- 02115 } regexp;
- 02116
- 02117 /* Function Prototypes. */
- 02118 #ifndef _ANSI_H
- 02119 #include <ansi.h>
- 02120 #endif
- 02121
- 02122 _PROTOTYPE( regexp *regcomp, (char *_exp) );
- 02123 _PROTOTYPE( int regexec, (regexp *_prog, char *_string, int _bolflag) );
- 02124 _PROTOTYPE( void regsub, (regexp *_prog, char *_source, char *_dest) );
- 02125 _PROTOTYPE( void regerror, (char *_message) );
- 02126
- 02127 #endif /* _REGEXP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/setjmp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02200 /* The <setjmp.h> header relates to the C phenomenon known as setjmp/longjmp.
- 02201 * It is used to escape out of the current situation into a previous one.
- 02202 * A typical example is in an editor, where hitting DEL breaks off the current
- 02203 * command and puts the editor back in the main loop, though care has to be
- 02204 * taken when the DEL occurs while executing a library function, since
- 02205 * some of them are not reentrant.
- 02206 *
- 02207 * POSIX does not require the process signal mask to be saved and restored
- 02208 * during setjmp/longjmp. However, the current implementation does this
- 02209 * in order to agree with OSF/1 and other BSD derived systems.
- 02210 *
- 02211 * The pair of functions _setjmp/_longjmp may be used when the signal
- 02212 * mask is not to be saved/restored. These functions are traditional
- 02213 * in BSD systems.
- 02214 *
- 02215 * There are different ways of implementing setjmp/longjmp. Probably
- 02216 * the best way is to unify it with signal handling. This is true for the
- 02217 * following reasons: Both setjmp/longjmp and signal delivery must save
- 02218 * a context so that it may be restored later. The jmp_buf necessarily
- 02219 * contains signal information, namely the signal mask to restore. Both
- .Op 23 include/setjmp.h
- 02220 * longjmp and the return of a signal handler must trap to the operating
- 02221 * system to restore the previous signal mask. Finally, the jmp_buf
- 02222 * and the sigcontext structure contain the registers to restore.
- 02223 *
- 02224 * Some compilers, namely ACK, will not enregister any variables inside a
- 02225 * function containing a call to setjmp, even if those variables are
- 02226 * explicitly declared as register variables. Thus for ACK, the
- 02227 * identification of the jmp_buf with a sigcontext structure would cause
- 02228 * unnecessary overhead: the jmp_buf has room for all the registers, but
- 02229 * the only registers that need to be saved are the stack pointer,
- 02230 * frame pointer, and program counter.
- 02231 *
- 02232 * So, for ACK a jmp_buf is much smaller than a sigcontext structure, and
- 02233 * longjmp does not directly call sigreturn. Instead, longjmp calls a
- 02234 * front-end function which initializes the appropriate fields of a
- 02235 * sigcontext structure, marks this structure as containing no valid
- 02236 * general purpose registers, and then calls sigreturn.
- 02237 *
- 02238 * The POSIX sigjmp_buf is identical to the jmp_buf in all cases.
- 02239 *
- 02240 * Different compilers have different symbols that they recognize as
- 02241 * setjmp symbols. ACK recognizes __setjmp, the GNU C compiler
- 02242 * recognizes setjmp and _setjmp, and BCC recognizes all three.
- 02243 * When these symbols occur within a function, the compiler may keep
- 02244 * all local variables on the stack, avoid certain optimizations, or
- 02245 * pass hidden arguments to the setjmp function.
- 02246 *
- 02247 * Thus, setjmp implementations vary in two independent ways which may
- 02248 * be identified through the following preprocessor tokens:
- 02249 *
- 02250 * _SETJMP_SYMBOL -- If 0, this means the compiler treats setjmp and _setjmp
- 02251 * specially. If 1, this means the compiler treats __setjmp specially.
- 02252 *
- 02253 * _SETJMP_SAVES_REGS -- If 1, this means setjmp/longjmp must explicitly
- 02254 * save and restore all registers. This also implies that a jmp_buf is
- 02255 * different than a sigcontext structure. If 0, this means that the compiler
- 02256 * will not use register variables within a function that calls one of
- 02257 * its SETJMP_SYMBOLs.
- 02258 *
- 02259 * When _SETJMP_SYMBOL = 1, the implementation has a few dozen bytes of
- 02260 * unnecessary overhead. This happens in the following manner: a program uses
- 02261 * _setjmp/_longjmp because it is not interested in saving and restoring the
- 02262 * signal mask. Nevertheless, because _setjmp expands to the general purpose
- 02263 * function __setjmp, code for sigprocmask(2) is linked into the program.
- 02264 */
- 02265
- 02266 #ifndef _SETJMP_H
- 02267 #define _SETJMP_H
- 02268
- 02269 #ifndef _ANSI_H
- 02270 #include <ansi.h>
- 02271 #endif
- 02272
- 02273 #if !defined(__ACK__) && !defined(__BCC__) && !defined(__GNUC__)
- 02274 #define __ACK__
- 02275 #endif
- 02276
- 02277 #ifdef __ACK__
- 02278 #define _SETJMP_SYMBOL 1
- 02279 #define _SETJMP_SAVES_REGS 0
- .Ep 24 include/setjmp.h
- 02280 #endif
- 02281 #ifdef __BCC__
- 02282 #define _SETJMP_SYMBOL 0
- 02283 #define _SETJMP_SAVES_REGS 1
- 02284 #endif
- 02285 #ifdef __GNUC__
- 02286 #define _SETJMP_SYMBOL 0
- 02287 #define _SETJMP_SAVES_REGS 1
- 02288 #endif
- 02289
- 02290 /* The jmp_buf data type. Do not change the order of these fields -- some
- 02291 * C library code refers to these fields by name. When _SETJMP_SAVES_REGS
- 02292 * is 1, the file <sys/jmp_buf.h> gives the usage of the sixteen registers.
- 02293 */
- 02294 typedef struct {
- 02295 int __flags; /* XXX - long might give better alignment */
- 02296 long __mask; /* must have size >= sizeof(sigset_t) */
- 02297 #if (_SETJMP_SAVES_REGS == 0)
- 02298 _PROTOTYPE(void (*__pc),(void)); /* program counter */
- 02299 void *__sp; /* stack pointer */
- 02300 void *__lb; /* local base (ACKspeak for frame pointer) */
- 02301 #else
- 02302 void *__regs[16]; /* size is machine dependent */
- 02303 #endif
- 02304 } jmp_buf[1];
- 02305
- 02306 #if (_SETJMP_SYMBOL == 1)
- 02307
- 02308 _PROTOTYPE( int __setjmp, (jmp_buf _env, int _savemask) );
- 02309 _PROTOTYPE( void longjmp, (jmp_buf _env, int _val) );
- 02310 _PROTOTYPE(int sigjmp, (jmp_buf _jb, int _retval) );
- 02311
- 02312 #define setjmp(env) __setjmp((env), 1)
- 02313
- 02314 #ifdef _MINIX
- 02315 #define _setjmp(env) __setjmp((env), 0)
- 02316 _PROTOTYPE(void _longjmp, (jmp_buf _env, int _val) );
- 02317 #endif
- 02318
- 02319 #ifdef _POSIX_SOURCE
- 02320 typedef jmp_buf sigjmp_buf;
- 02321 _PROTOTYPE( void siglongjmp, (sigjmp_buf _env, int _val) );
- 02322
- 02323 #define sigsetjmp(env, savemask) __setjmp((env), (savemask))
- 02324 #endif /* _POSIX_SOURCE */
- 02325
- 02326 #endif /* _SETJMP_SYMBOL == 1 */
- 02327
- 02328 #if (_SETJMP_SYMBOL == 0)
- 02329
- 02330 _PROTOTYPE( int setjmp, (jmp_buf _env) );
- 02331 _PROTOTYPE( void longjmp, (jmp_buf _env, int _val) );
- 02332
- 02333 #ifdef _MINIX
- 02334 _PROTOTYPE( int _setjmp, (jmp_buf _env) );
- 02335 _PROTOTYPE( void _longjmp, (jmp_buf _env, int _val) );
- 02336 #endif
- 02337
- 02338 #ifdef _POSIX_SOURCE
- 02339 #define sigjmp_buf jmp_buf
- .Op 25 include/setjmp.h
- 02340 _PROTOTYPE( void siglongjmp, (sigjmp_buf _env, int _val) );
- 02341 /* XXX - the name _setjmp is no good - that's why ACK used __setjmp. */
- 02342 #define sigsetjmp(env, savemask) ((savemask) ? setjmp(env) : _setjmp(env))
- 02343 #endif /* _POSIX_SOURCE */
- 02344
- 02345 #endif /* _SETJMP_SYMBOL == 0 */
- 02346
- 02347 #endif /* _SETJMP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sgtty.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02400 /* The <sgtty.h> header contains data structures for ioctl(). */
- 02401
- 02402 #ifndef _SGTTY_H
- 02403 #define _SGTTY_H
- 02404
- 02405 /* Should not be used, nor extended. Termios.h is the replacement for
- 02406 * sgtty.h for tty functions, and ioctl replaced code should be moved to
- 02407 * sys/ioctl.h and specific header files in the sys, or minix directory.
- 02408 */
- 02409 #include <sys/ioctl.h> /* Ouch. */
- 02410
- 02411 struct sgttyb {
- 02412 char sg_ispeed; /* input speed */
- 02413 char sg_ospeed; /* output speed */
- 02414 char sg_erase; /* erase character */
- 02415 char sg_kill; /* kill character */
- 02416 int sg_flags; /* mode flags */
- 02417 };
- 02418
- 02419 struct tchars {
- 02420 char t_intrc; /* SIGINT char */
- 02421 char t_quitc; /* SIGQUIT char */
- 02422 char t_startc; /* start output (initially CTRL-Q) */
- 02423 char t_stopc; /* stop output (initially CTRL-S) */
- 02424 char t_eofc; /* EOF (initially CTRL-D) */
- 02425 char t_brkc; /* input delimiter (like nl) */
- 02426 };
- 02427
- 02428 #if !_SYSTEM /* the kernel doesn't want to see the rest */
- 02429
- 02430 /* Field names */
- 02431 #define XTABS 0006000 /* do tab expansion */
- 02432 #define BITS8 0001400 /* 8 bits/char */
- 02433 #define BITS7 0001000 /* 7 bits/char */
- 02434 #define BITS6 0000400 /* 6 bits/char */
- 02435 #define BITS5 0000000 /* 5 bits/char */
- 02436 #define EVENP 0000200 /* even parity */
- 02437 #define ODDP 0000100 /* odd parity */
- 02438 #define RAW 0000040 /* enable raw mode */
- 02439 #define CRMOD 0000020 /* map lf to cr + lf */
- 02440 #define ECHO 0000010 /* echo input */
- 02441 #define CBREAK 0000002 /* enable cbreak mode */
- 02442 #define COOKED 0000000 /* neither CBREAK nor RAW */
- 02443
- 02444 #define DCD 0100000 /* Data Carrier Detect */
- .Ep 26 include/sgtty.h
- 02445
- 02446 /* Line speeds */
- 02447 #define B0 0 /* code for line-hangup */
- 02448 #define B110 1
- 02449 #define B300 3
- 02450 #define B1200 12
- 02451 #define B2400 24
- 02452 #define B4800 48
- 02453 #define B9600 96
- 02454 #define B19200 192
- 02455 #define B38400 195
- 02456 #define B57600 194
- 02457 #define B115200 193
- 02458
- 02459 /* Things Minix supports but not properly */
- 02460 /* the divide-by-100 encoding ain't too hot */
- 02461 #define ANYP 0000300
- 02462 #define B50 0
- 02463 #define B75 0
- 02464 #define B134 0
- 02465 #define B150 0
- 02466 #define B200 2
- 02467 #define B600 6
- 02468 #define B1800 18
- 02469 #define B3600 36
- 02470 #define B7200 72
- 02471 #define EXTA 192
- 02472 #define EXTB 0
- 02473
- 02474 /* Things Minix doesn't support but are fairly harmless if used */
- 02475 #define NLDELAY 0001400
- 02476 #define TBDELAY 0006000
- 02477 #define CRDELAY 0030000
- 02478 #define VTDELAY 0040000
- 02479 #define BSDELAY 0100000
- 02480 #define ALLDELAY 0177400
- 02481
- 02482 /* Copied from termios.h: */
- 02483 struct winsize
- 02484 {
- 02485 unsigned short ws_row; /* rows, in characters */
- 02486 unsigned short ws_col; /* columns, in characters */
- 02487 unsigned short ws_xpixel; /* horizontal size, pixels */
- 02488 unsigned short ws_ypixel; /* vertical size, pixels */
- 02489 };
- 02490 #endif /* !_SYSTEM */
- 02491 #endif /* _SGTTY_H */
- .Op 27 include/signal.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/signal.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02500 /* The <signal.h> header defines all the ANSI and POSIX signals.
- 02501 * MINIX supports all the signals required by POSIX. They are defined below.
- 02502 * Some additional signals are also supported.
- 02503 */
- 02504
- 02505 #ifndef _SIGNAL_H
- 02506 #define _SIGNAL_H
- 02507
- 02508 #ifndef _ANSI_H
- 02509 #include <ansi.h>
- 02510 #endif
- 02511
- 02512 /* Here are types that are closely associated with signal handling. */
- 02513 typedef int sig_atomic_t;
- 02514
- 02515 #ifdef _POSIX_SOURCE
- 02516 #ifndef _SIGSET_T
- 02517 #define _SIGSET_T
- 02518 typedef unsigned long sigset_t;
- 02519 #endif
- 02520 #endif
- 02521
- 02522 #define _NSIG 16 /* number of signals used */
- 02523
- 02524 #define SIGHUP 1 /* hangup */
- 02525 #define SIGINT 2 /* interrupt (DEL) */
- 02526 #define SIGQUIT 3 /* quit (ASCII FS) */
- 02527 #define SIGILL 4 /* illegal instruction */
- 02528 #define SIGTRAP 5 /* trace trap (not reset when caught) */
- 02529 #define SIGABRT 6 /* IOT instruction */
- 02530 #define SIGIOT 6 /* SIGABRT for people who speak PDP-11 */
- 02531 #define SIGUNUSED 7 /* spare code */
- 02532 #define SIGFPE 8 /* floating point exception */
- 02533 #define SIGKILL 9 /* kill (cannot be caught or ignored) */
- 02534 #define SIGUSR1 10 /* user defined signal # 1 */
- 02535 #define SIGSEGV 11 /* segmentation violation */
- 02536 #define SIGUSR2 12 /* user defined signal # 2 */
- 02537 #define SIGPIPE 13 /* write on a pipe with no one to read it */
- 02538 #define SIGALRM 14 /* alarm clock */
- 02539 #define SIGTERM 15 /* software termination signal from kill */
- 02540
- 02541 #define SIGEMT 7 /* obsolete */
- 02542 #define SIGBUS 10 /* obsolete */
- 02543
- 02544 /* POSIX requires the following signals to be defined, even if they are
- 02545 * not supported. Here are the definitions, but they are not supported.
- 02546 */
- 02547 #define SIGCHLD 17 /* child process terminated or stopped */
- 02548 #define SIGCONT 18 /* continue if stopped */
- 02549 #define SIGSTOP 19 /* stop signal */
- 02550 #define SIGTSTP 20 /* interactive stop signal */
- 02551 #define SIGTTIN 21 /* background process wants to read */
- 02552 #define SIGTTOU 22 /* background process wants to write */
- 02553
- 02554 /* The sighandler_t type is not allowed unless _POSIX_SOURCE is defined. */
- .Ep 28 include/signal.h
- 02555 #ifdef _POSIX_SOURCE
- 02556 #define __sighandler_t sighandler_t
- 02557 #else
- 02558 typedef void (*__sighandler_t) (int);
- 02559 #endif
- 02560
- 02561 /* Macros used as function pointers. */
- 02562 #define SIG_ERR ((__sighandler_t) -1) /* error return */
- 02563 #define SIG_DFL ((__sighandler_t) 0) /* default signal handling */
- 02564 #define SIG_IGN ((__sighandler_t) 1) /* ignore signal */
- 02565 #define SIG_HOLD ((__sighandler_t) 2) /* block signal */
- 02566 #define SIG_CATCH ((__sighandler_t) 3) /* catch signal */
- 02567
- 02568 #ifdef _POSIX_SOURCE
- 02569 struct sigaction {
- 02570 __sighandler_t sa_handler; /* SIG_DFL, SIG_IGN, or pointer to function */
- 02571 sigset_t sa_mask; /* signals to be blocked during handler */
- 02572 int sa_flags; /* special flags */
- 02573 };
- 02574
- 02575 /* Fields for sa_flags. */
- 02576 #define SA_ONSTACK 0x0001 /* deliver signal on alternate stack */
- 02577 #define SA_RESETHAND 0x0002 /* reset signal handler when signal caught */
- 02578 #define SA_NODEFER 0x0004 /* don't block signal while catching it */
- 02579 #define SA_RESTART 0x0008 /* automatic system call restart */
- 02580 #define SA_SIGINFO 0x0010 /* extended signal handling */
- 02581 #define SA_NOCLDWAIT 0x0020 /* don't create zombies */
- 02582 #define SA_NOCLDSTOP 0x0040 /* don't receive SIGCHLD when child stops */
- 02583
- 02584 /* POSIX requires these values for use with sigprocmask(2). */
- 02585 #define SIG_BLOCK 0 /* for blocking signals */
- 02586 #define SIG_UNBLOCK 1 /* for unblocking signals */
- 02587 #define SIG_SETMASK 2 /* for setting the signal mask */
- 02588 #define SIG_INQUIRE 4 /* for internal use only */
- 02589 #endif /* _POSIX_SOURCE */
- 02590
- 02591 /* POSIX and ANSI function prototypes. */
- 02592 _PROTOTYPE( int raise, (int _sig) );
- 02593 _PROTOTYPE( __sighandler_t signal, (int _sig, __sighandler_t _func) );
- 02594
- 02595 #ifdef _POSIX_SOURCE
- 02596 _PROTOTYPE( int kill, (pid_t _pid, int _sig) );
- 02597 _PROTOTYPE( int sigaction,
- 02598 (int _sig, const struct sigaction *_act, struct sigaction *_oact) );
- 02599 _PROTOTYPE( int sigaddset, (sigset_t *_set, int _sig) );
- 02600 _PROTOTYPE( int sigdelset, (sigset_t *_set, int _sig) );
- 02601 _PROTOTYPE( int sigemptyset, (sigset_t *_set) );
- 02602 _PROTOTYPE( int sigfillset, (sigset_t *_set) );
- 02603 _PROTOTYPE( int sigismember, (sigset_t *_set, int _sig) );
- 02604 _PROTOTYPE( int sigpending, (sigset_t *_set) );
- 02605 _PROTOTYPE( int sigprocmask,
- 02606 (int _how, const sigset_t *_set, sigset_t *_oset) );
- 02607 _PROTOTYPE( int sigsuspend, (const sigset_t *_sigmask) );
- 02608 #endif
- 02609
- 02610 #endif /* _SIGNAL_H */
- .Op 29 include/stdarg.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/stdarg.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02700 /* The <stdarg.h> header is ANSI's way to handle variable numbers of params.
- 02701 * Some programming languages require a function that is declared with n
- 02702 * parameters to be called with n parameters. C does not. A function may
- 02703 * called with more parameters than it is declared with. The well-known
- 02704 * printf function, for example, may have arbitrarily many parameters.
- 02705 * The question arises how one can access all the parameters in a portable
- 02706 * way. The C standard defines three macros that programs can use to
- 02707 * advance through the parameter list. The definition of these macros for
- 02708 * MINIX are given in this file. The three macros are:
- 02709 *
- 02710 * va_start(ap, parmN) prepare to access parameters
- 02711 * va_arg(ap, type) get next parameter value and type
- 02712 * va_end(ap) access is finished
- 02713 *
- 02714 * Ken Thompson's famous line from V6 UNIX is equally applicable to this file:
- 02715 *
- 02716 * "You are not expected to understand this"
- 02717 *
- 02718 */
- 02719
- 02720 #ifndef _STDARG_H
- 02721 #define _STDARG_H
- 02722
- 02723
- 02724 #ifdef __GNUC__
- 02725 /* The GNU C-compiler uses its own, but similar varargs mechanism. */
- 02726
- 02727 typedef char *va_list;
- 02728
- 02729 /* Amount of space required in an argument list for an arg of type TYPE.
- 02730 * TYPE may alternatively be an expression whose type is used.
- 02731 */
- 02732
- 02733 #define __va_rounded_size(TYPE)
- 02734 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
- 02735
- 02736 #if __GNUC__ < 2
- 02737
- 02738 #ifndef __sparc__
- 02739 #define va_start(AP, LASTARG)
- 02740 (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
- 02741 #else
- 02742 #define va_start(AP, LASTARG)
- 02743 (__builtin_saveregs (),
- 02744 AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
- 02745 #endif
- 02746
- 02747 void va_end (va_list); /* Defined in gnulib */
- 02748 #define va_end(AP)
- 02749
- 02750 #define va_arg(AP, TYPE)
- 02751 (AP += __va_rounded_size (TYPE),
- 02752 *((TYPE *) (AP - __va_rounded_size (TYPE))))
- 02753
- 02754 #else /* __GNUC__ >= 2 */
- .Ep 30 include/stdarg.h
- 02755
- 02756 #ifndef __sparc__
- 02757 #define va_start(AP, LASTARG)
- 02758 (AP = ((char *) __builtin_next_arg ()))
- 02759 #else
- 02760 #define va_start(AP, LASTARG)
- 02761 (__builtin_saveregs (), AP = ((char *) __builtin_next_arg ()))
- 02762 #endif
- 02763
- 02764 void va_end (va_list); /* Defined in libgcc.a */
- 02765 #define va_end(AP)
- 02766
- 02767 #define va_arg(AP, TYPE)
- 02768 (AP = ((char *) (AP)) += __va_rounded_size (TYPE),
- 02769 *((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE))))
- 02770
- 02771 #endif /* __GNUC__ >= 2 */
- 02772
- 02773 #else /* not __GNUC__ */
- 02774
- 02775
- 02776 typedef char *va_list;
- 02777
- 02778 #define __vasz(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))
- 02779
- 02780 #define va_start(ap, parmN) ((ap) = (va_list)&parmN + __vasz(parmN))
- 02781 #define va_arg(ap, type)
- 02782 (*((type *)((va_list)((ap) = (void *)((va_list)(ap) + __vasz(type)))
- 02783 - __vasz(type))))
- 02784 #define va_end(ap)
- 02785
- 02786
- 02787 #endif /* __GNUC__ */
- 02788
- 02789 #endif /* _STDARG_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/stddef.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02800 /* The <stddef.h> header defines certain commonly used macros. */
- 02801
- 02802 #ifndef _STDDEF_H
- 02803 #define _STDDEF_H
- 02804
- 02805 #define NULL ((void *)0)
- 02806
- 02807 /* The following is not portable, but the compiler accepts it. */
- 02808 #define offsetof(type, ident) ((size_t) (unsigned long) &((type *)0)->ident)
- 02809
- 02810 #if _EM_PSIZE == _EM_WSIZE
- 02811 typedef int ptrdiff_t; /* result of subtracting two pointers */
- 02812 #else /* _EM_PSIZE == _EM_LSIZE */
- 02813 typedef long ptrdiff_t;
- 02814 #endif
- .Op 31 include/stddef.h
- 02815
- 02816 #ifndef _SIZE_T
- 02817 #define _SIZE_T
- 02818 typedef unsigned int size_t; /* type returned by sizeof */
- 02819 #endif
- 02820
- 02821 #ifndef _WCHAR_T
- 02822 #define _WCHAR_T
- 02823 typedef char wchar_t; /* type expanded character set */
- 02824 #endif
- 02825
- 02826 #endif /* _STDDEF_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/stdio.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02900 /*
- 02901 * stdio.h - input/output definitions
- 02902 *
- 02903 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- 02904 * See the copyright notice in the ACK home directory, in the file "Copyright".
- 02905 */
- 02906 /* $Header: stdio.h,v 1.3 89/12/18 14:00:10 eck Exp $ */
- 02907
- 02908 #ifndef _STDIO_H
- 02909 #define _STDIO_H
- 02910
- 02911 /*
- 02912 * Focus point of all stdio activity.
- 02913 */
- 02914 typedef struct __iobuf {
- 02915 int _count;
- 02916 int _fd;
- 02917 int _flags;
- 02918 int _bufsiz;
- 02919 unsigned char *_buf;
- 02920 unsigned char *_ptr;
- 02921 } FILE;
- 02922
- 02923 #define _IOFBF 0x000
- 02924 #define _IOREAD 0x001
- 02925 #define _IOWRITE 0x002
- 02926 #define _IONBF 0x004
- 02927 #define _IOMYBUF 0x008
- 02928 #define _IOEOF 0x010
- 02929 #define _IOERR 0x020
- 02930 #define _IOLBF 0x040
- 02931 #define _IOREADING 0x080
- 02932 #define _IOWRITING 0x100
- 02933 #define _IOAPPEND 0x200
- 02934
- 02935 /* The following definitions are also in <unistd.h>. They should not
- 02936 * conflict.
- 02937 */
- 02938 #define SEEK_SET 0
- 02939 #define SEEK_CUR 1
- .Ep 32 include/stdio.h
- 02940 #define SEEK_END 2
- 02941
- 02942 #define stdin (&__stdin)
- 02943 #define stdout (&__stdout)
- 02944 #define stderr (&__stderr)
- 02945
- 02946 #define BUFSIZ 1024
- 02947 #define NULL ((void *)0)
- 02948 #define EOF (-1)
- 02949
- 02950 #define FOPEN_MAX 20
- 02951
- 02952 #define FILENAME_MAX 14
- 02953 #define TMP_MAX 999
- 02954 #define L_tmpnam (sizeof("/tmp/") + FILENAME_MAX)
- 02955 #define __STDIO_VA_LIST__ void *
- 02956
- 02957 typedef long int fpos_t;
- 02958
- 02959 #ifndef _SIZE_T
- 02960 #define _SIZE_T
- 02961 typedef unsigned int size_t; /* type returned by sizeof */
- 02962 #endif /* _SIZE_T */
- 02963
- 02964 extern FILE *__iotab[FOPEN_MAX];
- 02965 extern FILE __stdin, __stdout, __stderr;
- 02966
- 02967 #ifndef _ANSI_H
- 02968 #include <ansi.h>
- 02969 #endif
- 02970
- 02971 _PROTOTYPE( int remove, (const char *_filename) );
- 02972 _PROTOTYPE( int rename, (const char *_old, const char *_new) );
- 02973 _PROTOTYPE( FILE *tmpfile, (void) );
- 02974 _PROTOTYPE( char *tmpnam, (char *_s) );
- 02975 _PROTOTYPE( int fclose, (FILE *_stream) );
- 02976 _PROTOTYPE( int fflush, (FILE *_stream) );
- 02977 _PROTOTYPE( FILE *fopen, (const char *_filename, const char *_mode) );
- 02978 _PROTOTYPE( FILE *freopen,
- 02979 (const char *_filename, const char *_mode, FILE *_stream) );
- 02980 _PROTOTYPE( void setbuf, (FILE *_stream, char *_buf) );
- 02981 _PROTOTYPE( int setvbuf,
- 02982 (FILE *_stream, char *_buf, int _mode, size_t _size) );
- 02983 _PROTOTYPE( int fprintf, (FILE *_stream, const char *_format, ...) );
- 02984 _PROTOTYPE( int printf, (const char *_format, ...) );
- 02985 _PROTOTYPE( int sprintf, (char *_s, const char *_format, ...) );
- 02986 _PROTOTYPE( int vfprintf,
- 02987 (FILE *_stream, const char *_format, char *_arg) );
- 02988 _PROTOTYPE( int vprintf, (const char *_format, char *_arg) );
- 02989 _PROTOTYPE( int vsprintf, (char *_s, const char *_format, char *_arg) );
- 02990 _PROTOTYPE( int fscanf, (FILE *_stream, const char *_format, ...) );
- 02991 _PROTOTYPE( int scanf, (const char *_format, ...) );
- 02992 _PROTOTYPE( int sscanf, (const char *_s, const char *_format, ...) );
- 02993 #define vfscanf _doscan
- 02994 _PROTOTYPE( int vfscanf, (FILE *_stream, const char *_format, char *_arg));
- 02995 _PROTOTYPE( int vscanf, (const char *_format, char *_arg) );
- 02996 _PROTOTYPE( int vsscanf, (const char *_s, const char *_format, char *_arg));
- 02997 _PROTOTYPE( int fgetc, (FILE *_stream) );
- 02998 _PROTOTYPE( char *fgets, (char *_s, int _n, FILE *_stream) );
- 02999 _PROTOTYPE( int fputc, (int _c, FILE *_stream) );
- .Op 33 include/stdio.h
- 03000 _PROTOTYPE( int fputs, (const char *_s, FILE *_stream) );
- 03001 _PROTOTYPE( int getc, (FILE *_stream) );
- 03002 _PROTOTYPE( int getchar, (void) );
- 03003 _PROTOTYPE( char *gets, (char *_s) );
- 03004 _PROTOTYPE( int putc, (int _c, FILE *_stream) );
- 03005 _PROTOTYPE( int putchar, (int _c) );
- 03006 _PROTOTYPE( int puts, (const char *_s) );
- 03007 _PROTOTYPE( int ungetc, (int _c, FILE *_stream) );
- 03008 _PROTOTYPE( size_t fread,
- 03009 (void *_ptr, size_t _size, size_t _nmemb, FILE *_stream) );
- 03010 _PROTOTYPE( size_t fwrite,
- 03011 (const void *_ptr, size_t _size, size_t _nmemb, FILE *_stream) );
- 03012 _PROTOTYPE( int fgetpos, (FILE *_stream, fpos_t *_pos) );
- 03013 _PROTOTYPE( int fseek, (FILE *_stream, long _offset, int _whence) );
- 03014 _PROTOTYPE( int fsetpos, (FILE *_stream, fpos_t *_pos) );
- 03015 _PROTOTYPE( long ftell, (FILE *_stream) );
- 03016 _PROTOTYPE( void rewind, (FILE *_stream) );
- 03017 _PROTOTYPE( void clearerr, (FILE *_stream) );
- 03018 _PROTOTYPE( int feof, (FILE *_stream) );
- 03019 _PROTOTYPE( int ferror, (FILE *_stream) );
- 03020 _PROTOTYPE( void perror, (const char *_s) );
- 03021 _PROTOTYPE( int __fillbuf, (FILE *_stream) );
- 03022 _PROTOTYPE( int __flushbuf, (int _c, FILE *_stream) );
- 03023
- 03024 #define getchar() getc(stdin)
- 03025 #define putchar(c) putc(c,stdout)
- 03026 #define getc(p) (--(p)->_count >= 0 ? (int) (*(p)->_ptr++) :
- 03027 __fillbuf(p))
- 03028 #define putc(c, p) (--(p)->_count >= 0 ?
- 03029 (int) (*(p)->_ptr++ = (c)) :
- 03030 __flushbuf((c),(p)))
- 03031
- 03032 #define feof(p) (((p)->_flags & _IOEOF) != 0)
- 03033 #define ferror(p) (((p)->_flags & _IOERR) != 0)
- 03034 #define clearerr(p) ((p)->_flags &= ~(_IOERR|_IOEOF))
- 03035
- 03036 #ifdef _POSIX_SOURCE
- 03037 _PROTOTYPE( int fileno, (FILE *_stream) );
- 03038 _PROTOTYPE (FILE *fdopen, (int _fildes, const char *_types) );
- 03039 #define fileno(stream) ((stream)->_fd)
- 03040 #define L_ctermid 255 /* required by POSIX */
- 03041 #define L_cuserid 255 /* required by POSIX */
- 03042 #endif
- 03043
- 03044 #ifdef _MINIX
- 03045 _PROTOTYPE(FILE *popen, (const char *_command, const char *_type));
- 03046 _PROTOTYPE(int pclose, (FILE *_stream));
- 03047 #endif
- 03048
- 03049 #endif /* _STDIO_H */
- .Ep 34 include/stdlib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/stdlib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03100 /* The <stdlib.h> header defines certain common macros, types, and functions.*/
- 03101
- 03102 #ifndef _STDLIB_H
- 03103 #define _STDLIB_H
- 03104
- 03105 /* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/
- 03106 #define NULL ((void *)0)
- 03107
- 03108 #define EXIT_FAILURE 1 /* standard error return using exit() */
- 03109 #define EXIT_SUCCESS 0 /* successful return using exit() */
- 03110 #define RAND_MAX 32767 /* largest value generated by rand() */
- 03111 #define MB_CUR_MAX 1 /* max value of multibyte character in MINIX */
- 03112
- 03113 typedef struct { int quot, rem; } div_t;
- 03114 typedef struct { long quot, rem; } ldiv_t;
- 03115
- 03116 /* The types are size_t, wchar_t, div_t, and ldiv_t. */
- 03117 #ifndef _SIZE_T
- 03118 #define _SIZE_T
- 03119 typedef unsigned int size_t; /* type returned by sizeof */
- 03120 #endif
- 03121
- 03122 #ifndef _WCHAR_T
- 03123 #define _WCHAR_T
- 03124 typedef char wchar_t; /* type expanded character set */
- 03125 #endif
- 03126
- 03127 /* Function Prototypes. */
- 03128 #ifndef _ANSI_H
- 03129 #include <ansi.h>
- 03130 #endif
- 03131
- 03132 _PROTOTYPE( void abort, (void) );
- 03133 _PROTOTYPE( int abs, (int _j) );
- 03134 _PROTOTYPE( int atexit, (void (*_func)(void)) );
- 03135 _PROTOTYPE( double atof, (const char *_nptr) );
- 03136 _PROTOTYPE( int atoi, (const char *_nptr) );
- 03137 _PROTOTYPE( long atol, (const char *_nptr) );
- 03138 _PROTOTYPE( void *calloc, (size_t _nmemb, size_t _size) );
- 03139 _PROTOTYPE( div_t div, (int _numer, int _denom) );
- 03140 _PROTOTYPE( void exit, (int _status) );
- 03141 _PROTOTYPE( void free, (void *_ptr) );
- 03142 _PROTOTYPE( char *getenv, (const char *_name) );
- 03143 _PROTOTYPE( long labs, (long _j) );
- 03144 _PROTOTYPE( ldiv_t ldiv, (long _numer, long _denom) );
- 03145 _PROTOTYPE( void *malloc, (size_t _size) );
- 03146 _PROTOTYPE( int mblen, (const char *_s, size_t _n) );
- 03147 _PROTOTYPE( size_t mbstowcs, (wchar_t *_pwcs, const char *_s, size_t _n));
- 03148 _PROTOTYPE( int mbtowc, (wchar_t *_pwc, const char *_s, size_t _n) );
- 03149 _PROTOTYPE( int rand, (void) );
- 03150 _PROTOTYPE( void *realloc, (void *_ptr, size_t _size) );
- 03151 _PROTOTYPE( void srand, (unsigned int _seed) );
- 03152 _PROTOTYPE( double strtod, (const char *_nptr, char **_endptr) );
- 03153 _PROTOTYPE( long strtol, (const char *_nptr, char **_endptr, int _base) );
- 03154 _PROTOTYPE( int system, (const char *_string) );
- .Op 35 include/stdlib.h
- 03155 _PROTOTYPE( size_t wcstombs, (char *_s, const wchar_t *_pwcs, size_t _n));
- 03156 _PROTOTYPE( int wctomb, (char *_s, wchar_t _wchar) );
- 03157 _PROTOTYPE( void *bsearch, (const void *_key, const void *_base,
- 03158 size_t _nmemb, size_t _size,
- 03159 int (*compar) (const void *, const void *)) );
- 03160 _PROTOTYPE( void qsort, (void *_base, size_t _nmemb, size_t _size,
- 03161 int (*compar) (const void *, const void *)) );
- 03162 _PROTOTYPE( unsigned long int strtoul,
- 03163 (const char *_nptr, char **_endptr, int _base) );
- 03164
- 03165 #ifdef _MINIX
- 03166 _PROTOTYPE( int putenv, (const char *_name) );
- 03167 _PROTOTYPE(int getopt, (int _argc, char **_argv, char *_opts));
- 03168 extern char *optarg;
- 03169 extern int optind, opterr, optopt;
- 03170 #endif /* _MINIX */
- 03171
- 03172 #endif /* STDLIB_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/string.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03200 /* The <string.h> header contains prototypes for the string handling
- 03201 * functions.
- 03202 */
- 03203
- 03204 #ifndef _STRING_H
- 03205 #define _STRING_H
- 03206
- 03207 #define NULL ((void *)0)
- 03208
- 03209 #ifndef _SIZE_T
- 03210 #define _SIZE_T
- 03211 typedef unsigned int size_t; /* type returned by sizeof */
- 03212 #endif /*_SIZE_T */
- 03213
- 03214 /* Function Prototypes. */
- 03215 #ifndef _ANSI_H
- 03216 #include <ansi.h>
- 03217 #endif
- 03218
- 03219 _PROTOTYPE( void *memchr, (const void *_s, int _c, size_t _n) );
- 03220 _PROTOTYPE( int memcmp, (const void *_s1, const void *_s2, size_t _n) );
- 03221 _PROTOTYPE( void *memcpy, (void *_s1, const void *_s2, size_t _n) );
- 03222 _PROTOTYPE( void *memmove, (void *_s1, const void *_s2, size_t _n) );
- 03223 _PROTOTYPE( void *memset, (void *_s, int _c, size_t _n) );
- 03224 _PROTOTYPE( char *strcat, (char *_s1, const char *_s2) );
- 03225 _PROTOTYPE( char *strchr, (const char *_s, int _c) );
- 03226 _PROTOTYPE( int strncmp, (const char *_s1, const char *_s2, size_t _n) );
- 03227 _PROTOTYPE( int strcmp, (const char *_s1, const char *_s2) );
- 03228 _PROTOTYPE( int strcoll, (const char *_s1, const char *_s2) );
- 03229 _PROTOTYPE( char *strcpy, (char *_s1, const char *_s2) );
- 03230 _PROTOTYPE( size_t strcspn, (const char *_s1, const char *_s2) );
- 03231 _PROTOTYPE( char *strerror, (int _errnum) );
- 03232 _PROTOTYPE( size_t strlen, (const char *_s) );
- 03233 _PROTOTYPE( char *strncat, (char *_s1, const char *_s2, size_t _n) );
- 03234 _PROTOTYPE( char *strncpy, (char *_s1, const char *_s2, size_t _n) );
- .Ep 36 include/string.h
- 03235 _PROTOTYPE( char *strpbrk, (const char *_s1, const char *_s2) );
- 03236 _PROTOTYPE( char *strrchr, (const char *_s, int _c) );
- 03237 _PROTOTYPE( size_t strspn, (const char *_s1, const char *_s2) );
- 03238 _PROTOTYPE( char *strstr, (const char *_s1, const char *_s2) );
- 03239 _PROTOTYPE( char *strtok, (char *_s1, const char *_s2) );
- 03240 _PROTOTYPE( size_t strxfrm, (char *_s1, const char *_s2, size_t _n) );
- 03241
- 03242 #ifdef _MINIX
- 03243 /* For backward compatibility. */
- 03244 _PROTOTYPE( char *index, (const char *_s, int _charwanted) );
- 03245 _PROTOTYPE( char *rindex, (const char *_s, int _charwanted) );
- 03246 _PROTOTYPE( void bcopy, (const void *_src, void *_dst, size_t _length) );
- 03247 _PROTOTYPE( int bcmp, (const void *_s1, const void *_s2, size_t _length));
- 03248 _PROTOTYPE( void bzero, (void *_dst, size_t _length) );
- 03249 _PROTOTYPE( void *memccpy, (char *_dst, const char *_src, int _ucharstop,
- 03250 size_t _size) );
- 03251 /* BSD functions */
- 03252 _PROTOTYPE( int strcasecmp, (const char *_s1, const char *_s2) );
- 03253 #endif
- 03254
- 03255 #endif /* _STRING_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/tar.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03300 /* The <tar.h> header is used with the tape archiver, tar. */
- 03301
- 03302 #ifndef _TAR_H
- 03303 #define _TAR_H
- 03304
- 03305 #define TBLOCK 512
- 03306 #define NAMSIZ 100
- 03307 #define PFXSIZ 155
- 03308
- 03309 #define TMODLEN 8
- 03310 #define TUIDLEN 8
- 03311 #define TGIDLEN 8
- 03312 #define TSIZLEN 12
- 03313 #define TMTMLEN 12
- 03314 #define TCKSLEN 8
- 03315
- 03316 #define TMAGIC "ustar"
- 03317 #define TMAGLEN 6
- 03318 #define TVERSION "00"
- 03319 #define TVERSLEN 2
- 03320 #define TUNMLEN 32
- 03321 #define TGNMLEN 32
- 03322 #define TDEVLEN 8
- 03323
- 03324 #define REGTYPE '0'
- 03325 #define AREGTYPE ' '
- 03326 #define LNKTYPE '1'
- 03327 #define SYMTYPE '2'
- 03328 #define CHRTYPE '3'
- 03329 #define BLKTYPE '4'
- .Op 37 include/tar.h
- 03330 #define DIRTYPE '5'
- 03331 #define FIFOTYPE '6'
- 03332 #define CONTTYPE '7'
- 03333
- 03334 #define TSUID 04000
- 03335 #define TSGID 02000
- 03336 #define TSVTX 01000
- 03337
- 03338 #define TUREAD 00400
- 03339 #define TUWRITE 00200
- 03340 #define TUEXEC 00100
- 03341 #define TGREAD 00040
- 03342 #define TGWRITE 00020
- 03343 #define TGEXEC 00010
- 03344 #define TOREAD 00004
- 03345 #define TOWRITE 00002
- 03346 #define TOEXEC 00001
- 03347
- 03348 union hblock {
- 03349 char dummy[TBLOCK];
- 03350 struct header {
- 03351 char name[NAMSIZ];
- 03352 char mode[TMODLEN];
- 03353 char uid[TUIDLEN];
- 03354 char gid[TGIDLEN];
- 03355 char size[TSIZLEN];
- 03356 char mtime[TMTMLEN];
- 03357 char chksum[TCKSLEN];
- 03358 char typeflag;
- 03359 char linkname[NAMSIZ];
- 03360 char magic[TMAGLEN];
- 03361 char version[TVERSLEN];
- 03362 char uname[TUNMLEN];
- 03363 char gname[TGNMLEN];
- 03364 char devmajor[TDEVLEN];
- 03365 char devminor[TDEVLEN];
- 03366 char prefix[PFXSIZ];
- 03367 } dbuf;
- 03368 };
- 03369
- 03370 #endif /* _TAR_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/termcap.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03400 #ifndef _TERMCAP_H
- 03401 #define _TERMCAP_H
- 03402
- 03403 #include <ansi.h>
- 03404
- 03405 _PROTOTYPE( int tgetent, (char *_bp, char *_name) );
- 03406 _PROTOTYPE( int tgetflag, (char *_id) );
- 03407 _PROTOTYPE( int tgetnum, (char *_id) );
- 03408 _PROTOTYPE( char *tgetstr, (char *_id, char **_area) );
- 03409 _PROTOTYPE( char *tgoto, (char *_cm, int _destcol, int _destline) );
- .Ep 38 include/termcap.h
- 03410 _PROTOTYPE( int tputs, (char *_cp, int _affcnt, void (*_outc)(int)) );
- 03411
- 03412 #endif /* _TERMCAP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/termios.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03500 /* The <termios.h> header is used for controlling tty modes. */
- 03501
- 03502 #ifndef _TERMIOS_H
- 03503 #define _TERMIOS_H
- 03504
- 03505 typedef unsigned short tcflag_t;
- 03506 typedef unsigned char cc_t;
- 03507 typedef unsigned int speed_t;
- 03508
- 03509 #define NCCS 20 /* size of cc_c array, some extra space
- 03510 * for extensions. */
- 03511
- 03512 /* Primary terminal control structure. POSIX Table 7-1. */
- 03513 struct termios {
- 03514 tcflag_t c_iflag; /* input modes */
- 03515 tcflag_t c_oflag; /* output modes */
- 03516 tcflag_t c_cflag; /* control modes */
- 03517 tcflag_t c_lflag; /* local modes */
- 03518 speed_t c_ispeed; /* input speed */
- 03519 speed_t c_ospeed; /* output speed */
- 03520 cc_t c_cc[NCCS]; /* control characters */
- 03521 };
- 03522
- 03523 /* Values for termios c_iflag bit map. POSIX Table 7-2. */
- 03524 #define BRKINT 0x0001 /* signal interrupt on break */
- 03525 #define ICRNL 0x0002 /* map CR to NL on input */
- 03526 #define IGNBRK 0x0004 /* ignore break */
- 03527 #define IGNCR 0x0008 /* ignore CR */
- 03528 #define IGNPAR 0x0010 /* ignore characters with parity errors */
- 03529 #define INLCR 0x0020 /* map NL to CR on input */
- 03530 #define INPCK 0x0040 /* enable input parity check */
- 03531 #define ISTRIP 0x0080 /* mask off 8th bit */
- 03532 #define IXOFF 0x0100 /* enable start/stop input control */
- 03533 #define IXON 0x0200 /* enable start/stop output control */
- 03534 #define PARMRK 0x0400 /* mark parity errors in the input queue */
- 03535
- 03536 /* Values for termios c_oflag bit map. POSIX Sec. 7.1.2.3. */
- 03537 #define OPOST 0x0001 /* perform output processing */
- 03538
- 03539 /* Values for termios c_cflag bit map. POSIX Table 7-3. */
- 03540 #define CLOCAL 0x0001 /* ignore modem status lines */
- 03541 #define CREAD 0x0002 /* enable receiver */
- 03542 #define CSIZE 0x000C /* number of bits per character */
- 03543 #define CS5 0x0000 /* if CSIZE is CS5, characters are 5 bits */
- 03544 #define CS6 0x0004 /* if CSIZE is CS6, characters are 6 bits */
- 03545 #define CS7 0x0008 /* if CSIZE is CS7, characters are 7 bits */
- 03546 #define CS8 0x000C /* if CSIZE is CS8, characters are 8 bits */
- 03547 #define CSTOPB 0x0010 /* send 2 stop bits if set, else 1 */
- 03548 #define HUPCL 0x0020 /* hang up on last close */
- 03549 #define PARENB 0x0040 /* enable parity on output */
- .Op 39 include/termios.h
- 03550 #define PARODD 0x0080 /* use odd parity if set, else even */
- 03551
- 03552 /* Values for termios c_lflag bit map. POSIX Table 7-4. */
- 03553 #define ECHO 0x0001 /* enable echoing of input characters */
- 03554 #define ECHOE 0x0002 /* echo ERASE as backspace */
- 03555 #define ECHOK 0x0004 /* echo KILL */
- 03556 #define ECHONL 0x0008 /* echo NL */
- 03557 #define ICANON 0x0010 /* canonical input (erase and kill enabled) */
- 03558 #define IEXTEN 0x0020 /* enable extended functions */
- 03559 #define ISIG 0x0040 /* enable signals */
- 03560 #define NOFLSH 0x0080 /* disable flush after interrupt or quit */
- 03561 #define TOSTOP 0x0100 /* send SIGTTOU (job control, not implemented*/
- 03562
- 03563 /* Indices into c_cc array. Default values in parentheses. POSIX Table 7-5. */
- 03564 #define VEOF 0 /* cc_c[VEOF] = EOF char (^D) */
- 03565 #define VEOL 1 /* cc_c[VEOL] = EOL char (undef) */
- 03566 #define VERASE 2 /* cc_c[VERASE] = ERASE char (^H) */
- 03567 #define VINTR 3 /* cc_c[VINTR] = INTR char (DEL) */
- 03568 #define VKILL 4 /* cc_c[VKILL] = KILL char (^U) */
- 03569 #define VMIN 5 /* cc_c[VMIN] = MIN value for timer */
- 03570 #define VQUIT 6 /* cc_c[VQUIT] = QUIT char (^) */
- 03571 #define VTIME 7 /* cc_c[VTIME] = TIME value for timer */
- 03572 #define VSUSP 8 /* cc_c[VSUSP] = SUSP (^Z, ignored) */
- 03573 #define VSTART 9 /* cc_c[VSTART] = START char (^S) */
- 03574 #define VSTOP 10 /* cc_c[VSTOP] = STOP char (^Q) */
- 03575
- 03576 #define _POSIX_VDISABLE (cc_t)0xFF /* You can't even generate this
- 03577 * character with 'normal' keyboards.
- 03578 * But some language specific keyboards
- 03579 * can generate 0xFF. It seems that all
- 03580 * 256 are used, so cc_t should be a
- 03581 * short...
- 03582 */
- 03583
- 03584 /* Values for the baud rate settings. POSIX Table 7-6. */
- 03585 #define B0 0x0000 /* hang up the line */
- 03586 #define B50 0x1000 /* 50 baud */
- 03587 #define B75 0x2000 /* 75 baud */
- 03588 #define B110 0x3000 /* 110 baud */
- 03589 #define B134 0x4000 /* 134.5 baud */
- 03590 #define B150 0x5000 /* 150 baud */
- 03591 #define B200 0x6000 /* 200 baud */
- 03592 #define B300 0x7000 /* 300 baud */
- 03593 #define B600 0x8000 /* 600 baud */
- 03594 #define B1200 0x9000 /* 1200 baud */
- 03595 #define B1800 0xA000 /* 1800 baud */
- 03596 #define B2400 0xB000 /* 2400 baud */
- 03597 #define B4800 0xC000 /* 4800 baud */
- 03598 #define B9600 0xD000 /* 9600 baud */
- 03599 #define B19200 0xE000 /* 19200 baud */
- 03600 #define B38400 0xF000 /* 38400 baud */
- 03601
- 03602 /* Optional actions for tcsetattr(). POSIX Sec. 7.2.1.2. */
- 03603 #define TCSANOW 1 /* changes take effect immediately */
- 03604 #define TCSADRAIN 2 /* changes take effect after output is done */
- 03605 #define TCSAFLUSH 3 /* wait for output to finish and flush input */
- 03606
- 03607 /* Queue_selector values for tcflush(). POSIX Sec. 7.2.2.2. */
- 03608 #define TCIFLUSH 1 /* flush accumulated input data */
- 03609 #define TCOFLUSH 2 /* flush accumulated output data */
- .Ep 40 include/termios.h
- 03610 #define TCIOFLUSH 3 /* flush accumulated input and output data */
- 03611
- 03612 /* Action values for tcflow(). POSIX Sec. 7.2.2.2. */
- 03613 #define TCOOFF 1 /* suspend output */
- 03614 #define TCOON 2 /* restart suspended output */
- 03615 #define TCIOFF 3 /* transmit a STOP character on the line */
- 03616 #define TCION 4 /* transmit a START character on the line */
- 03617
- 03618
- 03619 /* Function Prototypes. */
- 03620 #ifndef _ANSI_H
- 03621 #include <ansi.h>
- 03622 #endif
- 03623
- 03624 _PROTOTYPE( int tcsendbreak, (int _fildes, int _duration) );
- 03625 _PROTOTYPE( int tcdrain, (int _filedes) );
- 03626 _PROTOTYPE( int tcflush, (int _filedes, int _queue_selector) );
- 03627 _PROTOTYPE( int tcflow, (int _filedes, int _action) );
- 03628 _PROTOTYPE( speed_t cfgetispeed, (const struct termios *_termios_p) );
- 03629 _PROTOTYPE( speed_t cfgetospeed, (const struct termios *_termios_p) );
- 03630 _PROTOTYPE( int cfsetispeed, (struct termios *_termios_p, speed_t _speed) );
- 03631 _PROTOTYPE( int cfsetospeed, (struct termios *_termios_p, speed_t _speed) );
- 03632 _PROTOTYPE( int tcgetattr, (int _filedes, struct termios *_termios_p) );
- 03633 _PROTOTYPE( int tcsetattr,
- 03634 (int _filedes, int _opt_actions, const struct termios *_termios_p) );
- 03635
- 03636 #define cfgetispeed(termios_p) ((termios_p)->c_ispeed)
- 03637 #define cfgetospeed(termios_p) ((termios_p)->c_ospeed)
- 03638 #define cfsetispeed(termios_p, speed) ((termios_p)->c_ispeed = (speed), 0)
- 03639 #define cfsetospeed(termios_p, speed) ((termios_p)->c_ospeed = (speed), 0)
- 03640
- 03641 #ifdef _MINIX
- 03642 /* Here are the local extensions to the POSIX standard for Minix. Posix
- 03643 * conforming programs are not able to access these, and therefore they are
- 03644 * only defined when a Minix program is compiled.
- 03645 */
- 03646
- 03647 /* Extensions to the termios c_iflag bit map. */
- 03648 #define IXANY 0x0800 /* allow any key to continue ouptut */
- 03649
- 03650 /* Extensions to the termios c_oflag bit map. They are only active iff
- 03651 * OPOST is enabled. */
- 03652 #define ONLCR 0x0002 /* Map NL to CR-NL on output */
- 03653 #define XTABS 0x0004 /* Expand tabs to spaces */
- 03654 #define ONOEOT 0x0008 /* discard EOT's (^D) on output) */
- 03655
- 03656 /* Extensions to the termios c_lflag bit map. */
- 03657 #define LFLUSHO 0x0200 /* Flush output. */
- 03658
- 03659 /* Extensions to the c_cc array. */
- 03660 #define VREPRINT 11 /* cc_c[VREPRINT] (^R) */
- 03661 #define VLNEXT 12 /* cc_c[VLNEXT] (^V) */
- 03662 #define VDISCARD 13 /* cc_c[VDISCARD] (^O) */
- 03663
- 03664 /* Extensions to baud rate settings. */
- 03665 #define B57600 0x0100 /* 57600 baud */
- 03666 #define B115200 0x0200 /* 115200 baud */
- 03667
- 03668 /* These are the default settings used by the kernel and by 'stty sane' */
- 03669
- .Op 41 include/termios.h
- 03670 #define TCTRL_DEF (CREAD | CS8 | HUPCL)
- 03671 #define TINPUT_DEF (BRKINT | ICRNL | IXON | IXANY)
- 03672 #define TOUTPUT_DEF (OPOST | ONLCR)
- 03673 #define TLOCAL_DEF (ISIG | IEXTEN | ICANON | ECHO | ECHOE)
- 03674 #define TSPEED_DEF B9600
- 03675
- 03676 #define TEOF_DEF '4' /* ^D */
- 03677 #define TEOL_DEF _POSIX_VDISABLE
- 03678 #define TERASE_DEF '10' /* ^H */
- 03679 #define TINTR_DEF '177' /* ^? */
- 03680 #define TKILL_DEF '25' /* ^U */
- 03681 #define TMIN_DEF 1
- 03682 #define TQUIT_DEF '34' /* ^ */
- 03683 #define TSTART_DEF '21' /* ^Q */
- 03684 #define TSTOP_DEF '23' /* ^S */
- 03685 #define TSUSP_DEF '32' /* ^Z */
- 03686 #define TTIME_DEF 0
- 03687 #define TREPRINT_DEF '22' /* ^R */
- 03688 #define TLNEXT_DEF '26' /* ^V */
- 03689 #define TDISCARD_DEF '17' /* ^O */
- 03690
- 03691 /* Window size. This information is stored in the TTY driver but not used.
- 03692 * This can be used for screen based applications in a window environment.
- 03693 * The ioctls TIOCGWINSZ and TIOCSWINSZ can be used to get and set this
- 03694 * information.
- 03695 */
- 03696
- 03697 struct winsize
- 03698 {
- 03699 unsigned short ws_row; /* rows, in characters */
- 03700 unsigned short ws_col; /* columns, in characters */
- 03701 unsigned short ws_xpixel; /* horizontal size, pixels */
- 03702 unsigned short ws_ypixel; /* vertical size, pixels */
- 03703 };
- 03704 #endif /* _MINIX */
- 03705
- 03706 #endif /* _TERMIOS_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/time.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03800 /* The <time.h> header is used by the procedures that deal with time.
- 03801 * Handling time is surprisingly complicated, what with GMT, local time
- 03802 * and other factors. Although the Bishop of Ussher (1581-1656) once
- 03803 * calculated that based on the Bible, the world began on 12 Oct. 4004 BC
- 03804 * at 9 o'clock in the morning, in the UNIX world time begins at midnight,
- 03805 * 1 Jan. 1970 GMT. Before that, all was NULL and (void).
- 03806 */
- 03807
- 03808 #ifndef _TIME_H
- 03809 #define _TIME_H
- 03810
- 03811 #define CLOCKS_PER_SEC 60 /* MINIX always uses 60 Hz, even in Europe */
- 03812
- 03813 #ifdef _POSIX_SOURCE
- 03814 #define CLK_TCK CLOCKS_PER_SEC /* obsolescent mame for CLOCKS_PER_SEC */
- .Ep 42 include/time.h
- 03815 #endif
- 03816
- 03817 #define NULL ((void *)0)
- 03818
- 03819 #ifndef _SIZE_T
- 03820 #define _SIZE_T
- 03821 typedef unsigned int size_t;
- 03822 #endif
- 03823
- 03824 #ifndef _TIME_T
- 03825 #define _TIME_T
- 03826 typedef long time_t; /* time in sec since 1 Jan 1970 0000 GMT */
- 03827 #endif
- 03828
- 03829 #ifndef _CLOCK_T
- 03830 #define _CLOCK_T
- 03831 typedef long clock_t; /* time in ticks since process started */
- 03832 #endif
- 03833
- 03834 struct tm {
- 03835 int tm_sec; /* seconds after the minute [0, 59] */
- 03836 int tm_min; /* minutes after the hour [0, 59] */
- 03837 int tm_hour; /* hours since midnight [0, 23] */
- 03838 int tm_mday; /* day of the month [1, 31] */
- 03839 int tm_mon; /* months since January [0, 11] */
- 03840 int tm_year; /* years since 1900 */
- 03841 int tm_wday; /* days since Sunday [0, 6] */
- 03842 int tm_yday; /* days since January 1 [0, 365] */
- 03843 int tm_isdst; /* Daylight Saving Time flag */
- 03844 };
- 03845
- 03846 extern char *tzname[];
- 03847
- 03848 /* Function Prototypes. */
- 03849 #ifndef _ANSI_H
- 03850 #include <ansi.h>
- 03851 #endif
- 03852
- 03853 _PROTOTYPE( clock_t clock, (void) );
- 03854 _PROTOTYPE( double difftime, (time_t _time1, time_t _time0) );
- 03855 _PROTOTYPE( time_t mktime, (struct tm *_timeptr) );
- 03856 _PROTOTYPE( time_t time, (time_t *_timeptr) );
- 03857 _PROTOTYPE( char *asctime, (const struct tm *_timeptr) );
- 03858 _PROTOTYPE( char *ctime, (const time_t *_timer) );
- 03859 _PROTOTYPE( struct tm *gmtime, (const time_t *_timer) );
- 03860 _PROTOTYPE( struct tm *localtime, (const time_t *_timer) );
- 03861 _PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
- 03862 const struct tm *_timep) );
- 03863
- 03864 #ifdef _POSIX_SOURCE
- 03865 _PROTOTYPE( void tzset, (void) );
- 03866 #endif
- 03867
- 03868 #ifdef _MINIX
- 03869 _PROTOTYPE( int stime, (time_t *_top) );
- 03870 #endif
- 03871
- 03872 #endif /* _TIME_H */
- .Op 43 include/tools.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/tools.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03900 /* Constants describing the disk */
- 03901 #define SECTOR_SIZE 512
- 03902 #define SECTOR_SHIFT 9
- 03903 #define RATIO (BLOCK_SIZE / SECTOR_SIZE)
- 03904 #define HRATIO (SECTOR_SIZE / HCLICK_SIZE)
- 03905 #define PARAMSEC 1 /* sector containing boot parameters */
- 03906 #define DSKBASE 0x1E /* floppy disk parameter vector */
- 03907 #define DSKPARSIZE 11 /* there are this many bytes of parameters */
- 03908 #define ESC '33' /* escape key */
- 03909 #define HEADERSEG 0x0060 /* place for an array of struct exec's */
- 03910 #define MINIXSEG 0x0080 /* MINIX loaded here (rounded up to a click) */
- 03911 #define BOOTSEG 0x07C0 /* bootstraps are loaded here */
- 03912 #define SIGNATURE 0xAA55 /* proper bootstraps have this signature */
- 03913 #define SIGNATPOS 510 /* offset within bootblock */
- 03914 #define FREESEG 0x0800 /* Memory from FREESEG to cseg is free */
- 03915 #define MSEC_PER_TICK 55 /* 18.2 ticks per second */
- 03916
- 03917 /* Scan codes for four different keyboards (from kernel/keyboard.c) */
- 03918 #define DUTCH_EXT_SCAN 32 /* 'd' */
- 03919 #define OLIVETTI_SCAN 12 /* '=' key on olivetti */
- 03920 #define STANDARD_SCAN 13 /* '=' key on IBM */
- 03921 #define US_EXT_SCAN 22 /* 'u' */
- 03922
- 03923 /* Other */
- 03924 #define ROOT_INO ((ino_t) 1) /* Inode nr of root dir. */
- 03925 #define IM_NAME_MAX 63
- 03926
- 03927 /* Variables */
- 03928 #ifndef EXTERN
- 03929 #define EXTERN extern
- 03930 #endif
- 03931
- 03932 typedef struct vector {
- 03933 u16_t offset;
- 03934 u16_t segment;
- 03935 } vector;
- 03936
- 03937 struct image_header {
- 03938 char name[IM_NAME_MAX + 1]; /* Null terminated. */
- 03939 struct exec process;
- 03940 };
- 03941
- 03942 EXTERN vector rem_part; /* boot partition table entry */
- 03943 EXTERN u16_t cseg, dseg; /* code and data segment of the boot program */
- 03944 EXTERN u32_t runsize; /* size of this program */
- 03945 EXTERN u16_t device; /* drive being booted from */
- 03946 EXTERN u16_t heads, sectors; /* the drive's number of heads and sectors */
- 03947 extern u16_t eqscancode; /* Set by peek/getch() if they see a '=' */
- 03948
- 03949 /* Sticky attributes */
- 03950 #define E_SPECIAL 0x01 /* These are known to the program */
- 03951 #define E_DEV 0x02 /* The value is a device name */
- 03952 #define E_RESERVED 0x04 /* May not be set by user, e.g. scancode */
- 03953 #define E_STICKY 0x07 /* Don't go once set */
- 03954
- .Ep 44 include/tools.h
- 03955 /* Volatile attributes */
- 03956 #define E_VAR 0x08 /* Variable */
- 03957 #define E_FUNCTION 0x10 /* Function definition */
- 03958
- 03959 typedef struct environment {
- 03960 struct environment *next;
- 03961 char flags;
- 03962 char *name; /* name = value */
- 03963 char *arg; /* name(arg) {value} */
- 03964 char *value;
- 03965 char *defval; /* Safehouse for default values */
- 03966 } environment;
- 03967
- 03968 /* External variables */
- 03969 EXTERN environment *env; /* Lists the environment */
- 03970 EXTERN int fsok; /* True if the boot device contains an FS */
- 03971 EXTERN u32_t lowsec; /* Offset to the file system on the boot dev */
- 03972
- 03973 /* Prototypes */
- 03974 _PROTOTYPE( off_t r_super, (void));
- 03975 _PROTOTYPE( void r_stat, (Ino_t _inum, struct stat *_stp ));
- 03976 _PROTOTYPE( ino_t r_readdir, (char *_name ));
- 03977 _PROTOTYPE( off_t r_vir2abs, (off_t _virblk ));
- 03978 _PROTOTYPE( ino_t r_lookup, (Ino_t _cwd, char *_path ));
- 03979
- 03980 #ifdef _MONHEAD
- 03981 _PROTOTYPE( void readerr, (off_t _sec, int _err ));
- 03982 _PROTOTYPE( int numprefix, (char *_s, char **_ps ));
- 03983 _PROTOTYPE( int numeric, (char *_s ));
- 03984 _PROTOTYPE( dev_t name2dev, (char *_name ));
- 03985 _PROTOTYPE( int delay, (char *_msec ));
- 03986 _PROTOTYPE( char *unix_err, (int _err ));
- 03987 _PROTOTYPE( void init_cache, (void));
- 03988 _PROTOTYPE( void invalidate_cache, (void));
- 03989 _PROTOTYPE( char *b_value, (char *_name ));
- 03990 _PROTOTYPE( void raw_copy, (int _doff, int _dseg, int _soff, int _sseg,
- 03991 int _count));
- 03992 _PROTOTYPE( void raw_clear, (int _off, int _seg, int _count));
- 03993 _PROTOTYPE( void bootstrap, (int _device, int _partoff, int _partseg));
- 03994
- 03995 _PROTOTYPE( long a2l, (char *_a ));
- 03996 _PROTOTYPE( char *ul2a, (u32_t _n ));
- 03997 _PROTOTYPE( char *u2a, (int _n1 ));
- 03998
- 03999 /* Functions defined in monhead.s and usable by other files. */
- 04000 _PROTOTYPE( void reset_video, (int color));
- 04001 _PROTOTYPE( int dev_geometry, (void));
- 04002 _PROTOTYPE( u16_t get_ext_memsize, (void));
- 04003 _PROTOTYPE( u16_t get_low_memsize, (void));
- 04004 _PROTOTYPE( u16_t get_processor, (void));
- 04005 _PROTOTYPE( u32_t get_tick, (void));
- 04006 _PROTOTYPE( u16_t get_video, (void));
- 04007 _PROTOTYPE( u16_t get_word, (int _off, int _seg));
- 04008 _PROTOTYPE( int getchar, (void));
- 04009 _PROTOTYPE( void minix, (void));
- 04010 _PROTOTYPE( void minix86, (int _kcs, int _kds, char *_bpar, int _psize));
- 04011 _PROTOTYPE( void minix386, (int _kcs, int _kds, char *_bpar, int _psize));
- 04012 _PROTOTYPE( int peekchar, (void));
- 04013 _PROTOTYPE( void put_word, (int _off, int _seg, int _word));
- 04014 _PROTOTYPE( int putchar, (char _c));
- .Op 45 include/tools.h
- 04015 _PROTOTYPE( int readsectors, (int _off, int _seg, off_t _adr, int _ct));
- 04016 _PROTOTYPE( void reboot, (void));
- 04017 _PROTOTYPE( void relocate, (void));
- 04018 _PROTOTYPE( int writesectors, (int _off, int _seg, off_t _adr, int _ct));
- 04019 #endif
- 04020
- 04021
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ttyent.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04100 /* <ttyent.h> is used by getttyent(3). Author: Kees J. Bot
- 04101 * 28 Oct 1995
- 04102 */
- 04103 #ifndef _TTYENT_H
- 04104 #define _TTYENT_H
- 04105
- 04106 #ifndef _ANSI_H
- 04107 #include <ansi.h>
- 04108 #endif
- 04109
- 04110 struct ttyent {
- 04111 char *ty_name; /* Name of the terminal device. */
- 04112 char *ty_type; /* Terminal type name (termcap(3)). */
- 04113 char **ty_getty; /* Program to run, normally getty. */
- 04114 char **ty_init; /* Initialization command, normally stty. */
- 04115 };
- 04116
- 04117 _PROTOTYPE( struct ttyent *getttyent, (void) );
- 04118 _PROTOTYPE( struct ttyent *getttynam, (const char *_name) );
- 04119 _PROTOTYPE( int setttyent, (void) );
- 04120 _PROTOTYPE( void endttyent, (void) );
- 04121
- 04122 #endif /* _TTYENT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/unistd.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04200 /* The <unistd.h> header contains a few miscellaneous manifest constants. */
- 04201
- 04202 #ifndef _UNISTD_H
- 04203 #define _UNISTD_H
- 04204
- 04205 /* POSIX requires size_t and ssize_t in <unistd.h> and elsewhere. */
- 04206 #ifndef _SIZE_T
- 04207 #define _SIZE_T
- 04208 typedef unsigned int size_t;
- 04209 #endif
- 04210
- 04211 #ifndef _SSIZE_T
- 04212 #define _SSIZE_T
- 04213 typedef int ssize_t;
- 04214 #endif
- .Ep 46 include/unistd.h
- 04215
- 04216 /* Values used by access(). POSIX Table 2-8. */
- 04217 #define F_OK 0 /* test if file exists */
- 04218 #define X_OK 1 /* test if file is executable */
- 04219 #define W_OK 2 /* test if file is writable */
- 04220 #define R_OK 4 /* test if file is readable */
- 04221
- 04222 /* Values used for whence in lseek(fd, offset, whence). POSIX Table 2-9. */
- 04223 #define SEEK_SET 0 /* offset is absolute */
- 04224 #define SEEK_CUR 1 /* offset is relative to current position */
- 04225 #define SEEK_END 2 /* offset is relative to end of file */
- 04226
- 04227 /* This value is required by POSIX Table 2-10. */
- 04228 #define _POSIX_VERSION 199009L /* which standard is being conformed to */
- 04229
- 04230 /* These three definitions are required by POSIX Sec. 8.2.1.2. */
- 04231 #define STDIN_FILENO 0 /* file descriptor for stdin */
- 04232 #define STDOUT_FILENO 1 /* file descriptor for stdout */
- 04233 #define STDERR_FILENO 2 /* file descriptor for stderr */
- 04234
- 04235 #ifdef _MINIX
- 04236 /* How to exit the system. */
- 04237 #define RBT_HALT 0
- 04238 #define RBT_REBOOT 1
- 04239 #define RBT_PANIC 2 /* for servers */
- 04240 #define RBT_MONITOR 3 /* let the monitor do this */
- 04241 #define RBT_RESET 4 /* hard reset the system */
- 04242 #endif
- 04243
- 04244 /* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */
- 04245 #define NULL ((void *)0)
- 04246
- 04247 /* The following relate to configurable system variables. POSIX Table 4-2. */
- 04248 #define _SC_ARG_MAX 1
- 04249 #define _SC_CHILD_MAX 2
- 04250 #define _SC_CLOCKS_PER_SEC 3
- 04251 #define _SC_CLK_TCK 3
- 04252 #define _SC_NGROUPS_MAX 4
- 04253 #define _SC_OPEN_MAX 5
- 04254 #define _SC_JOB_CONTROL 6
- 04255 #define _SC_SAVED_IDS 7
- 04256 #define _SC_VERSION 8
- 04257 #define _SC_STREAM_MAX 9
- 04258 #define _SC_TZNAME_MAX 10
- 04259
- 04260 /* The following relate to configurable pathname variables. POSIX Table 5-2. */
- 04261 #define _PC_LINK_MAX 1 /* link count */
- 04262 #define _PC_MAX_CANON 2 /* size of the canonical input queue */
- 04263 #define _PC_MAX_INPUT 3 /* type-ahead buffer size */
- 04264 #define _PC_NAME_MAX 4 /* file name size */
- 04265 #define _PC_PATH_MAX 5 /* pathname size */
- 04266 #define _PC_PIPE_BUF 6 /* pipe size */
- 04267 #define _PC_NO_TRUNC 7 /* treatment of long name components */
- 04268 #define _PC_VDISABLE 8 /* tty disable */
- 04269 #define _PC_CHOWN_RESTRICTED 9 /* chown restricted or not */
- 04270
- 04271 /* POSIX defines several options that may be implemented or not, at the
- 04272 * implementer's whim. This implementer has made the following choices:
- 04273 *
- 04274 * _POSIX_JOB_CONTROL not defined: no job control
- .Op 47 include/unistd.h
- 04275 * _POSIX_SAVED_IDS not defined: no saved uid/gid
- 04276 * _POSIX_NO_TRUNC defined as -1: long path names are truncated
- 04277 * _POSIX_CHOWN_RESTRICTED defined: you can't give away files
- 04278 * _POSIX_VDISABLE defined: tty functions can be disabled
- 04279 */
- 04280 #define _POSIX_NO_TRUNC (-1)
- 04281 #define _POSIX_CHOWN_RESTRICTED 1
- 04282
- 04283 /* Function Prototypes. */
- 04284 #ifndef _ANSI_H
- 04285 #include <ansi.h>
- 04286 #endif
- 04287
- 04288 _PROTOTYPE( void _exit, (int _status) );
- 04289 _PROTOTYPE( int access, (const char *_path, int _amode) );
- 04290 _PROTOTYPE( unsigned int alarm, (unsigned int _seconds) );
- 04291 _PROTOTYPE( int chdir, (const char *_path) );
- 04292 _PROTOTYPE( int chown, (const char *_path, Uid_t _owner, Gid_t _group) );
- 04293 _PROTOTYPE( int close, (int _fd) );
- 04294 _PROTOTYPE( char *ctermid, (char *_s) );
- 04295 _PROTOTYPE( char *cuserid, (char *_s) );
- 04296 _PROTOTYPE( int dup, (int _fd) );
- 04297 _PROTOTYPE( int dup2, (int _fd, int _fd2) );
- 04298 _PROTOTYPE( int execl, (const char *_path, const char *_arg, ...) );
- 04299 _PROTOTYPE( int execle, (const char *_path, const char *_arg, ...) );
- 04300 _PROTOTYPE( int execlp, (const char *_file, const char *arg, ...) );
- 04301 _PROTOTYPE( int execv, (const char *_path, char *const _argv[]) );
- 04302 _PROTOTYPE( int execve, (const char *_path, char *const _argv[],
- 04303 char *const _envp[]) );
- 04304 _PROTOTYPE( int execvp, (const char *_file, char *const _argv[]) );
- 04305 _PROTOTYPE( pid_t fork, (void) );
- 04306 _PROTOTYPE( long fpathconf, (int _fd, int _name) );
- 04307 _PROTOTYPE( char *getcwd, (char *_buf, size_t _size) );
- 04308 _PROTOTYPE( gid_t getegid, (void) );
- 04309 _PROTOTYPE( uid_t geteuid, (void) );
- 04310 _PROTOTYPE( gid_t getgid, (void) );
- 04311 _PROTOTYPE( int getgroups, (int _gidsetsize, gid_t _grouplist[]) );
- 04312 _PROTOTYPE( char *getlogin, (void) );
- 04313 _PROTOTYPE( pid_t getpgrp, (void) );
- 04314 _PROTOTYPE( pid_t getpid, (void) );
- 04315 _PROTOTYPE( pid_t getppid, (void) );
- 04316 _PROTOTYPE( uid_t getuid, (void) );
- 04317 _PROTOTYPE( int isatty, (int _fd) );
- 04318 _PROTOTYPE( int link, (const char *_existing, const char *_new) );
- 04319 _PROTOTYPE( off_t lseek, (int _fd, off_t _offset, int _whence) );
- 04320 _PROTOTYPE( long pathconf, (const char *_path, int _name) );
- 04321 _PROTOTYPE( int pause, (void) );
- 04322 _PROTOTYPE( int pipe, (int _fildes[2]) );
- 04323 _PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
- 04324 _PROTOTYPE( int rmdir, (const char *_path) );
- 04325 _PROTOTYPE( int setgid, (Gid_t _gid) );
- 04326 _PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
- 04327 _PROTOTYPE( pid_t setsid, (void) );
- 04328 _PROTOTYPE( int setuid, (Uid_t _uid) );
- 04329 _PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
- 04330 _PROTOTYPE( long sysconf, (int _name) );
- 04331 _PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
- 04332 _PROTOTYPE( int tcsetpgrp, (int _fd, pid_t _pgrp_id) );
- 04333 _PROTOTYPE( char *ttyname, (int _fd) );
- 04334 _PROTOTYPE( int unlink, (const char *_path) );
- .Ep 48 include/unistd.h
- 04335 _PROTOTYPE( ssize_t write, (int _fd, const void *_buf, size_t _n) );
- 04336
- 04337 #ifdef _MINIX
- 04338 _PROTOTYPE( int brk, (char *_addr) );
- 04339 _PROTOTYPE( int chroot, (const char *_name) );
- 04340 _PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr) );
- 04341 _PROTOTYPE( int mknod4, (const char *_name, Mode_t _mode, Dev_t _addr,
- 04342 long _size) );
- 04343 _PROTOTYPE( char *mktemp, (char *_template) );
- 04344 _PROTOTYPE( int mount, (char *_spec, char *_name, int _flag) );
- 04345 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
- 04346 _PROTOTYPE( char *sbrk, (int _incr) );
- 04347 _PROTOTYPE( int sync, (void) );
- 04348 _PROTOTYPE( int umount, (const char *_name) );
- 04349 _PROTOTYPE( int reboot, (int _how, ...) );
- 04350 _PROTOTYPE( int gethostname, (char *_hostname, size_t _len) );
- 04351 _PROTOTYPE( int getdomainname, (char *_domain, size_t _len) );
- 04352 _PROTOTYPE( int ttyslot, (void) );
- 04353 _PROTOTYPE( int fttyslot, (int _fd) );
- 04354 _PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
- 04355 #endif
- 04356
- 04357 #endif /* _UNISTD_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/utime.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04400 /* The <utime.h> header is used for the utime() system call. */
- 04401
- 04402 #ifndef _UTIME_H
- 04403 #define _UTIME_H
- 04404
- 04405 struct utimbuf {
- 04406 time_t actime; /* access time */
- 04407 time_t modtime; /* modification time */
- 04408 };
- 04409
- 04410
- 04411 /* Function Prototypes. */
- 04412 #ifndef _ANSI_H
- 04413 #include <ansi.h>
- 04414 #endif
- 04415
- 04416 _PROTOTYPE( int utime, (const char *_path, const struct utimbuf *_times) );
- 04417
- 04418 #endif /* _UTIME_H */
- .Op 49 include/utmp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/utmp.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04500 /* The <utmp.h> header is used by init, login, who, etc. */
- 04501
- 04502 #ifndef _UTMP_H
- 04503 #define _UTMP_H
- 04504
- 04505 #define WTMP "/usr/adm/wtmp" /* the login history file */
- 04506 #define BTMP "/usr/adm/btmp" /* the bad-login history file */
- 04507 #define UTMP "/etc/utmp" /* the user accouting file */
- 04508
- 04509
- 04510 struct utmp {
- 04511 char ut_user[8]; /* user name */
- 04512 char ut_id[4]; /* /etc/inittab ID */
- 04513 char ut_line[12]; /* terminal name */
- 04514 char ut_host[16]; /* host name, when remote */
- 04515 short ut_pid; /* process id */
- 04516 short int ut_type; /* type of entry */
- 04517 long ut_time; /* login/logout time */
- 04518 };
- 04519
- 04520 #define ut_name ut_user /* for compatibility with other systems */
- 04521
- 04522
- 04523 /* Definitions for ut_type. */
- 04524 #define RUN_LVL 1 /* this is a RUN_LEVEL record */
- 04525 #define BOOT_TIME 2 /* this is a REBOOT record */
- 04526 #define INIT_PROCESS 5 /* this process was spawned by INIT */
- 04527 #define LOGIN_PROCESS 6 /* this is a 'getty' process waiting */
- 04528 #define USER_PROCESS 7 /* any other user process */
- 04529 #define DEAD_PROCESS 8 /* this process has died (wtmp only) */
- 04530
- 04531 #endif /* _UTMP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/asynchio.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04600 /* asynchio.h - Asynchronous I/O Author: Kees J. Bot
- 04601 * 26 Jan 1995
- 04602 * This is just a fake async I/O library to be used for programs
- 04603 * written for Minix-vmd that must also run under standard Minix.
- 04604 * This limits the number of ugly #ifdefs somewhat. The programs must
- 04605 * be restricted to performing just one service, of course.
- 04606 */
- 04607 #ifndef _SYS__ASYNCHIO_H
- 04608 #define _SYS__ASYNCHIO_H
- 04609
- 04610 typedef int asynchio_t;
- 04611
- 04612 #define ASYN_NONBLOCK 0x01
- 04613
- 04614 struct timeval { long tv_sec, tv_usec; };
- .Ep 50 include/sys/asynchio.h
- 04615
- 04616 #define EINPROGRESS EINTR
- 04617
- 04618 void asyn_init(asynchio_t *_asyn);
- 04619 ssize_t asyn_read(asynchio_t *_asyn, int _fd, void *_buf, size_t _len);
- 04620 ssize_t asyn_write(asynchio_t *_asyn, int _fd, const void *_buf, size_t _len);
- 04621 int asyn_ioctl(asynchio_t *_asyn, int _fd, unsigned long _request, void *_data);
- 04622 int asyn_wait(asynchio_t *_asyn, int _flags, struct timeval *to);
- 04623 int asyn_synch(asynchio_t *_asyn, int _fd);
- 04624 int asyn_close(asynchio_t *_asyn, int _fd);
- 04625
- 04626 #endif /* _SYS__ASYNCHIO_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/dir.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04700 /* The <dir.h> header gives the layout of a directory. */
- 04701
- 04702 #ifndef _DIR_H
- 04703 #define _DIR_H
- 04704
- 04705 #define DIRBLKSIZ 512 /* size of directory block */
- 04706
- 04707 #ifndef DIRSIZ
- 04708 #define DIRSIZ 14