ast@cs.vu.nl (Andy Tanenbaum) (06/05/88)
: This is a shar archive. Extract with sh, not csh. : This archive ends with exit, so do not worry about trailing junk. : --------------------------- cut here -------------------------- PATH=/bin:/usr/bin:/usr/ucb echo Extracting 'LISTING' sed 's/^X//' > 'LISTING' << '+ END-OF-FILE ''LISTING' Xtotal 13 X-rw-rw-rw- 1 ast 0 Jun 4 22:35 LISTING X-rw-r--r-- 1 ast 128 Jun 4 22:35 makefile.new X-rw-rw-rw- 1 ast 861 Jun 4 22:35 mined.h.diff X-rw-rw-rw- 1 ast 7926 Jun 4 22:35 mined1.c.diff X-rw-rw-rw- 1 ast 2955 Jun 4 22:35 mined2.c.diff + END-OF-FILE LISTING chmod 'u=rw,g=rw,o=rw' 'LISTING' set `wc -c 'LISTING'` count=$1 case $count in 296) :;; *) echo 'Bad character count in ''LISTING' >&2 echo 'Count should be 296' >&2 esac echo Extracting 'mined.h.diff' sed 's/^X//' > 'mined.h.diff' << '+ END-OF-FILE ''mined.h.diff' X14c14 X< #define YMAX 23 X--- X> #define YMAX 49 X49a50 X> #ifdef i8088 X50a52 X> #endif X54,58c56,57 X< /* X< * To avoid #define XXX 0 #define !XXX 1 an enum type is used for all flags used X< * in mined. X< */ X< typedef enum { X--- X> typedef int FLAG; X> X60,65c59,64 X< FALSE, X< TRUE, X< NOT_VALID, X< VALID, X< OFF, X< ON, X--- X> #define FALSE 0 X> #define TRUE 1 X> #define NOT_VALID 2 X> #define VALID 3 X> #define OFF 4 X> #define ON 5 X68,69c67,68 X< FORWARD, X< REVERSE, X--- X> #define FORWARD 6 X> #define REVERSE 7 X72,80c71,78 X< SMALLER, X< BIGGER, X< SAME, X< EMPTY, X< NO_DELETE, X< DELETE, X< READ, X< WRITE X< } FLAG; X--- X> #define SMALLER 8 X> #define BIGGER 9 X> #define SAME 10 X> #define EMPTY 11 X> #define NO_DELETE 12 X> #define DELETE 13 X> #define READ 14 X> #define WRITE 15 X141a140,141 X> extern int ymax; X> extern int screenmax; + END-OF-FILE mined.h.diff chmod 'u=rw,g=rw,o=rw' 'mined.h.diff' set `wc -c 'mined.h.diff'` count=$1 case $count in 861) :;; *) echo 'Bad character count in ''mined.h.diff' >&2 echo 'Count should be 861' >&2 esac echo Extracting 'mined1.c.diff' sed 's/^X//' > 'mined1.c.diff' << '+ END-OF-FILE ''mined1.c.diff' X10c10 X< * Mined is a screen editor designed for the minix operating system. X--- X> * Mined is a screen editor designed for the MINIX operating system. X408,410c408,409 X< #include "signal.h" X< #include "sgtty.h" X< #ifdef UNIX X--- X> #include <signal.h> X> #include <sgtty.h> X412,414d410 X< #else X< #include "errno.h" X< #endif UNIX X416a413,414 X> int ymax = YMAX; X> int screenmax = SCREENMAX; X417a416 X> X524c523 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X581a581,582 X> char buf[LINE_LEN]; X> register char *p = buf; X582a584,593 X> *p++ = ' '; X> if (s1 != NIL_PTR) X> while (*p = *s1++) X> p++; X> if (s2 != NIL_PTR) X> while (*p = *s2++) X> p++; X> *p++ = ' '; X> *p++ = 0; X> X585c596 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X597,603c608 X< putchar(' '); X< if (s1 != NIL_PTR) X< string_print(s1); X< X< if (s2 != NIL_PTR) X< string_print(s2); X< putchar(' '); X--- X> string_print(buf); X617c622 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X818c823 X< for (last_y = 0; last_y < nlines - 1 && last_y < SCREENMAX X--- X> for (last_y = 0; last_y < nlines - 1 && last_y < screenmax X840,842c845,848 X< string_print(pos_string); X< putchar(X_PLUS + nx); X< putchar(Y_PLUS + YMAX - ny);/* Driver has (0,0) at lower left corner */ X--- X> char text_buffer[10]; X> X> build_string(text_buffer, pos_string, ny+1, nx+1); X> string_print(text_buffer); X1070c1076 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X1093c1099 X< #ifdef UNIX X--- X> #ifdef NTTYDISC X1095c1101 X< #endif UNIX X--- X> #endif NTTYDISC X1100c1106 X< #ifdef UNIX X--- X> #ifdef NTTYDISC X1103c1109 X< #endif UNIX X--- X> #endif NTTYDISC X1111c1117 X< #ifdef UNIX X--- X> #ifdef NTTYDISC X1114c1120 X< #endif UNIX X--- X> #endif NTTYDISC X1159,1240d1164 X< #ifndef lint X< X< typedef unsigned vir_bytes; X< X< #define POINTER_SIZE (sizeof(char *)) X< #define cast(x) ((vir_bytes) (x)) X< #define align(x, a) (((x) + (a - 1)) & ~(a - 1)) X< #define BUSY 1 X< #define succ(p) (* (char **) (p)) X< #define is_busy(p) (cast(p) & BUSY) X< #define set_busy(p) ((char *) (cast(p) | BUSY)) X< X< char *free_list; X< X< /* X< * Init_alloc() sets up the free list. The free list initially consists of X< * MEMORY_SIZE bytes. X< */ X< init_alloc() X< { X< register char *ptr, *top; X< extern char *sbrk(); X< X< /* Get data space for free list */ X< free_list = sbrk(POINTER_SIZE); X< if ((ptr = sbrk(MEMORY_SIZE)) < 0) X< panic("Bad memory allocation in startup"); X< top = sbrk(POINTER_SIZE); X< X< /* Set up list */ X< succ(free_list) = ptr; X< succ(ptr) = top; X< succ(top) = NIL_PTR; X< } X< X< /* X< * Allocate size bytes of memory. X< */ X< char *alloc(size) X< unsigned size; X< { X< register char *p = free_list; X< register char *next; X< char *new; X< unsigned len = align(size, POINTER_SIZE) + POINTER_SIZE; X< X< p = free_list; X< while ((next = succ(p)) != NIL_PTR) { X< if (is_busy(next)) /* Already in use */ X< p = (char *) (cast(next) & ~BUSY); X< else { X< while ((new = succ(next)) != NIL_PTR && !is_busy(new)) X< next = new; X< if (next - p >= len) { /* fits */ X< if ((new = p + len) < next) { /* too big */ X< succ(new) = next; X< succ(p) = set_busy(new); X< } X< else X< succ(p) = set_busy(next); X< free_list = p; X< return (p + POINTER_SIZE); X< } X< p = next; X< } X< } X< if (loading == TRUE) X< panic("File too big."); X< panic("Out of memory."); X< } X< X< free_space(p) X< register char *p; X< { X< p = (char *) (cast(p) - POINTER_SIZE); X< *(vir_bytes *) (p) &= ~BUSY; X< X< /* Pointer to free list should point to lowest address freed. */ X< if (free_list > p) X< free_list = p; X< } X< #else X1243a1168 X> char *p; X1246c1171,1177 X< return malloc((unsigned) bytes); X--- X> p = malloc((unsigned) bytes); X> if (p == NIL_PTR) { X> if (loading == TRUE) X> panic("File too big."); X> panic("Out of memory."); X> } X> return(p); X1254d1184 X< #endif lint X1264c1194 X< extern S(), LIB(), DPC(), DCC(), DLN(), DNW(), DPW(), CTRL(); X--- X> extern S(), LIB(), DPC(), DCC(), DLN(), DNW(), DPW(), CTL(); X1276c1206 X< /* 100-117 */ S, S, S, CTRL, S, EF, SF, S, HO, S, S, S, S, S, S, S, X--- X> /* 100-117 */ S, S, S, CTL, S, EF, SF, S, HO, S, S, S, S, S, S, S, X1283c1213 X< /* 000-017 */ I, BL, MP, YA, SD, RD, MN, IF, DPC, S, S, DT, LR, S, DNW, LIB, X--- X> /* 000-017 */ MA, BL, MP, YA, SD, RD, MN, IF, DPC, S, S, DT, LR, S, DNW, LIB, X1293c1223 X< /* 220-237 */ MA, I, I, I, I, I, I, I, I, I, I, CTRL, I, I, I, I, X--- X> /* 220-237 */ MA, I, I, I, I, I, I, I, I, I, I, CTL, I, I, I, I, X1330,1334c1260,1264 X< char *enter_string = "\033 8\033~0"; /* String printed on entering mined */ X< char *pos_string = "\033"; /* Absolute cursor position */ X< char *rev_scroll = "\033~1"; /* String for reverse scrolling */ X< char *rev_video = "\033z\160"; /* String for starting reverse video */ X< char *normal_video = "\033z\007"; /* String for leaving reverse video */ X--- X> char *enter_string = "\033[H\033[J"; /* String printed on entering mined */ X> char *pos_string = "\033[%d;%dH"; /* Absolute cursor position */ X> char *rev_scroll = "\033M"; /* String for reverse scrolling */ X> char *rev_video = "\033[7m"; /* String for starting reverse video */ X> char *normal_video = "\033[m"; /* String for leaving reverse video */ X1543d1472 X< init_alloc(); X1594c1523 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X1619c1548 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X1625a1555,1594 X> (*escfunc(c))() X> { X> if (c == '[') { X> /* Start of ASCII escape sequence. */ X> switch (getchar()) { X> case 'H': return(HO); X> case 'A': return(UP); X> case 'B': return(DN); X> case 'C': return(RT); X> case 'D': return(LF); X> #ifdef i8088 X> case 'G': return(FS); X> case 'S': return(SR); X> case 'T': return(SF); X> case 'U': return(PD); X> case 'V': return(PU); X> case 'Y': return(EF); X> #endif X> } X> return(I); X> } X> #ifdef ATARI_ST X> if (c == 'O') { X> /* Start of ASCII function key escape sequence. */ X> switch (getchar()) { X> case 'P': return(SF); X> case 'Q': return(SR); X> case 'R': return(PD); X> case 'S': return(PU); X> case 'T': return(FS); X> case 'U': return(EF); X> case 'V': return(MA); X> case 'W': return(CTL); X> } X> return(I); X> } X> #endif X> return(I); X> } X> X1627c1596 X< * ESC() prompts for a count and wants a command after that. It repeats the X--- X> * ESC() wants a count and a command after that. It repeats the X1633c1602 X< register int count; X--- X> register int count = 0; X1635c1604 X< int index, number; X--- X> int index; X1638,1639c1607,1620 X< if ((index = get_number("Please enter repeat count.", &number)) == ERRORS) X< return; X--- X> index = getchar(); X> while (index >= '0' && index <= '9' && quit == FALSE) { X> count *= 10; X> count += index - '0'; X> index = getchar(); X> } X> if (count == 0) { X> count = 1; X> func = escfunc(index); X> } else { X> func = key_map[index]; X> if (func == ESC) X> func = escfunc(getchar()); X> } X1641c1622 X< if ((func = key_map[index]) == I) { /* Function assigned? */ X--- X> if (func == I) { /* Function assigned? */ X1646,1647d1626 X< count = number; X< X1657,1658d1635 X< else X< clear_status(); X1753c1730 X< int *argptr = &args; X--- X> char *argptr = (char *) &args; X1761c1738,1739 X< scanp = (char *) *argptr; X--- X> scanp = (char *) *((char **)argptr); X> argptr += sizeof(char *); X1764c1742,1743 X< scanp = num_out((long) *argptr); X--- X> scanp = num_out((long) *((int *)argptr)); X> argptr += sizeof(int); X1767,1773c1746,1748 X< scanp = num_out((long) *((long *) X< #ifdef UNIX X< argptr)); X< #else X< argptr++)); X< #endif UNIX X< break; X--- X> scanp = num_out((long) *((long *) argptr)); X> argptr += sizeof(long); X> break; X1780d1754 X< argptr++; X1976a1951,1952 X> ymax = tgetnum("li") - 1; X> screenmax = ymax - 1; + END-OF-FILE mined1.c.diff chmod 'u=rw,g=rw,o=rw' 'mined1.c.diff' set `wc -c 'mined1.c.diff'` count=$1 case $count in 7926) :;; *) echo 'Bad character count in ''mined1.c.diff' >&2 echo 'Count should be 7926' >&2 esac echo Extracting 'mined2.c.diff' sed 's/^X//' > 'mined2.c.diff' << '+ END-OF-FILE ''mined2.c.diff' X132c132 X< for (i = 0; i < SCREENMAX; i++) X--- X> for (i = 0; i < screenmax; i++) X136c136 X< move_to(0, SCREENMAX >> 1); X--- X> move_to(0, screenmax >> 1); X152c152 X< for (i = 0; i < SCREENMAX; i++) X--- X> for (i = 0; i < screenmax; i++) X155c155 X< set_cursor(0, YMAX); /* Erase very bottom line */ X--- X> set_cursor(0, ymax); /* Erase very bottom line */ X161,162c161,162 X< if (y + i > SCREENMAX) /* line no longer on screen */ X< move_to(0, SCREENMAX >> 1); X--- X> if (y + i > screenmax) /* line no longer on screen */ X> move_to(0, screenmax >> 1); X172c172 X< if (proceed(top_line, -SCREENMAX) == header) X--- X> if (proceed(top_line, -screenmax) == header) X188c188 X< if (proceed(bot_line, SCREENMAX) == tail) X--- X> if (proceed(bot_line, screenmax) == tail) X191c191 X< reset(proceed(tail->prev, -SCREENMAX), SCREENMAX); X--- X> reset(proceed(tail->prev, -screenmax), screenmax); X206c206 X< set_cursor(0, YMAX); /* Erase very bottom line */ X--- X> set_cursor(0, ymax); /* Erase very bottom line */ X212c212 X< move_to(x, (y == SCREENMAX) ? SCREENMAX : y + 1); X--- X> move_to(x, (y == screenmax) ? screenmax : y + 1); X237c237 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X252c252 X< if (last_y != SCREENMAX) /* Reset last_y if necessary */ X--- X> if (last_y != screenmax) /* Reset last_y if necessary */ X447c447 X< if (y == SCREENMAX) { /* Can't use display */ X--- X> if (y == screenmax) { /* Can't use display */ X455c455 X< move_to(0, (y == SCREENMAX) ? y : y + 1); X--- X> move_to(0, (y == screenmax) ? y : y + 1); X466c466 X< * CTRL inserts a control-char at the current location. A message that this X--- X> * CTL inserts a control-char at the current location. A message that this X469c469 X< CTRL() X--- X> CTL() X593c593 X< LINE *line; X--- X> LINE *line, *stop; X618c618,619 X< while (line != end_line->next && line != tail) { X--- X> stop = end_line->next; X> while (line != stop && line != tail) { X755c756 X< display(0, y, cur_line, SCREENMAX - y); X--- X> display(0, y, cur_line, screenmax - y); X1145c1146 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X1161c1162 X< if (page <= SCREENMAX) { X--- X> if (page <= screenmax) { X1166c1167 X< if (page <= SCREENMAX) X--- X> if (page <= screenmax) X1261c1262 X< set_cursor(0, YMAX); X--- X> set_cursor(0, ymax); X1295c1296 X< if ((line = proceed(match_line, -(SCREENMAX >> 1))) == header) { X--- X> if ((line = proceed(match_line, -(screenmax >> 1))) == header) { X1303c1304 X< count = SCREENMAX >> 1; X--- X> count = screenmax >> 1; X1358a1360,1367 X> * X> * bcopy(from, to, bytes) X> * register char *from, *to; X> * register int bytes; X> * { X> * while (bytes--) X> * *to++ = *from++; X> * } X1360,1366d1368 X< bcopy(from, to, bytes) X< register char *from, *to; X< register int bytes; X< { X< while (bytes--) X< *to++ = *from++; X< } X1367a1370 X> X1732c1735 X< if (last_y != SCREENMAX) { X--- X> if (last_y != screenmax) { + END-OF-FILE mined2.c.diff chmod 'u=rw,g=rw,o=rw' 'mined2.c.diff' set `wc -c 'mined2.c.diff'` count=$1 case $count in 2955) :;; *) echo 'Bad character count in ''mined2.c.diff' >&2 echo 'Count should be 2955' >&2 esac exit 0
Dickson@his-phoenix-multics.arpa (Paul Dickson) (06/20/88)
In the LISTING file, a makefile.new is listed, but the file isn't included in the shipment. -Paul Dickson Dickson%pco @ BCO-Multics.ARPA
ast@cs.vu.nl (Andy Tanenbaum) (06/23/88)
In article <3056@louie.udel.EDU> Dickson@his-phoenix-multics.arpa (Paul Dickson) writes: >In the LISTING file, a makefile.new is listed, but the file isn't included. My fault. There is no such makefile. My disk is full of irrelevant things and sometimes I forget to edit all of them out of the listing. Andy Tanenbaum (ast@cs.vu.nl) -- Andy Tanenbaum (ast@cs.vu.nl)