diff --git a/Makefile b/Makefile index b61ac87..3ee359f 100644 --- a/Makefile +++ b/Makefile @@ -126,77 +126,76 @@ depend: ${SRC} # DO NOT DELETE THIS LINE -- make depend uses it -ansi.o: ansi.c estruct.h retcode.h +ansi.o: ansi.c estruct.h basic.o: basic.c basic.h buffer.h crypt.h line.h utf8.h display.h \ - estruct.h retcode.h input.h bind.h random.h terminal.h defines.h \ + estruct.h input.h bind.h random.h terminal.h defines.h retcode.h \ window.h -bind.o: bind.c bind.h estruct.h retcode.h bindable.h buffer.h crypt.h \ - line.h utf8.h display.h ebind.h exec.h file.h flook.h input.h names.h \ +bind.o: bind.c bind.h estruct.h bindable.h buffer.h crypt.h line.h utf8.h \ + display.h ebind.h exec.h retcode.h file.h flook.h input.h names.h \ window.h defines.h bindable.o: bindable.c bindable.h defines.h buffer.h crypt.h line.h \ - utf8.h display.h estruct.h retcode.h file.h input.h bind.h lock.h \ + utf8.h display.h estruct.h file.h retcode.h input.h bind.h lock.h \ terminal.h buffer.o: buffer.c buffer.h crypt.h line.h utf8.h defines.h display.h \ - estruct.h retcode.h file.h input.h bind.h window.h + estruct.h file.h retcode.h input.h bind.h window.h crypt.o: crypt.c crypt.h display.o: display.c display.h buffer.h crypt.h line.h utf8.h estruct.h \ - retcode.h input.h bind.h termio.h terminal.h defines.h version.h \ + input.h bind.h termio.h terminal.h defines.h retcode.h version.h \ wrapper.h window.h -ebind.o: ebind.c ebind.h basic.h bind.h estruct.h retcode.h bindable.h \ - buffer.h crypt.h line.h utf8.h eval.h exec.h file.h isearch.h random.h \ +ebind.o: ebind.c ebind.h basic.h bind.h estruct.h bindable.h buffer.h \ + crypt.h line.h utf8.h eval.h exec.h retcode.h file.h isearch.h random.h \ region.h search.h spawn.h window.h defines.h word.h eval.o: eval.c eval.h basic.h bind.h buffer.h crypt.h line.h utf8.h \ - display.h estruct.h retcode.h exec.h execute.h flook.h input.h random.h \ + display.h estruct.h exec.h retcode.h execute.h flook.h input.h random.h \ search.h terminal.h defines.h termio.h version.h window.h exec.o: exec.c exec.h retcode.h buffer.h crypt.h line.h utf8.h bind.h \ display.h estruct.h eval.h file.h flook.h input.h random.h window.h \ defines.h -execute.o: execute.c execute.h estruct.h retcode.h bind.h random.h \ - display.h file.h crypt.h buffer.h line.h utf8.h terminal.h defines.h \ - window.h +execute.o: execute.c execute.h estruct.h bind.h random.h display.h file.h \ + crypt.h retcode.h buffer.h line.h utf8.h terminal.h defines.h window.h file.o: file.c file.h crypt.h retcode.h buffer.h line.h utf8.h defines.h \ estruct.h execute.h fileio.h input.h bind.h lock.h log.h window.h fileio.o: fileio.c fileio.h crypt.h retcode.h defines.h flook.o: flook.c flook.h retcode.h defines.h fileio.h crypt.h -ibmpc.o: ibmpc.c estruct.h retcode.h -input.o: input.c input.h bind.h estruct.h retcode.h bindable.h display.h \ - exec.h names.h terminal.h defines.h wrapper.h +ibmpc.o: ibmpc.c estruct.h +input.o: input.c input.h bind.h estruct.h bindable.h display.h exec.h \ + retcode.h names.h terminal.h defines.h wrapper.h isearch.o: isearch.c isearch.h basic.h buffer.h crypt.h line.h utf8.h \ - display.h estruct.h retcode.h exec.h input.h bind.h search.h terminal.h \ + display.h estruct.h exec.h retcode.h input.h bind.h search.h terminal.h \ defines.h window.h -line.o: line.c line.h utf8.h buffer.h crypt.h estruct.h retcode.h log.h \ +line.o: line.c line.h utf8.h buffer.h crypt.h estruct.h log.h retcode.h \ window.h defines.h -lock.o: lock.c lock.h estruct.h retcode.h +lock.o: lock.c estruct.h lock.h log.o: log.c log.h retcode.h -main.o: main.c estruct.h retcode.h basic.h bind.h bindable.h buffer.h \ - crypt.h line.h utf8.h display.h eval.h execute.h file.h input.h lock.h \ +main.o: main.c estruct.h basic.h bind.h bindable.h buffer.h crypt.h \ + line.h utf8.h display.h eval.h execute.h file.h retcode.h input.h lock.h \ log.h random.h search.h terminal.h defines.h termio.h version.h window.h names.o: names.c names.h basic.h bind.h bindable.h buffer.h crypt.h \ line.h utf8.h display.h eval.h exec.h retcode.h file.h isearch.h \ region.h random.h search.h spawn.h window.h defines.h word.h -pklock.o: pklock.c estruct.h retcode.h pklock.h +pklock.o: pklock.c estruct.h pklock.h posix.o: posix.c termio.h random.o: random.c random.h basic.h buffer.h crypt.h line.h utf8.h \ - display.h estruct.h retcode.h execute.h input.h bind.h log.h search.h \ + display.h estruct.h execute.h input.h bind.h log.h retcode.h search.h \ terminal.h defines.h window.h region.o: region.c region.h line.h utf8.h buffer.h crypt.h estruct.h \ - retcode.h log.h random.h window.h defines.h + log.h retcode.h random.h window.h defines.h search.o: search.c search.h line.h utf8.h basic.h buffer.h crypt.h \ - display.h estruct.h retcode.h input.h bind.h log.h terminal.h defines.h \ + display.h estruct.h input.h bind.h log.h retcode.h terminal.h defines.h \ window.h spawn.o: spawn.c spawn.h defines.h buffer.h crypt.h line.h utf8.h \ - display.h estruct.h retcode.h exec.h file.h flook.h input.h bind.h log.h \ + display.h estruct.h exec.h retcode.h file.h flook.h input.h bind.h log.h \ terminal.h window.h tcap.o: tcap.c terminal.h defines.h retcode.h display.h estruct.h \ termio.h termio.o: termio.c termio.h estruct.h retcode.h utf8.h utf8.o: utf8.c utf8.h -vmsvt.o: vmsvt.c estruct.h retcode.h -vt52.o: vt52.c estruct.h retcode.h +vmsvt.o: vmsvt.c estruct.h +vt52.o: vt52.c estruct.h window.o: window.c window.h defines.h buffer.h crypt.h line.h utf8.h \ - basic.h display.h estruct.h retcode.h execute.h terminal.h wrapper.h + basic.h display.h estruct.h execute.h terminal.h retcode.h wrapper.h word.o: word.c word.h basic.h buffer.h crypt.h line.h utf8.h estruct.h \ - retcode.h log.h random.h region.h window.h defines.h + log.h retcode.h random.h region.h window.h defines.h wrapper.o: wrapper.c wrapper.h # DEPENDENCIES MUST END AT END OF FILE diff --git a/defines.h b/defines.h index 2e59365..1ed7467 100644 --- a/defines.h +++ b/defines.h @@ -3,7 +3,6 @@ */ #define USG 1 -#define NBUFN 16 /* # of bytes, buffer name */ #define NSTRING 128 /* # of bytes, string buffers */ #define PKCODE 1 @@ -14,3 +13,6 @@ #define META 0x20000000 /* Meta flag, or'ed in */ #define CTLX 0x40000000 /* ^X flag, or'ed in */ #define SPEC 0x80000000 /* special key (function keys) */ + +#define MAXCOL 500 +#define MAXROW 500 diff --git a/ebind.h b/ebind.h index af8ed2c..4f129df 100644 --- a/ebind.h +++ b/ebind.h @@ -1,8 +1,9 @@ /* Structure for the table of initial key bindings. */ struct key_tab { - int k_code; /* Key code */ - int (*k_fp)(int, int); /* Routine to handle it */ -}; + int k_code ; /* Key code */ + int (*k_fp)( int, int) ; /* Routine to handle it */ +} ; -extern struct key_tab keytab[]; /* key bind to functions table */ +#define NBINDS 256 /* max # of bound keys */ +extern struct key_tab keytab[ NBINDS] ; /* key bind to functions table */ diff --git a/estruct.h b/estruct.h index eecc1d8..0bcde5f 100644 --- a/estruct.h +++ b/estruct.h @@ -12,9 +12,6 @@ */ -#define MAXCOL 500 -#define MAXROW 500 - #ifdef MSDOS #undef MSDOS #endif @@ -226,27 +223,16 @@ /* Internal constants. */ -#define NBINDS 256 /* max # of bound keys */ #define NFILEN 80 /* # of bytes, file name */ -#define NBUFN 16 /* # of bytes, buffer name */ -#define NLINE 256 /* # of bytes, input line */ #define NSTRING 128 /* # of bytes, string buffers */ #define NPAT 128 /* # of bytes, pattern */ #define HUGE 1000 /* Huge number */ -#define NLOCKS 100 /* max # of file locks active */ #define CONTROL 0x10000000 /* Control flag, or'ed in */ #define META 0x20000000 /* Meta flag, or'ed in */ #define CTLX 0x40000000 /* ^X flag, or'ed in */ #define SPEC 0x80000000 /* special key (function keys) */ -#include "retcode.h" - -#define BELL 0x07 /* a bell character */ -#define TAB 0x09 /* a tab character */ - -#define INTWIDTH sizeof(int) * 3 - /* Internal defined functions */ #ifdef abs diff --git a/eval.c b/eval.c index 176da31..b72a38e 100644 --- a/eval.c +++ b/eval.c @@ -937,6 +937,8 @@ static int svar(struct variable_description *var, char *value) */ char *itoa(int i) { + #define INTWIDTH sizeof( int) * 3 + int digit; /* current digit being used */ char *sp; /* pointer into result */ int sign; /* sign of resulting number */ diff --git a/line.h b/line.h index 2080899..634a18a 100644 --- a/line.h +++ b/line.h @@ -3,6 +3,8 @@ #include "utf8.h" +#define NLINE 256 /* # of bytes, input line */ + /* * All text is kept in circularly linked lists of "struct line" structures. These * begin at the header line (which is the blank line beyond the end of the diff --git a/lock.c b/lock.c index a39c51a..f912f52 100644 --- a/lock.c +++ b/lock.c @@ -22,8 +22,9 @@ #include -static char *lname[NLOCKS]; /* names of all locked files */ -static int numlocks; /* # of current locks active */ +#define NLOCKS 100 /* max # of file locks active */ +static char *lname[ NLOCKS] ; /* names of all locked files */ +static int numlocks ; /* # of current locks active */ static void lckerror(char *errstr) ; @@ -45,7 +46,7 @@ int lockchk( const char *fname) return TRUE; /* if we have a full locking table, bitch and leave */ - if (numlocks == NLOCKS) { + if( numlocks >= NLOCKS) { mlwrite("LOCK ERROR: Lock table full"); return ABORT; } diff --git a/search.h b/search.h index b354b50..9b53f32 100644 --- a/search.h +++ b/search.h @@ -5,6 +5,8 @@ #include "line.h" +#define BELL 0x07 /* a bell character */ + extern unsigned int matchlen ; extern char *patmatch ; diff --git a/tcap.c b/tcap.c index 9100fd6..ffa0c00 100644 --- a/tcap.c +++ b/tcap.c @@ -37,7 +37,8 @@ boolean eolexist = TRUE ; /* does clear to EOL exist */ boolean revexist = FALSE ; /* does reverse video exist? */ boolean sgarbf = TRUE ; /* TRUE if screen is garbage */ -char sres[ NBUFN] ; /* current screen resolution */ +char sres[ 16] ; /* current screen resolution */ + /* NORMAL, CGA, EGA, VGA */ #if UNIX #include diff --git a/terminal.h b/terminal.h index 1fe04ed..df4e9e8 100644 --- a/terminal.h +++ b/terminal.h @@ -76,5 +76,6 @@ extern boolean revexist ; /* does reverse video exist? */ extern boolean sgarbf ; /* State of screen unknown */ extern char sres[] ; /* Current screen resolution. */ + /* NORMAL, CGA, EGA, VGA */ #endif diff --git a/termio.c b/termio.c index 43d78fa..92fbc95 100644 --- a/termio.c +++ b/termio.c @@ -15,6 +15,7 @@ #include #include "estruct.h" +#include "retcode.h" #include "utf8.h" diff --git a/word.c b/word.c index 76be9ea..b29f060 100644 --- a/word.c +++ b/word.c @@ -21,6 +21,8 @@ #include "region.h" #include "window.h" +#define TAB 0x09 /* a tab character */ + #if PKCODE static int justflag = FALSE ; /* justify, don't fill */ #endif