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

  1. Subject:  v23i102:  ABC interactive programming environment, Part23/25
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: bcd4a878 1c5622f5 e9ef9a9a d92317e9
  5.  
  6. Submitted-by: Steven Pemberton <steven@cwi.nl>
  7. Posting-number: Volume 23, Issue 102
  8. Archive-name: abc/part23
  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/README abc/README2 abc/b/b1file.c abc/b/getopt.c
  17. #   abc/bed/e1save.c abc/bio/i4grp.c abc/boot/Makefile.bsd
  18. #   abc/boot/README abc/btr/DEP abc/doc/ABCproject abc/ehdrs/getc.h
  19. #   abc/ehdrs/supr.h abc/ex/generate/follower.cts
  20. #   abc/ex/try/follower.cts abc/ihdrs/i0err.h abc/ihdrs/i3sou.h
  21. #   abc/keys/Makefile abc/keys/keydef.h abc/tc/README abc/tc/tc3.c
  22. #   abc/uhdrs/feat.h abc/uhdrs/os.h.gen abc/unix/DEP abc/unix/u1dir.c
  23. #   abc/unix/u1time.c
  24. # Wrapped by rsalz@litchi.bbn.com on Mon Dec 17 13:28:25 1990
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 23 (of 25)."'
  28. if test -f 'abc/README' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'abc/README'\"
  30. else
  31.   echo shar: Extracting \"'abc/README'\" \(2086 characters\)
  32.   sed "s/^X//" >'abc/README' <<'END_OF_FILE'
  33. XCopyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  34. X
  35. XHOW TO INSTALL ABC:
  36. X
  37. XYou will need 2.5 megabytes in total to compile and load the ABC system.
  38. XTo start type:
  39. X
  40. X        ./Setup
  41. X
  42. Xwhich will ask you some questions to set the ABC system up on your
  43. Xinstallation.  You can call "Setup" any number of times without spoiling
  44. Xfiles.  So run it once to see what questions you will be asked.  If you
  45. Xdon't know the answer to some question, you can run it again.
  46. X
  47. X        make makefiles
  48. X        make depend
  49. X
  50. Xwill construct simple makefiles and makefiles with dependencies,
  51. Xrespectively, in the relevant subdirectories.
  52. X
  53. X        make all
  54. X
  55. Xwill compile and load the ABC system, producing the "abc" command file and
  56. Xthe binaries and datafiles it needs locally in this directory.  You can
  57. Xtest the ABC interpreter with:
  58. X
  59. X        make examples
  60. X
  61. XThis runs some examples in ./ex. It does not test the ABC editor, however;
  62. Xthat can only be done interactively with
  63. X
  64. X        make try_editor
  65. X
  66. XConsult the sheet "HOW TO TRY THE ABC EDITOR" (also in ./README2).
  67. X
  68. XIf all is well and you want to make ABC public
  69. X
  70. X        make install
  71. X
  72. Xwill do some editing to get the right pathnames in, and install the "abc"
  73. Xshell command file, the "abc.1" manual file, and the auxiliary files in the
  74. Xdirectories you indicated during setup.  Finally
  75. X
  76. X        make clean
  77. X
  78. Xwill clean all intermediate object files from the source directories, and
  79. X
  80. X        make clobber
  81. X
  82. Xwill clean the automatically created makefiles from the subdirectories.
  83. X
  84. XIf you have made ABC public, all necessary files have been copied to the
  85. Xpublic places, and you can get rid of the entire ABC file system hierarchy
  86. Xyou extracted from the tape, if you want.
  87. X
  88. XIf there are any problems, don't panic. See ./Problems for advice.  Also
  89. Xedit the example Bug Report form in ./doc to communicate the problem to us.
  90. XWe can then send out diffs for fixed problems in the future.
  91. X
  92. XAbove all, we would be very grateful to receive any comments you have about
  93. Xthe setup procedure, or the ABC system in general, on how to make it easier
  94. Xto use.
  95. X
  96. XGood luck!
  97. END_OF_FILE
  98.   if test 2086 -ne `wc -c <'abc/README'`; then
  99.     echo shar: \"'abc/README'\" unpacked with wrong size!
  100.   fi
  101.   # end of 'abc/README'
  102. fi
  103. if test -f 'abc/README2' -a "${1}" != "-c" ; then 
  104.   echo shar: Will not clobber existing file \"'abc/README2'\"
  105. else
  106.   echo shar: Extracting \"'abc/README2'\" \(1775 characters\)
  107.   sed "s/^X//" >'abc/README2' <<'END_OF_FILE'
  108. XCopyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  109. X
  110. XHOW TO TRY THE ABC EDITOR:
  111. X
  112. XThe directory ./ex/try is here to try the ABC editor interactively.
  113. X
  114. XAfter a successful "make all" or "make examples" say:
  115. X
  116. X        make try_editor
  117. X
  118. Xto enter the ABC system.  (If you are cross-compiling, copy ./ex
  119. Xrecursively to the target machine and say:
  120. X
  121. X        cd ex
  122. X        TryEditor
  123. X
  124. Xyou should make sure that the "abc" command in your PATH.)
  125. X
  126. XAfter the ABC system has started up it will prompt for a command with
  127. X
  128. X        >>> ?
  129. X
  130. XSlowly type `s', then `t', (no capitals needed) and you should see the ABC
  131. Xeditor suggest the SELECT and START commands, respectively.  Now
  132. Xpress [TAB] to accept this last suggestion, and [RETURN] to enter the
  133. XSTART command to the ABC interpreter.  This command will prompt you for
  134. Xinput, with
  135. X
  136. X        ?
  137. X
  138. XJust enter a few lines of text, (which will be echoed), ending with an
  139. Xempty one (press [RETURN] immediately).  A short "poem" should be generated
  140. Xby the ABC interpreter.
  141. X
  142. XIf you are already familiar with the ABC language, you might try to edit
  143. Xthe START how-to by answering
  144. X
  145. X        >>> ?
  146. X
  147. Xwith
  148. X
  149. X        :START
  150. X
  151. XFor example, try to remove the SET RANDOM command, to get random
  152. Xresults on the same input.  Or make the unit delay the echoing of the text,
  153. Xentered by the user, until after the reading of the empty line.  For
  154. Xtesting purposes you should at least try the arrow keys to move the focus
  155. Xaround.
  156. X
  157. XYou can undo any change by pressing [BACKSPACE].
  158. XYou can get help with ? or [ESC]-?.
  159. XYou can leave the ABC editor with [ESC]-[ESC].
  160. XYou can leave "abc" by typing QUIT.
  161. X
  162. XFor more information, see the manual page "abc(1)" and "The ABC
  163. Xprogrammer's Handbook".
  164. X
  165. XSee the B Newsletter, issue 2, for a description of the "generate" program.
  166. END_OF_FILE
  167.   if test 1775 -ne `wc -c <'abc/README2'`; then
  168.     echo shar: \"'abc/README2'\" unpacked with wrong size!
  169.   fi
  170.   # end of 'abc/README2'
  171. fi
  172. if test -f 'abc/b/b1file.c' -a "${1}" != "-c" ; then 
  173.   echo shar: Will not clobber existing file \"'abc/b/b1file.c'\"
  174. else
  175.   echo shar: Extracting \"'abc/b/b1file.c'\" \(1866 characters\)
  176.   sed "s/^X//" >'abc/b/b1file.c' <<'END_OF_FILE'
  177. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  178. X
  179. X#include "b.h"
  180. X#include "bfil.h"
  181. X#include "bmem.h"
  182. X
  183. XVisible string messfile= (string) NULL;    /* error messages */
  184. XVisible string keysfile= (string) NULL;    /* key definitions */
  185. XVisible string helpfile= (string) NULL;    /* manual as help */
  186. X
  187. XVisible string permfile= PERMFILE;    /* saves links file name vs. abc name */
  188. XVisible string suggfile= SUGGFILE;    /* saves user suggestions */
  189. XVisible string posfile= POSFILE;    /* saves focus positions */
  190. XVisible string typesfile= TYPESFILE;    /* saves typecode's */
  191. X
  192. XVisible string buffile= BUFFILE;    /* saves copybuffer */
  193. X
  194. XVisible string wsgroupfile= WSGROUPFILE; 
  195. X                /* saves links workspace name vs. abc name */
  196. XVisible string curwsfile= CURWSFILE;    /* saves last workspace */
  197. X
  198. XVisible string tempfile= TEMPFILE;    /* temporary file */
  199. XVisible string temp1file= TEMP1FILE;    /* another temporary file */
  200. X
  201. XVisible string editor;            /* another editor (via command line) */
  202. X
  203. XVisible char *bwsdefault; /* full path name of the default group directory */
  204. XVisible char *startdir; /* full path name of the startup directory */
  205. X
  206. XVisible char *makepath(path1, path2) char *path1, *path2; {
  207. X    if (path1 == NULL || *path1 == '\0')
  208. X        return savepath(path2);
  209. X    else if (path2 == NULL || *path2 == '\0')
  210. X        return savepath(path1);
  211. X    else {
  212. X        char *path, *ppath;
  213. X        int len;
  214. X    
  215. X        len= strlen(path1) + 1 + strlen(path2);
  216. X        path= (char *) getmem((unsigned) (len+1));
  217. X        strcpy(path, path1);
  218. X        ppath= path + strlen(path);
  219. X        if (ppath[-1] == DELIM && *path2 == DELIM)
  220. X            --ppath;
  221. X        else if (ppath[-1] != DELIM && *path2 != DELIM)
  222. X            *ppath++= DELIM;
  223. X        strcpy(ppath, path2);
  224. X        return path;
  225. X    }
  226. X}
  227. X
  228. XVisible char *savepath(path) char *path; {
  229. X    if (path != NULL)
  230. X        return savestr(path);
  231. X    return (char *) NULL;
  232. X}
  233. X
  234. XVisible Procedure freepath(path) char *path; {
  235. X    if (path != NULL)
  236. X        freestr(path);
  237. X}
  238. END_OF_FILE
  239.   if test 1866 -ne `wc -c <'abc/b/b1file.c'`; then
  240.     echo shar: \"'abc/b/b1file.c'\" unpacked with wrong size!
  241.   fi
  242.   # end of 'abc/b/b1file.c'
  243. fi
  244. if test -f 'abc/b/getopt.c' -a "${1}" != "-c" ; then 
  245.   echo shar: Will not clobber existing file \"'abc/b/getopt.c'\"
  246. else
  247.   echo shar: Extracting \"'abc/b/getopt.c'\" \(1313 characters\)
  248.   sed "s/^X//" >'abc/b/getopt.c' <<'END_OF_FILE'
  249. X/* This file is slightly adapted from a public domain version. */
  250. X/* We need os.h for the index-strchr controversy. */
  251. X
  252. X#include "os.h"
  253. X
  254. X/*LINTLIBRARY*/
  255. X#define NULL    0
  256. X#define EOF    (-1)
  257. X#define ERR(s, c)    if(opterr){\
  258. X    extern int write();\
  259. X    char errbuf[2];\
  260. X    errbuf[0] = c; errbuf[1] = '\n';\
  261. X    VOID write(2, argv[0], (int)strlen(argv[0]));\
  262. X    VOID write(2, s, (int)strlen(s));\
  263. X    VOID write(2, errbuf, 2);}
  264. X
  265. Xint    opterr = 1;
  266. Xint    optind = 1;
  267. Xint    optopt;
  268. Xchar    *optarg;
  269. X
  270. Xint
  271. Xgetopt(argc, argv, opts)
  272. Xint    argc;
  273. Xchar    **argv, *opts;
  274. X{
  275. X    static int sp = 1;
  276. X    register int c;
  277. X    register char *cp;
  278. X
  279. X    if(sp == 1)
  280. X        if(optind >= argc ||
  281. X           argv[optind][0] != '-' || argv[optind][1] == '\0')
  282. X            return(EOF);
  283. X        else if(strcmp(argv[optind], "--") == NULL) {
  284. X            optind++;
  285. X            return(EOF);
  286. X        }
  287. X    optopt = c = argv[optind][sp];
  288. X    if(c == ':' || (cp=strchr(opts, c)) == NULL) {
  289. X        ERR(": illegal option -- ", c);
  290. X        if(argv[optind][++sp] == '\0') {
  291. X            optind++;
  292. X            sp = 1;
  293. X        }
  294. X        return('?');
  295. X    }
  296. X    if(*++cp == ':') {
  297. X        if(argv[optind][sp+1] != '\0')
  298. X            optarg = &argv[optind++][sp+1];
  299. X        else if(++optind >= argc) {
  300. X            ERR(": option requires an argument -- ", c);
  301. X            sp = 1;
  302. X            return('?');
  303. X        } else
  304. X            optarg = argv[optind++];
  305. X        sp = 1;
  306. X    } else {
  307. X        if(argv[optind][++sp] == '\0') {
  308. X            sp = 1;
  309. X            optind++;
  310. X        }
  311. X        optarg = NULL;
  312. X    }
  313. X    return(c);
  314. X}
  315. END_OF_FILE
  316.   if test 1313 -ne `wc -c <'abc/b/getopt.c'`; then
  317.     echo shar: \"'abc/b/getopt.c'\" unpacked with wrong size!
  318.   fi
  319.   # end of 'abc/b/getopt.c'
  320. fi
  321. if test -f 'abc/bed/e1save.c' -a "${1}" != "-c" ; then 
  322.   echo shar: Will not clobber existing file \"'abc/bed/e1save.c'\"
  323. else
  324.   echo shar: Extracting \"'abc/bed/e1save.c'\" \(2113 characters\)
  325.   sed "s/^X//" >'abc/bed/e1save.c' <<'END_OF_FILE'
  326. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  327. X
  328. X/*
  329. X * B editor -- Save Parse tree on file.
  330. X */
  331. X
  332. X#include "b.h"
  333. X#include "b0lan.h"
  334. X#include "bedi.h"
  335. X#include "etex.h"
  336. X#include "bmem.h"
  337. X#include "bobj.h"
  338. X#include "node.h"
  339. X#include "gram.h"
  340. X
  341. XHidden int spaces = 0; /* Saved-up spaces; emitted when non-blank found */
  342. X
  343. X/*
  344. X * Write the representation of a node.    If it has children,
  345. X * they are written by recursive calls.
  346. X */
  347. X
  348. XHidden Procedure savewalk(n, level, bp, fp) node n; int level;
  349. X        bufadm *bp; FILE *fp; {
  350. X    string *rp;
  351. X    string cp;
  352. X    int nch;
  353. X    int i;
  354. X    char c;
  355. X
  356. X    if (Is_etext(n)) {
  357. X        for (; spaces > 0; --spaces)
  358. X            bufpush(bp, ' ');
  359. X        bufcpy(bp, e_strval((value) n));
  360. X        return;
  361. X    }
  362. X    nch = nchildren(n);
  363. X    rp = noderepr(n);
  364. X    for (i = 0; i <= nch; ++i) {
  365. X        if (i)
  366. X            savewalk(child(n, i), level, bp, fp);
  367. X        cp = rp[i];
  368. X        if (!cp) continue;
  369. X        for (; c = *cp; ++cp) {
  370. X            switch (c) {
  371. X
  372. X            case '\n':
  373. X#if '\n' != '\r' /* This condition is TRUE in MPW C! */
  374. X            case '\r':
  375. X#endif
  376. X                bufpush(bp, '\n');
  377. X                if (fp) {
  378. X                    bufpush(bp, '\0');
  379. X                    fputs(bp->buf, fp);
  380. X                    bufreinit(bp);
  381. X                }
  382. X                if (c == '\n')
  383. X                    for (i = level; i > 0; --i)
  384. X                        bufcpy(bp, Indent);
  385. X                spaces = 0;
  386. X                break;
  387. X
  388. X            case '\b':
  389. X                --level;
  390. X                break;
  391. X
  392. X            case '\t':
  393. X                ++level;
  394. X                break;
  395. X
  396. X            case ' ':
  397. X                ++spaces;
  398. X                break;
  399. X
  400. X            default:
  401. X                for (; spaces > 0; --spaces)
  402. X                    bufpush(bp, ' ');
  403. X                bufpush(bp, c);
  404. X                break;
  405. X            }
  406. X        }
  407. X    }
  408. X}
  409. X
  410. XVisible bool save(p, filename) path p; string filename; {
  411. X    bufadm b, *bp;
  412. X    FILE *fp = fopen(filename, "w");
  413. X    
  414. X    if (!fp) return No;
  415. X    bp= &b;
  416. X    bufinit(bp);
  417. X    sendsave(p, bp, fp);
  418. X    bufpush(bp, '\0');
  419. X    fputs(bp->buf, fp);
  420. X    buffree(bp);
  421. X    return fclose(fp) != EOF;
  422. X}
  423. X
  424. X
  425. XHidden Procedure sendsave(p, bp, fp) path p; bufadm *bp; FILE *fp; {
  426. X    p = pathcopy(p);
  427. X    top(&p);
  428. X    spaces = 0;
  429. X    savewalk(tree(p), 0, bp, fp);
  430. X    bufpush(bp, '\n');
  431. X    pathrelease(p);
  432. X}
  433. X
  434. X/*
  435. X * Interface to top level.
  436. X */
  437. X
  438. XVisible char *send(p) path p; {
  439. X    char *res;
  440. X    bufadm b, *bp;
  441. X    
  442. X    bp= &b;
  443. X    bufinit(bp);
  444. X    sendsave(p, bp, (FILE *)NULL);
  445. X    bufpush(bp, '\0');
  446. X    res= savestr(bp->buf);
  447. X    buffree(bp);
  448. X    return res;
  449. X}
  450. X
  451. END_OF_FILE
  452.   if test 2113 -ne `wc -c <'abc/bed/e1save.c'`; then
  453.     echo shar: \"'abc/bed/e1save.c'\" unpacked with wrong size!
  454.   fi
  455.   # end of 'abc/bed/e1save.c'
  456. fi
  457. if test -f 'abc/bio/i4grp.c' -a "${1}" != "-c" ; then 
  458.   echo shar: Will not clobber existing file \"'abc/bio/i4grp.c'\"
  459. else
  460.   echo shar: Extracting \"'abc/bio/i4grp.c'\" \(2117 characters\)
  461.   sed "s/^X//" >'abc/bio/i4grp.c' <<'END_OF_FILE'
  462. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  463. X
  464. X#include "b.h"
  465. X#include "bfil.h"
  466. X#include "bobj.h"
  467. X#include "i3bws.h"    
  468. X#include "i3sou.h"
  469. X#include "i4bio.h"
  470. X
  471. X/* code to recover the index of a group of workspaces */
  472. X
  473. XVisible bool gr_recovered= No;
  474. X
  475. XHidden bool rec_ok= Yes;
  476. X
  477. XHidden value newgroup;
  478. X
  479. XVisible Procedure rec_wsgroup() {
  480. X    value lis, dname;
  481. X    value k, len, m;
  482. X
  483. X    gr_recovered= No;
  484. X    rec_ok= Yes;
  485. X    
  486. X    newgroup= mk_elt();
  487. X    
  488. X    lis= get_names(bwsdir, abcworkspace);
  489. X    k= one; len= size(lis);
  490. X    while (numcomp(k, len) <= 0) {
  491. X        dname= item(lis, k);
  492. X        rec_dirname(dname);
  493. X        release(dname);
  494. X        k= sum(m= k, one);
  495. X        release(m);
  496. X    }
  497. X    release(k); release(len);
  498. X    release(lis);
  499. X
  500. X    rec_curlast();
  501. X    
  502. X    release(ws_group);
  503. X    ws_group= newgroup;
  504. X    groupchanges= Yes;
  505. X    
  506. X    gr_recovered= Yes;
  507. X}
  508. X
  509. XHidden Procedure rec_dirname(dname) value dname; {
  510. X    value name;
  511. X    intlet k, len;
  512. X    
  513. X    /* try to find a name via the old index table */
  514. X    name= Vnil;
  515. X    len= Valid(ws_group) ? length(ws_group) : 0;
  516. X    for (k= 0; k<len; ++k) {
  517. X        if (compare(*assoc(ws_group, k), dname) == 0) {
  518. X            name= copy(*key(ws_group, k));
  519. X            if (is_wsname(name))
  520. X                break;
  521. X            release(name); name= Vnil;
  522. X        }
  523. X    }
  524. X    if (!Valid(name)) { /* make a new name */
  525. X        char *base= sstrval(dname);
  526. X        name= mkabcname(base);
  527. X        fstrval(base);
  528. X    }
  529. X    if (!is_abcname(name)) {
  530. X        grperrV(G_DNAME, dname);
  531. X        release(name);
  532. X        return;
  533. X    }
  534. X    mk_groupentry(name, dname);
  535. X    release(name);
  536. X}
  537. X
  538. XHidden bool is_wsname(name) value name; {
  539. X    if (!is_abcname(name))
  540. X        return No;
  541. X    if (compare(name, curwskey) == 0 || compare(name, lastwskey) == 0)
  542. X        return No;
  543. X    return Yes;
  544. X}
  545. X
  546. XHidden Procedure mk_groupentry(name, dname) value name, dname; {
  547. X    if (in_keys(name, newgroup)) {
  548. X        grperrV(G_EXIST, dname);
  549. X        return;
  550. X    }
  551. X    replace(dname, &newgroup, name);
  552. X}
  553. X
  554. XHidden Procedure rec_curlast() {
  555. X    value *aa;
  556. X    if (!Valid(ws_group))
  557. X        return;
  558. X    if (in_env(ws_group, curwskey, &aa))
  559. X        replace(*aa, &newgroup, curwskey);
  560. X    if (in_env(ws_group, lastwskey, &aa))
  561. X        replace(*aa, &newgroup, lastwskey);
  562. X}
  563. X
  564. XHidden Procedure grperrV(m, v) int m; value v; {
  565. X    if (rec_ok) {
  566. X        bioerr(G_ERROR);
  567. X        rec_ok= No;
  568. X    }
  569. X    bioerrV(m, v);
  570. X}
  571. END_OF_FILE
  572.   if test 2117 -ne `wc -c <'abc/bio/i4grp.c'`; then
  573.     echo shar: \"'abc/bio/i4grp.c'\" unpacked with wrong size!
  574.   fi
  575.   # end of 'abc/bio/i4grp.c'
  576. fi
  577. if test -f 'abc/boot/Makefile.bsd' -a "${1}" != "-c" ; then 
  578.   echo shar: Will not clobber existing file \"'abc/boot/Makefile.bsd'\"
  579. else
  580.   echo shar: Extracting \"'abc/boot/Makefile.bsd'\" \(1989 characters\)
  581.   sed "s/^X//" >'abc/boot/Makefile.bsd' <<'END_OF_FILE'
  582. X#
  583. X# BSD Makefile for booting grammar tables with mktable from grammar file.
  584. X#
  585. X
  586. X# --- Where to install the stuff ---
  587. X
  588. XCFILE=../bed/e1tabl.c
  589. XHFILE=../ehdrs/tabl.h
  590. X
  591. X# --- What is the C preprocessor called ---
  592. X#
  593. X# ../scripts/mkdep has the right CPP if Setup succeeded and your UNIX ain't BSD
  594. X
  595. XCPP=    /bin/cc -E
  596. X
  597. X# --- Flags to the C compiler ---
  598. X
  599. XBINCL=    -I../bhdrs -I../ehdrs -I../uhdrs
  600. XDEFS=    -DNDEBUG -DBSD
  601. XCFLAGS= -O $(DEFS) $(BINCL)
  602. XLDFLAGS=-s
  603. XLIBS=    
  604. XGDEFS=
  605. X
  606. X# --- Stuff for lint ---
  607. X
  608. XLINT=        lint
  609. XLINTFLAGS=    -abh
  610. XLBINCL=        $(BINCL)
  611. X
  612. X# --- Relevant files ---
  613. X
  614. XOBJS=    main.o alloc.o read.o fill.o comp.o dump.o code.o
  615. X
  616. XSRCS=    main.c alloc.c read.c fill.c comp.c dump.c ../bed/e1code.c
  617. X
  618. XHDRS=    ../bhdrs/b.h main.h ../ehdrs/code.h lang.h
  619. X
  620. X# --- Main entries of the makefile ---
  621. X
  622. Xall: tabl.c.out tabl.h.out
  623. X
  624. Xtabl.c.out tabl.h.out: grammar mktable
  625. X    mktable -g grammar -h tabl.h -t tabl.c.out -i tabl.h.out
  626. X
  627. Xgrammar: grammar.abc lang.h
  628. X    $(CPP) $(GDEFS) grammar.abc 2>/dev/null | sed -e "/^$$/d" -e "/^#/d" >grammar
  629. X
  630. Xmktable: $(OBJS)
  631. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o mktable
  632. X
  633. Xinstall: $(CFILE) $(HFILE)
  634. X
  635. X$(CFILE): tabl.c.out
  636. X    cp tabl.c.out $(CFILE)
  637. X
  638. X$(HFILE): tabl.h.out
  639. X    cp tabl.h.out $(HFILE)
  640. X
  641. Xclean:
  642. X    rm -f *.o mktable grammar tabl.c.out tabl.h.out tabl.c tabl.h
  643. X
  644. Xclobber: clean
  645. X    rm -f lint tags
  646. X
  647. Xcode.o: ../bed/e1code.c
  648. X    $(CC) -c $(CFLAGS) ../bed/e1code.c -o code.o
  649. X
  650. X# --- Utilities for the programmer ---
  651. X
  652. Xmflags:
  653. X    echo MFLAGS=\"$(MFLAGS)\", MAKEFLAGS=\"$(MAKEFLAGS)\"
  654. X
  655. X# If your UNIX isn't BSD4.2 or higher, use:
  656. X# MKDEP=../scripts/mkdep
  657. XMKDEP=$(CC) -M
  658. X
  659. XMakefile: ALWAYS
  660. X    rm -f Makefile
  661. X    (echo "# EDIT MY ANCESTOR Makefile.bsd"; \
  662. X     echo "# AND SAY 'make -f Makefile.bsd Makefile'"; \
  663. X     cat Makefile.bsd; \
  664. X     $(MKDEP) $(DEFS) $(BINCL) $(SRCS); \
  665. X    ) >Makefile
  666. X
  667. Xlint:    $(SRCS) $(HDRS)
  668. X    $(LINT) $(LINTFLAGS) $(DEFS) $(LBINCL) $(SRCS) >lint
  669. X
  670. Xtags:    $(HDRS) $(SRCS)
  671. X    rm -f tags
  672. X    ctags $(HDRS) $(SRCS)
  673. X
  674. Xtest:    all
  675. X    cp tabl.h.out tabl.h
  676. X    cp tabl.c.out tabl.c
  677. X    cc -c $(CFLAGS) tabl.c
  678. X
  679. XALWAYS:    #dummy
  680. X
  681. X###
  682. END_OF_FILE
  683.   if test 1989 -ne `wc -c <'abc/boot/Makefile.bsd'`; then
  684.     echo shar: \"'abc/boot/Makefile.bsd'\" unpacked with wrong size!
  685.   fi
  686.   # end of 'abc/boot/Makefile.bsd'
  687. fi
  688. if test -f 'abc/boot/README' -a "${1}" != "-c" ; then 
  689.   echo shar: Will not clobber existing file \"'abc/boot/README'\"
  690. else
  691.   echo shar: Extracting \"'abc/boot/README'\" \(1407 characters\)
  692.   sed "s/^X//" >'abc/boot/README' <<'END_OF_FILE'
  693. XThe purpose of this directory is to generate the grammar tables for
  694. Xthe ABC editor in ../bed/e1tabl.c and ../ehdrs/tabl.h from a more or
  695. Xless readable description in ./grammar.abc (also using ./lang.h).
  696. X
  697. XThe ABC system is set up such that you can do without this directory.
  698. X
  699. XHowever, if you want to make a version of ABC with KEYWORDS in another
  700. Xlanguage, you only need to change ./lang.h and say 'make install' here.
  701. X(You might have to change the name of the C preprocessor in the Makefile.)
  702. XThis will install new versions of ../bed/e1tabl.c and ../ehdrs/tabl.h,
  703. Xincorporating the new grammar info.
  704. XYou should also change ../bhdrs/b0lan.h and bint2/i2dis.c 
  705. Xfor the ABC interpreter.
  706. XThen you can 'cd ..' and remake the ABC system.
  707. X
  708. XLikewise if for whatever reason you only change the grammar file,
  709. Xit is sufficient to say 'make install' here, and remake in '..'.
  710. X
  711. XThe ABC grammar is in the file grammar.abc.
  712. XThe format of this file is decribed in its heading.
  713. X
  714. XThe rest of the files here (together with some files from elsewhere in
  715. Xthe ABC system) are sources for the program 'mktable' that generates the
  716. Xinclude- and data-file.
  717. XIf you change anything in them you might have to recreate the
  718. Xdependencies in the Makefile with 'make -f Makefile.bsd Makefile'.
  719. XSee ../Makefile.unix, ../scripts/mkdep and ../Problems if your system cannot
  720. Xcope with the BSD-ism 'cc -M' for generating dependency info for make.
  721. END_OF_FILE
  722.   if test 1407 -ne `wc -c <'abc/boot/README'`; then
  723.     echo shar: \"'abc/boot/README'\" unpacked with wrong size!
  724.   fi
  725.   # end of 'abc/boot/README'
  726. fi
  727. if test -f 'abc/btr/DEP' -a "${1}" != "-c" ; then 
  728.   echo shar: Will not clobber existing file \"'abc/btr/DEP'\"
  729. else
  730.   echo shar: Extracting \"'abc/btr/DEP'\" \(1392 characters\)
  731.   sed "s/^X//" >'abc/btr/DEP' <<'END_OF_FILE'
  732. Xe1etex.o: e1etex.c
  733. Xe1etex.o: ../bhdrs/b.h
  734. Xe1etex.o: ../uhdrs/osconf.h
  735. Xe1etex.o: ../uhdrs/os.h
  736. Xe1etex.o: ../uhdrs/conf.h
  737. Xe1etex.o: ../uhdrs/config.h
  738. Xe1etex.o: ../bhdrs/bedi.h
  739. Xe1etex.o: ../bhdrs/bobj.h
  740. Xe1etex.o: ./etex.h
  741. Xe1etex.o: ../bhdrs/bmem.h
  742. Xi1btr.o: i1btr.c
  743. Xi1btr.o: ../bhdrs/b.h
  744. Xi1btr.o: ../uhdrs/osconf.h
  745. Xi1btr.o: ../uhdrs/os.h
  746. Xi1btr.o: ../uhdrs/conf.h
  747. Xi1btr.o: ../uhdrs/config.h
  748. Xi1btr.o: ../bhdrs/bmem.h
  749. Xi1btr.o: ./i1btr.h
  750. Xi1btr.o: ./i1tlt.h
  751. Xi1lta.o: i1lta.c
  752. Xi1lta.o: ../bhdrs/b.h
  753. Xi1lta.o: ../uhdrs/osconf.h
  754. Xi1lta.o: ../uhdrs/os.h
  755. Xi1lta.o: ../uhdrs/conf.h
  756. Xi1lta.o: ../uhdrs/config.h
  757. Xi1lta.o: ../bhdrs/bobj.h
  758. Xi1lta.o: ./i1btr.h
  759. Xi1lta.o: ../ihdrs/i3scr.h
  760. Xi1lta.o: ./i1tlt.h
  761. Xi1obj.o: i1obj.c
  762. Xi1obj.o: ../bhdrs/b.h
  763. Xi1obj.o: ../uhdrs/osconf.h
  764. Xi1obj.o: ../uhdrs/os.h
  765. Xi1obj.o: ../uhdrs/conf.h
  766. Xi1obj.o: ../uhdrs/config.h
  767. Xi1obj.o: ../bhdrs/bmem.h
  768. Xi1obj.o: ../bhdrs/bobj.h
  769. Xi1obj.o: ./i1btr.h
  770. Xi1obj.o: ./i1tlt.h
  771. Xi1obj.o: ../ihdrs/i3typ.h
  772. Xi1tex.o: i1tex.c
  773. Xi1tex.o: ../bhdrs/b.h
  774. Xi1tex.o: ../uhdrs/osconf.h
  775. Xi1tex.o: ../uhdrs/os.h
  776. Xi1tex.o: ../uhdrs/conf.h
  777. Xi1tex.o: ../uhdrs/config.h
  778. Xi1tex.o: ../bhdrs/bmem.h
  779. Xi1tex.o: ../bhdrs/bobj.h
  780. Xi1tex.o: ./i1btr.h
  781. Xi1tex.o: ./i1tlt.h
  782. Xi1tlt.o: i1tlt.c
  783. Xi1tlt.o: ../bhdrs/b.h
  784. Xi1tlt.o: ../uhdrs/osconf.h
  785. Xi1tlt.o: ../uhdrs/os.h
  786. Xi1tlt.o: ../uhdrs/conf.h
  787. Xi1tlt.o: ../uhdrs/config.h
  788. Xi1tlt.o: ../uhdrs/feat.h
  789. Xi1tlt.o: ../bhdrs/bobj.h
  790. Xi1tlt.o: ./i1btr.h
  791. Xi1tlt.o: ./i1tlt.h
  792. END_OF_FILE
  793.   if test 1392 -ne `wc -c <'abc/btr/DEP'`; then
  794.     echo shar: \"'abc/btr/DEP'\" unpacked with wrong size!
  795.   fi
  796.   # end of 'abc/btr/DEP'
  797. fi
  798. if test -f 'abc/doc/ABCproject' -a "${1}" != "-c" ; then 
  799.   echo shar: Will not clobber existing file \"'abc/doc/ABCproject'\"
  800. else
  801.   echo shar: Extracting \"'abc/doc/ABCproject'\" \(1681 characters\)
  802.   sed "s/^X//" >'abc/doc/ABCproject' <<'END_OF_FILE'
  803. X# Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  804. X
  805. X================================================================
  806. X=         The ABC programming language and environment.        =
  807. X================================================================
  808. X
  809. XAuthors:    Frank van Dijk
  810. X        Leo Geurts
  811. X        Timo Krijnen
  812. X        Lambert Meertens
  813. X        Steven Pemberton
  814. X        Guido van Rossum
  815. X
  816. X        Centrum voor Wiskunde en Informatica / AA
  817. X        POB 4079
  818. X        1900 AB  Amsterdam
  819. X        The Netherlands
  820. X
  821. XNet address:    abc@cwi.nl   (mcvax!abc.uucp for older mailers)
  822. X
  823. XDescription:
  824. X
  825. XABC is a programming language and environment for personal computing
  826. Xdesigned and implemented at the CWI.
  827. XWe have tried to combine attractive features in existing systems
  828. Xwith some ideas of our own.
  829. X
  830. XSome features of the ABC programming language are:
  831. X * a powerful collection of only five different data types
  832. X   that may easily be combined;
  833. X * strong typing, yet without declarations;
  834. X * no limitations, apart from sheer exhaustion of memory;
  835. X * refinements to support top-down programming;
  836. X * nesting by indentation.
  837. X
  838. XSome features of the ABC environment are:
  839. X * no need for files; how-to's (procedures and functions) and global
  840. X   variables remain after logging out;
  841. X * one consistent face is shown to the user at all times,
  842. X   whether she executes commands, edits how-to's, or enters input to
  843. X   a program;
  844. X * generalized undo mechanism.
  845. X
  846. XFor full details see:
  847. X
  848. X    Leo Geurts, Lambert Meertens, Steven Pemberton,
  849. X    The ABC Programmer's Handbook,
  850. X    Prentice-Hall, Englewood Cliffs, New Jersey, 1989,
  851. X    ISBN 0-13-000027-2.
  852. X
  853. XAvailable free from CWI is THE ABC NEWSLETTER.
  854. XJust send a note to one of the above addresses for your subscription.
  855. END_OF_FILE
  856.   if test 1681 -ne `wc -c <'abc/doc/ABCproject'`; then
  857.     echo shar: \"'abc/doc/ABCproject'\" unpacked with wrong size!
  858.   fi
  859.   # end of 'abc/doc/ABCproject'
  860. fi
  861. if test -f 'abc/ehdrs/getc.h' -a "${1}" != "-c" ; then 
  862.   echo shar: Will not clobber existing file \"'abc/ehdrs/getc.h'\"
  863. else
  864.   echo shar: Extracting \"'abc/ehdrs/getc.h'\" \(507 characters\)
  865.   sed "s/^X//" >'abc/ehdrs/getc.h' <<'END_OF_FILE'
  866. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  867. X
  868. Xextern Procedure initkeys();
  869. X
  870. Xtypedef struct tabent {
  871. X    int code;
  872. X    string name;
  873. X    string def;
  874. X    string rep;
  875. X} tabent;
  876. X
  877. Xextern struct tabent deftab[];
  878. Xextern int ndefs;         /* number of entries in deftab */
  879. X
  880. X#ifdef KEYS
  881. X
  882. X#define MAXDEFS 200
  883. X#define MAXNEWDEFS 100
  884. Xextern int ddefs;         /* idem, before processing of keydefsfile */
  885. X
  886. X#else
  887. X
  888. X#define MAXDEFS 100
  889. Xextern Procedure initgetc();
  890. Xextern Procedure endgetc();
  891. Xextern int inchar();
  892. X
  893. X#endif
  894. END_OF_FILE
  895.   if test 507 -ne `wc -c <'abc/ehdrs/getc.h'`; then
  896.     echo shar: \"'abc/ehdrs/getc.h'\" unpacked with wrong size!
  897.   fi
  898.   # end of 'abc/ehdrs/getc.h'
  899. fi
  900. if test -f 'abc/ehdrs/supr.h' -a "${1}" != "-c" ; then 
  901.   echo shar: Will not clobber existing file \"'abc/ehdrs/supr.h'\"
  902. else
  903.   echo shar: Extracting \"'abc/ehdrs/supr.h'\" \(2335 characters\)
  904.   sed "s/^X//" >'abc/ehdrs/supr.h' <<'END_OF_FILE'
  905. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  906. X
  907. X/*
  908. X * B editor -- Superstructure for fine focusing.
  909. X */
  910. X
  911. X/*
  912. X * Interpretation of s1, s2, s3 of focus (where n == tree(ep->focus)):
  913. X *
  914. X * s:    1    2    3    4    5    6    7    8    9
  915. X *    fixed    varia    fixed    varia    fixed    varia    fixed    varia    fixed
  916. X *
  917. X * the fixed fields are the r_repr[i] fields of grammar rule table[symbol(n)],
  918. X * with i == s/2 (and i is odd), thus:
  919. X *
  920. X *    repr[0]        repr[1]        repr[2]        repr[3]        repr[4]
  921. X *
  922. X * the variable fields are the children of the node, with i == s/2 and s even:
  923. X *
  924. X *        child(n,1)    child(n,2)    child(n,3)    child(n,4)
  925. X *
  926. X * (and child(n,i) == n->n_child[i-1]:-)
  927. X *
  928. X * Interpretation of mode of focus:
  929. X *
  930. X * WHOLE: whole node is the focus;
  931. X * SUBSET: s1/2, s2/2 are first and last child number under focus;
  932. X *          odd means fixed text, even means child node;
  933. X * SUBRANGE: focus is part of fixed text or child; in C terms:
  934. X *          s1 odd: repr[s1/2][s2..s3];
  935. X *          s1 even: e_strval(child(n, s1/2))[s2..s3];
  936. X * VHOLE: s1/2 is fixed text number; volatile hole before char s2;
  937. X *          if s1 is even, ditto for child which must be "text".
  938. X * ATEND: a volatile hole just after the entire node.
  939. X * ATBEGIN: ditto just before it.
  940. X * SUBLIST: s3 indicates how many times downrite() bring us
  941. X *          beyond the focus (i.e., the focus is the subtree below
  942. X *          ep->focus EXCLUDING the subtree reached after s3 times
  943. X *          downrite().  Note s3 > 0.
  944. X * FHOLE: Like VHOLE but in Fixed text.
  945. X *
  946. X * It is assumed that if the focus is a substring of fixed text
  947. X * (SUBRANGE, VHOLE), it does not begin or end with lay-out of spaces.
  948. X */
  949. X
  950. X#define WHOLE    'W'
  951. X#define SUBSET    'S'
  952. X#define SUBRANGE    'R'
  953. X#define VHOLE    'V'
  954. X#define ATEND    'E'
  955. X#define ATBEGIN    'B'
  956. X#define SUBLIST    'L'
  957. X#define FHOLE    'F'
  958. X
  959. Xtypedef struct {
  960. X    path focus;
  961. X    char mode;
  962. X    char /*bool*/ copyflag;
  963. X    char /*bool*/ spflag;
  964. X    char /*bool*/ changed;
  965. X    short /*0..2*MAXCHILD+1*/ s1;
  966. X    short s2;
  967. X    short s3;
  968. X    short highest;
  969. X    value copybuffer; /* Actually, a queue */
  970. X    value oldmacro; /* A text */
  971. X    value newmacro; /* A text, too */
  972. X    int generation;
  973. X} environ;
  974. X
  975. X#ifdef STRUCTASS
  976. X#define Emove(e1, e2) ((e2) = (e1))
  977. X#else /* !STRUCTASS */
  978. X#define Emove(e1, e2) emove(&(e1), &(e2))
  979. X#endif /* !STRUCTASS */
  980. X#define Ecopy(e1, e2) ecopy(&(e1), &(e2))
  981. X#define Erelease(e) erelease(&(e))
  982. X
  983. Xbool ishole();
  984. END_OF_FILE
  985.   if test 2335 -ne `wc -c <'abc/ehdrs/supr.h'`; then
  986.     echo shar: \"'abc/ehdrs/supr.h'\" unpacked with wrong size!
  987.   fi
  988.   # end of 'abc/ehdrs/supr.h'
  989. fi
  990. if test -f 'abc/ex/generate/follower.cts' -a "${1}" != "-c" ; then 
  991.   echo shar: Will not clobber existing file \"'abc/ex/generate/follower.cts'\"
  992. else
  993.   echo shar: Extracting \"'abc/ex/generate/follower.cts'\" \(1197 characters\)
  994.   sed "s/^X//" >'abc/ex/generate/follower.cts' <<'END_OF_FILE'
  995. X{[" ","M"]:{"a"};[" ","a"]:{" "; "s"};[" ","e"]:{"v"};[" ","f"]:{"l"};[" ","g"]:{"o"};[" ","h"]:{"a"};[" ","l"]:{"a"; "a"; "i"};[" ","s"]:{"n"; "u"};[" ","t"]:{"h"; "o"};[" ","w"]:{"a"; "a"; "e"; "h"};["A","n"]:{"d"};["I","t"]:{"s"};["M","a"]:{"r"; "r"};["T","h"]:{"a"};["a"," "]:{"l"};["a","d"]:{" "};["a","m"]:{"b"; "b"};["a","r"]:{"y"; "y"};["a","s"]:{" "; " "; " "};["a","t"]:{" "; " "};["b"," "]:{"w"};["c","e"]:{" "};["d"," "]:{"a"; "e"};["e"," "]:{"a"; "l"; "t"; "t"; "w"};["e","c"]:{"e"};["e","e"]:{"c"};["e","n"]:{"t"};["e","r"]:{"e"; "y"};["e","v"]:{"e"};["f","l"]:{"e"};["g","o"]:{"."};["h","a"]:{"d"; "t"; "t"};["h","e"]:{"r"};["h","i"]:{"t"};["i","t"]:{"e"; "t"};["l","a"]:{"m"; "m"};["l","e"]:{" "; "e"};["l","i"]:{"t"};["m","b"]:{" "; ","};["n","d"]:{" "};["n","o"]:{"w"};["n","t"]:{","};["o"," "]:{"g"};["o","w"]:{","};["r","e"]:{" "; " "};["r","y"]:{" "; " "; "w"};["s"," "]:{"f"; "s"; "s"; "w"};["s","n"]:{"o"};["s","u"]:{"r"};["t"," "]:{"M"; "l"};["t","e"]:{" "};["t","!
  996. Xh"]:{"a"};["t","l"]:{"e"};["t","o"
  997. X
  998. X
  999. X
  1000. X
  1001. X]:{" "};["t","s"]:{" "};["t","t"]:{"l"};["u","r"]:{"e"};["v","e"]:{"r"};["w","a"]:{"s"; "s"};["w","e"]:{"n"};["w","h"]:{"e"; "i"};["y"," "]:{"h"; "w"};["y","w"]:{"h"}}
  1002. END_OF_FILE
  1003.   if test 1197 -ne `wc -c <'abc/ex/generate/follower.cts'`; then
  1004.     echo shar: \"'abc/ex/generate/follower.cts'\" unpacked with wrong size!
  1005.   fi
  1006.   # end of 'abc/ex/generate/follower.cts'
  1007. fi
  1008. if test -f 'abc/ex/try/follower.cts' -a "${1}" != "-c" ; then 
  1009.   echo shar: Will not clobber existing file \"'abc/ex/try/follower.cts'\"
  1010. else
  1011.   echo shar: Extracting \"'abc/ex/try/follower.cts'\" \(1407 characters\)
  1012.   sed "s/^X//" >'abc/ex/try/follower.cts' <<'END_OF_FILE'
  1013. X{[" ","b"]:{"a"; "e"; "e"};[" ","c"]:{"o"};[" ","d"]:{"e"; "u"};[" ","e"]:{"e"; "e"; "r"};[" ","g"]:{"a"};[" ","h"]:{"e"};[" ","l"]:{"a"; "a"};[" ","m"]:{"a"};[" ","t"]:{"o"};[" ","w"]:{"e"; "i"};[" ","z"]:{"e"; "i"};["a","a"]:{"m"; "n"; "r"; "r"};["a","b"]:{"c"};["a","g"]:{" "};["a","l"]:{" "};["a","m"]:{"."};["a","n"]:{" "; "g"; "g"; "g"};["a","r"]:{" "; "v"};["b","a"]:{"n"};["b","c"]:{" "};["b","e"]:{"e"; "e"};["c"," "]:{"m"};["c","h"]:{" "};["c","o"]:{"n"};["d","a"]:{"a"};["d","e"]:{" "};["d","u"]:{"u"};["e"," "]:{"b"; "c"; "l"};["e","e"]:{"n"; "n"; "r"; "t"; "t"};["e","n"]:{" "; " "; "."};["e","r"]:{" "; " "; "s"};["e","s"]:{" "};["e","t"]:{" "; "j"; "j"};["e","z"]:{"e"};["g"," "]:{"e"};["g","a"]:{"a"};["g","z"]:{"a"};["h"," "]:{"e"};["h","e"]:{"t"};["i","e"]:{"s"};["i","j"]:{" "; "n"};["j"," "]:{"t"};["j","e"]:{" "; " "};["j","n"]:{" "};["l"," "]:{"d"};["l","a"]:{"n"; "n"};["m","a"]:{"a"; "g"};["n"," "]:{"b"; "b"; "w"; "z"};["n","g"]:{"."; "."; "z"};["n","v"]:{"e"};["!
  1014. Xo","c"]:{"h"};["o","n"]:{"v"};["o"
  1015. X
  1016. X
  1017. X
  1018. X
  1019. X,"o"]:{"r"; "r"};["o","r"]:{" "; "a"};["r"," "]:{"h"; "l"; "w"; "z"};["r","a"]:{"l"};["r","s"]:{"i"};["r","t"]:{" "};["r","v"]:{"o"};["s"," "]:{"g"};["s","i"]:{"e"};["t"," "]:{"d"; "e"};["t","j"]:{"e"; "e"};["t","o"]:{"c"};["u","r"]:{"t"};["u","u"]:{"r"};["v","e"]:{"r"};["v","o"]:{"o"; "o"};["w","e"]:{"z"};["w","i"]:{"j"};["z","a"]:{"a"};["z","e"]:{"e"; "n"};["z","i"]:{"j"}}
  1020. END_OF_FILE
  1021.   if test 1407 -ne `wc -c <'abc/ex/try/follower.cts'`; then
  1022.     echo shar: \"'abc/ex/try/follower.cts'\" unpacked with wrong size!
  1023.   fi
  1024.   # end of 'abc/ex/try/follower.cts'
  1025. fi
  1026. if test -f 'abc/ihdrs/i0err.h' -a "${1}" != "-c" ; then 
  1027.   echo shar: Will not clobber existing file \"'abc/ihdrs/i0err.h'\"
  1028. else
  1029.   echo shar: Extracting \"'abc/ihdrs/i0err.h'\" \(1676 characters\)
  1030.   sed "s/^X//" >'abc/ihdrs/i0err.h' <<'END_OF_FILE'
  1031. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1986. */
  1032. X
  1033. X/* i1fun.c, i1nua.c, i1nur.c */
  1034. X
  1035. X#define ZERO_DIVIDE    MESS(1800, "in i/j, j is zero")
  1036. X#define NEG_POWER    MESS(1801, "in 0**y or y root 0, y is negative")
  1037. X#define NEG_EVEN    MESS(1802, "in x**(p/q) or (q/p) root x, x is negative and q is even")
  1038. X#define NEG_EXACT    MESS(1803, "in x**y or y root x, x is negative and y is not exact")
  1039. X
  1040. X/* i2exp.c, i2fix.c, i2tes.c */
  1041. X
  1042. X#define PRIO        MESS(1804, "ambiguous expression; please use ( and ) to resolve")
  1043. X#define NO_EXPR        MESS(1805, "no expression where expected")
  1044. X#define NO_TEST        MESS(1806, "no test where expected")
  1045. X#define UPTO_EXPR     MESS(1807, "something unexpected in expression")
  1046. X#define UPTO_TEST     MESS(1808, "something unexpected in test")
  1047. X#define NO_TRIM_TARG    MESS(1809, "misformed address")
  1048. X
  1049. X/* i2gen.c, i2fix.c */
  1050. X
  1051. X#define NO_INIT_OR_DEF    MESS(1810, "%s hasn't been initialised or (properly) defined")
  1052. X#define NO_DEFINITION    MESS(1811, "%s hasn't been (properly) defined")
  1053. X
  1054. X/* i3in2.c */
  1055. X
  1056. X#define NO_VALUE    MESS(1812, "%s has not yet received a value")
  1057. X
  1058. X/* i2gen.c, i3int.c */
  1059. X
  1060. X#define YIELD_NO_RETURN    MESS(1813, "function returns no value")
  1061. X#define TEST_NO_REPORT    MESS(1814, "predicate reports no outcome")
  1062. X
  1063. X/* i2gen.c, i2ana.c */
  1064. X
  1065. X#define REF_NO_TARGET    MESS(1815, "a refinement may not be used as an address")
  1066. X#define BAD_WHILE    MESS(1816, "bad node in while")
  1067. X#define BAD_TESTSUITE    MESS(1817, "bad node in testsuite")
  1068. X
  1069. X/* i2cmd.c, i2uni.c */
  1070. X#define WRONG_INDENT    MESS(1818, "indentation not used consistently")
  1071. X#define SMALL_INDENT    MESS(1819, "indentation must be at least 2")
  1072. X
  1073. X/* i3loc.c, i3sta.c */
  1074. X
  1075. X#define SEL_NO_TABLE    MESS(1820, "selection on non-table")
  1076. END_OF_FILE
  1077.   if test 1676 -ne `wc -c <'abc/ihdrs/i0err.h'`; then
  1078.     echo shar: \"'abc/ihdrs/i0err.h'\" unpacked with wrong size!
  1079.   fi
  1080.   # end of 'abc/ihdrs/i0err.h'
  1081. fi
  1082. if test -f 'abc/ihdrs/i3sou.h' -a "${1}" != "-c" ; then 
  1083.   echo shar: Will not clobber existing file \"'abc/ihdrs/i3sou.h'\"
  1084. else
  1085.   echo shar: Extracting \"'abc/ihdrs/i3sou.h'\" \(1597 characters\)
  1086.   sed "s/^X//" >'abc/ihdrs/i3sou.h' <<'END_OF_FILE'
  1087. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1987. */
  1088. X
  1089. X#define p_exists(pname, aa)    (in_env(b_perm, pname, aa))
  1090. X#define def_perm(pname, f)    (e_replace(f, &b_perm, pname), permchanges= Yes)
  1091. X#define free_perm(pname)    (e_delete(&b_perm, pname), permchanges= Yes)
  1092. X
  1093. X#define u_exists(pname, aa)    (in_env(b_units, pname, aa))
  1094. X#define def_unit(pname, u)    (e_replace(u, &b_units, pname))
  1095. X#define free_unit(pname)    (e_delete(&b_units, pname))
  1096. X
  1097. Xextern value b_perm;
  1098. Xextern bool permchanges;
  1099. Xextern value b_units;
  1100. Xextern value last_unit;
  1101. Xextern value last_target;
  1102. X
  1103. X#define Permname(pname) (behead(pname, MkSmallInt(2)))
  1104. X#define Permtype(pname) (strval(pname)[0])
  1105. X    /* possible types:
  1106. X     *    1-8 [Cmd ... Tar]    (order used in mac/m1print.c!)
  1107. X     *    : [last_unit]
  1108. X     *    = [last_target]
  1109. X     */
  1110. X
  1111. X#define Cmd '1'
  1112. X#define Zfd '2'
  1113. X#define Mfd '3'
  1114. X#define Dfd '4'
  1115. X#define Zpd '5'
  1116. X#define Mpd '6'
  1117. X#define Dpd '7'
  1118. X#define Tar '8'
  1119. X#define OldHow '+'    /* old how-to type (used in bio) */
  1120. X#define OldTar '-'    /* old target type (used in bio) */
  1121. X#define Wsp '.'        /* workspace type */
  1122. X
  1123. X#define    Cmd_ext ".cmd"
  1124. X#define Zfd_ext ".zfd"
  1125. X#define Mfd_ext ".mfd"
  1126. X#define Dfd_ext ".dfd"
  1127. X#define Zpd_ext ".zpd"
  1128. X#define Mpd_ext ".mpd"
  1129. X#define Dpd_ext ".dpd"
  1130. X#define Cts_ext ".cts"
  1131. X#define Wsp_ext ""
  1132. X
  1133. Xvalue permkey();
  1134. Xvalue get_pname();
  1135. Xvalue getval();
  1136. X
  1137. Xvalue new_fname();        /* devise a filename for a unit or target */
  1138. Xvalue mkabcname();        /* vice versa for recovering target name */
  1139. X#define CONVP_SIGN '_'        /* to map point */
  1140. X#define CONVDQ_SIGN '@'        /* to map double quote */
  1141. X
  1142. Xbool is_udfpr();        /* REPORT is user defined func or predic */
  1143. END_OF_FILE
  1144.   if test 1597 -ne `wc -c <'abc/ihdrs/i3sou.h'`; then
  1145.     echo shar: \"'abc/ihdrs/i3sou.h'\" unpacked with wrong size!
  1146.   fi
  1147.   # end of 'abc/ihdrs/i3sou.h'
  1148. fi
  1149. if test -f 'abc/keys/Makefile' -a "${1}" != "-c" ; then 
  1150.   echo shar: Will not clobber existing file \"'abc/keys/Makefile'\"
  1151. else
  1152.   echo shar: Extracting \"'abc/keys/Makefile'\" \(2193 characters\)
  1153.   sed "s/^X//" >'abc/keys/Makefile' <<'END_OF_FILE'
  1154. X#
  1155. X# Makefile for ../abckeys.
  1156. X#
  1157. X# This is intended to be used through ../Makefile, where several
  1158. X# generic macro's are filled in.
  1159. X# The following macro's are more specific and should be changed here
  1160. X# in case you have to make very drastic changes.
  1161. X
  1162. X# --- Include flags to the C compiler ---
  1163. X
  1164. XKINCL=    -I../bhdrs -I../ehdrs -I../uhdrs
  1165. X
  1166. X# --- Include flags for lint ---
  1167. X
  1168. XLKINCL=        $(KINCL)
  1169. X
  1170. X# --- Relevant files ---
  1171. X
  1172. XOBJS=    keydef.o keyhlp.o \
  1173. X    e1getc.o \
  1174. X    b1file.o b1memo.o b1mess.o getopt.o b1outp.o \
  1175. X    u1file.o u1keys.o u1trm.o u1dir.o
  1176. X
  1177. XSRCS=    keydef.c keyhlp.c \
  1178. X    ../bed/e1getc.c \
  1179. X    ../b/b1file.c ../b/b1memo.c ../b/b1mess.c ../b/getopt.c ../b/b1outp.c \
  1180. X    ../unix/u1file.c ../unix/u1keys.c ../unix/u1trm.c ../unix/u1dir.c
  1181. X
  1182. XHDRS=    keydef.h \
  1183. X    ../bhdrs/b.h ../bhdrs/bfil.h ../bhdrs/bmem.h \
  1184. X    ../bhdrs/bobj.h ../bhdrs/getopt.h \
  1185. X    ../ehdrs/getc.h ../ehdrs/keys.h ../ehdrs/trm.h \
  1186. X    ../uhdrs/osgen.h ../uhdrs/feat.h ../uhdrs/defs.h
  1187. X
  1188. X# --- Main entries of the makefile ---
  1189. X
  1190. Xall:    ../abckeys
  1191. X
  1192. X../abckeys: $(OBJS)
  1193. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o ../abckeys
  1194. X
  1195. Xkeydef.o: keydef.c
  1196. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) keydef.c
  1197. X
  1198. Xkeyhlp.o: keyhlp.c
  1199. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) keyhlp.c
  1200. X
  1201. Xe1getc.o: ../bed/e1getc.c
  1202. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../bed/e1getc.c
  1203. X
  1204. Xgetopt.o: ../b/getopt.c
  1205. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/getopt.c
  1206. X
  1207. Xb1file.o: ../b/b1file.c
  1208. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1file.c
  1209. X
  1210. Xb1memo.o: ../b/b1memo.c
  1211. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1memo.c
  1212. X
  1213. Xb1mess.o: ../b/b1mess.c
  1214. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1mess.c
  1215. X
  1216. Xb1outp.o: ../b/b1outp.c
  1217. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1outp.c
  1218. X
  1219. Xu1file.o: ../unix/u1file.c
  1220. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1file.c
  1221. X
  1222. Xu1keys.o: ../unix/u1keys.c
  1223. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1keys.c
  1224. X
  1225. Xu1trm.o: ../unix/u1trm.c
  1226. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1trm.c
  1227. X
  1228. Xu1dir.o: ../unix/u1dir.c
  1229. X    $(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1dir.c
  1230. X
  1231. X# --- Utilities for the programmer ---
  1232. X
  1233. Xdepend:
  1234. X    @$(MKDEP) $(DEFS) $(KINCL) $(SRCS)
  1235. X
  1236. Xlint:
  1237. X    $(LINT) $(LINTFLAGS) $(DEFS) -DKEYS $(LKINCL) $(SRCS)
  1238. X
  1239. XALWAYS:    #dummy
  1240. X
  1241. X###
  1242. X# Dependency information is taken from ./Dep or ./DEP; see ../Makefile.
  1243. X###
  1244. END_OF_FILE
  1245.   if test 2193 -ne `wc -c <'abc/keys/Makefile'`; then
  1246.     echo shar: \"'abc/keys/Makefile'\" unpacked with wrong size!
  1247.   fi
  1248.   # end of 'abc/keys/Makefile'
  1249. fi
  1250. if test -f 'abc/keys/keydef.h' -a "${1}" != "-c" ; then 
  1251.   echo shar: Will not clobber existing file \"'abc/keys/keydef.h'\"
  1252. else
  1253.   echo shar: Extracting \"'abc/keys/keydef.h'\" \(1324 characters\)
  1254.   sed "s/^X//" >'abc/keys/keydef.h' <<'END_OF_FILE'
  1255. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989. */
  1256. X
  1257. Xstring reprchar();
  1258. X
  1259. X/****************************************************************************/
  1260. X
  1261. X#define ABC_RELEASE "ABC Release %s."
  1262. X#define COPYRIGHT "Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989."
  1263. X#define HEADING "This program allows you to redefine the key bindings for the ABC editor operations, producing a key definitions file."
  1264. X
  1265. X/****************************************************************************/
  1266. X
  1267. X#define E_INTERRUPT    "*** Your interrupt character is undefined."
  1268. X
  1269. X#ifdef CANSUSPEND
  1270. X
  1271. X#define E_SPCHAR    "*** You cannot include your interrupt or suspend character."
  1272. X
  1273. X#else
  1274. X
  1275. X#define E_SPCHAR    "*** You cannot include your interrupt character."
  1276. X
  1277. X#endif /* CANSUSPEND */
  1278. X
  1279. X#define E_ILLEGAL    "*** You are not allowed to start a definition with '%c' since that would make that character unavailable."
  1280. X
  1281. X#define E_TOO_MANY     "*** Sorry, can't remember more key definitions"
  1282. X
  1283. X#define E_UNLAWFUL    "*** It may not contain an unprintable character"
  1284. X
  1285. X#define E_IN_USE    "*** That representation is in use for %s."
  1286. X
  1287. X#define E_UNKNOWN    "*** unknown operation name"
  1288. X
  1289. X#define E_NOTALLOWED    "*** you are not allowed to change \"%s\""
  1290. X
  1291. X#define E_KEYFILE    "*** Can't open key definitions file %s for writing; writing to standard output instead."
  1292. END_OF_FILE
  1293.   if test 1324 -ne `wc -c <'abc/keys/keydef.h'`; then
  1294.     echo shar: \"'abc/keys/keydef.h'\" unpacked with wrong size!
  1295.   fi
  1296.   # end of 'abc/keys/keydef.h'
  1297. fi
  1298. if test -f 'abc/tc/README' -a "${1}" != "-c" ; then 
  1299.   echo shar: Will not clobber existing file \"'abc/tc/README'\"
  1300. else
  1301.   echo shar: Extracting \"'abc/tc/README'\" \(1294 characters\)
  1302.   sed "s/^X//" >'abc/tc/README' <<'END_OF_FILE'
  1303. Xtermcap - terminal capabilities, library and database.
  1304. X
  1305. XThe routines provided by the library 'libtermcap.a' extract and use
  1306. Xcapabilities from the terminal database 'termcap'.
  1307. X
  1308. XIt is included in the Mark 2 distribution of ABC because the ABC editor
  1309. Xuses it, it is in the public domain, and there are UNIXes without it.
  1310. XIf '../Setup' finds the termcap in your system it uses that one.
  1311. X
  1312. XIf you don't have termcap available on your system the best thing to do
  1313. Xis to install it and run ../Setup again.
  1314. X
  1315. X    make DEST=/usr/lib ETC=/etc install
  1316. X
  1317. Xwill install the library and database at their usual places.  If these
  1318. Xare different on your system you will probably have to change pathnames
  1319. Xin the sources too. The files tc?.c test out the library routines.
  1320. XDon't forget to copy the manual pages from termcap.3X and termcap.5
  1321. Xto your systems manual.
  1322. X
  1323. XFor more information consult those manual pages.
  1324. X
  1325. XFor any program to work with termcap, the user should set the $TERM and
  1326. X$TERMCAP environment variables in her profile. You can also install
  1327. Xabc and abckeys as shell scripts, calling the executable binaries after
  1328. Xsetting these, e.g. for abc:
  1329. X    
  1330. X    : set TERMCAP environment variable
  1331. X    : ${TERMCAP=$ABC_LIB/termcap}
  1332. X    export TERMCAP
  1333. X    exec /usr/new/lib/abc/abc.exe
  1334. X
  1335. Xif the latter is the name you gave the binary.
  1336. END_OF_FILE
  1337.   if test 1294 -ne `wc -c <'abc/tc/README'`; then
  1338.     echo shar: \"'abc/tc/README'\" unpacked with wrong size!
  1339.   fi
  1340.   # end of 'abc/tc/README'
  1341. fi
  1342. if test -f 'abc/tc/tc3.c' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'abc/tc/tc3.c'\"
  1344. else
  1345.   echo shar: Extracting \"'abc/tc/tc3.c'\" \(1303 characters\)
  1346.   sed "s/^X//" >'abc/tc/tc3.c' <<'END_OF_FILE'
  1347. X/*
  1348. X * tc3 [term]
  1349. X * Dummy program to test out termlib.
  1350. X * Input two numbers and it prints out the tgoto string generated.
  1351. X */
  1352. X#include <stdio.h>
  1353. Xchar buf[1024];
  1354. Xchar *getenv(), *tgetstr();
  1355. Xchar *rdchar();
  1356. Xchar *tgoto();
  1357. Xchar *CM;
  1358. Xchar cmbuff[30];
  1359. Xchar *x;
  1360. Xchar *UP;
  1361. Xchar *tgout;
  1362. X
  1363. Xmain(argc, argv) char **argv; {
  1364. X    char *p;
  1365. X    int rc;
  1366. X    int row, col;
  1367. X
  1368. X    if (argc < 2)
  1369. X        p = getenv("TERM");
  1370. X    else
  1371. X        p = argv[1];
  1372. X    rc = tgetent(buf,p);
  1373. X    x = cmbuff;
  1374. X    UP = tgetstr("up", &x);
  1375. X    printf("UP = %x = ", UP); pr(UP); printf("\n");
  1376. X    if (UP && *UP==0)
  1377. X        UP = 0;
  1378. X    CM = tgetstr("cm", &x);
  1379. X    printf("CM = "); pr(CM); printf("\n");
  1380. X    for (;;) {
  1381. X        if (scanf("%d %d", &row, &col) < 2)
  1382. X            exit(0);
  1383. X        tgout = tgoto(CM, row, col);
  1384. X        pr(tgout);
  1385. X        printf("\n");
  1386. X    }
  1387. X}
  1388. X
  1389. Xpr(p)
  1390. Xregister char *p;
  1391. X{
  1392. X    for (; *p; p++)
  1393. X        printf("%s", rdchar(*p));
  1394. X}
  1395. X
  1396. X/*
  1397. X * rdchar: returns a readable representation of an ASCII char, using ^ notation.
  1398. X */
  1399. X#include <ctype.h>
  1400. Xchar *rdchar(c)
  1401. Xchar c;
  1402. X{
  1403. X    static char ret[4];
  1404. X    register char *p;
  1405. X
  1406. X    /*
  1407. X     * Due to a bug in isprint, this prints spaces as ^`, but this is OK
  1408. X     * because we want something to show up on the screen.
  1409. X     */
  1410. X    ret[0] = ((c&0377) > 0177) ? '\'' : ' ';
  1411. X    c &= 0177;
  1412. X    ret[1] = isprint(c) ? ' ' : '^';
  1413. X    ret[2] = isprint(c) ?  c  : c^0100;
  1414. X    ret[3] = 0;
  1415. X    for (p=ret; *p==' '; p++)
  1416. X        ;
  1417. X    return (p);
  1418. X}
  1419. END_OF_FILE
  1420.   if test 1303 -ne `wc -c <'abc/tc/tc3.c'`; then
  1421.     echo shar: \"'abc/tc/tc3.c'\" unpacked with wrong size!
  1422.   fi
  1423.   # end of 'abc/tc/tc3.c'
  1424. fi
  1425. if test -f 'abc/uhdrs/feat.h' -a "${1}" != "-c" ; then 
  1426.   echo shar: Will not clobber existing file \"'abc/uhdrs/feat.h'\"
  1427. else
  1428.   echo shar: Extracting \"'abc/uhdrs/feat.h'\" \(1433 characters\)
  1429.   sed "s/^X//" >'abc/uhdrs/feat.h' <<'END_OF_FILE'
  1430. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1431. X
  1432. X/*
  1433. X * -- #define features, to make it easy to turn them off.
  1434. X */
  1435. X
  1436. X#define SAVEBUF        /* Save Copy Buffer on file between edit sessions */
  1437. X#define USERSUGG    /* Give suggestions for user-defined commands */
  1438. X#define SAVEPOS        /* Save focus position between edit sessions */
  1439. X#define RECORDING    /* [record] and [playback] commands */
  1440. X#define SCROLLBAR    /* Show scroll bar if unit > screen */
  1441. X#define SHOWBUF        /* Shows contents of copy buffer if locked */
  1442. X#define HELPFUL        /* Print help blurb on ESC-? or ? */
  1443. X#define GOTOCURSOR    /* enable [goto] operation */
  1444. X
  1445. X#ifdef SMALLSYS
  1446. X/*
  1447. X * The #define SMALLSYS squeezes out some lesser important debugging
  1448. X * code. Moreover you can #undef here some of the above mentioned features.
  1449. X * They are roughly sorted on amount of code saved, greatest
  1450. X * saving first.
  1451. X */
  1452. X
  1453. X#undef SAVEBUF
  1454. X#undef USERSUGG
  1455. X#undef SAVEPOS
  1456. X#undef RECORDING
  1457. X#undef SCROLLBAR
  1458. X#undef SHOWBUF
  1459. X#undef HELPFUL
  1460. X#undef GOTOCURSOR
  1461. X
  1462. X#endif /* SMALLSYS */
  1463. X
  1464. X#define CANSUSPEND    /* Can suspend abc? */
  1465. X#define STRUCTASS    /* C compiler knows structure assignment */
  1466. X
  1467. X#define    EXT_RANGE    /* extend range of approximate arithmetic */
  1468. X#define    TYPE_CHECK    /* do static type checking */
  1469. X#undef    CLEAR_MEM    /* remove internal adm. before editing a howto */
  1470. X#undef    SAVE_PERM    /* write perm env after each edit */
  1471. X
  1472. X#define TTY_ERRFILE    /* redirect error output from interpreter to /dev/tty */
  1473. END_OF_FILE
  1474.   if test 1433 -ne `wc -c <'abc/uhdrs/feat.h'`; then
  1475.     echo shar: \"'abc/uhdrs/feat.h'\" unpacked with wrong size!
  1476.   fi
  1477.   # end of 'abc/uhdrs/feat.h'
  1478. fi
  1479. if test -f 'abc/uhdrs/os.h.gen' -a "${1}" != "-c" ; then 
  1480.   echo shar: Will not clobber existing file \"'abc/uhdrs/os.h.gen'\"
  1481. else
  1482.   echo shar: Extracting \"'abc/uhdrs/os.h.gen'\" \(2433 characters\)
  1483.   sed "s/^X//" >'abc/uhdrs/os.h.gen' <<'END_OF_FILE'
  1484. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1485. X
  1486. X/* Operating system dependent ABC configuration */
  1487. X
  1488. X#include <math.h>    /* mathematical library, see math(3) */
  1489. X#include <ctype.h>    /* character classifications, see ctype(3) */
  1490. X#include <strings.h>    /* string operations, like strlen(), see string(3) */
  1491. X#include <sys/types.h>    /* basic system types, see stat(2) */
  1492. X#include <sys/stat.h>    /* file status, see stat(2) */
  1493. X#include <sys/file.h>    /* for access(2) modes, like R_OK; only used below */
  1494. X
  1495. X#define VOID (void)    /* VOID is used in casts only, for quieter lint */
  1496. X            /* make it empty if your compiler doesn't have void */
  1497. X
  1498. X#define SIGNAL        /* can #include <signal.h> (v7 or any BSD compatible) */
  1499. X#define SIGTYPE int    /* type returned by signal handler function */
  1500. X
  1501. X#define SETJMP        /* can #include <setjmp.h> */
  1502. X
  1503. X#define Interrupted() interrupted
  1504. X
  1505. X#define DELIM '/'
  1506. X#define SIZE_PATH 1024
  1507. X
  1508. X#define SEPARATOR '/'
  1509. X#define CURDIR "."
  1510. X#define PARENTDIR ".."
  1511. X
  1512. X#define Issep(c) ((c) == SEPARATOR)
  1513. X#define Isanysep(c) Issep(c)
  1514. X#define Isabspath(path) Issep(*(path))
  1515. X
  1516. X#define F_readable(f)    (access(f, R_OK) == 0)
  1517. X#define F_writable(f)    (access(f, W_OK) == 0)
  1518. X#define F_exists(f)    (access(f, F_OK) == 0)
  1519. X#define D_exists(f)    (access(f, F_OK) == 0)
  1520. X
  1521. X#define DIRMODE 0777
  1522. X#define Mkdir(path)    (mkdir(path, DIRMODE))
  1523. X
  1524. X#define KEYSPREFIX "abckeys_" /* only set for unix */
  1525. X
  1526. X#ifdef KEYS
  1527. X
  1528. X#define NEWFILE        "abc.key"
  1529. X    /* default name for new keydefinitions file */
  1530. X
  1531. X#define Eok(c) ((c) == '\r')
  1532. X    /* return character of user key sequence */
  1533. X
  1534. X#undef KNOWN_KEYBOARD
  1535. X    /* do we know the keyboard codes ? */
  1536. X
  1537. X#undef NULL_EXTENDED
  1538. X    /* keyboard extended codes start with a null char */
  1539. X
  1540. X#endif /* KEYS */
  1541. X
  1542. X/***************** code only for unix systems ***************************/
  1543. X
  1544. X#define strchr index    /* use index for strchr */
  1545. X#define strrchr rindex  /* and rindex for strrchr */
  1546. X
  1547. X#undef  TERMIO        /* is this a termio system */
  1548. X
  1549. X#define HAS_FTIME    /* ftime() and <sys/timeb.h> available */
  1550. X#define HAS_PERROR    /* can use sys_errlist and sys_nerr (from perror(3)) */
  1551. X#define HAS_MKDIR    /* mkdir() and rmdir() available */
  1552. X#define HAS_GETWD    /* getwd() available */
  1553. X#define HAS_RENAME    /* rename() available */
  1554. X#define HAS_SELECT    /* 4.2 BSD select() system call available */
  1555. X#define HAS_READDIR    /* Berkeley style directory reading routines */
  1556. X            /* opendir(), readdir() and closedir(); */
  1557. X            /* see directory(3), or ../unix/u1dir.c and ./dir.h */
  1558. END_OF_FILE
  1559.   if test 2433 -ne `wc -c <'abc/uhdrs/os.h.gen'`; then
  1560.     echo shar: \"'abc/uhdrs/os.h.gen'\" unpacked with wrong size!
  1561.   fi
  1562.   # end of 'abc/uhdrs/os.h.gen'
  1563. fi
  1564. if test -f 'abc/unix/DEP' -a "${1}" != "-c" ; then 
  1565.   echo shar: Will not clobber existing file \"'abc/unix/DEP'\"
  1566. else
  1567.   echo shar: Extracting \"'abc/unix/DEP'\" \(1764 characters\)
  1568.   sed "s/^X//" >'abc/unix/DEP' <<'END_OF_FILE'
  1569. Xu1dir.o: u1dir.c
  1570. Xu1dir.o: ../bhdrs/b.h
  1571. Xu1dir.o: ../uhdrs/osconf.h
  1572. Xu1dir.o: ../uhdrs/os.h
  1573. Xu1dir.o: ../uhdrs/conf.h
  1574. Xu1dir.o: ../uhdrs/config.h
  1575. Xu1edit.o: u1edit.c
  1576. Xu1edit.o: ../bhdrs/b.h
  1577. Xu1edit.o: ../uhdrs/osconf.h
  1578. Xu1edit.o: ../uhdrs/os.h
  1579. Xu1edit.o: ../uhdrs/conf.h
  1580. Xu1edit.o: ../uhdrs/config.h
  1581. Xu1edit.o: ../bhdrs/bfil.h
  1582. Xu1file.o: u1file.c
  1583. Xu1file.o: ../bhdrs/b.h
  1584. Xu1file.o: ../uhdrs/osconf.h
  1585. Xu1file.o: ../uhdrs/os.h
  1586. Xu1file.o: ../uhdrs/conf.h
  1587. Xu1file.o: ../uhdrs/config.h
  1588. Xu1file.o: ../bhdrs/bmem.h
  1589. Xu1file.o: ../uhdrs/dest.h
  1590. Xu1file.o: ../bhdrs/bfil.h
  1591. Xu1keys.o: u1keys.c
  1592. Xu1keys.o: ../bhdrs/b.h
  1593. Xu1keys.o: ../uhdrs/osconf.h
  1594. Xu1keys.o: ../uhdrs/os.h
  1595. Xu1keys.o: ../uhdrs/conf.h
  1596. Xu1keys.o: ../uhdrs/config.h
  1597. Xu1keys.o: ../uhdrs/feat.h
  1598. Xu1keys.o: ../bhdrs/bmem.h
  1599. Xu1keys.o: ../ehdrs/getc.h
  1600. Xu1keys.o: ../ehdrs/keys.h
  1601. Xu1keys.o: ../uhdrs/args.h
  1602. Xu1main.o: u1main.c
  1603. Xu1main.o: ../bhdrs/b.h
  1604. Xu1main.o: ../uhdrs/osconf.h
  1605. Xu1main.o: ../uhdrs/os.h
  1606. Xu1main.o: ../uhdrs/conf.h
  1607. Xu1main.o: ../uhdrs/config.h
  1608. Xu1main.o: ../bhdrs/bmem.h
  1609. Xu1main.o: ../bhdrs/bfil.h
  1610. Xu1main.o: ../bhdrs/getopt.h
  1611. Xu1main.o: ../ihdrs/i3bws.h
  1612. Xu1os.o: u1os.c
  1613. Xu1os.o: ../bhdrs/b.h
  1614. Xu1os.o: ../uhdrs/osconf.h
  1615. Xu1os.o: ../uhdrs/os.h
  1616. Xu1os.o: ../uhdrs/conf.h
  1617. Xu1os.o: ../uhdrs/config.h
  1618. Xu1os.o: ../uhdrs/feat.h
  1619. Xu1sig.o: u1sig.c
  1620. Xu1sig.o: ../bhdrs/b.h
  1621. Xu1sig.o: ../uhdrs/osconf.h
  1622. Xu1sig.o: ../uhdrs/os.h
  1623. Xu1sig.o: ../uhdrs/conf.h
  1624. Xu1sig.o: ../uhdrs/config.h
  1625. Xu1sig.o: ../uhdrs/feat.h
  1626. Xu1time.o: u1time.c
  1627. Xu1time.o: ../bhdrs/b.h
  1628. Xu1time.o: ../uhdrs/osconf.h
  1629. Xu1time.o: ../uhdrs/os.h
  1630. Xu1time.o: ../uhdrs/conf.h
  1631. Xu1time.o: ../uhdrs/config.h
  1632. Xu1time.o: ../bhdrs/bobj.h
  1633. Xu1time.o: ../ihdrs/i1num.h
  1634. Xu1trm.o: u1trm.c
  1635. Xu1trm.o: ../bhdrs/b.h
  1636. Xu1trm.o: ../uhdrs/osconf.h
  1637. Xu1trm.o: ../uhdrs/os.h
  1638. Xu1trm.o: ../uhdrs/conf.h
  1639. Xu1trm.o: ../uhdrs/config.h
  1640. Xu1trm.o: ../ehdrs/trm.h
  1641. END_OF_FILE
  1642.   if test 1764 -ne `wc -c <'abc/unix/DEP'`; then
  1643.     echo shar: \"'abc/unix/DEP'\" unpacked with wrong size!
  1644.   fi
  1645.   # end of 'abc/unix/DEP'
  1646. fi
  1647. if test -f 'abc/unix/u1dir.c' -a "${1}" != "-c" ; then 
  1648.   echo shar: Will not clobber existing file \"'abc/unix/u1dir.c'\"
  1649. else
  1650.   echo shar: Extracting \"'abc/unix/u1dir.c'\" \(2268 characters\)
  1651.   sed "s/^X//" >'abc/unix/u1dir.c' <<'END_OF_FILE'
  1652. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1653. X
  1654. X/* This is slightly edited from a public domain version */
  1655. X
  1656. X#include "b.h"
  1657. X
  1658. X#ifndef HAS_MKDIR
  1659. X
  1660. X/* mkdir - Make a directory */
  1661. X
  1662. XVisible int mkdir(dir, mode) char *dir; int mode; {
  1663. X    char buf[1024];
  1664. X
  1665. X    sprintf(buf, "(mkdir %s && chmod %o %s) >/dev/null 2>/dev/null",
  1666. X            dir, mode, dir);
  1667. X    return(system(buf));
  1668. X}
  1669. X
  1670. X/* rmdir - remove directory */
  1671. X
  1672. XVisible Procedure rmdir(dir) char *dir; {
  1673. X    char buf[1024];
  1674. X
  1675. X    sprintf(buf, "rmdir %s >/dev/null 2>/dev/null", dir);
  1676. X    return(system(buf));
  1677. X}
  1678. X
  1679. X#endif /* !HAS_MKDIR */
  1680. X
  1681. X#ifndef HAS_READDIR
  1682. X
  1683. X#include "dir.h"
  1684. X
  1685. X/*
  1686. X * support for Berkeley directory reading routines
  1687. X * on a VERSION7 or ATT file system
  1688. X */
  1689. X
  1690. X/* open a directory */
  1691. X
  1692. XVisible DIR *opendir(name) char *name; {
  1693. X    register DIR *dirp;
  1694. X    register int fd;
  1695. X    char *malloc();
  1696. X
  1697. X    if ((fd = open(name, 0)) == -1)
  1698. X        return NULL;
  1699. X    if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
  1700. X        close (fd);
  1701. X        return NULL;
  1702. X    }
  1703. X    dirp->dd_fd = fd;
  1704. X    dirp->dd_loc = 0;
  1705. X    return dirp;
  1706. X}
  1707. X
  1708. X/* read an old style directory entry and present it as a new one */
  1709. X#ifndef pyr
  1710. X#define    ODIRSIZ    14
  1711. X
  1712. Xstruct    olddirect {
  1713. X    ino_t    od_ino;
  1714. X    char    od_name[ODIRSIZ];
  1715. X};
  1716. X#else    /* a Pyramid in the ATT universe */
  1717. X#define    ODIRSIZ    248
  1718. X
  1719. Xstruct    olddirect {
  1720. X    long    od_ino;
  1721. X    short    od_fill1, od_fill2;
  1722. X    char    od_name[ODIRSIZ];
  1723. X};
  1724. X#endif
  1725. X
  1726. X/* get next entry in a directory */
  1727. X
  1728. XVisible struct direct *readdir(dirp) register DIR *dirp; {
  1729. X    register struct olddirect *dp;
  1730. X    static struct direct dir;
  1731. X
  1732. X    for (;;) {
  1733. X        if (dirp->dd_loc == 0) {
  1734. X            dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
  1735. X                DIRBLKSIZ);
  1736. X            if (dirp->dd_size <= 0)
  1737. X                return NULL;
  1738. X        }
  1739. X        if (dirp->dd_loc >= dirp->dd_size) {
  1740. X            dirp->dd_loc = 0;
  1741. X            continue;
  1742. X        }
  1743. X        dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
  1744. X        dirp->dd_loc += sizeof(struct olddirect);
  1745. X        if (dp->od_ino == 0)
  1746. X            continue;
  1747. X        dir.d_ino = dp->od_ino;
  1748. X        strncpy(dir.d_name, dp->od_name, ODIRSIZ);
  1749. X        dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
  1750. X        dir.d_namlen = strlen(dir.d_name);
  1751. X        dir.d_reclen = DIRSIZ(&dir);
  1752. X        return (&dir);
  1753. X    }
  1754. X}
  1755. X
  1756. X/* close a directory */
  1757. X
  1758. XVisible Procedure closedir(dirp) register DIR *dirp; {
  1759. X    close(dirp->dd_fd);
  1760. X    dirp->dd_fd = -1;
  1761. X    dirp->dd_loc = 0;
  1762. X    free(dirp);
  1763. X}
  1764. X
  1765. X#endif /* !HAS_READDIR */
  1766. END_OF_FILE
  1767.   if test 2268 -ne `wc -c <'abc/unix/u1dir.c'`; then
  1768.     echo shar: \"'abc/unix/u1dir.c'\" unpacked with wrong size!
  1769.   fi
  1770.   # end of 'abc/unix/u1dir.c'
  1771. fi
  1772. if test -f 'abc/unix/u1time.c' -a "${1}" != "-c" ; then 
  1773.   echo shar: Will not clobber existing file \"'abc/unix/u1time.c'\"
  1774. else
  1775.   echo shar: Extracting \"'abc/unix/u1time.c'\" \(1237 characters\)
  1776.   sed "s/^X//" >'abc/unix/u1time.c' <<'END_OF_FILE'
  1777. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989. */
  1778. X
  1779. X#include "b.h"
  1780. X#include "bobj.h"
  1781. X#include "i1num.h"
  1782. X
  1783. X#include <time.h>
  1784. X
  1785. X#ifdef HAS_FTIME    /* Berkeley */
  1786. X
  1787. X#include <sys/timeb.h>
  1788. X
  1789. XVisible value nowisthetime() {
  1790. X    struct tm *lt;
  1791. X    struct timeb tt;
  1792. X    value now;
  1793. X    value millisecs;
  1794. X    value thousand;
  1795. X    
  1796. X    ftime(&tt);
  1797. X    lt= localtime((long*) &tt.time);
  1798. X    
  1799. X    now= mk_compound(6);
  1800. X
  1801. X    *Field(now, 0)= mk_integer(lt->tm_year + 1900);
  1802. X    *Field(now, 1)= mk_integer(lt->tm_mon + 1);
  1803. X    *Field(now, 2)= mk_integer(lt->tm_mday);
  1804. X    *Field(now, 3)= mk_integer(lt->tm_hour);
  1805. X    *Field(now, 4)= mk_integer(lt->tm_min);
  1806. X    millisecs= mk_integer((int) (lt->tm_sec * 1000 + tt.millitm));
  1807. X    thousand= mk_integer(1000);
  1808. X    *Field(now, 5)= mk_exact(millisecs, thousand, 3);
  1809. X    release(millisecs); release(thousand);
  1810. X    return now;
  1811. X}
  1812. X
  1813. X#else
  1814. X
  1815. XVisible value nowisthetime() {
  1816. X    long ttt;
  1817. X    struct tm *lt;
  1818. X    value now;
  1819. X    
  1820. X    ttt= time((long*)0);
  1821. X    lt= localtime(&ttt);
  1822. X    
  1823. X    now= mk_compound(6);
  1824. X
  1825. X    *Field(now, 0)= mk_integer(lt->tm_year + 1900);
  1826. X    *Field(now, 1)= mk_integer(lt->tm_mon + 1);
  1827. X    *Field(now, 2)= mk_integer(lt->tm_mday);
  1828. X    *Field(now, 3)= mk_integer(lt->tm_hour);
  1829. X    *Field(now, 4)= mk_integer(lt->tm_min);
  1830. X    *Field(now, 5)= mk_integer(lt->tm_sec);
  1831. X    
  1832. X    return now;
  1833. X}
  1834. X
  1835. X#endif
  1836. END_OF_FILE
  1837.   if test 1237 -ne `wc -c <'abc/unix/u1time.c'`; then
  1838.     echo shar: \"'abc/unix/u1time.c'\" unpacked with wrong size!
  1839.   fi
  1840.   # end of 'abc/unix/u1time.c'
  1841. fi
  1842. echo shar: End of archive 23 \(of 25\).
  1843. cp /dev/null ark23isdone
  1844. MISSING=""
  1845. 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
  1846.     if test ! -f ark${I}isdone ; then
  1847.     MISSING="${MISSING} ${I}"
  1848.     fi
  1849. done
  1850. if test "${MISSING}" = "" ; then
  1851.     echo You have unpacked all 25 archives.
  1852.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1853. else
  1854.     echo You still must unpack the following archives:
  1855.     echo "        " ${MISSING}
  1856. fi
  1857. exit 0 # Just in case...
  1858.