1 /* 2 3 * Copyright (c) 1984, 1985, 1986 AT&T 4 * All Rights Reserved 5 6 * THIS IS UNPUBLISHED PROPRIETARY SOURCE 7 * CODE OF AT&T. 8 * The copyright notice above does not 9 * evidence any actual or intended 10 * publication of such source code. 11 12 */ 13 /* @(#)history.h 1.1 */ 14 15 /* 16 * UNIX shell 17 * Header File for history mechanism 18 * written by David Korn 19 * 20 */ 21 22 23 24 /* structure for fix command files */ 25 26 #define HIS_DFLT 128 /* default size of history list */ 27 #define HISMAX (sizeof(int)*BUFSIZ) 28 #define HISBIG (0100000-1024) /* 1K less than maximum short */ 29 #define HISLINE 16 /* estimate of average sized history line */ 30 #define MAXLINE 258 /* longest history line permitted */ 31 32 #define H_UNDO 0201 /* invalidate previous command */ 33 #define H_CMDNO 0202 /* next 3 bytes give command number */ 34 #define H_VERSION 1 /* history file format version no. */ 35 36 struct fixcmd 37 { 38 FILE *fixfd; /* file descriptor for history file */ 39 int fixind; /* current command number index */ 40 long fixcnt; /* offset into history file */ 41 int fixmax; /* number of accessible history lines */ 42 int fixline; /* line number within command */ 43 long fixcmds[1]; /* byte offset for recent commands */ 44 }; 45 46 typedef struct 47 { 48 short his_command; 49 short his_line; 50 } histloc; 51 52 extern struct fixcmd *fc_fix; 53 extern void hist_close(); 54 55 #ifndef KSHELL 56 #define FCIO 19 57 typedef char MSG[]; 58 extern char *getenv(); 59 #define valup(s) getenv("s") 60 61 # ifdef BSD 62 # define strchr index 63 # define strrchr rindex 64 # endif /* BSD */ 65 66 #define NIL ((char*)0) 67 #define setalt e_setalt 68 #define setraw e_setraw 69 #define setcooked e_setcooked 70 #define failed e_failed 71 #define hread emacs_read 72 #define vread vi_read 73 #define movstr e_movstr 74 #define ungetchar e_ungetchar 75 #endif /* KSHELL */ 76 77 /* the following are readonly */ 78 extern MSG histfname; 79 extern MSG nohistory; 80 extern MSG badcooked; 81