diff --git a/ebind.h b/ebind.h index 6e25fdb..20551fc 100644 --- a/ebind.h +++ b/ebind.h @@ -409,10 +409,10 @@ KEYTAB keytab[NBINDS] = { , /* special internal bindings */ - SPEC | META | 'W', wrapword, /* called on word wrap */ - SPEC | META | 'C', nullproc, /* every command input */ - SPEC | META | 'R', nullproc, /* on file read */ - SPEC | META | 'X', nullproc, /* on window change P.K. */ + { SPEC | META | 'W', wrapword }, /* called on word wrap */ + { SPEC | META | 'C', nullproc }, /* every command input */ + { SPEC | META | 'R', nullproc }, /* on file read */ + { SPEC | META | 'X', nullproc }, /* on window change P.K. */ {0, NULL} }; diff --git a/efunc.h b/efunc.h index b408b77..199aeb8 100644 --- a/efunc.h +++ b/efunc.h @@ -120,7 +120,7 @@ extern int istring(int f, int n); extern int ovstring(int f, int n); /* main.c */ -extern int edinit(char *bname); +extern void edinit(char *bname); extern int execute(int c, int f, int n); extern int quickexit(int f, int n); extern int quit(int f, int n); @@ -320,7 +320,7 @@ extern int cbuf40(int f, int n); /* spawn.c */ extern int spawncli(int f, int n); -extern void bktoshell(void); +extern int bktoshell(int f, int n); extern void rtfrmshell(void); extern int spawn(int f, int n); extern int execprg(int f, int n); diff --git a/lock.c b/lock.c index 25603a9..31a5e92 100644 --- a/lock.c +++ b/lock.c @@ -14,9 +14,6 @@ #if BSD | SVR4 #include -extern int sys_nerr; /* number of system error messages defined */ -extern int errno; /* current error */ - char *lname[NLOCKS]; /* names of all locked files */ int numlocks; /* # of current locks active */ @@ -157,10 +154,7 @@ void lckerror(char *errstr) strcpy(obuf, errstr); strcat(obuf, " - "); - if (errno < sys_nerr) - strcat(obuf, sys_errlist[errno]); - else - strcat(obuf, "(can not get system error message)"); + strcat(obuf, strerror(errno)); mlwrite(obuf); } #endif diff --git a/main.c b/main.c index 1db1389..6b5a802 100644 --- a/main.c +++ b/main.c @@ -94,7 +94,7 @@ int emacs(int argc, char **argv) int main(int argc, char **argv) #endif { - register int c; /* command character */ + register int c = -1; /* command character */ register int f; /* default flag */ register int n; /* numeric repeat count */ register int mflag; /* negative flag on repeat */ @@ -115,7 +115,6 @@ int main(int argc, char **argv) int cryptflag; /* encrypting on the way in? */ char ekey[NPAT]; /* startup encryption key */ #endif - extern *pathname[]; /* startup file path/name array */ int newc; #if PKCODE & VMS @@ -373,7 +372,7 @@ int main(int argc, char **argv) n = 4; /* with argument of 4 */ mflag = 0; /* that can be discarded. */ mlwrite("Arg: 4"); - while ((c = getcmd()) >= '0' && c <= '9' || c == reptc + while (((c = getcmd()) >= '0' && c <= '9') || c == reptc || c == '-') { if (c == reptc) if ((n > 0) == ((n * 4) > 0)) @@ -425,7 +424,7 @@ int main(int argc, char **argv) * as an argument, because the main routine may have been told to read in a * file by default, and we want the buffer name to be right. */ -int edinit(char *bname) +void edinit(char *bname) { register BUFFER *bp; register WINDOW *wp; @@ -706,20 +705,28 @@ int resterr(void) return (FALSE); } +/* user function that does NOTHING */ int nullproc(int f, int n) -{ /* user function that does NOTHING */ +{ + return (TRUE); } +/* dummy function for binding to meta prefix */ int meta(int f, int n) -{ /* dummy function for binding to meta prefix */ +{ + return (TRUE); } +/* dummy function for binding to control-x prefix */ int cex(int f, int n) -{ /* dummy function for binding to control-x prefix */ +{ + return (TRUE); } +/* dummy function for binding to universal-argument */ int unarg(int f, int n) -{ /* dummy function for binding to universal-argument */ +{ + return (TRUE); } /***** Compiler specific Library functions ****/ diff --git a/posix.c b/posix.c index b9b0ada..cc09d03 100644 --- a/posix.c +++ b/posix.c @@ -13,6 +13,7 @@ #ifdef POSIX #include +#include #include "estruct.h" #include "edef.h" #include "efunc.h" @@ -23,9 +24,7 @@ #include static int kbdflgs; /* saved keyboard fd flags */ -static int kbdpoll; /* in O_NDELAY mode */ -static int kbdqp; /* there is a char in kbdq */ -static char kbdq; /* char we've already read */ +static int kbdpoll; /* in O_NDELAY mode */ static struct termios otermios; /* original terminal characteristics */ static struct termios ntermios; /* charactoristics to use inside */ @@ -101,6 +100,7 @@ void ttclose(void) int ttputc(int c) { fputc(c, stdout); + return (TRUE); } /* diff --git a/spawn.c b/spawn.c index 7290e0c..3195a9b 100644 --- a/spawn.c +++ b/spawn.c @@ -5,6 +5,7 @@ */ #include +#include #include "estruct.h" #include "edef.h" #include "efunc.h" @@ -104,16 +105,17 @@ int spawncli(int f, int n) #if BSD | __hpux | SVR4 -void bktoshell(void) +int bktoshell(int f, int n) { /* suspend MicroEMACS and wait to wake up */ - int pid; - vttidy(); /****************************** + int pid; + pid = getpid(); kill(pid,SIGTSTP); ******************************/ kill(0, SIGTSTP); + return (TRUE); } void rtfrmshell(void)