home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume11
/
jove.pch
/
part04
/
jove.pch.4
Wrap
Text File
|
1987-09-15
|
32KB
|
1,414 lines
diff -c ojove/rec.c jove/rec.c
*** ojove/rec.c Thu Jul 16 09:15:04 1987
--- jove/rec.c Mon Jul 13 09:46:08 1987
***************
*** 51,57 ****
(void) unlink(recfname);
}
! static
putaddr(addr, p)
disk_line addr;
register File *p;
--- 51,57 ----
(void) unlink(recfname);
}
! private
putaddr(addr, p)
disk_line addr;
register File *p;
***************
*** 63,69 ****
putc(*cp++ & 0377, p);
}
! static
putn(cp, nbytes)
register char *cp;
register int nbytes;
--- 63,69 ----
putc(*cp++ & 0377, p);
}
! private
putn(cp, nbytes)
register char *cp;
register int nbytes;
***************
*** 74,80 ****
/* Write out the line pointers for buffer B. */
! static
dmppntrs(b)
register Buffer *b;
{
--- 74,80 ----
/* Write out the line pointers for buffer B. */
! private
dmppntrs(b)
register Buffer *b;
{
***************
*** 86,106 ****
/* dump the buffer info and then the actual line pointers. */
! static
! dmp_buf(b)
register Buffer *b;
{
! static struct rec_entry record;
register Line *lp;
register int nlines = 0;
for (lp = b->b_first; lp != 0; lp = lp->l_next, nlines++)
! ;
strcpy(record.r_fname, b->b_fname ? b->b_fname : NullStr);
strcpy(record.r_bname, b->b_name);
record.r_nlines = nlines;
putn((char *) &record, sizeof record);
- dmppntrs(b);
}
/* Goes through all the buffers and syncs them to the disk. */
--- 86,107 ----
/* dump the buffer info and then the actual line pointers. */
! private
! dmp_buf_header(b)
register Buffer *b;
{
! struct rec_entry record;
register Line *lp;
register int nlines = 0;
for (lp = b->b_first; lp != 0; lp = lp->l_next, nlines++)
! if (lp == b->b_dot)
! record.r_dotline = nlines;
strcpy(record.r_fname, b->b_fname ? b->b_fname : NullStr);
strcpy(record.r_bname, b->b_name);
record.r_nlines = nlines;
+ record.r_dotchar = b->b_char;
putn((char *) &record, sizeof record);
}
/* Goes through all the buffers and syncs them to the disk. */
***************
*** 110,115 ****
--- 111,117 ----
SyncRec()
{
register Buffer *b;
+ extern disk_line DFree;
if (rec_fd == 0)
recinit(); /* Init recover file. */
***************
*** 123,128 ****
--- 125,131 ----
continue;
else
Header.Nbuffers++;
+ Header.FreePtr = DFree;
putn((char *) &Header, sizeof Header);
if (Header.Nbuffers != 0) {
SyncTmp();
***************
*** 130,136 ****
if (b->b_type == B_SCRATCH || !IsModified(b))
continue;
else
! dmp_buf(b);
}
flush(rec_out);
}
--- 133,148 ----
if (b->b_type == B_SCRATCH || !IsModified(b))
continue;
else
! dmp_buf_header(b);
! for (b = world; b != 0; b = b->b_next)
! if (b->b_type == B_SCRATCH || !IsModified(b))
! continue;
! else
! dmppntrs(b);
}
flush(rec_out);
+ }
+
+ FullRecover()
+ {
}
diff -c ojove/rec.h jove/rec.h
*** ojove/rec.h Thu Jul 16 09:15:06 1987
--- jove/rec.h Thu Mar 19 17:13:30 1987
***************
*** 6,20 ****
************************************************************************/
struct rec_head {
! int Uid, /* Uid of owner. */
! Pid; /* Pid of jove process. */
! time_t UpdTime; /* Last time this was updated. */
! int Nbuffers; /* Number of buffers. */
};
struct rec_entry {
char r_bname[128],
r_fname[128];
! int r_nlines;
};
-
--- 6,22 ----
************************************************************************/
struct rec_head {
! int Uid, /* uid of owner */
! Pid; /* pid of jove process */
! time_t UpdTime; /* last time this was updated */
! int Nbuffers; /* number of buffers */
! disk_line FreePtr; /* position of DFree */
};
struct rec_entry {
char r_bname[128],
r_fname[128];
! int r_nlines,
! r_dotline, /* so we can really save the context */
! r_dotchar;
};
diff -c ojove/recover.c jove/recover.c
*** ojove/recover.c Thu Jul 16 09:15:12 1987
--- jove/recover.c Mon Jul 13 12:00:15 1987
***************
*** 405,414 ****
printf("recover: cannot create %s.\n", dest);
return;
}
- seekto(src - buflist);
if (dest != tty)
printf("\"%s\"", dest);
! dump_file(outfile);
} else
printf("\nAborted!\n");
fclose(outfile);
--- 405,413 ----
printf("recover: cannot create %s.\n", dest);
return;
}
if (dest != tty)
printf("\"%s\"", dest);
! dump_file(src - buflist, outfile);
} else
printf("\nAborted!\n");
fclose(outfile);
***************
*** 440,454 ****
seekto(which)
{
struct rec_entry rec;
! fseek(ptrs_fp, (long) (sizeof Header), L_SET);
!
! while (which-- > 1) {
! read_rec(&rec);
! if (fseek(ptrs_fp, (long) rec.r_nlines * sizeof (disk_line),
! L_INCR) == -1)
! printf("recover: improper fseek!\n");
! }
}
makblist()
--- 439,451 ----
seekto(which)
{
struct rec_entry rec;
+ long offset;
+ int i;
! offset = sizeof (Header) + (Header.Nbuffers * sizeof (rec));
! for (i = 1; i < which; i++)
! offset += buflist[i]->r_nlines * sizeof (disk_line);
! fseek(ptrs_fp, offset, L_SET);
}
makblist()
***************
*** 455,469 ****
{
int i;
for (i = 1; i <= Header.Nbuffers; i++) {
- seekto(i);
if (buflist[i] == 0)
buflist[i] = (struct rec_entry *) malloc (sizeof (struct rec_entry));
read_rec(buflist[i]);
}
! if (buflist[i]) {
free((char *) buflist[i]);
buflist[i] = 0;
}
}
--- 452,467 ----
{
int i;
+ fseek(ptrs_fp, (long) sizeof (Header), L_SET);
for (i = 1; i <= Header.Nbuffers; i++) {
if (buflist[i] == 0)
buflist[i] = (struct rec_entry *) malloc (sizeof (struct rec_entry));
read_rec(buflist[i]);
}
! while (buflist[i]) {
free((char *) buflist[i]);
buflist[i] = 0;
+ i++;
}
}
***************
*** 481,496 ****
return addr;
}
! dump_file(out)
FILE *out;
{
- struct rec_entry record;
register int nlines;
register disk_line daddr;
char buf[BUFSIZ];
! read_rec(&record);
! nlines = record.r_nlines;
Nchars = Nlines = 0L;
while (--nlines >= 0) {
daddr = getaddr(ptrs_fp);
--- 479,493 ----
return addr;
}
! dump_file(which, out)
FILE *out;
{
register int nlines;
register disk_line daddr;
char buf[BUFSIZ];
! seekto(which);
! nlines = buflist[which]->r_nlines;
Nchars = Nlines = 0L;
while (--nlines >= 0) {
daddr = getaddr(ptrs_fp);
***************
*** 539,549 ****
#ifdef KILL0
if (kill(Header.Pid, 0) == 0)
return 0;
- #else
- #ifdef LSRHS
- if (pexist(Header.Pid))
- return 0;
- #endif LSRHS
#endif KILL0
if (Header.Nbuffers == 0) {
--- 536,541 ----
***************
*** 568,573 ****
--- 560,566 ----
return 1;
}
makblist();
+ list();
for (;;) {
tellme("(Type '?' for options): ", answer);
***************
*** 699,707 ****
printf("recover: usage: recover [-d directory]\n");
printf("Use \"recover\" after JOVE has died for some\n");
printf("unknown reason.\n\n");
! printf("Use \"recover -syscrash\" when the system is in the process\n");
printf("of rebooting. This is done automatically at reboot time\n");
printf("and so most of you don't have to worry about that.\n\n");
printf("Use \"recover -d directory\" when the tmp files are store\n");
printf("in DIRECTORY instead of the default one (/tmp).\n");
exit(0);
--- 692,701 ----
printf("recover: usage: recover [-d directory]\n");
printf("Use \"recover\" after JOVE has died for some\n");
printf("unknown reason.\n\n");
! /* printf("Use \"recover -syscrash\" when the system is in the process\n");
printf("of rebooting. This is done automatically at reboot time\n");
printf("and so most of you don't have to worry about that.\n\n");
+ */
printf("Use \"recover -d directory\" when the tmp files are store\n");
printf("in DIRECTORY instead of the default one (/tmp).\n");
exit(0);
diff -c ojove/screen.c jove/screen.c
*** ojove/screen.c Thu Jul 16 09:15:18 1987
--- jove/screen.c Mon Jul 13 08:34:13 1987
***************
*** 222,231 ****
BufSwrite(linenum)
{
- char *bp;
register int n = cursend - cursor,
col = 0,
c;
int StartCol = DesiredScreen[linenum].s_offset,
visspace = DesiredScreen[linenum].s_window->w_flags & W_VISSPACE,
aborted = 0;
--- 222,231 ----
BufSwrite(linenum)
{
register int n = cursend - cursor,
col = 0,
c;
+ register char *bp;
int StartCol = DesiredScreen[linenum].s_offset,
visspace = DesiredScreen[linenum].s_window->w_flags & W_VISSPACE,
aborted = 0;
***************
*** 369,376 ****
What ever turns you on ... */
private struct cursaddr {
! int c_numchars,
! (*c_proc)();
};
private char *Cmstr;
--- 369,376 ----
What ever turns you on ... */
private struct cursaddr {
! int cm_numchars,
! (*cm_proc)();
};
private char *Cmstr;
***************
*** 532,538 ****
register int nlines = destline - CapLine;
while (--nlines >= 0)
! putchar('\n');
CapLine = destline;
}
--- 532,538 ----
register int nlines = destline - CapLine;
while (--nlines >= 0)
! putpad(NL, 1);
CapLine = destline;
}
***************
*** 574,580 ****
#define CursMin(which,addrs,max) \
for (best = 0, cp = &addrs[1], i = 1; i < max; i++, cp++) \
! if (cp->c_numchars < addrs[best].c_numchars) \
best = i; \
which = &addrs[best];
--- 574,580 ----
#define CursMin(which,addrs,max) \
for (best = 0, cp = &addrs[1], i = 1; i < max; i++, cp++) \
! if (cp->cm_numchars < addrs[best].cm_numchars) \
best = i; \
which = &addrs[best];
***************
*** 598,610 ****
if (dcol == 1 || dcol == 0) { /* Most common case. */
HorMin = &WarpHor[FORWARD];
! HorMin->c_numchars = dcol + xtracost;
} else {
! WarpHor[FORWARD].c_numchars = dcol >= 0 ? dcol + xtracost : 1000;
! WarpHor[BACKWARD].c_numchars = dcol < 0 ? -(dcol + xtracost) : 1000;
! WarpHor[FORTAB].c_numchars = dcol >= 0 && TABS ?
ForNum(CapCol, col) + xtracost : 1000;
! WarpHor[RETFORWARD].c_numchars = (xtracost + 1 + (TABS ? ForNum(0, col) : col));
/* Which is the shortest of the bunch */
--- 598,610 ----
if (dcol == 1 || dcol == 0) { /* Most common case. */
HorMin = &WarpHor[FORWARD];
! HorMin->cm_numchars = dcol + xtracost;
} else {
! WarpHor[FORWARD].cm_numchars = dcol >= 0 ? dcol + xtracost : 1000;
! WarpHor[BACKWARD].cm_numchars = dcol < 0 ? -(dcol + xtracost) : 1000;
! WarpHor[FORTAB].cm_numchars = dcol >= 0 && TABS ?
ForNum(CapCol, col) + xtracost : 1000;
! WarpHor[RETFORWARD].cm_numchars = (xtracost + 1 + (TABS ? ForNum(0, col) : col));
/* Which is the shortest of the bunch */
***************
*** 613,620 ****
/* Moving vertically is more simple. */
! WarpVert[DOWN].c_numchars = dline >= 0 ? dline : 1000;
! WarpVert[UPMOVE].c_numchars = dline < 0 ? ((-dline) * UPlen) : 1000;
/* Which of these is simpler */
CursMin(VertMin, WarpVert, NUMVERT);
--- 613,620 ----
/* Moving vertically is more simple. */
! WarpVert[DOWN].cm_numchars = dline >= 0 ? dline : 1000;
! WarpVert[UPMOVE].cm_numchars = dline < 0 ? ((-dline) * UPlen) : 1000;
/* Which of these is simpler */
CursMin(VertMin, WarpVert, NUMVERT);
***************
*** 624,651 ****
Homing first's total is the sum of the cost of homing
and the sum of tabbing (if possible) to the right. */
! if (VertMin->c_numchars + HorMin->c_numchars <= 3) {
DirectMin = &WarpDirect[DIRECT]; /* A dummy ... */
! DirectMin->c_numchars = 100;
} else {
! WarpDirect[DIRECT].c_numchars = CM ?
strlen(Cmstr = tgoto(CM, col, line)) : 1000;
! WarpDirect[HOME].c_numchars = HOlen + line +
! WarpHor[RETFORWARD].c_numchars;
! WarpDirect[LOWER].c_numchars = LLlen + ((ILI - line) * UPlen) +
! WarpHor[RETFORWARD].c_numchars;
CursMin(DirectMin, WarpDirect, NUMDIRECT);
}
! if (HorMin->c_numchars + VertMin->c_numchars < DirectMin->c_numchars) {
if (line != CapLine)
! (*VertMin->c_proc)(line);
if (col != CapCol) {
#ifdef ID_CHAR
if (IN_INSmode) /* We may use real characters ... */
INSmode(0);
#endif
! (*HorMin->c_proc)(col);
}
} else {
#ifdef ID_CHAR
--- 624,651 ----
Homing first's total is the sum of the cost of homing
and the sum of tabbing (if possible) to the right. */
! if (VertMin->cm_numchars + HorMin->cm_numchars <= 3) {
DirectMin = &WarpDirect[DIRECT]; /* A dummy ... */
! DirectMin->cm_numchars = 100;
} else {
! WarpDirect[DIRECT].cm_numchars = CM ?
strlen(Cmstr = tgoto(CM, col, line)) : 1000;
! WarpDirect[HOME].cm_numchars = HOlen + line +
! WarpHor[RETFORWARD].cm_numchars;
! WarpDirect[LOWER].cm_numchars = LLlen + ((ILI - line) * UPlen) +
! WarpHor[RETFORWARD].cm_numchars;
CursMin(DirectMin, WarpDirect, NUMDIRECT);
}
! if (HorMin->cm_numchars + VertMin->cm_numchars < DirectMin->cm_numchars) {
if (line != CapLine)
! (*VertMin->cm_proc)(line);
if (col != CapCol) {
#ifdef ID_CHAR
if (IN_INSmode) /* We may use real characters ... */
INSmode(0);
#endif
! (*HorMin->cm_proc)(col);
}
} else {
#ifdef ID_CHAR
***************
*** 652,658 ****
if (IN_INSmode && !MI)
INSmode(0);
#endif
! (*DirectMin->c_proc)(line, col);
}
}
--- 652,658 ----
if (IN_INSmode && !MI)
INSmode(0);
#endif
! (*DirectMin->cm_proc)(line, col);
}
}
***************
*** 716,727 ****
register int i;
if (CS) {
! putpad(tgoto(CS, bottom, top));
CapCol = CapLine = 0;
Placur(top, 0);
for (i = 0; i < num; i++)
putpad(SR, bottom - top);
! putpad(tgoto(CS, ILI, 0));
CapCol = CapLine = 0;
} else {
Placur(bottom - num + 1, 0);
--- 716,727 ----
register int i;
if (CS) {
! putpad(tgoto(CS, bottom, top), 1);
CapCol = CapLine = 0;
Placur(top, 0);
for (i = 0; i < num; i++)
putpad(SR, bottom - top);
! putpad(tgoto(CS, ILI, 0), 1);
CapCol = CapLine = 0;
} else {
Placur(bottom - num + 1, 0);
***************
*** 785,796 ****
register int i;
if (CS) {
! putpad(tgoto(CS, bottom, top));
CapCol = CapLine = 0;
Placur(bottom, 0);
for (i = 0; i < num; i++)
putpad(SF, bottom - top);
! putpad(tgoto(CS, ILI, 0));
CapCol = CapLine = 0;
} else {
Placur(top, 0);
--- 785,796 ----
register int i;
if (CS) {
! putpad(tgoto(CS, bottom, top), 1);
CapCol = CapLine = 0;
Placur(bottom, 0);
for (i = 0; i < num; i++)
putpad(SF, bottom - top);
! putpad(tgoto(CS, ILI, 0), 1);
CapCol = CapLine = 0;
} else {
Placur(top, 0);
diff -c ojove/term.c jove/term.c
*** ojove/term.c Thu Jul 16 09:15:21 1987
--- jove/term.c Wed Jun 3 16:31:57 1987
***************
*** 6,11 ****
--- 6,12 ----
************************************************************************/
#include "jove.h"
+ #include <ctype.h>
#include <errno.h>
#ifdef SYSV
# include <termio.h>
***************
*** 48,60 ****
*SF, /* Scroll forward */
*SR,
*SP, /* Send Cursor Position */
- #ifdef LSRHS
- *RS, /* Reverse video start */
- *RE, /* Reverse end */
- #endif
*VB,
*IP, /* insert pad after character inserted */
! *lPC;
int LI,
ILI, /* Internal lines, i.e., 23 of LI is 24. */
--- 49,59 ----
*SF, /* Scroll forward */
*SR,
*SP, /* Send Cursor Position */
*VB,
+ *BL,
*IP, /* insert pad after character inserted */
! *lPC,
! *NL;
int LI,
ILI, /* Internal lines, i.e., 23 of LI is 24. */
***************
*** 70,103 ****
HOlen,
LLlen;
! #ifdef SYSV /* release 2, at least */
! char PC ;
#else
extern char PC;
! #endif SYSV
static char tspace[256];
/* The ordering of ts and meas must agree !! */
! #ifdef LSRHS
! static char *ts="vsvealdlspcssosecmclcehoupbcicimdceillsfsrvbksketiteALDLICDCrsrepcip";
static char **meas[] = {
&VS, &VE, &AL, &DL, &SP, &CS, &SO, &SE,
&CM, &CL, &CE, &HO, &UP, &BC, &IC, &IM,
&DC, &EI, &LL, &SF, &SR, &VB, &KS, &KE,
&TI, &TE, &M_AL, &M_DL, &M_IC, &M_DC,
! &RS, &RE, &lPC, &IP, 0
};
- #else
- static char *ts="vsvealdlspcssosecmclcehoupbcicimdceillsfsrvbksketiteALDLICDCpcip";
- static char **meas[] = {
- &VS, &VE, &AL, &DL, &SP, &CS, &SO, &SE,
- &CM, &CL, &CE, &HO, &UP, &BC, &IC, &IM,
- &DC, &EI, &LL, &SF, &SR, &VB, &KS, &KE,
- &TI, &TE, &M_AL, &M_DL, &M_IC, &M_DC,
- &lPC, &IP, 0
- };
- #endif
static
gets(buf)
--- 69,91 ----
HOlen,
LLlen;
! #ifdef SYSVR2 /* release 2, at least */
! char PC;
#else
extern char PC;
! #endif SYSVR2
static char tspace[256];
/* The ordering of ts and meas must agree !! */
! static char *ts="vsvealdlspcssosecmclcehoupbcicimdceillsfsrvbksketiteALDLICDCpcipblnl";
static char **meas[] = {
&VS, &VE, &AL, &DL, &SP, &CS, &SO, &SE,
&CM, &CL, &CE, &HO, &UP, &BC, &IC, &IM,
&DC, &EI, &LL, &SF, &SR, &VB, &KS, &KE,
&TI, &TE, &M_AL, &M_DL, &M_IC, &M_DC,
! &lPC, &IP, &BL, &NL, 0
};
static
gets(buf)
***************
*** 172,189 ****
UL = tgetflag("ul");
! #ifdef LSRHS /* We, at the high school, are the only ones who
! do SO right in termcap, but unfortunately the
! right SO doesn't look as good with modelines. */
! if (RS)
! SO = RS;
! if (RE)
! SE = RE;
! /* I only ever use SO for the modeline anyway. */
! /* SO is really BOLDFACE! Why is LS always right and the rest of the
! world wrong? */
! #endif
#ifdef ID_CHAR
disp_opt_init();
#endif
--- 160,177 ----
UL = tgetflag("ul");
! if (NL == 0)
! NL = "\n";
! else { /* strip stupid padding information */
! while (isdigit(*NL))
! NL++;
! if (*NL == '*')
! NL++;
! }
! if (BL == 0)
! BL = "\007";
!
#ifdef ID_CHAR
disp_opt_init();
#endif
diff -c ojove/termcap.h jove/termcap.h
*** ojove/termcap.h Thu Jul 16 09:15:22 1987
--- jove/termcap.h Fri May 29 16:28:21 1987
***************
*** 36,48 ****
*SF, /* Scroll forward */
*SR, /* Scroll reverse */
*SP, /* Send cursor position */
- #ifdef LSRHS
- *RS, /* reverse video start */
- *RE, /* reverse video end */
- #endif
*VB, /* visible bell */
*IP, /* insert pad after character inserted */
! *lPC;
extern int
LI, /* number of lines */
--- 36,46 ----
*SF, /* Scroll forward */
*SR, /* Scroll reverse */
*SP, /* Send cursor position */
*VB, /* visible bell */
+ *BL, /* audible bell */
*IP, /* insert pad after character inserted */
! *lPC,
! *NL; /* newline character (usually \n) */
extern int
LI, /* number of lines */
diff -c ojove/tune.h jove/tune.h
*** ojove/tune.h Thu Jul 16 09:15:22 1987
--- jove/tune.h Fri May 29 11:14:40 1987
***************
*** 7,17 ****
#define TUNED /* don't touch this */
- /*#define LSRHS /* if this is Lincoln-Sudbury Regional High School */
/*#define MSDOS /* if this is MSDOS */
#define BSD4_2 /* Berkeley 4.2 BSD */
/*#define BSD4_3 /* Berkeley 4.3 BSD */
/*#define SYSV /* for (System III/System V) UNIX systems */
#ifdef BSD4_3
# ifndef BSD4_2
# define BSD4_2 /* 4.3 is 4.2 only different. */
--- 7,23 ----
#define TUNED /* don't touch this */
/*#define MSDOS /* if this is MSDOS */
#define BSD4_2 /* Berkeley 4.2 BSD */
/*#define BSD4_3 /* Berkeley 4.3 BSD */
/*#define SYSV /* for (System III/System V) UNIX systems */
+ /*#define SYSVR2 /* system 5, rel. 2 */
+ #ifdef SYSVR2
+ # ifndef SYSV
+ # define SYSV /* SYSV is a subset of SYSVR2 */
+ # endif
+ #endif
+
#ifdef BSD4_3
# ifndef BSD4_2
# define BSD4_2 /* 4.3 is 4.2 only different. */
***************
*** 36,42 ****
# define NBUF 3
# endif
#
! /* # define LOAD_AV /* Use the load average for various commands.
# Do not define this if you lack a load average
# system call and kmem is read protected. */
#
--- 42,48 ----
# define NBUF 3
# endif
#
! # define LOAD_AV /* Use the load average for various commands.
# Do not define this if you lack a load average
# system call and kmem is read protected. */
#
***************
*** 67,73 ****
# define BIFF /* if you have biff (or the equivalent) */
# define F_COMPLETION /* filename completion */
# define CHDIR /* cd command and absolute pathnames */
! # define KILL0 /* kill(pid, 0) returns 0 if proc exists */
# define SPELL /* spell words and buffer commands */
# define ID_CHAR /* include code to IDchar */
# define WIRED_TERMS /* include code for wired terminals */
--- 73,79 ----
# define BIFF /* if you have biff (or the equivalent) */
# define F_COMPLETION /* filename completion */
# define CHDIR /* cd command and absolute pathnames */
! /*# define KILL0 /* kill(pid, 0) returns 0 if proc exists */
# define SPELL /* spell words and buffer commands */
# define ID_CHAR /* include code to IDchar */
# define WIRED_TERMS /* include code for wired terminals */
diff -c ojove/util.c jove/util.c
*** ojove/util.c Thu Jul 16 09:15:24 1987
--- jove/util.c Fri Jun 19 16:01:01 1987
***************
*** 7,17 ****
#include "jove.h"
#include "ctype.h"
#include <signal.h>
#include <varargs.h>
! #ifdef SYSV /* release 2, at least */
! short ospeed ;
#endif
struct cmd *
--- 7,18 ----
#include "jove.h"
#include "ctype.h"
+ #include "termcap.h"
#include <signal.h>
#include <varargs.h>
! #ifdef SYSVR2 /* release 2, at least */
! short ospeed;
#endif
struct cmd *
***************
*** 27,32 ****
--- 28,34 ----
}
int Interactive; /* True when we invoke with the command handler? */
+ data_obj *LastCmd;
char *ProcFmt = ": %f ";
ExecCmd(cp)
***************
*** 56,76 ****
lastline(lp)
register Line *lp;
{
! while (lp->l_next)
! lp = lp->l_next;
return lp;
}
! Upper(c)
! register int c;
! {
! return (islower(c) ? toupper(c) : c);
! }
- int alarmed = 0;
-
char key_strokes[100];
! static char *key_p = key_strokes;
init_strokes()
{
--- 58,74 ----
lastline(lp)
register Line *lp;
{
! register Line *next;
!
! while (next = lp->l_next)
! lp = next;
return lp;
}
! private int *slowp = 0;
char key_strokes[100];
! private char *key_p = key_strokes;
init_strokes()
{
***************
*** 88,94 ****
slowpoke()
{
! alarmed++;
f_mess(key_strokes);
}
--- 86,93 ----
slowpoke()
{
! if (slowp)
! *slowp = YES;
f_mess(key_strokes);
}
***************
*** 95,104 ****
#ifdef BSD4_2
# define N_SEC 1 /* will be precisely 1 second on 4.2 */
#else
! # define N_SEC 2 /* but from 0 to 2 seconds otherwise */
#endif
! waitchar()
{
#ifdef EUNICE
return getch();
--- 94,104 ----
#ifdef BSD4_2
# define N_SEC 1 /* will be precisely 1 second on 4.2 */
#else
! # define N_SEC 2 /* but from 1 to 2 seconds otherwise */
#endif
! waitchar(slow)
! int *slow;
{
#ifdef EUNICE
return getch();
***************
*** 107,113 ****
int c;
int (*oldproc)();
! alarmed = 0;
oldproc = signal(SIGALRM, slowpoke);
if ((old_time = alarm((unsigned) N_SEC)) == 0)
--- 107,115 ----
int c;
int (*oldproc)();
! slowp = slow;
! if (slow)
! *slow = NO;
oldproc = signal(SIGALRM, slowpoke);
if ((old_time = alarm((unsigned) N_SEC)) == 0)
***************
*** 214,220 ****
Eol();
}
! int MarkThresh = 22; /* Average screen size ... */
static int line_diff;
LineDist(nextp, endp)
--- 216,222 ----
Eol();
}
! int MarkThresh = 22; /* average screen size ... */
static int line_diff;
LineDist(nextp, endp)
***************
*** 255,263 ****
PushPntp(line)
register Line *line;
{
- exp_p = NO;
if (LineDist(curline, line) >= MarkThresh)
! SetMark();
}
ToFirst()
--- 257,264 ----
PushPntp(line)
register Line *line;
{
if (LineDist(curline, line) >= MarkThresh)
! set_mark();
}
ToFirst()
***************
*** 276,282 ****
{
register char c;
! if (dir > 0) {
while ((c = linebuf[curchar]) != 0 && !isword(c))
curchar++;
if (eolp()) {
--- 277,283 ----
{
register char c;
! if (dir == FORWARD) {
while ((c = linebuf[curchar]) != 0 && !isword(c))
curchar++;
if (eolp()) {
***************
*** 319,325 ****
filename(b)
register Buffer *b;
{
! return b->b_fname ? pr_name(b->b_fname) : "[No file]";
}
char *
--- 320,326 ----
filename(b)
register Buffer *b;
{
! return b->b_fname ? pr_name(b->b_fname, YES) : "[No file]";
}
char *
***************
*** 430,436 ****
return 0;
}
! /* Make `buf' modified and tell the redisplay code to update the modeline
if it will need to be changed. */
int ModCount = 0;
--- 431,437 ----
return 0;
}
! /* Make `buf' (un)modified and tell the redisplay code to update the modeline
if it will need to be changed. */
int ModCount = 0;
***************
*** 439,447 ****
{
extern int DOLsave;
! if (!curbuf->b_modified)
UpdModLine++;
! curbuf->b_modified++;
DOLsave++;
if (!Asking)
ModCount++;
--- 440,449 ----
{
extern int DOLsave;
! if (!curbuf->b_modified) {
UpdModLine++;
! curbuf->b_modified = YES;
! }
DOLsave++;
if (!Asking)
ModCount++;
***************
*** 449,457 ****
unmodify()
{
! if (curbuf->b_modified)
UpdModLine++;
! curbuf->b_modified = 0;
}
numcomp(s1, s2)
--- 451,460 ----
unmodify()
{
! if (curbuf->b_modified) {
UpdModLine++;
! curbuf->b_modified = NO;
! }
}
numcomp(s1, s2)
***************
*** 500,506 ****
{
register char *pp, *pp1;
register int len;
! int numchars; /* Number of characters to copy forward */
if (num <= 0)
return;
--- 503,509 ----
{
register char *pp, *pp1;
register int len;
! int numchars; /* number of characters to copy forward */
if (num <= 0)
return;
***************
*** 566,572 ****
char *
emalloc(size)
{
! char *ptr;
if (ptr = malloc((unsigned) size))
return ptr;
--- 569,575 ----
char *
emalloc(size)
{
! register char *ptr;
if (ptr = malloc((unsigned) size))
return ptr;
***************
*** 606,613 ****
}
#ifdef LOAD_AV
! # ifdef BSD4_2
! # ifdef PURDUE_EE
get_la(dp)
double *dp;
--- 609,616 ----
}
#ifdef LOAD_AV
! # ifdef BSD4_2
! # ifdef PURDUE_EE && (vax || gould)
get_la(dp)
double *dp;
***************
*** 615,622 ****
*dp = (double) loadav(0) / 100.0;
}
! # else PURDUE_EE
#include <nlist.h>
static struct nlist nl[] = {
--- 618,628 ----
*dp = (double) loadav(0) / 100.0;
}
! # else PURDUE_EE
+ #ifdef sun
+ # include <sys/param.h>
+ #endif
#include <nlist.h>
static struct nlist nl[] = {
***************
*** 628,634 ****
--- 634,644 ----
get_la(dp)
double *dp;
{
+ #ifdef sun
+ long avenrun[3];
+ #else
double avenrun[3];
+ #endif
static int kmem = 0;
if (kmem == -1) {
***************
*** 644,650 ****
--- 654,664 ----
}
lseek(kmem, (long) nl[X_AVENRUN].n_value, 0);
read(kmem, (char *) avenrun, sizeof(avenrun));
+ #ifdef sun
+ *dp = (double) avenrun[0] / FSCALE;
+ #else
*dp = avenrun[0];
+ #endif
}
# endif PURDUE_EE
***************
*** 693,703 ****
strlen(s)
register char *s;
{
! register char *base = s + 1; /* Can you say kludge? */
while (*s++)
;
! return (s - base);
}
char *
--- 707,717 ----
strlen(s)
register char *s;
{
! register char *base = s;
while (*s++)
;
! return (s - base) - 1;
}
char *
***************
*** 719,725 ****
*s2;
{
if (!s1 || !s2)
! return 1; /* Which is not zero ... */
while (*s1 == *s2++)
if (*s1++ == '\0')
return 0;
--- 733,739 ----
*s2;
{
if (!s1 || !s2)
! return 1; /* which is not zero ... */
while (*s1 == *s2++)
if (*s1++ == '\0')
return 0;
***************
*** 731,738 ****
*s2;
{
if (!s1 || !s2)
! return 1; /* Which is not zero ... */
! while (*s1 == *s2++ || Upper(*s1) == Upper(s2[-1]))
if (*s1++ == '\0')
return 0;
return (*s1 - *--s2);
--- 745,752 ----
*s2;
{
if (!s1 || !s2)
! return 1; /* which is not zero ... */
! while (CharUpcase(*s1) == CharUpcase(*s2++))
if (*s1++ == '\0')
return 0;
return (*s1 - *--s2);
***************
*** 744,751 ****
register int n;
{
if (!s1 || !s2)
! return 1; /* Which is not zero ... */
! while (--n >= 0 && (*s1 == *s2++ || Upper(*s1) == Upper(s2[-1])))
if (*s1++ == '\0')
return 0;
return ((n < 0) ? 0 : *s1 - *--s2);
--- 758,765 ----
register int n;
{
if (!s1 || !s2)
! return 1; /* which is not zero ... */
! while (--n >= 0 && (CharUpcase(*s1) == CharUpcase(*s2++)))
if (*s1++ == '\0')
return 0;
return ((n < 0) ? 0 : *s1 - *--s2);
diff -c ojove/vars.c jove/vars.c
*** ojove/vars.c Thu Jul 16 09:15:25 1987
--- jove/vars.c Thu May 28 12:48:29 1987
***************
*** 25,30 ****
--- 25,31 ----
VARIABLE, "disable-biff", &BiffChk, V_BOOL,
#endif
VARIABLE, "error-window-size", &EWSize, V_BASE10,
+ VARIABLE, "expand-environment-variables", &DoEVexpand, V_BOOL,
VARIABLE, "file-creation-mode", &CreatMode, V_BASE8,
VARIABLE, "files-should-end-with-newline", &EndWNewline, V_BOOL,
VARIABLE, "internal-tabstop", &tabstop, V_BASE10|V_CLRSCREEN,
diff -c ojove/version.c jove/version.c
*** ojove/version.c Thu Jul 16 09:15:26 1987
--- jove/version.c Mon Jun 15 16:26:12 1987
***************
*** 5,8 ****
* included in all the files. *
************************************************************************/
! char *version = "4.6.1.4";
--- 5,8 ----
* included in all the files. *
************************************************************************/
! char *version = "4.7";
diff -c ojove/wind.c jove/wind.c
*** ojove/wind.c Thu Jul 16 09:15:28 1987
--- jove/wind.c Fri Jun 12 11:39:26 1987
***************
*** 219,225 ****
DOTsave(&savedot);
! switch (waitchar()) {
case 't':
case 'T':
ExecCmd((data_obj *) FindCmd(FindTag));
--- 219,225 ----
DOTsave(&savedot);
! switch (waitchar((int *) 0)) {
case 't':
case 'T':
ExecCmd((data_obj *) FindCmd(FindTag));
***************
*** 354,365 ****
GrowWindow()
{
! WindSize(curwind, abs(exp));
}
ShrWindow()
{
! WindSize(curwind, -abs(exp));
}
/* Change the size of the window by inc. First arg is the window,
--- 354,365 ----
GrowWindow()
{
! WindSize(curwind, abs(arg_value()));
}
ShrWindow()
{
! WindSize(curwind, -abs(arg_value()));
}
/* Change the size of the window by inc. First arg is the window,
***************
*** 434,438 ****
SplitWind()
{
! SetWind(div_wind(curwind, exp_p ? (exp - 1) : 1));
}
--- 434,460 ----
SplitWind()
{
! SetWind(div_wind(curwind, is_an_arg() ? (arg_value() - 1) : 1));
! }
!
! /* Goto the window with the named buffer. If no such window
! exists, pop one and attach the buffer to it. */
! GotoWind()
! {
! extern Buffer *lastbuf;
! char *bname;
! Window *w;
!
! bname = ask_buf(lastbuf);
! w = curwind->w_next;
! do {
! if (w->w_bufp->b_name == bname) {
! SetABuf(curbuf);
! SetWind(w);
! return;
! }
! w = w->w_next;
! } while (w != curwind);
! SetABuf(curbuf);
! pop_wind(bname, NO, -1);
}