home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume23 / abc / part24 < prev    next >
Encoding:
Internet Message Format  |  1991-01-08  |  54.1 KB

  1. Subject:  v23i103:  ABC interactive programming environment, Part24/25
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: ce62bbeb 78159c2f d7f7a852 2f417837
  5.  
  6. Submitted-by: Steven Pemberton <steven@cwi.nl>
  7. Posting-number: Volume 23, Issue 103
  8. Archive-name: abc/part24
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # Contents:  abc/b/DEP abc/bed/e1code.c abc/bed/e1lexi.c
  17. #   abc/bhdrs/bedi.h abc/bhdrs/bfil.h abc/bint2/i2tar.c
  18. #   abc/bio/i4bio.c abc/bio/i4bio.h abc/bio/i4out.c abc/boot/lang.h
  19. #   abc/btr/e1etex.c abc/ch_all abc/ch_install abc/ch_messages
  20. #   abc/doc/BugReport abc/doc/Structure abc/ehdrs/cell.h
  21. #   abc/ehdrs/erro.h abc/ehdrs/trm.h abc/ex/README abc/ex/TryEditor
  22. #   abc/ex/generate.out abc/ihdrs/i2exp.h abc/ihdrs/i3env.h
  23. #   abc/ihdrs/i3int.h abc/scripts/Change abc/scripts/Collect
  24. #   abc/stc/DEP abc/tc/Makefile abc/tc/tc2.c abc/uhdrs/conf.h
  25. #   abc/uhdrs/dir.h abc/ukeys/abckeys_2621 abc/ukeys/abckeys_5620
  26. #   abc/ukeys/abckeys_5620-2 abc/ukeys/abckeys_5620-e
  27. #   abc/ukeys/abckeys_adm31 abc/unix/u1edit.c abc/unix/u1os.c
  28. # Wrapped by rsalz@litchi.bbn.com on Mon Dec 17 13:28:28 1990
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. echo If this archive is complete, you will see the following message:
  31. echo '          "shar: End of archive 24 (of 25)."'
  32. if test -f 'abc/b/DEP' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'abc/b/DEP'\"
  34. else
  35.   echo shar: Extracting \"'abc/b/DEP'\" \(1069 characters\)
  36.   sed "s/^X//" >'abc/b/DEP' <<'END_OF_FILE'
  37. Xb1file.o: b1file.c
  38. Xb1file.o: ../bhdrs/b.h
  39. Xb1file.o: ../uhdrs/osconf.h
  40. Xb1file.o: ../uhdrs/os.h
  41. Xb1file.o: ../uhdrs/conf.h
  42. Xb1file.o: ../uhdrs/config.h
  43. Xb1file.o: ../bhdrs/bfil.h
  44. Xb1file.o: ../bhdrs/bmem.h
  45. Xb1grab.o: b1grab.c
  46. Xb1grab.o: ../bhdrs/b.h
  47. Xb1grab.o: ../uhdrs/osconf.h
  48. Xb1grab.o: ../uhdrs/os.h
  49. Xb1grab.o: ../uhdrs/conf.h
  50. Xb1grab.o: ../uhdrs/config.h
  51. Xb1grab.o: ../bhdrs/bint.h
  52. Xb1grab.o: ../bhdrs/bedi.h
  53. Xb1grab.o: ../bhdrs/bmem.h
  54. Xb1grab.o: ../bhdrs/bobj.h
  55. Xb1memo.o: b1memo.c
  56. Xb1memo.o: ../bhdrs/b.h
  57. Xb1memo.o: ../uhdrs/osconf.h
  58. Xb1memo.o: ../uhdrs/os.h
  59. Xb1memo.o: ../uhdrs/conf.h
  60. Xb1memo.o: ../uhdrs/config.h
  61. Xb1memo.o: ../bhdrs/bmem.h
  62. Xb1mess.o: b1mess.c
  63. Xb1mess.o: ../bhdrs/b.h
  64. Xb1mess.o: ../uhdrs/osconf.h
  65. Xb1mess.o: ../uhdrs/os.h
  66. Xb1mess.o: ../uhdrs/conf.h
  67. Xb1mess.o: ../uhdrs/config.h
  68. Xb1mess.o: ../bhdrs/bfil.h
  69. Xb1mess.o: ../bhdrs/bmem.h
  70. Xb1mess.o: ../bhdrs/bobj.h
  71. Xb1outp.o: b1outp.c
  72. Xb1outp.o: ../bhdrs/b.h
  73. Xb1outp.o: ../uhdrs/osconf.h
  74. Xb1outp.o: ../uhdrs/os.h
  75. Xb1outp.o: ../uhdrs/conf.h
  76. Xb1outp.o: ../uhdrs/config.h
  77. Xb1outp.o: ../bhdrs/bmem.h
  78. Xgetopt.o: getopt.c
  79. Xgetopt.o: ../uhdrs/os.h
  80. END_OF_FILE
  81.   if test 1069 -ne `wc -c <'abc/b/DEP'`; then
  82.     echo shar: \"'abc/b/DEP'\" unpacked with wrong size!
  83.   fi
  84.   # end of 'abc/b/DEP'
  85. fi
  86. if test -f 'abc/bed/e1code.c' -a "${1}" != "-c" ; then 
  87.   echo shar: Will not clobber existing file \"'abc/bed/e1code.c'\"
  88. else
  89.   echo shar: Extracting \"'abc/bed/e1code.c'\" \(833 characters\)
  90.   sed "s/^X//" >'abc/bed/e1code.c' <<'END_OF_FILE'
  91. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  92. X
  93. X/*
  94. X * Compaction scheme for characters to save space in grammar tables
  95. X * by combining characters with similar properties (digits, l.c. letters).
  96. X */
  97. X
  98. X#include "b.h"
  99. X#include "code.h"
  100. X
  101. XVisible char code_array[RANGE];
  102. XVisible char invcode_array[RANGE];
  103. XVisible int lastcode= 0;
  104. X
  105. XVisible Procedure initcodes() {
  106. X    int c;
  107. X
  108. X    code_array['\n'] = ++lastcode;
  109. X    invcode_array[lastcode] = '\n';
  110. X    for (c = ' '; c <= '0'; ++c) {
  111. X        code_array[c] = ++lastcode;
  112. X        invcode_array[lastcode] = c;
  113. X    }
  114. X    for (; c <= '9'; ++c)
  115. X        code_array[c] = lastcode;
  116. X    for (; c <= 'a'; ++c) {
  117. X        code_array[c] = ++lastcode;
  118. X        invcode_array[lastcode] = c;
  119. X    }
  120. X    for (; c <= 'z'; ++c)
  121. X        code_array[c] = lastcode;
  122. X    for (; c < RANGE; ++c) {
  123. X        code_array[c] = ++lastcode;
  124. X        invcode_array[lastcode] = c;
  125. X    }
  126. X}
  127. END_OF_FILE
  128.   if test 833 -ne `wc -c <'abc/bed/e1code.c'`; then
  129.     echo shar: \"'abc/bed/e1code.c'\" unpacked with wrong size!
  130.   fi
  131.   # end of 'abc/bed/e1code.c'
  132. fi
  133. if test -f 'abc/bed/e1lexi.c' -a "${1}" != "-c" ; then 
  134.   echo shar: Will not clobber existing file \"'abc/bed/e1lexi.c'\"
  135. else
  136.   echo shar: Extracting \"'abc/bed/e1lexi.c'\" \(1145 characters\)
  137.   sed "s/^X//" >'abc/bed/e1lexi.c' <<'END_OF_FILE'
  138. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  139. X
  140. X/*
  141. X * B editor -- Lexical elements (identifiers, keywords, numbers etc.)
  142. X */
  143. X
  144. X#include "b.h"
  145. X#include "bedi.h"
  146. X#include "bobj.h"
  147. X#include "node.h"
  148. X#include "tabl.h"
  149. X
  150. X/*
  151. X * Table defining lexical elements is generated by 'mktable' in e1tabl.c.
  152. X *
  153. X * ********** Indexed by (symbol-LEXICAL).
  154. X */
  155. X
  156. X
  157. X/*
  158. X * Test whether character `c' may start a lexical element with
  159. X * symbolic name `lex'.
  160. X */
  161. X
  162. XVisible bool maystart(c, ilex) char c; int ilex; {
  163. X    string cp;
  164. X
  165. X    ilex-= LEXICAL;
  166. X    Assert(0 <= ilex && ilex < NLEX);
  167. X    if (!isascii(c) || c != ' ' && !isprint(c))
  168. X        return No;
  169. X    cp= lextab[ilex].l_start;
  170. X    if (*cp == '^')
  171. X        return (strchr(cp+1, c) == NULL);
  172. X    return (strchr(cp, c) != NULL);
  173. X}
  174. X
  175. X
  176. X/*
  177. X * Test whether character `c' may continue a lexical element with
  178. X * symbolic name `ilex'.
  179. X */
  180. X
  181. XVisible bool maycontinue(c, ilex) char c; int ilex; {
  182. X    string cp;
  183. X
  184. X    ilex-= LEXICAL;
  185. X    Assert(0 <= ilex && ilex < NLEX);
  186. X    if (!isascii(c) || c != ' ' && !isprint(c))
  187. X        return No;
  188. X    cp= lextab[ilex].l_continue;
  189. X    if (*cp == '^')
  190. X        return (strchr(cp+1, c) == NULL);
  191. X    return (strchr(cp, c) != NULL);
  192. X}
  193. END_OF_FILE
  194.   if test 1145 -ne `wc -c <'abc/bed/e1lexi.c'`; then
  195.     echo shar: \"'abc/bed/e1lexi.c'\" unpacked with wrong size!
  196.   fi
  197.   # end of 'abc/bed/e1lexi.c'
  198. fi
  199. if test -f 'abc/bhdrs/bedi.h' -a "${1}" != "-c" ; then 
  200.   echo shar: Will not clobber existing file \"'abc/bhdrs/bedi.h'\"
  201. else
  202.   echo shar: Extracting \"'abc/bhdrs/bedi.h'\" \(1100 characters\)
  203.   sed "s/^X//" >'abc/bhdrs/bedi.h' <<'END_OF_FILE'
  204. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  205. X
  206. X#define CMDPROMPT ">>> " /* Prompt user for immediate command */
  207. X
  208. X/* Types */
  209. X
  210. X#define Nod 'N'
  211. X#define Pat 'P'
  212. X#define Etex 'E'
  213. X    /* text values in the kernel of the editor are stored
  214. X     * according to the lineair model.
  215. X     */
  216. X
  217. X#define Is_Node(n) (Type(n) == Nod)
  218. X#define Is_Pat(p) (Type(p) == Pat)
  219. X#define Is_etext(v) (Type(v) == Etex)
  220. X
  221. Xtypedef struct node *node;
  222. Xtypedef struct path *path;
  223. Xtypedef int markbits;
  224. X
  225. Xstruct node {
  226. X    HEADER;
  227. X    markbits    n_marks;
  228. X    intlet    n_width;
  229. X    intlet    n_symbol;
  230. X    node    n_child[1];
  231. X};
  232. X
  233. X#define Nnil ((node) Vnil)
  234. X
  235. X#define NodOffset (sizeof(int) + 2*sizeof(intlet))
  236. X
  237. Xstruct path {
  238. X    HEADER;
  239. X    path    p_parent;
  240. X    node    p_tree;
  241. X    intlet    p_ichild;
  242. X    intlet    p_ycoord;
  243. X    intlet    p_xcoord;
  244. X    intlet    p_level;
  245. X    markbits    p_addmarks;
  246. X    markbits    p_delmarks;
  247. X};
  248. X
  249. X#define NilPath ((path) Vnil)
  250. X
  251. X
  252. Xextern int doctype;    /* type of document edited by editdocument() */
  253. X#define D_perm 0    /* a how-to definition or permanent location */
  254. X#define D_input 1    /* input for READ or question */
  255. X#define D_immcmd 2    /* editing immediate command */
  256. END_OF_FILE
  257.   if test 1100 -ne `wc -c <'abc/bhdrs/bedi.h'`; then
  258.     echo shar: \"'abc/bhdrs/bedi.h'\" unpacked with wrong size!
  259.   fi
  260.   # end of 'abc/bhdrs/bedi.h'
  261. fi
  262. if test -f 'abc/bhdrs/bfil.h' -a "${1}" != "-c" ; then 
  263.   echo shar: Will not clobber existing file \"'abc/bhdrs/bfil.h'\"
  264. else
  265.   echo shar: Extracting \"'abc/bhdrs/bfil.h'\" \(1010 characters\)
  266.   sed "s/^X//" >'abc/bhdrs/bfil.h' <<'END_OF_FILE'
  267. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  268. X
  269. X/* MESSFILE and HELPFILE in ../?hdrs/dest.h. */
  270. X
  271. X#define KEYSFILE    "abc.key"
  272. X
  273. X#define PERMFILE    "perm.abc"
  274. X#define SUGGFILE    "suggest.abc"
  275. X#define POSFILE        "position.abc"
  276. X#define TYPESFILE    "types.abc"
  277. X
  278. X#define BUFFILE        "copybuf.abc"
  279. X
  280. X#define WSGROUPFILE    "wsgroup.abc"
  281. X#define CURWSFILE    "curws.abc"
  282. X
  283. X#define TEMPFILE    "temp.abc"
  284. X#define TEMP1FILE    "temp1.abc"
  285. X
  286. X#ifndef BWSNAME
  287. X#define BWSNAME        "abc"
  288. X#endif
  289. X
  290. Xextern string messfile;
  291. Xextern string keysfile;
  292. Xextern string helpfile;
  293. X
  294. Xextern string permfile;
  295. Xextern string suggfile;
  296. Xextern string posfile;
  297. Xextern string typesfile;
  298. Xextern string buffile;
  299. X
  300. Xextern string wsgroupfile;
  301. Xextern string curwsfile;
  302. X
  303. Xextern string tempfile;
  304. Xextern string temp1file;
  305. X
  306. Xextern string editor;
  307. X
  308. Xextern char *makepath();
  309. Xextern char *savepath();
  310. X/* extern Procedure freepath(); */
  311. X
  312. Xextern char *startdir;
  313. Xextern char *bwsdefault;
  314. Xextern char *curdir();
  315. X
  316. Xchar *f_getline();        /* return line from file including \n */
  317. END_OF_FILE
  318.   if test 1010 -ne `wc -c <'abc/bhdrs/bfil.h'`; then
  319.     echo shar: \"'abc/bhdrs/bfil.h'\" unpacked with wrong size!
  320.   fi
  321.   # end of 'abc/bhdrs/bfil.h'
  322. fi
  323. if test -f 'abc/bint2/i2tar.c' -a "${1}" != "-c" ; then 
  324.   echo shar: Will not clobber existing file \"'abc/bint2/i2tar.c'\"
  325. else
  326.   echo shar: Extracting \"'abc/bint2/i2tar.c'\" \(701 characters\)
  327.   sed "s/^X//" >'abc/bint2/i2tar.c' <<'END_OF_FILE'
  328. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  329. X
  330. X#include "b.h"
  331. X#include "bint.h"
  332. X#include "bobj.h"
  333. X#include "i2par.h"
  334. X#include "i2nod.h"
  335. X
  336. XForward parsetree singtarg();
  337. X
  338. XVisible parsetree targ(q) txptr q; {
  339. X    return collateral(q, singtarg);
  340. X}
  341. X
  342. XHidden parsetree singtarg(q) txptr q; {
  343. X    parsetree v; value t;
  344. X    skipsp(&tx);
  345. X    if (nothing(q, MESS(2500, "nothing where address expected"))) 
  346. X        return NilTree;
  347. X    if (open_sign) v= compound(q, targ);
  348. X    else if (is_tag(&t)) v= node2(TAG, t);
  349. X    else {
  350. X        parerr(MESS(2501, "no address where expected"));
  351. X        tx= q;
  352. X        return NilTree;
  353. X    }
  354. X    selection(q, &v);
  355. X    trim_target(q, &v);
  356. X    upto1(q, MESS(2502, "something unexpected in address"));
  357. X    return v;
  358. X}
  359. END_OF_FILE
  360.   if test 701 -ne `wc -c <'abc/bint2/i2tar.c'`; then
  361.     echo shar: \"'abc/bint2/i2tar.c'\" unpacked with wrong size!
  362.   fi
  363.   # end of 'abc/bint2/i2tar.c'
  364. fi
  365. if test -f 'abc/bio/i4bio.c' -a "${1}" != "-c" ; then 
  366.   echo shar: Will not clobber existing file \"'abc/bio/i4bio.c'\"
  367. else
  368.   echo shar: Extracting \"'abc/bio/i4bio.c'\" \(745 characters\)
  369.   sed "s/^X//" >'abc/bio/i4bio.c' <<'END_OF_FILE'
  370. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  371. X
  372. X#include "b.h"
  373. X#include "bint.h"
  374. X#include "bmem.h"
  375. X#include "bobj.h"
  376. X#include "i2par.h"
  377. X#include "i3scr.h"
  378. X#include "i3sou.h"
  379. X#include "i4bio.h"
  380. X
  381. XVisible Procedure abcio(option, name_arg) char option, *name_arg; {
  382. X    sv_ifile= ifile= stdin;
  383. X    
  384. X    switch (option) {
  385. X        case 'i':
  386. X            abcinput(name_arg);
  387. X            break;
  388. X        case 'o':
  389. X            abcoutput(name_arg);
  390. X            break;
  391. X        case 'l':
  392. X            abclist(stdout);
  393. X            break;
  394. X        case 'r':
  395. X            if (!ws_recovered)
  396. X                rec_workspace();
  397. X            break;
  398. X        case 'R':
  399. X            if (!gr_recovered)
  400. X                rec_wsgroup();
  401. X            break;
  402. X    }
  403. X}
  404. X
  405. XVisible Procedure bioerr(m) int m; {
  406. X    putmess(errfile, m);
  407. X}
  408. X
  409. XVisible Procedure bioerrV(m, v) int m; value v; {
  410. X    putSmess(errfile, m, strval(v));
  411. X}
  412. END_OF_FILE
  413.   if test 745 -ne `wc -c <'abc/bio/i4bio.c'`; then
  414.     echo shar: \"'abc/bio/i4bio.c'\" unpacked with wrong size!
  415.   fi
  416.   # end of 'abc/bio/i4bio.c'
  417. fi
  418. if test -f 'abc/bio/i4bio.h' -a "${1}" != "-c" ; then 
  419.   echo shar: Will not clobber existing file \"'abc/bio/i4bio.h'\"
  420. else
  421.   echo shar: Extracting \"'abc/bio/i4bio.h'\" \(1189 characters\)
  422.   sed "s/^X//" >'abc/bio/i4bio.h' <<'END_OF_FILE'
  423. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  424. X
  425. Xvalue get_names();
  426. Xbool abcfile();
  427. Xbool abcworkspace();
  428. Xbool unitfile();
  429. Xbool targetfile();
  430. Xchar *base_fname();
  431. Xbool typeclash();
  432. X
  433. Xextern bool ws_recovered;
  434. Xextern bool gr_recovered;
  435. X
  436. X#define IO_NAME        MESS(4600, "*** %s isn't the name of a location\n")
  437. X#define O_INIT        MESS(4601, "*** %s hasn't been initialised\n")
  438. X#define O_TABLE        MESS(4602, "*** %s isn't a table\n")
  439. X#define R_ERROR        MESS(4603, "*** Errors while recovering workspace:\n")
  440. X#define R_TNAME        MESS(4604, "*** %s: cannot derive a location name\n")
  441. X#define R_FREAD        MESS(4605, "*** %s: cannot read this file\n")
  442. X#define R_UNAME        MESS(4606, "*** %s: cannot derive a how-to name\n")
  443. X#define R_RENAME    MESS(4607, "*** %s: cannot rename this file\n")
  444. X#define R_EXIST        MESS(4608, "*** %s: the ABC name for this file is already in use\n")
  445. X#define R_FWRITE    MESS(4609, "*** %s: cannot create this file\n")
  446. X#define G_ERROR        MESS(4610, "*** Errors while recovering the workspace index\n")
  447. X#define G_DNAME        MESS(4611, "*** %s: cannot derive an ABC name for this workspace\n")
  448. X#define G_EXIST        MESS(4612, "*** %s: the ABC name for this workspace is already in use\n")
  449. END_OF_FILE
  450.   if test 1189 -ne `wc -c <'abc/bio/i4bio.h'`; then
  451.     echo shar: \"'abc/bio/i4bio.h'\" unpacked with wrong size!
  452.   fi
  453.   # end of 'abc/bio/i4bio.h'
  454. fi
  455. if test -f 'abc/bio/i4out.c' -a "${1}" != "-c" ; then 
  456.   echo shar: Will not clobber existing file \"'abc/bio/i4out.c'\"
  457. else
  458.   echo shar: Extracting \"'abc/bio/i4out.c'\" \(953 characters\)
  459.   sed "s/^X//" >'abc/bio/i4out.c' <<'END_OF_FILE'
  460. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  461. X
  462. X#include "b.h"
  463. X#include "bint.h"
  464. X#include "bmem.h"
  465. X#include "bobj.h"
  466. X#include "i3env.h"
  467. X#include "i3scr.h"
  468. X#include "i3sou.h"
  469. X#include "i4bio.h"
  470. X
  471. X/* write_table_of_texts */
  472. X
  473. XVisible Procedure abcoutput(name_arg) char *name_arg; {
  474. X    value name, pname;
  475. X    value *aa;
  476. X    value v;
  477. X    intlet k, len;
  478. X    
  479. X    name= mk_text(name_arg);
  480. X    if (!is_abcname(name)) {
  481. X        bioerrV(IO_NAME, name);
  482. X        release(name);
  483. X        return;
  484. X    }
  485. X    pname= permkey(name, Tar);
  486. X    if (!p_exists(pname, &aa)) {
  487. X        bioerrV(O_INIT, name);
  488. X        release(name);
  489. X        release(pname);
  490. X        return;
  491. X    }
  492. X    release(pname);
  493. X    v= getval(*aa, In_tarval);
  494. X    if (!still_ok) {
  495. X        release(name);
  496. X        release(v);
  497. X        return;
  498. X    }
  499. X    if (!Is_table(v)) {
  500. X        bioerrV(O_TABLE, name);
  501. X        release(name);
  502. X        release(v);
  503. X        return;
  504. X    }
  505. X    at_nwl= Yes;
  506. X    len= length(v);
  507. X    for (k= 0; k<len && !Interrupted(); ++k) {
  508. X        wri(*assoc(v, k), No, Yes, No);
  509. X        newline();
  510. X    }
  511. X    release(name);
  512. X    release(v);
  513. X}
  514. END_OF_FILE
  515.   if test 953 -ne `wc -c <'abc/bio/i4out.c'`; then
  516.     echo shar: \"'abc/bio/i4out.c'\" unpacked with wrong size!
  517.   fi
  518.   # end of 'abc/bio/i4out.c'
  519. fi
  520. if test -f 'abc/boot/lang.h' -a "${1}" != "-c" ; then 
  521.   echo shar: Will not clobber existing file \"'abc/boot/lang.h'\"
  522. else
  523.   echo shar: Extracting \"'abc/boot/lang.h'\" \(1192 characters\)
  524.   sed "s/^X//" >'abc/boot/lang.h' <<'END_OF_FILE'
  525. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1987. */
  526. X
  527. X/* If you change this file, don't forget ../bhdrs/b0lan.h and bint2/i2dis.c */
  528. X
  529. X#define R_HOW_TO    "HOW TO "
  530. X#define R_PASS        "PASS"
  531. X#define R_PUT        "PUT "
  532. X#define R_IN_put    " IN "
  533. X#define R_INSERT    "INSERT "
  534. X#define R_IN_insert    " IN "
  535. X#define R_REMOVE    "REMOVE "
  536. X#define R_FROM_remove    " FROM "
  537. X#define R_SET_RANDOM    "SET RANDOM "
  538. X#define R_DELETE    "DELETE "
  539. X#define R_CHECK     "CHECK "
  540. X#define R_SHARE     "SHARE "
  541. X#define R_WRITE     "WRITE "
  542. X#define R_READ        "READ "
  543. X#define R_EG        " EG "
  544. X#define R_RAW        " RAW"
  545. X#define R_IF        "IF "
  546. X#define R_WHILE     "WHILE "
  547. X#define R_FOR        "FOR "
  548. X#define R_IN_for    " IN "
  549. X#define R_SELECT    "SELECT: "
  550. X#define R_ELSE        "ELSE"
  551. X#define R_QUIT        "QUIT"
  552. X#define R_RETURN    "RETURN "
  553. X#define R_REPORT    "REPORT "
  554. X#define R_SUCCEED    "SUCCEED"
  555. X#define R_FAIL        "FAIL"
  556. X#define R_AND        "AND "
  557. X#define R_OR        "OR "
  558. X#define R_NOT        "NOT "
  559. X#define R_SOME        "SOME "
  560. X#define R_EACH        "EACH "
  561. X#define R_NO        "NO "
  562. X#define R_IN_quant    " IN "
  563. X#define R_PARSING    " PARSING "
  564. X#define R_HAS        " HAS "
  565. X
  566. X#ifdef GFX
  567. X#define R_SPACE     "SPACE "
  568. X#define R_TO_space    " TO "
  569. X#define R_LINE        "LINE "
  570. X#define R_TO_line    " TO "
  571. X#define R_CLEAR     "CLEAR"
  572. X#endif
  573. END_OF_FILE
  574.   if test 1192 -ne `wc -c <'abc/boot/lang.h'`; then
  575.     echo shar: \"'abc/boot/lang.h'\" unpacked with wrong size!
  576.   fi
  577.   # end of 'abc/boot/lang.h'
  578. fi
  579. if test -f 'abc/btr/e1etex.c' -a "${1}" != "-c" ; then 
  580.   echo shar: Will not clobber existing file \"'abc/btr/e1etex.c'\"
  581. else
  582.   echo shar: Extracting \"'abc/btr/e1etex.c'\" \(1152 characters\)
  583.   sed "s/^X//" >'abc/btr/e1etex.c' <<'END_OF_FILE'
  584. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  585. X
  586. X#include "b.h"
  587. X#include "bedi.h"
  588. X#include "bobj.h"
  589. X#include "etex.h"
  590. X#include "bmem.h"
  591. X
  592. XVisible int e_length(v) value v; {
  593. X    return Length(v);
  594. X}
  595. X
  596. XVisible value mk_etext(m) string m; {
  597. X    value v; intlet len= strlen(m);
  598. X    v= grab(Etex, len);
  599. X    strcpy(Str(v), m);
  600. X    return v;
  601. X}
  602. X
  603. XVisible char e_ncharval(n, v) int n; value v; {
  604. X    return *(Str(v)+n-1);
  605. X}
  606. X
  607. XVisible string e_strval(v) value v; {
  608. X    return Str(v);
  609. X}
  610. X
  611. X
  612. XVisible string e_sstrval(v) value v; {
  613. X    return (string) savestr(Str(v));
  614. X}
  615. X
  616. XVisible Procedure e_fstrval(s) string s; {
  617. X    freestr(s);
  618. X}
  619. X
  620. X
  621. XVisible value e_icurtail(v, k) value v; int k; {
  622. X    value w= grab(Etex, k);
  623. X    strncpy(Str(w), Str(v), k);
  624. X    *(Str(w) + k)= '\0';
  625. X    return w;
  626. X}
  627. X
  628. X
  629. XVisible value e_ibehead(v, k) value v; int k; {
  630. X    value w= grab(Etex, Length(v) - (k - 1));
  631. X    strcpy(Str(w), Str(v) + k - 1);
  632. X    return w;
  633. X}
  634. X
  635. X
  636. X
  637. XVisible value e_concat(s, t) value s, t; {
  638. X    value v= grab(Etex, Length(s) + Length(t));
  639. X    strcpy(Str(v), Str(s));
  640. X    strcpy(Str(v) + Length(s), Str(t));
  641. X    return v;
  642. X}
  643. X
  644. XVisible Procedure e_concto(s, t) value *s, t; {
  645. X    value v= *s;
  646. X    *s= e_concat(*s, t);
  647. X    release(v);
  648. X}
  649. END_OF_FILE
  650.   if test 1152 -ne `wc -c <'abc/btr/e1etex.c'`; then
  651.     echo shar: \"'abc/btr/e1etex.c'\" unpacked with wrong size!
  652.   fi
  653.   # end of 'abc/btr/e1etex.c'
  654. fi
  655. if test -f 'abc/ch_all' -a "${1}" != "-c" ; then 
  656.   echo shar: Will not clobber existing file \"'abc/ch_all'\"
  657. else
  658.   echo shar: Extracting \"'abc/ch_all'\" \(753 characters\)
  659.   sed "s/^X//" >'abc/ch_all' <<'END_OF_FILE'
  660. X: 'Check if make all went allright.'
  661. X
  662. Xmsg="$1"
  663. Xhlp="$2"
  664. Xdestroot="$3"
  665. X
  666. Xerrors="no"
  667. X
  668. Xecho " "
  669. X
  670. Xfor f in abc abckeys
  671. Xdo
  672. X    if test ! -s $f
  673. X    then
  674. X        echo "*** Failed to make $f"
  675. X        errors="yes"
  676. X    fi
  677. Xdone
  678. X
  679. Xcase $msg in
  680. Xabc.mse)
  681. X    if test ! -s abc.mse
  682. X    then
  683. X        echo "*** Failed to make messages file abc.mse"
  684. X        errors="yes"
  685. X    fi;;
  686. Xesac
  687. X
  688. Xcase $hlp in
  689. Xabc.hlp)
  690. X    if test ! -s abc.hlp
  691. X    then
  692. X        echo "*** Failed to make help file abc.hlp"
  693. X        errors="yes"
  694. X    fi;;
  695. Xesac
  696. X
  697. Xcase $errors in
  698. Xyes)
  699. X    exit 1
  700. X    ;;
  701. Xno)
  702. X    case $destroot in
  703. X    '')    echo "The 'abc' command should now work."
  704. X        echo "You can test the ABC interpreter with 'make examples'."
  705. X        ;;
  706. X    *)    echo "That 'make all' went well."
  707. X        echo "Say 'make install' to install the ABC system in $destroot."
  708. X        ;;
  709. X    esac
  710. X    exit 0
  711. X    ;;
  712. Xesac
  713. END_OF_FILE
  714.   if test 753 -ne `wc -c <'abc/ch_all'`; then
  715.     echo shar: \"'abc/ch_all'\" unpacked with wrong size!
  716.   fi
  717.   chmod +x 'abc/ch_all'
  718.   # end of 'abc/ch_all'
  719. fi
  720. if test -f 'abc/ch_install' -a "${1}" != "-c" ; then 
  721.   echo shar: Will not clobber existing file \"'abc/ch_install'\"
  722. else
  723.   echo shar: Extracting \"'abc/ch_install'\" \(1009 characters\)
  724.   sed "s/^X//" >'abc/ch_install' <<'END_OF_FILE'
  725. X: 'Check if make install went allright.'
  726. X
  727. Xmsg="$1"
  728. Xhlp="$2"
  729. Xabcdir="$3"
  730. Xlibdir="$4"
  731. Xmandir="$5"
  732. Xdestroot="$6"
  733. X
  734. Xerrors="no"
  735. X
  736. Xecho " "
  737. X
  738. Xfor f in abc abckeys
  739. Xdo
  740. X    if test ! -s $destroot$abcdir/$f
  741. X    then
  742. X        echo "*** Failed to install '$f' in $destroot$abcdir"
  743. X        errors="yes"
  744. X    fi
  745. Xdone
  746. Xfor f in $msg $hlp
  747. Xdo
  748. X    if test ! -s $destroot$libdir/$f
  749. X    then
  750. X        echo "*** Failed to install '$f' in $destroot$libdir"
  751. X        errors="yes"
  752. X    fi
  753. Xdone
  754. X
  755. Xif test ! -s $destroot$mandir/abc.1
  756. Xthen
  757. X    echo "*** Failed to install 'abc.1' manual in $destroot$mandir"
  758. X    errors="yes"
  759. Xfi
  760. X
  761. Xcase $errors in
  762. Xyes)
  763. X    exit 1
  764. X    ;;
  765. Xno)
  766. X    echo "The ABC system is installed."
  767. X    case $destroot in
  768. X    '')    echo "You can clean up with 'make clean'.";;
  769. X    *)    echo "You can copy from $destroot to the target machine."
  770. X        echo "To test ABC there also copy ./ex there,"
  771. X        echo "and use ./ex/DoExamples and ./ex/TryEditor"
  772. X        echo "to test the interpreter and the editor, respectively."
  773. X        echo "If all is well, you can clean up here with 'make clean'."
  774. X        ;;
  775. X    esac
  776. X    exit 0
  777. X    ;;    
  778. Xesac
  779. END_OF_FILE
  780.   if test 1009 -ne `wc -c <'abc/ch_install'`; then
  781.     echo shar: \"'abc/ch_install'\" unpacked with wrong size!
  782.   fi
  783.   chmod +x 'abc/ch_install'
  784.   # end of 'abc/ch_install'
  785. fi
  786. if test -f 'abc/ch_messages' -a "${1}" != "-c" ; then 
  787.   echo shar: Will not clobber existing file \"'abc/ch_messages'\"
  788. else
  789.   echo shar: Extracting \"'abc/ch_messages'\" \(722 characters\)
  790.   sed "s/^X//" >'abc/ch_messages' <<'END_OF_FILE'
  791. X: Check whether makefile is properly edited
  792. X
  793. Xcase $1 in
  794. Xabc.msg)
  795. X    echo "First redefine MESSAGES=abc.mse in the Makefile." >&2
  796. X    echo "Otherwise 'make all' would still use the distributed abc.msg." >&2
  797. X    exit 1;;
  798. Xabc.mse)
  799. X    echo "Collecting error messages from source files to abc.mse." >&2
  800. X    echo "After completion use 'make all' to incorporate them into abc." >&2
  801. X    exit 0;;
  802. X*)
  803. X    if test -s "$1"
  804. X    then
  805. X        echo "Use 'make all' to incorporate your own messages file $1 into abc." >&2
  806. X    else
  807. X        echo "I see no messages file '$1' here." >&2
  808. X        echo "You must create it yourself." >&2
  809. X    fi
  810. X    echo " " >&2
  811. X    echo "Or redefine MESSAGES=abc.mse in the makefile" >&2
  812. X    echo "if you want a new messages file from the source." >&2
  813. X    exit 1;;
  814. Xesac
  815. END_OF_FILE
  816.   if test 722 -ne `wc -c <'abc/ch_messages'`; then
  817.     echo shar: \"'abc/ch_messages'\" unpacked with wrong size!
  818.   fi
  819.   chmod +x 'abc/ch_messages'
  820.   # end of 'abc/ch_messages'
  821. fi
  822. if test -f 'abc/doc/BugReport' -a "${1}" != "-c" ; then 
  823.   echo shar: Will not clobber existing file \"'abc/doc/BugReport'\"
  824. else
  825.   echo shar: Extracting \"'abc/doc/BugReport'\" \(720 characters\)
  826.   sed "s/^X//" >'abc/doc/BugReport' <<'END_OF_FILE'
  827. XBug Report
  828. X
  829. XFROM
  830. X
  831. XName:
  832. X
  833. XFirm/Institute:
  834. X
  835. XAddress:
  836. X
  837. X
  838. X
  839. XTelephone:
  840. X
  841. XInternet network address:
  842. X
  843. XMachine Type:      O Vax       O Sun         O PDP        O other: .......
  844. X
  845. XOperating System:  O 4.3 BSD   O Version 7   O System V   O other: .......
  846. X
  847. X==========================================================================
  848. XABC Release 1.02.01.
  849. X==========================================================================
  850. X
  851. XFAULTY PROGRAM:
  852. X
  853. XDESCRIPTION OF FAULT:
  854. X
  855. X
  856. X
  857. X
  858. X
  859. X
  860. X
  861. X
  862. X
  863. XREPEAT BY:
  864. X
  865. X
  866. X
  867. X
  868. X
  869. X
  870. X
  871. X
  872. X==========================================================================
  873. X
  874. XSend to
  875. X
  876. X    ABC Group
  877. X    CWI / AA
  878. X    POB 4079
  879. X    1009 AB  Amsterdam
  880. X    The Netherlands
  881. X
  882. Xor by electronic mail to
  883. X
  884. X    abc@cwi.nl
  885. X    
  886. XFor older mailers use:
  887. X    
  888. X    mcvax!abc.uucp
  889. X
  890. END_OF_FILE
  891.   if test 720 -ne `wc -c <'abc/doc/BugReport'`; then
  892.     echo shar: \"'abc/doc/BugReport'\" unpacked with wrong size!
  893.   fi
  894.   # end of 'abc/doc/BugReport'
  895. fi
  896. if test -f 'abc/doc/Structure' -a "${1}" != "-c" ; then 
  897.   echo shar: Will not clobber existing file \"'abc/doc/Structure'\"
  898. else
  899.   echo shar: Extracting \"'abc/doc/Structure'\" \(1254 characters\)
  900.   sed "s/^X//" >'abc/doc/Structure' <<'END_OF_FILE'
  901. X# Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  902. X
  903. X===========================================================================
  904. X=  The Directory Structure of Release 1.00 of the Implementation of ABC.  =
  905. X===========================================================================
  906. X
  907. X=
  908. X= editor-interpreter directories:
  909. X=
  910. X
  911. Xb    low level support (memory grabbing, option handling, etc)
  912. X
  913. Xbhdrs    interface include files for same
  914. X
  915. Xbed    editor source files
  916. X
  917. Xehdrs    editor include files
  918. X
  919. Xbint1    interpreter module for compound and number values
  920. X
  921. Xbtr    module for text, list and table values, using B trees
  922. X
  923. Xlin    module for text, list and table values, using linear structures
  924. X
  925. Xbint2    interpreter parser
  926. X
  927. Xstc    static type check
  928. X
  929. Xbint3    interpreter runtime system
  930. X
  931. Xihdrs    interpreter include files
  932. X
  933. Xbio    support for -[iolrR] options (interface with operating system)
  934. X
  935. Xuhdrs    unix specific header files
  936. X
  937. Xunix    unix specific source files
  938. X
  939. X=
  940. X= other directories:
  941. X=
  942. X
  943. Xkeys    source for utility abckeys (abc -k)
  944. X
  945. Xukeys    default keys definition files for some terminals
  946. X
  947. Xscripts    shell scripts for installation
  948. X
  949. Xboot    booting editor source files with grammar info
  950. X
  951. Xex    example B workspaces
  952. X
  953. Xdoc    documentation
  954. X
  955. Xtc    public domain sources for the termcap library needed by the editor
  956. END_OF_FILE
  957.   if test 1254 -ne `wc -c <'abc/doc/Structure'`; then
  958.     echo shar: \"'abc/doc/Structure'\" unpacked with wrong size!
  959.   fi
  960.   # end of 'abc/doc/Structure'
  961. fi
  962. if test -f 'abc/ehdrs/cell.h' -a "${1}" != "-c" ; then 
  963.   echo shar: Will not clobber existing file \"'abc/ehdrs/cell.h'\"
  964. else
  965.   echo shar: Extracting \"'abc/ehdrs/cell.h'\" \(893 characters\)
  966.   sed "s/^X//" >'abc/ehdrs/cell.h' <<'END_OF_FILE'
  967. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  968. X
  969. X/*
  970. X * B editor -- Definitions for linked lists of screen lines, baptized `cells'.
  971. X * (This is NOT an abstract data type!)
  972. X */
  973. X
  974. Xstruct cell {
  975. X    struct cell *c_link;
  976. X    node c_data;
  977. X    short c_onscreen;
  978. X    short c_oldindent;
  979. X    short c_newindent;
  980. X    short c_length;
  981. X    char c_oldvhole;
  982. X    char c_newvhole; /* Yes if this line contains a `vhole' */
  983. X    char c_oldfocus;
  984. X    char c_newfocus; /* Yes if this line contains underlining */
  985. X};
  986. X
  987. Xtypedef struct cell cell;
  988. X
  989. X#define Cnil ((cell*) NULL)
  990. X
  991. X#define Nowhere (-9999)
  992. X
  993. X#define SpaceRound(x) ((indent + (x) + llength - 1) / llength)
  994. X#define Space(p) \
  995. X    SpaceRound((p)->c_length + (p)->c_newindent + (p)->c_newvhole)
  996. X#define Oldspace(p) \
  997. X    SpaceRound((p)->c_length + (p)->c_oldindent + (p)->c_oldvhole)
  998. X
  999. Xcell *replist();
  1000. Xcell *build();
  1001. X
  1002. Xextern int llength;
  1003. Xextern int winheight;
  1004. Xextern int indent;
  1005. END_OF_FILE
  1006.   if test 893 -ne `wc -c <'abc/ehdrs/cell.h'`; then
  1007.     echo shar: \"'abc/ehdrs/cell.h'\" unpacked with wrong size!
  1008.   fi
  1009.   # end of 'abc/ehdrs/cell.h'
  1010. fi
  1011. if test -f 'abc/ehdrs/erro.h' -a "${1}" != "-c" ; then 
  1012.   echo shar: Will not clobber existing file \"'abc/ehdrs/erro.h'\"
  1013. else
  1014.   echo shar: Extracting \"'abc/ehdrs/erro.h'\" \(970 characters\)
  1015.   sed "s/^X//" >'abc/ehdrs/erro.h' <<'END_OF_FILE'
  1016. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1017. X
  1018. X/*
  1019. X * B editor -- User (error) messages collected together.
  1020. X */
  1021. X
  1022. X#define COPY_EMPTY    MESS(6000, "Empty copy buffer")
  1023. X#define READ_BAD    MESS(6001, "Trouble with your how-to, see last line. Hit [interrupt] if you don't want this")
  1024. X#define EDIT_TABS    MESS(6002, "Spaces and tabs mixed for indentation; check your program layout")
  1025. X#define EXIT_HOLES    MESS(6003, "There are still holes left.  Please fill or delete these first.")
  1026. X#define GOTO_BAD    MESS(6004, "I cannot [goto] that position")
  1027. X#define GOTO_OUT    MESS(6005, "Sorry, I could not [goto] that position")
  1028. X#define GOTO_REC    MESS(6006, "You can't use [goto] in recording mode")
  1029. X#define INS_BAD        MESS(6007, "Cannot insert '%c'")
  1030. X#define PLB_NOK        MESS(6008, "No keystrokes recorded")
  1031. X#define REC_OK        MESS(6009, "Keystrokes recorded, use [play] to play back")
  1032. X#define REDO_OLD    MESS(6010, "This redo brought you to an older version.  Use [undo] to cancel")
  1033. X    
  1034. END_OF_FILE
  1035.   if test 970 -ne `wc -c <'abc/ehdrs/erro.h'`; then
  1036.     echo shar: \"'abc/ehdrs/erro.h'\" unpacked with wrong size!
  1037.   fi
  1038.   # end of 'abc/ehdrs/erro.h'
  1039. fi
  1040. if test -f 'abc/ehdrs/trm.h' -a "${1}" != "-c" ; then 
  1041.   echo shar: Will not clobber existing file \"'abc/ehdrs/trm.h'\"
  1042. else
  1043.   echo shar: Extracting \"'abc/ehdrs/trm.h'\" \(938 characters\)
  1044.   sed "s/^X//" >'abc/ehdrs/trm.h' <<'END_OF_FILE'
  1045. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1046. X
  1047. X/*
  1048. X * Terminal capabilities.  These correspond to bits set by trmstart in its
  1049. X * parameter flags parameter.
  1050. X */
  1051. X
  1052. X#define HAS_STANDOUT    1    /* Terminal has inverse video or underline */
  1053. X#define CAN_SCROLL    2    /* Terminal can insert/delete lines */
  1054. X#define CAN_OPTIMISE    4    /* Terminal can insert/delete characters */
  1055. X#define CAN_SENSE    8    /* Terminal can send cursor position */
  1056. X
  1057. X/*
  1058. X * Error codes returned by trmstart.
  1059. X */
  1060. X
  1061. X#define TE_OK        0    /* No errors */
  1062. X#define TE_TWICE    1    /* Trmstart called again */
  1063. X#define TE_NOTERM    2    /* $TERM not set or empty */
  1064. X#define TE_BADTERM    3    /* $TERM not found in termcap database */
  1065. X#define TE_DUMB        4    /* Terminal too dumb */
  1066. X#define TE_NOTTY    5    /* Stdin not a tty or cannot open "/etc/tty" */
  1067. X#define TE_NOMEM    6    /* Can't get enough memory */
  1068. X#define TE_BADSCREEN    7    /* Bad $SCREEN */
  1069. X#define TE_OTHER    8    /* This and higher are reserved errors */
  1070. END_OF_FILE
  1071.   if test 938 -ne `wc -c <'abc/ehdrs/trm.h'`; then
  1072.     echo shar: \"'abc/ehdrs/trm.h'\" unpacked with wrong size!
  1073.   fi
  1074.   # end of 'abc/ehdrs/trm.h'
  1075. fi
  1076. if test -f 'abc/ex/README' -a "${1}" != "-c" ; then 
  1077.   echo shar: Will not clobber existing file \"'abc/ex/README'\"
  1078. else
  1079.   echo shar: Extracting \"'abc/ex/README'\" \(793 characters\)
  1080.   sed "s/^X//" >'abc/ex/README' <<'END_OF_FILE'
  1081. XThe subdirectories here represent ABC workspaces, with example ABC how-to's.
  1082. X
  1083. XWith DoExamples, the ABC interpreter in .. is tested (via the shell
  1084. Xcommand '../abc') on the following four examples:
  1085. X
  1086. X    generate    generates new sentences based on those supplied
  1087. X            by the user;
  1088. X    hanoi        the towers of hanoi;
  1089. X    pi        calculates the value of pi, using the unbounded
  1090. X            arithmetic of ABC;
  1091. X    xref        a cross reference generator.
  1092. X
  1093. XFor more information on these programs, see the B Newsletter, Issue 2.
  1094. X
  1095. XThe ABC editor can only be tested by calling ../abc interactively, as
  1096. Xis done by TryEditor.
  1097. XFor this the 'try' workspace has been created from the 'generate' example,
  1098. Xso you can always regenerate it with:
  1099. X
  1100. X        cd  ./generate
  1101. X        cp  *  ../try
  1102. X
  1103. XThe file ../README2 tells you how to try the ABC editor.
  1104. END_OF_FILE
  1105.   if test 793 -ne `wc -c <'abc/ex/README'`; then
  1106.     echo shar: \"'abc/ex/README'\" unpacked with wrong size!
  1107.   fi
  1108.   # end of 'abc/ex/README'
  1109. fi
  1110. if test -f 'abc/ex/TryEditor' -a "${1}" != "-c" ; then 
  1111.   echo shar: Will not clobber existing file \"'abc/ex/TryEditor'\"
  1112. else
  1113.   echo shar: Extracting \"'abc/ex/TryEditor'\" \(973 characters\)
  1114.   sed "s/^X//" >'abc/ex/TryEditor' <<'END_OF_FILE'
  1115. X: 'test ABC editor'
  1116. X
  1117. Xcase $1 in
  1118. Xlocal)    abc=../abc;;
  1119. X*)    abc=abc;;
  1120. Xesac
  1121. X
  1122. Xcat <<EOF
  1123. XYou're about to try the ABC editor.
  1124. X
  1125. XFirst wait for the prompt '>>> ?' to appear.
  1126. XThen press 's' to get 'S?ELECT:'.
  1127. XNext press 't' to see 'ST?ART'.
  1128. XNow press the [TAB]-key to accept this suggestion.
  1129. XFinally press the [RETURN]-key to start execution.
  1130. X
  1131. XABC will prompt with '?' for some lines of text, until you type an empty line.
  1132. XAfter some time it will then generate a small poem from your twisted text.
  1133. X
  1134. XYou can undo any change by pressing [BACKSPACE].
  1135. XYou can get help with ? or [ESC]-?.
  1136. XYou can leave the ABC editor with [ESC]-[ESC].
  1137. XYou can leave 'abc' by typing QUIT.
  1138. X
  1139. XSee 'HOW TO TRY THE ABC EDITOR' in README2 for more information.
  1140. X
  1141. XLoading ABC ...
  1142. X
  1143. XEOF
  1144. X
  1145. X$abc -W `pwd` -w try
  1146. X
  1147. Xecho " "
  1148. Xecho "If you are satisfied about the ABC editor"
  1149. Xcase $1 in
  1150. Xlocal)    echo "you can make ABC public with 'make install'.";;
  1151. X*)    echo "you can clean on the compilation machine with 'make clean'.";;
  1152. Xesac
  1153. END_OF_FILE
  1154.   if test 973 -ne `wc -c <'abc/ex/TryEditor'`; then
  1155.     echo shar: \"'abc/ex/TryEditor'\" unpacked with wrong size!
  1156.   fi
  1157.   chmod +x 'abc/ex/TryEditor'
  1158.   # end of 'abc/ex/TryEditor'
  1159. fi
  1160. if test -f 'abc/ex/generate.out' -a "${1}" != "-c" ; then 
  1161.   echo shar: Will not clobber existing file \"'abc/ex/generate.out'\"
  1162. else
  1163.   echo shar: Extracting \"'abc/ex/generate.out'\" \(441 characters\)
  1164.   sed "s/^X//" >'abc/ex/generate.out' <<'END_OF_FILE'
  1165. XMary had a little lamb,
  1166. XIts fleece was white as snow,
  1167. XAnd everywhere that Mary went,
  1168. XThat lamb was sure to go.
  1169. X
  1170. XIts whittle as whittle that lamb,
  1171. XMarywhittleece to go.
  1172. XIts sure as snow,
  1173. XThat Mary wherywhery was went,
  1174. X
  1175. XThat Mary hat Marywhere to go.
  1176. XIts was sure that lamb was fle lamb,
  1177. XIts snow,
  1178. XIts sure lite to go.
  1179. X
  1180. XAnd a lite went,
  1181. XAnd evere a lite to go.
  1182. XAnd evere where thad every was was where to go.
  1183. XMary where thad a lamb was went,
  1184. X
  1185. END_OF_FILE
  1186.   if test 441 -ne `wc -c <'abc/ex/generate.out'`; then
  1187.     echo shar: \"'abc/ex/generate.out'\" unpacked with wrong size!
  1188.   fi
  1189.   # end of 'abc/ex/generate.out'
  1190. fi
  1191. if test -f 'abc/ihdrs/i2exp.h' -a "${1}" != "-c" ; then 
  1192.   echo shar: Will not clobber existing file \"'abc/ihdrs/i2exp.h'\"
  1193. else
  1194.   echo shar: Extracting \"'abc/ihdrs/i2exp.h'\" \(1136 characters\)
  1195.   sed "s/^X//" >'abc/ihdrs/i2exp.h' <<'END_OF_FILE'
  1196. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1197. X
  1198. X/* General definitions for parsing expressions */
  1199. X
  1200. X#ifdef macintosh
  1201. X/* Avoid conflict with extra reserved word: */
  1202. X#define comp b_comp
  1203. X#endif
  1204. X
  1205. Xtypedef struct {                            
  1206. X    parsetree *stack;
  1207. X    parsetree *sp;
  1208. X    parsetree *top;
  1209. X    int nextend;
  1210. X    char level;        /* PARSER or FIXER */
  1211. X    char /* bool */ prop;    /* Yes while fixing left expr dya pred */
  1212. X    intlet nfield;        /* fieldnr unparsed node during fixing */
  1213. X} expadm;
  1214. X
  1215. X#define Stack(adm)    (adm->stack)
  1216. X#define Sp(adm)        (adm->sp)
  1217. X#define Top(adm)    (adm->top)
  1218. X#define Nextend(adm)    (adm->nextend)
  1219. X#define Level(adm)    (adm->level)
  1220. X#define Prop(adm)    (adm->prop)
  1221. X#define Nfld(adm)    (adm->nfield)
  1222. X
  1223. X#define N_EXP_STACK    15
  1224. X#define N_LTA_STACK    100
  1225. X
  1226. X#define Pop(adm)    *--Sp(adm)
  1227. X
  1228. X#define PARSER 'p'
  1229. X#define FIXER  'f'
  1230. X
  1231. X#define Bottom "$"
  1232. X
  1233. X#define Dya_opr(v) (Valid(v) && Is_compound(v))
  1234. X
  1235. X/************************************************************************/
  1236. X
  1237. Xstruct prio {
  1238. X    string fun;
  1239. X    char adic;
  1240. X    int L, H;
  1241. X};
  1242. X
  1243. X#define P_mon '1'
  1244. X#define P_dya '2'
  1245. X
  1246. X#define dprio(i) pprio(i, P_dya)
  1247. X#define mprio(i) pprio(i, P_mon)
  1248. X
  1249. Xstruct prio * pprio();
  1250. X
  1251. X
  1252. END_OF_FILE
  1253.   if test 1136 -ne `wc -c <'abc/ihdrs/i2exp.h'`; then
  1254.     echo shar: \"'abc/ihdrs/i2exp.h'\" unpacked with wrong size!
  1255.   fi
  1256.   # end of 'abc/ihdrs/i2exp.h'
  1257. fi
  1258. if test -f 'abc/ihdrs/i3env.h' -a "${1}" != "-c" ; then 
  1259.   echo shar: Will not clobber existing file \"'abc/ihdrs/i3env.h'\"
  1260. else
  1261.   echo shar: Extracting \"'abc/ihdrs/i3env.h'\" \(872 characters\)
  1262.   sed "s/^X//" >'abc/ihdrs/i3env.h' <<'END_OF_FILE'
  1263. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1264. X
  1265. X/* environments and context */
  1266. X
  1267. Xtypedef struct {
  1268. X    value uname;
  1269. X    env curnv;
  1270. X    value r_names, *bndtgs;
  1271. X    literal cntxt, resexp;
  1272. X    parsetree cur_line;
  1273. X    value cur_lino;
  1274. X} context;
  1275. X
  1276. X#define Enil ((env) NULL)
  1277. X
  1278. X/* contexts: */
  1279. X#define In_command 'c'
  1280. X#define In_read '?'
  1281. X#define In_unit 'u'
  1282. X#define In_edval 'e'
  1283. X#define In_tarval 't'
  1284. X#define In_prmnv 'p'
  1285. X#define In_wsgroup 'w'
  1286. X
  1287. X/* results */
  1288. X#define Ret 'V'
  1289. X#define Rep '+'
  1290. X#define Voi ' '
  1291. X
  1292. Xvalue* envassoc();
  1293. X
  1294. Xextern env curnv; extern value *bndtgs;
  1295. Xextern literal cntxt, resexp; extern value uname;
  1296. Xextern value errtname;
  1297. Xextern intlet lino;
  1298. Xextern intlet f_lino;
  1299. Xextern intlet i_lino;
  1300. X
  1301. Xextern context read_context;
  1302. X
  1303. Xextern envtab prmnvtab;
  1304. Xextern envchain prmnvchain;
  1305. Xextern env prmnv;
  1306. X
  1307. Xextern intlet errlino;
  1308. Xextern parsetree curline;
  1309. Xextern value curlino;
  1310. X
  1311. END_OF_FILE
  1312.   if test 872 -ne `wc -c <'abc/ihdrs/i3env.h'`; then
  1313.     echo shar: \"'abc/ihdrs/i3env.h'\" unpacked with wrong size!
  1314.   fi
  1315.   # end of 'abc/ihdrs/i3env.h'
  1316. fi
  1317. if test -f 'abc/ihdrs/i3int.h' -a "${1}" != "-c" ; then 
  1318.   echo shar: Will not clobber existing file \"'abc/ihdrs/i3int.h'\"
  1319. else
  1320.   echo shar: Extracting \"'abc/ihdrs/i3int.h'\" \(698 characters\)
  1321.   sed "s/^X//" >'abc/ihdrs/i3int.h' <<'END_OF_FILE'
  1322. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1323. X
  1324. X/* Interpreter */
  1325. X
  1326. Xvalue pop();
  1327. X/* Procedure push(); */
  1328. X
  1329. X#define Stop ((parsetree)zero) /* Legal stop */
  1330. X#define Halt NilTree /* Illegal stop (loose end of code) */
  1331. X
  1332. Xextern int call_level;
  1333. X
  1334. X#define _Thread(t) *Branch(t, Nbranches(t)) /* Next instruction */
  1335. X#define _Thread2(t) *Branch(t, Nbranches(t)+1) /* Alternate next instr. or flag */
  1336. X
  1337. X#ifdef MSDOS
  1338. X#ifdef M_I86LM
  1339. X
  1340. X#define Thread(t) (*_thread(t))
  1341. X#define Thread2(t) (*_thread2(t))
  1342. Xparsetree *_thread();
  1343. Xparsetree *_thread2();
  1344. X
  1345. X#endif /* M_I86LM */
  1346. X#endif /* MSDOS */
  1347. X
  1348. X#ifndef Thread
  1349. X#define Thread(t) _Thread(t)
  1350. X#endif
  1351. X#ifndef Thread2
  1352. X#define Thread2(t) _Thread2(t)
  1353. X#endif
  1354. END_OF_FILE
  1355.   if test 698 -ne `wc -c <'abc/ihdrs/i3int.h'`; then
  1356.     echo shar: \"'abc/ihdrs/i3int.h'\" unpacked with wrong size!
  1357.   fi
  1358.   # end of 'abc/ihdrs/i3int.h'
  1359. fi
  1360. if test -f 'abc/scripts/Change' -a "${1}" != "-c" ; then 
  1361.   echo shar: Will not clobber existing file \"'abc/scripts/Change'\"
  1362. else
  1363.   echo shar: Extracting \"'abc/scripts/Change'\" \(1083 characters\)
  1364.   sed "s/^X//" >'abc/scripts/Change' <<'END_OF_FILE'
  1365. X: 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. '
  1366. X
  1367. X: 'Change error messages in limited number of files'
  1368. X
  1369. X: 'This should be called locally in the directory of the concerning files!'
  1370. X
  1371. Xcase $1 in
  1372. X''|-*)    echo "Usage: $0 [start [step]] file ..." 1>&2; exit 1;;
  1373. X[0-9]*) start=$1; shift;
  1374. X    case $1 in
  1375. X    [0-9]*) step=$1; shift;;
  1376. X    *) step=100;;
  1377. X    esac;;
  1378. X*)    start=100; step=100;;
  1379. Xesac
  1380. X
  1381. Xfor file
  1382. Xdo
  1383. X    if test -f $file.orig
  1384. X    then
  1385. X        echo $file.orig already exists, $file skipped
  1386. X    else
  1387. X        mv $file $file.orig || exit
  1388. X        echo $file $start
  1389. X        sed 's/MESS([0-9]*/MESS($/' $file.orig |
  1390. X        awk "BEGIN {messnum=$start}"'
  1391. X            /MESS\(/ {n=split($0, field, "$");
  1392. X             for (i=1; i<= n; i++) {
  1393. X              if (i==2) {printf "%d", messnum; ++messnum}
  1394. X              if (i>2) printf "$"
  1395. X              printf "%s", field[i]
  1396. X             }
  1397. X             printf "\n"
  1398. X            }
  1399. X            !/MESS\(/ {print}' >$file
  1400. X        if test -s $file
  1401. X        then
  1402. X            if cmp -s $file.orig $file
  1403. X            then
  1404. X                mv $file.orig $file
  1405. X                echo $file unchanged
  1406. X            else
  1407. X                start=`expr $start + $step`
  1408. X            fi
  1409. X        else
  1410. X            mv $file.orig $file
  1411. X            echo $file clobbered, old version put back
  1412. X        fi
  1413. X    fi
  1414. Xdone
  1415. END_OF_FILE
  1416.   if test 1083 -ne `wc -c <'abc/scripts/Change'`; then
  1417.     echo shar: \"'abc/scripts/Change'\" unpacked with wrong size!
  1418.   fi
  1419.   chmod +x 'abc/scripts/Change'
  1420.   # end of 'abc/scripts/Change'
  1421. fi
  1422. if test -f 'abc/scripts/Collect' -a "${1}" != "-c" ; then 
  1423.   echo shar: Will not clobber existing file \"'abc/scripts/Collect'\"
  1424. else
  1425.   echo shar: Extracting \"'abc/scripts/Collect'\" \(1178 characters\)
  1426.   sed "s/^X//" >'abc/scripts/Collect' <<'END_OF_FILE'
  1427. X: sh or ksh script
  1428. X
  1429. X# Collect error messages from source files.
  1430. X#
  1431. X# Messages must have the form MESS(number, "string") and be contained
  1432. X# on one line.  They are output in the form
  1433. X#     number [star] tab string
  1434. X# where [star] is a * after the number, present for system errors.
  1435. X# System errors are those lines that also contain the text "syserr" or
  1436. X# "SMESS"; the message number is repeated in the message text.
  1437. X# There are some more conventions for error messages, in particular
  1438. X# \n is replaced by a newline character, and %s may be replaced by
  1439. X# a parameter (e.g., ("you haven't yold me HOW TO %s").
  1440. X#
  1441. X# This script is called from the Makefile.  Its arguments are the files
  1442. X# from which messages must be collected.  The list of messages, sorted
  1443. X# by number, appears on the output.
  1444. X#
  1445. X# Since this script is somewhat naive, the output should be inspected
  1446. X# carefully (you might do a 'diff abc.msg abc.mse').
  1447. X# There is a companion script, Change, which assigns new numbers to
  1448. X# messages.
  1449. X
  1450. Xgrep 'MESS([0-9]' $* |
  1451. Xsed '/syserr/s/.*MESS(\([0-9]*\), *"\(.*\)").*/\1*    \2 (\1)/
  1452. X    /SMESS/s/.*MESS(\([0-9]*\), *"\(.*\)").*/\1*    \2 (\1)/
  1453. X    s/.*MESS(\([0-9]*\), *"\(.*\)").*/\1    \2/' |
  1454. Xsort -n
  1455. END_OF_FILE
  1456.   if test 1178 -ne `wc -c <'abc/scripts/Collect'`; then
  1457.     echo shar: \"'abc/scripts/Collect'\" unpacked with wrong size!
  1458.   fi
  1459.   chmod +x 'abc/scripts/Collect'
  1460.   # end of 'abc/scripts/Collect'
  1461. fi
  1462. if test -f 'abc/stc/DEP' -a "${1}" != "-c" ; then 
  1463.   echo shar: Will not clobber existing file \"'abc/stc/DEP'\"
  1464. else
  1465.   echo shar: Extracting \"'abc/stc/DEP'\" \(971 characters\)
  1466.   sed "s/^X//" >'abc/stc/DEP' <<'END_OF_FILE'
  1467. Xi2tca.o: i2tca.c
  1468. Xi2tca.o: ../bhdrs/b.h
  1469. Xi2tca.o: ../uhdrs/osconf.h
  1470. Xi2tca.o: ../uhdrs/os.h
  1471. Xi2tca.o: ../uhdrs/conf.h
  1472. Xi2tca.o: ../uhdrs/config.h
  1473. Xi2tca.o: ../bhdrs/bmem.h
  1474. Xi2tca.o: ../bhdrs/bfil.h
  1475. Xi2tca.o: ../bhdrs/bint.h
  1476. Xi2tca.o: ../bhdrs/bobj.h
  1477. Xi2tca.o: ../bhdrs/b0lan.h
  1478. Xi2tca.o: ../ihdrs/i2nod.h
  1479. Xi2tca.o: ../ihdrs/i2par.h
  1480. Xi2tca.o: ./i2stc.h
  1481. Xi2tca.o: ../ihdrs/i3env.h
  1482. Xi2tca.o: ../ihdrs/i3sou.h
  1483. Xi2tce.o: i2tce.c
  1484. Xi2tce.o: ../bhdrs/b.h
  1485. Xi2tce.o: ../uhdrs/osconf.h
  1486. Xi2tce.o: ../uhdrs/os.h
  1487. Xi2tce.o: ../uhdrs/conf.h
  1488. Xi2tce.o: ../uhdrs/config.h
  1489. Xi2tce.o: ../bhdrs/bobj.h
  1490. Xi2tce.o: ./i2stc.h
  1491. Xi2tce.o: ../ihdrs/i2nod.h
  1492. Xi2tcp.o: i2tcp.c
  1493. Xi2tcp.o: ../bhdrs/b.h
  1494. Xi2tcp.o: ../uhdrs/osconf.h
  1495. Xi2tcp.o: ../uhdrs/os.h
  1496. Xi2tcp.o: ../uhdrs/conf.h
  1497. Xi2tcp.o: ../uhdrs/config.h
  1498. Xi2tcp.o: ../bhdrs/bobj.h
  1499. Xi2tcp.o: ./i2stc.h
  1500. Xi2tcu.o: i2tcu.c
  1501. Xi2tcu.o: ../bhdrs/b.h
  1502. Xi2tcu.o: ../uhdrs/osconf.h
  1503. Xi2tcu.o: ../uhdrs/os.h
  1504. Xi2tcu.o: ../uhdrs/conf.h
  1505. Xi2tcu.o: ../uhdrs/config.h
  1506. Xi2tcu.o: ../bhdrs/bobj.h
  1507. Xi2tcu.o: ./i2stc.h
  1508. END_OF_FILE
  1509.   if test 971 -ne `wc -c <'abc/stc/DEP'`; then
  1510.     echo shar: \"'abc/stc/DEP'\" unpacked with wrong size!
  1511.   fi
  1512.   # end of 'abc/stc/DEP'
  1513. fi
  1514. if test -f 'abc/tc/Makefile' -a "${1}" != "-c" ; then 
  1515.   echo shar: Will not clobber existing file \"'abc/tc/Makefile'\"
  1516. else
  1517.   echo shar: Extracting \"'abc/tc/Makefile'\" \(882 characters\)
  1518.   sed "s/^X//" >'abc/tc/Makefile' <<'END_OF_FILE'
  1519. XCFLAGS          = -O -DCM_N -DCM_GT -DCM_B -DCM_D
  1520. X
  1521. XDEST          = ..
  1522. X
  1523. XETC          = ..
  1524. X
  1525. XHDRS          =
  1526. X
  1527. XLIBRARY          = libtermcap.a
  1528. X
  1529. XMAKEFILE      = Makefile
  1530. X
  1531. XOBJS          = termcap.o tgoto.o tputs.o
  1532. X
  1533. XPRINT          = print
  1534. X
  1535. XSRCS          = tc1.c tc2.c tc3.c \
  1536. X        termcap.c tgoto.c tputs.c
  1537. X
  1538. Xall:        $(LIBRARY)
  1539. X
  1540. X$(LIBRARY):    $(OBJS)
  1541. X        ar cru $(LIBRARY) $(OBJS)
  1542. X        ranlib $(LIBRARY)
  1543. X
  1544. Xclean:;        @rm -f $(OBJS) $(LIBRARY) tc1 tc2 tc3 tc1.o tc2.o tc3.o
  1545. X
  1546. Xindex:;        @ctags -wx $(HDRS) $(SRCS)
  1547. X
  1548. Xinstall:    library termcap
  1549. X
  1550. Xtermcap:
  1551. X        cp termcap $(ETC)
  1552. X
  1553. Xlibrary:        $(LIBRARY)
  1554. X        cp $(LIBRARY) $(DEST)
  1555. X
  1556. Xdatabase:
  1557. X        cp termcap $(ETC)
  1558. X
  1559. Xprint:;        @$(PRINT) $(HDRS) $(SRCS)
  1560. X
  1561. Xtags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
  1562. X
  1563. Xtc1:        tc1.o $(LIBRARY)
  1564. X        cc $(CFLAGS) tc1.o $(LIBRARY) -o tc1
  1565. Xtc2:        tc1.o $(LIBRARY)
  1566. X        cc $(CFLAGS) tc1.o $(LIBRARY) -o tc2
  1567. Xtc3:        tc1.o $(LIBRARY)
  1568. X        cc $(CFLAGS) tc1.o $(LIBRARY) -o tc3
  1569. END_OF_FILE
  1570.   if test 882 -ne `wc -c <'abc/tc/Makefile'`; then
  1571.     echo shar: \"'abc/tc/Makefile'\" unpacked with wrong size!
  1572.   fi
  1573.   # end of 'abc/tc/Makefile'
  1574. fi
  1575. if test -f 'abc/tc/tc2.c' -a "${1}" != "-c" ; then 
  1576.   echo shar: Will not clobber existing file \"'abc/tc/tc2.c'\"
  1577. else
  1578.   echo shar: Extracting \"'abc/tc/tc2.c'\" \(814 characters\)
  1579.   sed "s/^X//" >'abc/tc/tc2.c' <<'END_OF_FILE'
  1580. X/*
  1581. X * tc2 [term]
  1582. X * Dummy program to test out termlib.
  1583. X * Commands are "tcc\n" where t is type (s for string, f for flag,
  1584. X * or n for number) and cc is the name of the capability.
  1585. X */
  1586. X#include <stdio.h>
  1587. Xchar buf[1024];
  1588. Xchar *getenv(), *tgetstr();
  1589. X
  1590. Xmain(argc, argv) char **argv; {
  1591. X    char *p, *q;
  1592. X    int rc;
  1593. X    char b[3], c;
  1594. X    char area[200];
  1595. X
  1596. X    if (argc < 2)
  1597. X        p = getenv("TERM");
  1598. X    else
  1599. X        p = argv[1];
  1600. X    rc = tgetent(buf,p);
  1601. X    for (;;) {
  1602. X        c = getchar();
  1603. X        if (c < 0)
  1604. X            exit(0);
  1605. X        b[0] = getchar();
  1606. X        if (b[0] < ' ')
  1607. X            exit(0);
  1608. X        b[1] = getchar();
  1609. X        b[2] = 0;
  1610. X        getchar();
  1611. X        switch(c) {
  1612. X            case 'f':
  1613. X                printf("%s: %d\n",b,tgetflag(b));
  1614. X                break;
  1615. X            case 'n':
  1616. X                printf("%s: %d\n",b,tgetnum(b));
  1617. X                break;
  1618. X            case 's':
  1619. X                q = area;
  1620. X                printf("%s: %s\n",b,tgetstr(b,&q));
  1621. X                break;
  1622. X            default:
  1623. X                exit(0);
  1624. X        }
  1625. X    }
  1626. X}
  1627. END_OF_FILE
  1628.   if test 814 -ne `wc -c <'abc/tc/tc2.c'`; then
  1629.     echo shar: \"'abc/tc/tc2.c'\" unpacked with wrong size!
  1630.   fi
  1631.   # end of 'abc/tc/tc2.c'
  1632. fi
  1633. if test -f 'abc/uhdrs/conf.h' -a "${1}" != "-c" ; then 
  1634.   echo shar: Will not clobber existing file \"'abc/uhdrs/conf.h'\"
  1635. else
  1636.   echo shar: Extracting \"'abc/uhdrs/conf.h'\" \(867 characters\)
  1637.   sed "s/^X//" >'abc/uhdrs/conf.h' <<'END_OF_FILE'
  1638. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1639. X
  1640. X/* Most machine-dependent changes are done automatically by mkconfig,    */
  1641. X/* the results of which can be found in config.h.            */
  1642. X/* You only need to change this file conf.h under rare circumstances.    */
  1643. X
  1644. X/* Miscellaneous definitions*/
  1645. Xtypedef int expint;        /*The 2nd argument of frexp points to this */
  1646. X                /*(see manual page frexp(3)).              */
  1647. X                /*On some 68K systems must be short (foo!) */
  1648. X
  1649. X#define Maxtrig 1e16        /*Max x for sin(x), cos(x), tan(x)         */
  1650. X                /*(Can anybody find a way to compute this  */
  1651. X                /*automatically?)                          */
  1652. X
  1653. X#define MaxSmallInt (BASE-1) /* This must be so! */
  1654. X#define MinSmallInt (-BASE) /* This must be so!!! */
  1655. X
  1656. X#define SEED getpid()        /*Any suitable random int (eg date or time) */
  1657. X                /*to start the random number generator with */
  1658. END_OF_FILE
  1659.   if test 867 -ne `wc -c <'abc/uhdrs/conf.h'`; then
  1660.     echo shar: \"'abc/uhdrs/conf.h'\" unpacked with wrong size!
  1661.   fi
  1662.   # end of 'abc/uhdrs/conf.h'
  1663. fi
  1664. if test -f 'abc/uhdrs/dir.h' -a "${1}" != "-c" ; then 
  1665.   echo shar: Will not clobber existing file \"'abc/uhdrs/dir.h'\"
  1666. else
  1667.   echo shar: Extracting \"'abc/uhdrs/dir.h'\" \(1070 characters\)
  1668.   sed "s/^X//" >'abc/uhdrs/dir.h' <<'END_OF_FILE'
  1669. X/* slightly edited for ABC from public domain source */
  1670. X
  1671. X#ifndef DEV_BSIZE
  1672. X#define    DEV_BSIZE    512
  1673. X#endif
  1674. X#define DIRBLKSIZ    DEV_BSIZE
  1675. X#define    MAXNAMLEN    255
  1676. X
  1677. Xstruct    direct {
  1678. X    long    d_ino;            /* inode number of entry */
  1679. X    short    d_reclen;        /* length of this record */
  1680. X    short    d_namlen;        /* length of string in d_name */
  1681. X    char    d_name[MAXNAMLEN + 1];    /* name must be no longer than this */
  1682. X};
  1683. X
  1684. X/*
  1685. X * The DIRSIZ macro gives the minimum record length which will hold
  1686. X * the directory entry.  This requires the amount of space in struct direct
  1687. X * without the d_name field, plus enough space for the name with a terminating
  1688. X * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  1689. X */
  1690. X#undef DIRSIZ
  1691. X#define DIRSIZ(dp) \
  1692. X    ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  1693. X
  1694. X/*
  1695. X * Definitions for library routines operating on directories.
  1696. X */
  1697. Xtypedef struct _dirdesc {
  1698. X    int    dd_fd;
  1699. X    long    dd_loc;
  1700. X    long    dd_size;
  1701. X    char    dd_buf[DIRBLKSIZ];
  1702. X} DIR;
  1703. X#ifndef NULL
  1704. X#define NULL 0
  1705. X#endif
  1706. Xextern    DIR *opendir();
  1707. Xextern    struct direct *readdir();
  1708. Xextern    closedir();
  1709. END_OF_FILE
  1710.   if test 1070 -ne `wc -c <'abc/uhdrs/dir.h'`; then
  1711.     echo shar: \"'abc/uhdrs/dir.h'\" unpacked with wrong size!
  1712.   fi
  1713.   # end of 'abc/uhdrs/dir.h'
  1714. fi
  1715. if test -f 'abc/ukeys/abckeys_2621' -a "${1}" != "-c" ; then 
  1716.   echo shar: Will not clobber existing file \"'abc/ukeys/abckeys_2621'\"
  1717. else
  1718.   echo shar: Extracting \"'abc/ukeys/abckeys_2621'\" \(668 characters\)
  1719.   sed "s/^X//" >'abc/ukeys/abckeys_2621' <<'END_OF_FILE'
  1720. X# HP2621 terminal
  1721. X# display screen labels f1-f8 upon startup, config-edit after exit:
  1722. X[term-init]       = "\033&jB" = ""
  1723. X[term-done]       = "\033&jA" = ""
  1724. X# use first four standard:
  1725. X[widen]    = "\033p\015" = "f1"
  1726. X[extend]   = "\033q\015" = "f2"
  1727. X[first]    = "\033r\015" = "f3"
  1728. X[last]     = "\033s\015" = "f4"
  1729. X# because arrow keys are drawn on the keyboards keys:
  1730. X[up]       = "\033t\015" = "f5"
  1731. X[left]     = "\033u\015" = "f6"
  1732. X[right]    = "\033v\015" = "f7"
  1733. X[down]     = "\033w\015" = "f8"
  1734. X# which makes rebind for following four necessary:
  1735. X[previous] = "\033[" = "ESC-["
  1736. X[next]     = "\033]" = "ESC-]"
  1737. X[upline]   = "\033k" = "ESC-k"
  1738. X[downline] = "\033j" = "ESC-j"
  1739. END_OF_FILE
  1740.   if test 668 -ne `wc -c <'abc/ukeys/abckeys_2621'`; then
  1741.     echo shar: \"'abc/ukeys/abckeys_2621'\" unpacked with wrong size!
  1742.   fi
  1743.   # end of 'abc/ukeys/abckeys_2621'
  1744. fi
  1745. if test -f 'abc/ukeys/abckeys_5620' -a "${1}" != "-c" ; then 
  1746.   echo shar: Will not clobber existing file \"'abc/ukeys/abckeys_5620'\"
  1747. else
  1748.   echo shar: Extracting \"'abc/ukeys/abckeys_5620'\" \(696 characters\)
  1749.   sed "s/^X//" >'abc/ukeys/abckeys_5620' <<'END_OF_FILE'
  1750. X# Key bindings for the BLIT (TERM=5620).
  1751. X# Warning: this resets your function keys!
  1752. X
  1753. X# Initialize the function keys.
  1754. X
  1755. X[term-init]="[5620 PF keys]\r\n\e[1;2q\ew\e[2;2q\ee\e[3;2q\ef\e[4;2q\el\e[5;2q\ep\e[6;2q\en\e[7;2q\eu\e[8;2q\ed" = ""
  1756. X
  1757. X# Function key bindings are as in b(1) manual.
  1758. X# (Should reorder because of 3-2-3 lay-out?)
  1759. X
  1760. X[widen]        = "\ew" = "f1"
  1761. X[extend]    = "\ee" = "f2"
  1762. X[first]        = "\ef" = "f3"
  1763. X[last]        = "\el" = "f4"
  1764. X[previous]     = "\ep" = "f5"
  1765. X[next]         = "\en" = "f6"
  1766. X[upline]    = "\eu" = "f7"
  1767. X[downline]    = "\ed" = "f8"
  1768. X
  1769. X# Find some use for HOME and HOME DOWN keys.
  1770. X
  1771. X[upline]    = "\e[H" = "Arrow-Home"
  1772. X[downline]    = "\e[70;1H" = "Arrow-Home-Down"
  1773. X
  1774. X# Ignore CLEAR key.
  1775. X
  1776. X[ignore]    = "\e[2J" = ""
  1777. END_OF_FILE
  1778.   if test 696 -ne `wc -c <'abc/ukeys/abckeys_5620'`; then
  1779.     echo shar: \"'abc/ukeys/abckeys_5620'\" unpacked with wrong size!
  1780.   fi
  1781.   # end of 'abc/ukeys/abckeys_5620'
  1782. fi
  1783. if test -f 'abc/ukeys/abckeys_5620-2' -a "${1}" != "-c" ; then 
  1784.   echo shar: Will not clobber existing file \"'abc/ukeys/abckeys_5620-2'\"
  1785. else
  1786.   echo shar: Extracting \"'abc/ukeys/abckeys_5620-2'\" \(707 characters\)
  1787.   sed "s/^X//" >'abc/ukeys/abckeys_5620-2' <<'END_OF_FILE'
  1788. X# Key bindings for the 5620-2 (5620 with new ROMs), my personal preferences.
  1789. X# (Guido)
  1790. X
  1791. X# Initialize the function keys.
  1792. X
  1793. X[term-init]="[Changing PF keys!]\r\n\e[1;2q\eW\e[2;2q\eF\e[3;2q\eL\e[4;2q\eb\e[5;2q\ef\e[6;2q\es\e[7;2q\er\e[8;2q\ep" = ""
  1794. X
  1795. X# 5 function key bindings are the same as for BE, F6-F8 are different.
  1796. X
  1797. X[widen]        = "\eW" = "f1"
  1798. X[first]        = "\eF" = "f2"
  1799. X[last]        = "\eL" = "f3"
  1800. X
  1801. X[previous]    = "\eb" = "f4"
  1802. X[next]        = "\ef" = "f5"
  1803. X
  1804. X[copy]        = "\es" = "f6"
  1805. X[redo]        = "\er" = "f7"
  1806. X[extend]    = "\ep" = "f8"
  1807. X
  1808. X# Find some use for CLEAR, HOME and HOME DOWN keys.
  1809. X
  1810. X[upline]    = "\e[H"    = "HOME"
  1811. X[downline]    = "\e[70;1H"    = "HOME-DOWN"
  1812. X[look]        = "\e[2J"    = "CLEAR"
  1813. X
  1814. X# Bind DEL to [delete]
  1815. X
  1816. X[delete]    = "\177"    = "DEL"
  1817. END_OF_FILE
  1818.   if test 707 -ne `wc -c <'abc/ukeys/abckeys_5620-2'`; then
  1819.     echo shar: \"'abc/ukeys/abckeys_5620-2'\" unpacked with wrong size!
  1820.   fi
  1821.   # end of 'abc/ukeys/abckeys_5620-2'
  1822. fi
  1823. if test -f 'abc/ukeys/abckeys_5620-e' -a "${1}" != "-c" ; then 
  1824.   echo shar: Will not clobber existing file \"'abc/ukeys/abckeys_5620-e'\"
  1825. else
  1826.   echo shar: Extracting \"'abc/ukeys/abckeys_5620-e'\" \(799 characters\)
  1827.   sed "s/^X//" >'abc/ukeys/abckeys_5620-e' <<'END_OF_FILE'
  1828. X# Key bindings for the BLIT when using Steven's 'btty' driver.
  1829. X# Function keys are compatible with BE, not with the 'standard B' function
  1830. X# key numbering, which looks odd with the 3-2-3 arrangement of the DMD's function keys.
  1831. X# Warning: this resets your function keys!
  1832. X
  1833. X# Initialize the function keys.
  1834. X
  1835. X[term-init]="[5620-e PF keys]\r\n\e[1;3q\ep\r\e[2;3q\eq\r\e[3;3q\er\r\e[4;3q\eu\r\e[5;3q\ev\r\e[6;1q\3\e[7;1q\25\e[8;3q\es\r" = ""
  1836. X
  1837. X[widen]        = "\ep\r" = "f1"
  1838. X[first]        = "\eq\r" = "f2"
  1839. X[last]        = "\er\r" = "f3"
  1840. X
  1841. X[previous]    = "\eu\r" = "f4"
  1842. X[next]        = "\ev\r" = "f5"
  1843. X
  1844. X[upline]    = "\et\r" = "f7"
  1845. X[downline]    = "\ew\r" = "f8"
  1846. X
  1847. X# Find some use for HOME, HOME DOWN, DEL and CLEAR keys.
  1848. X
  1849. X[upline]    = "\e[H"    = "HOME"
  1850. X[downline]    = "\e[70;1H"    = "HOME-DOWN"
  1851. X[delete]    = "\177"    = "DEL"
  1852. X[look]        = "\e[2J"    = "CLEAR"
  1853. END_OF_FILE
  1854.   if test 799 -ne `wc -c <'abc/ukeys/abckeys_5620-e'`; then
  1855.     echo shar: \"'abc/ukeys/abckeys_5620-e'\" unpacked with wrong size!
  1856.   fi
  1857.   # end of 'abc/ukeys/abckeys_5620-e'
  1858. fi
  1859. if test -f 'abc/ukeys/abckeys_adm31' -a "${1}" != "-c" ; then 
  1860.   echo shar: Will not clobber existing file \"'abc/ukeys/abckeys_adm31'\"
  1861. else
  1862.   echo shar: Extracting \"'abc/ukeys/abckeys_adm31'\" \(781 characters\)
  1863.   sed "s/^X//" >'abc/ukeys/abckeys_adm31' <<'END_OF_FILE'
  1864. X[widen]        = "\027" = "Cmnd-W"
  1865. X[extend]       = "\005" = "Cmnd-E"
  1866. X[first]        = "\006" = "Cmnd-F"
  1867. X[last]         = "\014" = "Cmnd-L"
  1868. X[previous]     = "\020" = "Cmnd-P"
  1869. X[next]         = "\016" = "Cmnd-N"
  1870. X[upline]       = "\025" = "Cmnd-U"
  1871. X[downline]     = "\004" = "Cmnd-D"
  1872. X[up]           = "\017" = "Cmnd-Uparrow"
  1873. X[down]         = "\035" = "Cmnd-Downarrow"
  1874. X[left]         = "\013" = "Cmnd-Leftarrow"
  1875. X[right]        = "\012" = "Cmnd-Rightarrow"
  1876. X[redo]         = "\001" = "Cmnd-A"
  1877. X[copy]         = "\026" = "Cmnd-V"
  1878. X[copy]         = "\031" = "Cmnd-Y"
  1879. X[copy]         = "\002" = "Cmnd-B"
  1880. X[delete]       = "\030" = "Cmnd-X"
  1881. X[record]       = "\022" = "Cmnd-R"
  1882. X[playback]     = "\024" = "Cmnd-T"
  1883. X[look]         = "\033l" = "ESC-l"
  1884. X[term-init]    = "" = ""
  1885. X[term-done]    = "" = ""
  1886. END_OF_FILE
  1887.   if test 781 -ne `wc -c <'abc/ukeys/abckeys_adm31'`; then
  1888.     echo shar: \"'abc/ukeys/abckeys_adm31'\" unpacked with wrong size!
  1889.   fi
  1890.   # end of 'abc/ukeys/abckeys_adm31'
  1891. fi
  1892. if test -f 'abc/unix/u1edit.c' -a "${1}" != "-c" ; then 
  1893.   echo shar: Will not clobber existing file \"'abc/unix/u1edit.c'\"
  1894. else
  1895.   echo shar: Extracting \"'abc/unix/u1edit.c'\" \(698 characters\)
  1896.   sed "s/^X//" >'abc/unix/u1edit.c' <<'END_OF_FILE'
  1897. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1898. X
  1899. X/* edit via another editor */
  1900. X
  1901. X#include "b.h"
  1902. X#include "bfil.h"
  1903. X
  1904. X#define COML 200
  1905. XHidden char com_line[COML];
  1906. X#define At_eos(s) ((s)+= strlen(s))
  1907. X
  1908. XVisible Procedure ed_file(fname, line) string fname; intlet line; {
  1909. X    string cl= com_line;
  1910. X    strcpy(cl, editor);
  1911. X    if (*(cl+strlen(cl)-1) == '+') {
  1912. X        if (line != 0) sprintf(At_eos(cl), "%d", line);
  1913. X        else *(cl+strlen(cl)-1)= ' ';
  1914. X    }
  1915. X    app_fname(At_eos(cl), fname);
  1916. X    system(com_line);
  1917. X}
  1918. X
  1919. XHidden Procedure app_fname(ceos, fname) string ceos; string fname; {
  1920. X    intlet k, len= strlen(fname);
  1921. X    *ceos++= ' ';
  1922. X    for (k= 0; k<len; ++k) {
  1923. X        *ceos++= '\\';
  1924. X        *ceos++= *fname++;
  1925. X    }
  1926. X    *ceos= '\0';
  1927. X}
  1928. END_OF_FILE
  1929.   if test 698 -ne `wc -c <'abc/unix/u1edit.c'`; then
  1930.     echo shar: \"'abc/unix/u1edit.c'\" unpacked with wrong size!
  1931.   fi
  1932.   # end of 'abc/unix/u1edit.c'
  1933. fi
  1934. if test -f 'abc/unix/u1os.c' -a "${1}" != "-c" ; then 
  1935.   echo shar: Will not clobber existing file \"'abc/unix/u1os.c'\"
  1936. else
  1937.   echo shar: Extracting \"'abc/unix/u1os.c'\" \(976 characters\)
  1938.   sed "s/^X//" >'abc/unix/u1os.c' <<'END_OF_FILE'
  1939. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1940. X
  1941. X#include "b.h"
  1942. X#include "feat.h"
  1943. X
  1944. X#ifndef NDEBUG
  1945. X
  1946. X/* Assertion error */
  1947. X
  1948. XVisible Procedure asserr(file, line) string file; int line; {
  1949. X
  1950. X    putSDstr(errfile, "Assertion failed: file %s, line %d\n", file, line);
  1951. X    trmend(); /* quick hack to reset ttymodes */
  1952. X    bye(-1);
  1953. X}
  1954. X
  1955. X#endif /* !NDEBUG */
  1956. X
  1957. X#ifndef HAS_GETWD
  1958. X
  1959. X/* getwd - get working directory */
  1960. X
  1961. XVisible char *getwd(buf) char *buf; {
  1962. X    FILE *fp;
  1963. X
  1964. X    *buf = 0;
  1965. X    if ((fp=popen("pwd", "r")) == 0 ) {
  1966. X        strcpy(buf, "cannot execute pwd");
  1967. X        return(0);
  1968. X    }
  1969. X    if (fgets(buf, 1024, fp) )
  1970. X        buf[strlen(buf)-1] = 0;
  1971. X    pclose(fp);
  1972. X    if (*buf == '/')
  1973. X        return buf;
  1974. X    else
  1975. X        return (char*) NULL;
  1976. X}
  1977. X
  1978. X#endif /* !HAS_GETWD */
  1979. X
  1980. X#ifndef HAS_RENAME
  1981. X
  1982. X/* rename - rename a file */
  1983. X
  1984. XVisible Procedure rename(from, to) char *from, *to; {
  1985. X    int i;
  1986. X
  1987. X    if( (i=link(from, to)) < 0 ) return(i);
  1988. X    if( (i=unlink(from)) < 0 ) {
  1989. X        unlink(to);
  1990. X        return(i);
  1991. X    }
  1992. X    return(0);
  1993. X}
  1994. X
  1995. X#endif /* !HAS_RENAME */
  1996. END_OF_FILE
  1997.   if test 976 -ne `wc -c <'abc/unix/u1os.c'`; then
  1998.     echo shar: \"'abc/unix/u1os.c'\" unpacked with wrong size!
  1999.   fi
  2000.   # end of 'abc/unix/u1os.c'
  2001. fi
  2002. echo shar: End of archive 24 \(of 25\).
  2003. cp /dev/null ark24isdone
  2004. MISSING=""
  2005. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ; do
  2006.     if test ! -f ark${I}isdone ; then
  2007.     MISSING="${MISSING} ${I}"
  2008.     fi
  2009. done
  2010. if test "${MISSING}" = "" ; then
  2011.     echo You have unpacked all 25 archives.
  2012.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2013. else
  2014.     echo You still must unpack the following archives:
  2015.     echo "        " ${MISSING}
  2016. fi
  2017. exit 0 # Just in case...
  2018.