home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / microemacs-3.9 / 6 < prev    next >
Text File  |  1987-11-17  |  30KB  |  1,430 lines

  1. Article 82 of comp.sources.misc:
  2. Path: tut!osu-cis!cbosgd!mandrill!hal!ncoast!allbery
  3. From: nwd@j.cc.purdue.edu (Daniel Lawrence)
  4. Newsgroups: comp.sources.misc
  5. Subject: MicroEmacs 3.9 (Part 6 of 16)
  6. Message-ID: <5653@ncoast.UUCP>
  7. Date: 14 Nov 87 21:09:27 GMT
  8. Sender: allbery@ncoast.UUCP
  9. Lines: 1415
  10. Approved: allbery@ncoast.UUCP
  11. X-Archive: comp.sources.misc/microemacs-3.9/5
  12.  
  13. # This is a shar archive.
  14. # Remove everything above this line.
  15. # Run the file through sh, not csh.
  16. # (type `sh mes.6')
  17. # If you do not see the message
  18. #    `mes.6 completed!'
  19. # then the file was incomplete.
  20. echo extracting - fileio.c
  21. sed 's/^X//' > fileio.c << 'FRIDAY_NIGHT'
  22. X/*
  23. X * The routines in this file read and write ASCII files from the disk. All of
  24. X * the knowledge about files are here.
  25. X */
  26. X
  27. X#include        <stdio.h>
  28. X#include    "estruct.h"
  29. X#include        "edef.h"
  30. X
  31. XFILE    *ffp;        /* File pointer, all functions. */
  32. Xint eofflag;        /* end-of-file flag */
  33. X
  34. X/*
  35. X * Open a file for reading.
  36. X */
  37. Xffropen(fn)
  38. Xchar    *fn;
  39. X{
  40. X        if ((ffp=fopen(fn, "r")) == NULL)
  41. X                return (FIOFNF);
  42. X    eofflag = FALSE;
  43. X        return (FIOSUC);
  44. X}
  45. X
  46. X/*
  47. X * Open a file for writing. Return TRUE if all is well, and FALSE on error
  48. X * (cannot create).
  49. X */
  50. Xffwopen(fn)
  51. Xchar    *fn;
  52. X{
  53. X#if     VMS
  54. X        register int    fd;
  55. X
  56. X        if ((fd=creat(fn, 0666, "rfm=var", "rat=cr")) < 0
  57. X        || (ffp=fdopen(fd, "w")) == NULL) {
  58. X#else
  59. X        if ((ffp=fopen(fn, "w")) == NULL) {
  60. X#endif
  61. X                mlwrite("Cannot open file for writing");
  62. X                return (FIOERR);
  63. X        }
  64. X        return (FIOSUC);
  65. X}
  66. X
  67. X/*
  68. X * Close a file. Should look at the status in all systems.
  69. X */
  70. Xffclose()
  71. X{
  72. X    /* free this since we do not need it anymore */
  73. X    if (fline) {
  74. X        free(fline);
  75. X        fline = NULL;
  76. X    }
  77. X
  78. X#if    MSDOS & CTRLZ
  79. X    fputc(26, ffp);        /* add a ^Z at the end of the file */
  80. X#endif
  81. X    
  82. X#if     V7 | USG | BSD | (MSDOS & (LATTICE | MSC | TURBO)) | (ST520 & MWC)
  83. X        if (fclose(ffp) != FALSE) {
  84. X                mlwrite("Error closing file");
  85. X                return(FIOERR);
  86. X        }
  87. X        return(FIOSUC);
  88. X#else
  89. X        fclose(ffp);
  90. X        return (FIOSUC);
  91. X#endif
  92. X}
  93. X
  94. X/*
  95. X * Write a line to the already opened file. The "buf" points to the buffer,
  96. X * and the "nbuf" is its length, less the free newline. Return the status.
  97. X * Check only at the newline.
  98. X */
  99. Xffputline(buf, nbuf)
  100. Xchar    buf[];
  101. X{
  102. X        register int    i;
  103. X#if    CRYPT
  104. X    char c;        /* character to translate */
  105. X
  106. X    if (cryptflag) {
  107. X            for (i = 0; i < nbuf; ++i) {
  108. X            c = buf[i] & 0xff;
  109. X            crypt(&c, 1);
  110. X            fputc(c, ffp);
  111. X        }
  112. X    } else
  113. X            for (i = 0; i < nbuf; ++i)
  114. X                    fputc(buf[i]&0xFF, ffp);
  115. X#else
  116. X        for (i = 0; i < nbuf; ++i)
  117. X                fputc(buf[i]&0xFF, ffp);
  118. X#endif
  119. X
  120. X#if    ST520 & ADDCR
  121. X        fputc('\r', ffp);
  122. X#endif        
  123. X        fputc('\n', ffp);
  124. X
  125. X        if (ferror(ffp)) {
  126. X                mlwrite("Write I/O error");
  127. X                return (FIOERR);
  128. X        }
  129. X
  130. X        return (FIOSUC);
  131. X}
  132. X
  133. X/*
  134. X * Read a line from a file, and store the bytes in the supplied buffer. The
  135. X * "nbuf" is the length of the buffer. Complain about long lines and lines
  136. X * at the end of the file that don't have a newline present. Check for I/O
  137. X * errors too. Return status.
  138. X */
  139. Xffgetline()
  140. X
  141. X{
  142. X        register int c;        /* current character read */
  143. X        register int i;        /* current index into fline */
  144. X    register char *tmpline;    /* temp storage for expanding line */
  145. X
  146. X    /* if we are at the end...return it */
  147. X    if (eofflag)
  148. X        return(FIOEOF);
  149. X
  150. X    /* dump fline if it ended up too big */
  151. X    if (flen > NSTRING) {
  152. X        free(fline);
  153. X        fline = NULL;
  154. X    }
  155. X
  156. X    /* if we don't have an fline, allocate one */
  157. X    if (fline == NULL)
  158. X        if ((fline = malloc(flen = NSTRING)) == NULL)
  159. X            return(FIOMEM);
  160. X
  161. X    /* read the line in */
  162. X        i = 0;
  163. X        while ((c = fgetc(ffp)) != EOF && c != '\n') {
  164. X                fline[i++] = c;
  165. X        /* if it's longer, get more room */
  166. X                if (i >= flen) {
  167. X                    if ((tmpline = malloc(flen+NSTRING)) == NULL)
  168. X                        return(FIOMEM);
  169. X                    strncpy(tmpline, fline, flen);
  170. X                    flen += NSTRING;
  171. X                    free(fline);
  172. X                    fline = tmpline;
  173. X                }
  174. X        }
  175. X
  176. X#if    ST520
  177. X    if(fline[i-1] == '\r')
  178. X        i--;
  179. X#endif
  180. X
  181. X    /* test for any errors that may have occured */
  182. X        if (c == EOF) {
  183. X                if (ferror(ffp)) {
  184. X                        mlwrite("File read error");
  185. X                        return(FIOERR);
  186. X                }
  187. X
  188. X                if (i != 0)
  189. X            eofflag = TRUE;
  190. X        else
  191. X            return(FIOEOF);
  192. X        }
  193. X
  194. X    /* terminate and decrypt the string */
  195. X        fline[i] = 0;
  196. X#if    CRYPT
  197. X    if (cryptflag)
  198. X        crypt(fline, strlen(fline));
  199. X#endif
  200. X        return(FIOSUC);
  201. X}
  202. X
  203. Xint fexist(fname)    /* does <fname> exist on disk? */
  204. X
  205. Xchar *fname;        /* file to check for existance */
  206. X
  207. X{
  208. X    FILE *fp;
  209. X
  210. X    /* try to open the file for reading */
  211. X    fp = fopen(fname, "r");
  212. X
  213. X    /* if it fails, just return false! */
  214. X    if (fp == NULL)
  215. X        return(FALSE);
  216. X
  217. X    /* otherwise, close it and report true */
  218. X    fclose(fp);
  219. X    return(TRUE);
  220. X}
  221. X
  222. X#if    AZTEC & MSDOS
  223. X#undef    fgetc
  224. X/*    a1getc:        Get an ascii char from the file input stream
  225. X            but DO NOT strip the high bit
  226. X*/
  227. X
  228. Xint a1getc(fp)
  229. X
  230. XFILE *fp;
  231. X
  232. X{
  233. X    int c;        /* translated character */
  234. X
  235. X    c = getc(fp);    /* get the character */
  236. X
  237. X    /* if its a <LF> char, throw it out  */
  238. X    while (c == 10)
  239. X        c = getc(fp);
  240. X
  241. X    /* if its a <RETURN> char, change it to a LF */
  242. X    if (c == '\r')
  243. X        c = '\n';
  244. X
  245. X    /* if its a ^Z, its an EOF */
  246. X    if (c == 26)
  247. X        c = EOF;
  248. X
  249. X    return(c);
  250. X}
  251. X#endif
  252. FRIDAY_NIGHT
  253. echo extracting - hp110.c
  254. sed 's/^X//' > hp110.c << 'FRIDAY_NIGHT'
  255. X/*
  256. X *    HP110:    Hewlett Packard 110 Screen Driver
  257. X */
  258. X
  259. X#define    termdef    1            /* don't define "term" external */
  260. X
  261. X#include        <stdio.h>
  262. X#include    "estruct.h"
  263. X#include        "edef.h"
  264. X
  265. X#if     HP110
  266. X
  267. X#define NROW    16                      /* Screen size.                 */
  268. X#define NCOL    80                      /* Edit if you want to.         */
  269. X#define    NPAUSE    100            /* # times thru update to pause */
  270. X#define    MARGIN    8            /* size of minimim margin and    */
  271. X#define    SCRSIZ    64            /* scroll size for extended lines */
  272. X#define BEL     0x07                    /* BEL character.               */
  273. X#define ESC     0x1B                    /* ESC character.               */
  274. X
  275. Xextern  int     ttopen();               /* Forward references.          */
  276. Xextern  int     ttgetc();
  277. Xextern  int     ttputc();
  278. Xextern  int     ttflush();
  279. Xextern  int     ttclose();
  280. Xextern  int     h110move();
  281. Xextern  int     h110eeol();
  282. Xextern  int     h110eeop();
  283. Xextern  int     h110beep();
  284. Xextern  int     h110open();
  285. Xextern    int    h110rev();
  286. Xextern    int    h110cres();
  287. Xextern    int    h110close();
  288. Xextern    int    h110kopen();
  289. Xextern    int    h110kclose();
  290. X
  291. X#if    COLOR
  292. Xextern    int    h110fcol();
  293. Xextern    int    h110bcol();
  294. X
  295. Xint    cfcolor = -1;        /* current forground color */
  296. Xint    cbcolor = -1;        /* current background color */
  297. X#endif
  298. X
  299. X/*
  300. X * Standard terminal interface dispatch table. Most of the fields point into
  301. X * "termio" code.
  302. X */
  303. XTERM    term    = {
  304. X    NROW-1,
  305. X        NROW-1,
  306. X        NCOL,
  307. X        NCOL,
  308. X    MARGIN,
  309. X    SCRSIZ,
  310. X    NPAUSE,
  311. X        h110open,
  312. X        h110close,
  313. X    h110kopen,
  314. X    h110kclose,
  315. X        ttgetc,
  316. X        ttputc,
  317. X        ttflush,
  318. X        h110move,
  319. X        h110eeol,
  320. X        h110eeop,
  321. X        h110beep,
  322. X    h110rev,
  323. X    h110cres
  324. X#if    COLOR
  325. X    , h110fcol,
  326. X    h110bcol
  327. X#endif
  328. X};
  329. X
  330. X#if    COLOR
  331. Xh110fcol(color)        /* set the current output color */
  332. X
  333. Xint color;    /* color to set */
  334. X
  335. X{
  336. X    if (color == cfcolor)
  337. X        return;
  338. X    ttputc(ESC);
  339. X    ttputc('[');
  340. X    h110parm(color+30);
  341. X    ttputc('m');
  342. X    cfcolor = color;
  343. X}
  344. X
  345. Xh110bcol(color)        /* set the current background color */
  346. X
  347. Xint color;    /* color to set */
  348. X
  349. X{
  350. X    if (color == cbcolor)
  351. X        return;
  352. X    ttputc(ESC);
  353. X    ttputc('[');
  354. X    h110parm(color+40);
  355. X    ttputc('m');
  356. X        cbcolor = color;
  357. X}
  358. X#endif
  359. X
  360. Xh110move(row, col)
  361. X{
  362. X        ttputc(ESC);
  363. X        ttputc('[');
  364. X        h110parm(row+1);
  365. X        ttputc(';');
  366. X        h110parm(col+1);
  367. X        ttputc('H');
  368. X}
  369. X
  370. Xh110eeol()
  371. X{
  372. X        ttputc(ESC);
  373. X        ttputc('[');
  374. X    ttputc('0');
  375. X        ttputc('K');
  376. X}
  377. X
  378. Xh110eeop()
  379. X{
  380. X#if    COLOR
  381. X    h110fcol(gfcolor);
  382. X    h110bcol(gbcolor);
  383. X#endif
  384. X        ttputc(ESC);
  385. X        ttputc('[');
  386. X    ttputc('0');
  387. X        ttputc('J');
  388. X}
  389. X
  390. Xh110rev(state)        /* change reverse video state */
  391. X
  392. Xint state;    /* TRUE = reverse, FALSE = normal */
  393. X
  394. X{
  395. X#if    COLOR
  396. X    int ftmp, btmp;        /* temporaries for colors */
  397. X#endif
  398. X
  399. X    ttputc(ESC);
  400. X    ttputc('[');
  401. X    ttputc(state ? '7': '0');
  402. X    ttputc('m');
  403. X#if    COLOR
  404. X    if (state == FALSE) {
  405. X        ftmp = cfcolor;
  406. X        btmp = cbcolor;
  407. X        cfcolor = -1;
  408. X        cbcolor = -1;
  409. X        h110fcol(ftmp);
  410. X        h110bcol(btmp);
  411. X    }
  412. X#endif
  413. X}
  414. X
  415. Xh110cres()    /* change screen resolution */
  416. X
  417. X{
  418. X    return(TRUE);
  419. X}
  420. X
  421. Xspal()        /* change pallette register */
  422. X
  423. X{
  424. X    /*   not here */
  425. X}
  426. X
  427. Xh110beep()
  428. X{
  429. X        ttputc(BEL);
  430. X        ttflush();
  431. X}
  432. X
  433. Xh110parm(n)
  434. Xregister int    n;
  435. X{
  436. X        register int q,r;
  437. X
  438. X        q = n/10;
  439. X        if (q != 0) {
  440. X        r = q/10;
  441. X        if (r != 0) {
  442. X            ttputc((r%10)+'0');
  443. X        }
  444. X        ttputc((q%10) + '0');
  445. X        }
  446. X        ttputc((n%10) + '0');
  447. X}
  448. X
  449. Xh110open()
  450. X{
  451. X    strcpy(sres, "15LINE");
  452. X    revexist = TRUE;
  453. X        ttopen();
  454. X}
  455. X
  456. Xh110close()
  457. X
  458. X{
  459. X#if    COLOR
  460. X    h110fcol(7);
  461. X    h110bcol(0);
  462. X#endif
  463. X    ttclose();
  464. X}
  465. X
  466. Xh110kopen()
  467. X
  468. X{
  469. X}
  470. X
  471. Xh110kclose()
  472. X
  473. X{
  474. X}
  475. X
  476. X#if    FLABEL
  477. Xfnclabel(f, n)        /* label a function key */
  478. X
  479. Xint f,n;    /* default flag, numeric argument [unused] */
  480. X
  481. X{
  482. X    /* on machines with no function keys...don't bother */
  483. X    return(TRUE);
  484. X}
  485. X#endif
  486. X#else
  487. Xh110hello()
  488. X{
  489. X}
  490. X#endif
  491. FRIDAY_NIGHT
  492. echo extracting - hp150.c
  493. sed 's/^X//' > hp150.c << 'FRIDAY_NIGHT'
  494. X/*
  495. X * The routines in this file provide support for HP150 screens
  496. X * and routines to access the Keyboard through KEYCODE mode.
  497. X * It compiles into nothing if not an HP150 screen device.
  498. X * added by Daniel Lawrence
  499. X */
  500. X
  501. X#define    termdef    1            /* don't define "term" external */
  502. X
  503. X#include        <stdio.h>
  504. X#include        "estruct.h"
  505. X#include    "edef.h"
  506. X
  507. X#if     HP150
  508. X
  509. X#define NROW    24                      /* Screen size.                 */
  510. X#define NCOL    80                      /* Edit if you want to.         */
  511. X#define    MARGIN    8            /* size of minimim margin and    */
  512. X#define    SCRSIZ    64            /* scroll size for extended lines */
  513. X#define    NPAUSE    15            /* # times thru update to pause */
  514. X#define BEL     0x07                    /* BEL character.               */
  515. X#define ESC     0x1B                    /* ESC character.               */
  516. X
  517. Xextern  int     openhp();               /* Forward references.          */
  518. Xextern  int     ttgetc();
  519. Xextern  int     ttputc();
  520. Xextern  int     ttflush();
  521. Xextern    int    hpflush();
  522. Xextern  int     closehp();
  523. Xextern    int    hp15kopen();
  524. Xextern    int    hp15kclose();
  525. Xextern  int     hp15move();
  526. Xextern  int     hp15eeol();
  527. Xextern  int     hp15eeop();
  528. Xextern  int     hp15beep();
  529. Xextern    int    gethpkey();
  530. Xextern    int    hp15rev();
  531. Xextern    int    hp15cres();
  532. X#if    COLOR
  533. Xextern    int    hp15fcol();
  534. Xextern    int    hp15bcol();
  535. X#endif
  536. X
  537. X/* weird to ascii translation table */
  538. X
  539. Xchar trans[][2] = {
  540. X    0x24,    9,    /* tab */
  541. X    0x25,    13,    /* ret */
  542. X    0x27,    8,    /* backspace */
  543. X    0x30,    48,    /* zero */
  544. X    0x31,    49,    /* one */
  545. X    0x32,    50,    /* two */
  546. X    0x33,    51,    /* three */
  547. X    0x34,    52,    /* four */
  548. X    0x35,    53,    /* five */
  549. X    0x36,    54,    /* six */
  550. X    0x37,    55,    /* seven */
  551. X    0x38,    56,    /* eight */
  552. X    0x39,    57,    /* nine */
  553. X    0x50,    13,    /* enter */
  554. X    0x54,    27,    /* break -> ESC */
  555. X    0x55,    27,    /* esc */
  556. X    0x58,    24,    /* stop -> ^X */
  557. X    0x70,    45,    /* N-minus */
  558. X    0x71,    42,    /* N-asterisk */
  559. X    0x72,    43,    /* N-plus */
  560. X    0x73,    47,    /* N-slash */
  561. X    0x74,    44,    /* N-comma */
  562. X    0x75,    13,    /* N-enter */
  563. X    0x76,    9,    /* N-tab */
  564. X    0x77,    46    /* N-period */
  565. X};
  566. X
  567. X#define NTRANS    sizeof(trans) / 2
  568. X
  569. Xunion REGS r;        /* register set for bios and dos (AGIOS) calls */
  570. Xint capslock = 0;    /* caps lock flag */
  571. X
  572. X/*
  573. X * Standard terminal interface dispatch table. Most of the fields point into
  574. X * "termio" code.
  575. X */
  576. XTERM    term    = {
  577. X    NROW-1,
  578. X        NROW-1,
  579. X        NCOL,
  580. X        NCOL,
  581. X    MARGIN,
  582. X    SCRSIZ,
  583. X    NPAUSE,
  584. X    openhp,
  585. X        closehp,
  586. X    hp15kopen,
  587. X    hp15kclose,
  588. X    gethpkey,
  589. X        ttputc,
  590. X        hpflush,
  591. X        hp15move,
  592. X        hp15eeol,
  593. X        hp15eeop,
  594. X        hp15beep,
  595. X        hp15rev,
  596. X        hp15cres
  597. X#if    COLOR
  598. X    , hp15fcol,
  599. X    hp15bcol
  600. X#endif
  601. X};
  602. X
  603. Xhp15move(row, col)
  604. X{
  605. X        ttputc(ESC);
  606. X        ttputc('&');
  607. X        ttputc('a');
  608. X        hp15parm(col);
  609. X        ttputc('c');
  610. X        hp15parm(row);
  611. X        ttputc('R');
  612. X}
  613. X
  614. Xhpflush()
  615. X
  616. X{
  617. X
  618. X}
  619. X
  620. Xhp15eeol()
  621. X{
  622. X        ttputc(ESC);
  623. X        ttputc('K');
  624. X}
  625. X
  626. Xhp15eeop()
  627. X{
  628. X        ttputc(ESC);
  629. X        ttputc('J');
  630. X}
  631. X
  632. Xhp15rev(status)        /* change the reverse video status */
  633. X
  634. Xint status;    /* TRUE = on, FALSE = off */
  635. X
  636. X{
  637. X    ttputc(ESC);
  638. X    ttputc('&');
  639. X    ttputc('d');
  640. X    ttputc((status != FALSE) ? 'B': '@');
  641. X}
  642. X
  643. Xhp15cres()    /* change screen resolution */
  644. X
  645. X{
  646. X    return(TRUE);
  647. X}
  648. X
  649. Xspal()        /* change pallette register */
  650. X
  651. X{
  652. X    /*   not here */
  653. X}
  654. X
  655. Xhp15beep()
  656. X{
  657. X        ttputc(BEL);
  658. X        ttflush();
  659. X}
  660. X
  661. Xhp15parm(n)
  662. Xregister int    n;
  663. X{
  664. X        register int    q;
  665. X
  666. X        q = n/10;
  667. X        if (q != 0)
  668. X                hp15parm(q);
  669. X        ttputc((n%10) + '0');
  670. X}
  671. X
  672. X#if    COLOR
  673. Xhp15fcol()    /* we really can't do colors here, so just ignore it */
  674. X{
  675. X}
  676. X
  677. Xhp15bcol()    /* we really can't do colors here, so just ignore it */
  678. X{
  679. X}
  680. X#endif
  681. X
  682. Xgethpkey()    /* get a key from the HP keyboard while in keycode mode */
  683. X
  684. X{
  685. X    static int keepflag = 0;    /* kept ahead char flag */
  686. X    static int keepchar = 0;    /* kept ehead flag */
  687. X    int c;
  688. X    int devid;            /* device ID */
  689. X    int ctype;            /* type of character gotten */
  690. X    int shiftb;            /* state of shift keys */
  691. X    int i;
  692. X    
  693. X    /* if we are in an extended char sequence, finish it */
  694. X    if (keepflag != 0) {
  695. X        keepflag = 0;
  696. X        return(keepchar);
  697. X    }
  698. X
  699. X    /* grab the next 4 char sequence */
  700. Xnext:    shiftb = ttgetc();
  701. X    devid = ttgetc();
  702. X    c = ttgetc();
  703. X    ttgetc();        /* skip null byte */
  704. X    
  705. X    /* make sure we are from the keyboard */
  706. X    if (devid != 192)
  707. X        goto next;
  708. X
  709. X    /* if normal ascii, return it */
  710. X    if ((shiftb & 0x80) == 0) {
  711. X        if (capslock && c >= 'a' && c <= 'z')
  712. X            c -= 32;
  713. X        return(c);
  714. X    }
  715. X
  716. X    /* check specifically for the caps lock key */
  717. X    if (c == 0x56) {
  718. X        capslock = ~capslock;
  719. X        goto next;
  720. X    }
  721. X
  722. X    /* check to see if it needs translation */
  723. X    for (i=0; i < NTRANS; i++)
  724. X        if (trans[i][0] == c)
  725. X            return((int)trans[i][1]);
  726. X
  727. X    /* other wise, shove it in the keep char and return the leadin code */
  728. X    keepchar = c;
  729. X    keepflag = 1;
  730. X    return(0);
  731. X}
  732. X
  733. Xopenhp()        /* open the HP150 screen for input */
  734. X
  735. X{
  736. X    strcpy(sres, "NORMAL");
  737. X    revexist = TRUE;
  738. X}
  739. X
  740. Xclosehp()        /* close the HP150 screen for input */
  741. X
  742. X{
  743. X}
  744. X
  745. Xhp15kopen()        /* open the HP150 keyboard for input */
  746. X
  747. X{
  748. X    /* define key charectoristics with AGIOS call (0, 40) */
  749. X    defkey();
  750. X
  751. X    /* Turn on RAW mode with MSDOS call 44h */
  752. X    rawon();
  753. X
  754. X    /* Turn off Control-C checking  MS-DOS 33h */
  755. X    ckeyoff();
  756. X
  757. X    /* Turn on keycode mode with AGIOS call (0,43) */
  758. X    keycon();
  759. X
  760. X    /* display the application softkey labels */
  761. X    dsplbls();
  762. X}
  763. X
  764. Xhp15kclose()        /* close the HP150 keyboard for input */
  765. X
  766. X{
  767. X    /* define key charectoristics with AGIOS call (0, 40) */
  768. X    undefkey();
  769. X    
  770. X    /* Turn off RAW mode with MSDOS call 44h */
  771. X    rawoff();
  772. X
  773. X    /* Turn on Control-C checking  MS-DOS 33h */
  774. X    ckeyon();
  775. X
  776. X    /* Turn off keycode mode with AGIOS call (0,43) */
  777. X    keycoff();
  778. X}
  779. X
  780. Xrawon()        /* put the HP150 keyboard into RAW mode */
  781. X
  782. X{
  783. X    /* get the IO control info */
  784. X
  785. X    r.x.ax = 0x4400;    /* IO ctrl get device information */
  786. X    r.x.bx = 0x0001;    /* File handle; 1 for console */
  787. X    intdos(&r, &r);        /* go fer it */
  788. X
  789. X    r.h.dh = 0;        /* clear high byte for put */
  790. X    r.h.dl |= 0x20;        /* set raw bit */
  791. X
  792. X    /* and put it back */
  793. X
  794. X    r.x.ax = 0x4401;    /* IO ctrl put device information */
  795. X    r.x.bx = 0x0001;    /* File handle; 1 for console */
  796. X    intdos(&r, &r);        /* go fer it */
  797. X}
  798. X
  799. Xrawoff()    /* put the HP150 keyboard into COOKED mode */
  800. X
  801. X{
  802. X    /* get the IO control info */
  803. X
  804. X    r.x.ax = 0x4400;    /* IO ctrl get device information */
  805. X    r.x.bx = 0x0001;    /* File handle; 1 for console */
  806. X    intdos(&r, &r);        /* go fer it */
  807. X
  808. X    r.h.dh = 0;        /* clear high byte for put */
  809. X    r.h.dl &= 0xdf;        /* set raw bit */
  810. X
  811. X    /* and put it back */
  812. X
  813. X    r.x.ax = 0x4401;    /* IO ctrl put device information */
  814. X    r.x.bx = 0x0001;    /* File handle; 1 for console */
  815. X    intdos(&r, &r);        /* go fer it */
  816. X}
  817. X
  818. X
  819. Xckeyoff()    /* turn control-C trapping off */
  820. X
  821. X{
  822. X    r.h.ah = 0x33;    /* ctrl-break check */
  823. X    r.h.al = 1;    /* set the state of the ctrl-break check */
  824. X    r.h.dl = 0;    /* turn it off */
  825. X    intdos(&r, &r);
  826. X}
  827. X
  828. Xckeyon()    /* turn control-C trapping on */
  829. X
  830. X{
  831. X    r.h.ah = 0x33;    /* ctrl-break check */
  832. X    r.h.al = 1;    /* set the state of the ctrl-break check */
  833. X    r.h.dl = 1;    /* turn it on */
  834. X    intdos(&r, &r);
  835. X}
  836. X
  837. X#ifdef    unsigned
  838. X#undef    unsigned
  839. X#endif
  840. X
  841. Xagios(buf, len)    /* perform an AGIOS call */
  842. X
  843. Xchar *buf;    /* sequence of bytes in command */
  844. Xint len;    /* length of command in bytes */
  845. X
  846. X{
  847. X    r.x.ax = 0x4403;    /* I/O ctrl write */
  848. X    r.x.bx = 1;        /* console handle */
  849. X    r.x.cx = len;        /* buffer length */
  850. X    r.x.dx = (unsigned)buf;    /* buffer address */
  851. X    return(intdos(&r, &r));    /* do it */
  852. X}
  853. X
  854. Xkeycon()    /* turn keycode mode on */
  855. X
  856. X{
  857. X    static char cmd[] = {43, 0, 1};
  858. X
  859. X    return(agios(&cmd[0], 3));
  860. X}
  861. X
  862. Xkeycoff()    /* turn keycode mode off */
  863. X
  864. X{
  865. X    static char cmd[] = {43, 0, 0};
  866. X
  867. X    return(agios(&cmd[0], 3));
  868. X}
  869. X
  870. Xdefkey()    /* change all special keys to intercept mode */
  871. X
  872. X{
  873. X    static char cmd[] = {40, 0, 2, 0, 0xfe, 0};
  874. X
  875. X    return(agios(&cmd[0], 6));
  876. X}
  877. X
  878. Xundefkey()    /* change all special keys to intercept mode */
  879. X
  880. X{
  881. X    static char cmd[] = {40, 0, 0, 0, 0xfe, 0};
  882. X
  883. X    return(agios(&cmd[0], 6));
  884. X}
  885. X
  886. Xdsplbls()    /* display the application softkey labels on the screen */
  887. X
  888. X{
  889. X    static char cmd[] = {11, 0};
  890. X
  891. X    return(agios(&cmd[0], 2));
  892. X}
  893. X
  894. X#if    FLABEL
  895. Xfnclabel(f, n)        /* label a function key */
  896. X
  897. Xint f,n;    /* default flag, numeric argument */
  898. X
  899. X{
  900. X    register int status;    /* return status */
  901. X    register int i;        /* loop index */
  902. X    char lbl[17];    /* returned label contents */
  903. X    /* AGIOS command buffer */
  904. X    static char cmd[] = {8, 0, 1, 0, 7, 7, 7, 7, 10, 0, 10, 0};
  905. X    /*                   code  key#  ptr to      top    bottom
  906. X                                     label string  attribute */
  907. X    union {        /* union to cast ptr into AGIOS arg string */
  908. X        char *ptr;    /* pointer to arg string */
  909. X        char cstr[4];
  910. X    } ptru;
  911. X
  912. X    /* must have a numeric argument */
  913. X    if (f == FALSE) {
  914. X        mlwrite("%Need function key number");
  915. X        return(FALSE);
  916. X    }
  917. X
  918. X    /* and it must be a legal key number */
  919. X    if (n < 1 || n > 8) {
  920. X        mlwrite("%Function key number out of range");
  921. X        return(FALSE);
  922. X    }
  923. X
  924. X    /* get the string to send */
  925. X    status = mlreply("Label contents: ", &lbl[0], 17);
  926. X    if (status != TRUE)
  927. X        return(status);
  928. X
  929. X    /* pad the label out */
  930. X    for (i=0; i < 17; i++) {
  931. X        if (lbl[i] == 0)
  932. X            break;
  933. X    }
  934. X    for (; i < 16; i++)
  935. X        lbl[i] = ' ';
  936. X    lbl[16] = 0;
  937. X
  938. X    /* set up the parameters */
  939. X    cmd[2] = n;            /* function key number */
  940. X    ptru.ptr = &lbl[0];        /* set up pointer to label string */
  941. Xforce:    cmd[4] = ptru.cstr[0];
  942. X    cmd[5] = ptru.cstr[1];
  943. X    cmd[6] = ptru.cstr[2];
  944. X    cmd[7] = ptru.cstr[3];
  945. X
  946. X    /* and send it out */
  947. X    agios(&cmd[0], 12);
  948. X    return(TRUE);
  949. X}
  950. X#endif
  951. X#else
  952. X
  953. Xh15hello()
  954. X
  955. X{
  956. X}
  957. X#endif
  958. FRIDAY_NIGHT
  959. echo extracting - ibmpc.c
  960. sed 's/^X//' > ibmpc.c << 'FRIDAY_NIGHT'
  961. X/*
  962. X * The routines in this file provide support for the IBM-PC and other
  963. X * compatible terminals. It goes directly to the graphics RAM to do
  964. X * screen output. It compiles into nothing if not an IBM-PC driver
  965. X * Supported monitor cards include CGA, MONO and EGA.
  966. X */
  967. X
  968. X#define    termdef    1            /* don't define "term" external */
  969. X
  970. X#include        <stdio.h>
  971. X#include    "estruct.h"
  972. X#include        "edef.h"
  973. X
  974. X#if     IBMPC
  975. X#define NROW    43            /* Max Screen size.        */
  976. X#define NCOL    80                      /* Edit if you want to.         */
  977. X#define    MARGIN    8            /* size of minimim margin and    */
  978. X#define    SCRSIZ    64            /* scroll size for extended lines */
  979. X#define    NPAUSE    200            /* # times thru update to pause */
  980. X#define BEL     0x07                    /* BEL character.               */
  981. X#define ESC     0x1B                    /* ESC character.               */
  982. X#define    SPACE    32            /* space character        */
  983. X
  984. X#define    SCADC    0xb8000000L        /* CGA address of screen RAM    */
  985. X#define    SCADM    0xb0000000L        /* MONO address of screen RAM    */
  986. X#define SCADE    0xb8000000L        /* EGA address of screen RAM    */
  987. X
  988. X#define MONOCRSR 0x0B0D            /* monochrome cursor        */
  989. X#define CGACRSR 0x0607            /* CGA cursor            */
  990. X#define EGACRSR 0x0709            /* EGA cursor            */
  991. X
  992. X#define    CDCGA    0            /* color graphics card        */
  993. X#define    CDMONO    1            /* monochrome text card        */
  994. X#define    CDEGA    2            /* EGA color adapter        */
  995. X#define    CDSENSE    9            /* detect the card type        */
  996. X
  997. X#define NDRIVE    3            /* number of screen drivers    */
  998. X
  999. Xint dtype = -1;                /* current display type        */
  1000. Xchar drvname[][8] = {            /* screen resolution names    */
  1001. X    "CGA", "MONO", "EGA"
  1002. X};
  1003. Xlong scadd;                /* address of screen ram    */
  1004. Xint *scptr[NROW];            /* pointer to screen lines    */
  1005. Xunsigned int sline[NCOL];        /* screen line image        */
  1006. Xint egaexist = FALSE;            /* is an EGA card available?    */
  1007. Xextern union REGS rg;            /* cpu register for use of DOS calls */
  1008. X
  1009. Xextern  int     ttopen();               /* Forward references.          */
  1010. Xextern  int     ttgetc();
  1011. Xextern  int     ttputc();
  1012. Xextern  int     ttflush();
  1013. Xextern  int     ttclose();
  1014. Xextern  int     ibmmove();
  1015. Xextern  int     ibmeeol();
  1016. Xextern  int     ibmeeop();
  1017. Xextern  int     ibmbeep();
  1018. Xextern  int     ibmopen();
  1019. Xextern    int    ibmrev();
  1020. Xextern    int    ibmcres();
  1021. Xextern    int    ibmclose();
  1022. Xextern    int    ibmputc();
  1023. Xextern    int    ibmkopen();
  1024. Xextern    int    ibmkclose();
  1025. X
  1026. X#if    COLOR
  1027. Xextern    int    ibmfcol();
  1028. Xextern    int    ibmbcol();
  1029. X
  1030. Xint    cfcolor = -1;        /* current forground color */
  1031. Xint    cbcolor = -1;        /* current background color */
  1032. Xint    ctrans[] =        /* ansi to ibm color translation table */
  1033. X    {0, 4, 2, 6, 1, 5, 3, 7};
  1034. X#endif
  1035. X
  1036. X/*
  1037. X * Standard terminal interface dispatch table. Most of the fields point into
  1038. X * "termio" code.
  1039. X */
  1040. XTERM    term    = {
  1041. X    NROW-1,
  1042. X        NROW-1,
  1043. X        NCOL,
  1044. X        NCOL,
  1045. X    MARGIN,
  1046. X    SCRSIZ,
  1047. X    NPAUSE,
  1048. X        ibmopen,
  1049. X        ibmclose,
  1050. X    ibmkopen,
  1051. X    ibmkclose,
  1052. X        ttgetc,
  1053. X    ibmputc,
  1054. X        ttflush,
  1055. X        ibmmove,
  1056. X        ibmeeol,
  1057. X        ibmeeop,
  1058. X        ibmbeep,
  1059. X    ibmrev,
  1060. X    ibmcres
  1061. X#if    COLOR
  1062. X    , ibmfcol,
  1063. X    ibmbcol
  1064. X#endif
  1065. X};
  1066. X
  1067. X#if    COLOR
  1068. Xibmfcol(color)        /* set the current output color */
  1069. X
  1070. Xint color;    /* color to set */
  1071. X
  1072. X{
  1073. X    cfcolor = ctrans[color];
  1074. X}
  1075. X
  1076. Xibmbcol(color)        /* set the current background color */
  1077. X
  1078. Xint color;    /* color to set */
  1079. X
  1080. X{
  1081. X        cbcolor = ctrans[color];
  1082. X}
  1083. X#endif
  1084. X
  1085. Xibmmove(row, col)
  1086. X{
  1087. X    rg.h.ah = 2;        /* set cursor position function code */
  1088. X    rg.h.dl = col;
  1089. X    rg.h.dh = row;
  1090. X    rg.h.bh = 0;        /* set screen page number */
  1091. X    int86(0x10, &rg, &rg);
  1092. X}
  1093. X
  1094. Xibmeeol()    /* erase to the end of the line */
  1095. X
  1096. X{
  1097. X    unsigned int attr;    /* attribute byte mask to place in RAM */
  1098. X    unsigned int *lnptr;    /* pointer to the destination line */
  1099. X    int i;
  1100. X    int ccol;    /* current column cursor lives */
  1101. X    int crow;    /*       row    */
  1102. X
  1103. X    /* find the current cursor position */
  1104. X    rg.h.ah = 3;        /* read cursor position function code */
  1105. X    rg.h.bh = 0;        /* current video page */
  1106. X    int86(0x10, &rg, &rg);
  1107. X    ccol = rg.h.dl;        /* record current column */
  1108. X    crow = rg.h.dh;        /* and row */
  1109. X
  1110. X    /* build the attribute byte and setup the screen pointer */
  1111. X#if    COLOR
  1112. X    if (dtype != CDMONO)
  1113. X        attr = (((cbcolor & 15) << 4) | (cfcolor & 15)) << 8;
  1114. X    else
  1115. X        attr = 0x0700;
  1116. X#else
  1117. X    attr = 0x0700;
  1118. X#endif
  1119. X    lnptr = &sline[0];
  1120. X    for (i=0; i < term.t_ncol; i++)
  1121. X        *lnptr++ = SPACE | attr;
  1122. X
  1123. X    if (flickcode && (dtype == CDCGA)) {
  1124. X        /* wait for vertical retrace to be off */
  1125. X        while ((inp(0x3da) & 8))
  1126. X            ;
  1127. X    
  1128. X        /* and to be back on */
  1129. X        while ((inp(0x3da) & 8) == 0)
  1130. X            ;
  1131. X    }            
  1132. X
  1133. X    /* and send the string out */
  1134. X    movmem(&sline[0], scptr[crow]+ccol, (term.t_ncol-ccol)*2);
  1135. X
  1136. X}
  1137. X
  1138. Xibmputc(ch)    /* put a character at the current position in the
  1139. X           current colors */
  1140. X
  1141. Xint ch;
  1142. X
  1143. X{
  1144. X    rg.h.ah = 14;        /* write char to screen with current attrs */
  1145. X    rg.h.al = ch;
  1146. X#if    COLOR
  1147. X    if (dtype != CDMONO)
  1148. X        rg.h.bl = cfcolor;
  1149. X    else
  1150. X        rg.h.bl = 0x07;
  1151. X#else
  1152. X    rg.h.bl = 0x07;
  1153. X#endif
  1154. X    int86(0x10, &rg, &rg);
  1155. X}
  1156. X
  1157. Xibmeeop()
  1158. X{
  1159. X    int attr;        /* attribute to fill screen with */
  1160. X
  1161. X    rg.h.ah = 6;        /* scroll page up function code */
  1162. X    rg.h.al = 0;        /* # lines to scroll (clear it) */
  1163. X    rg.x.cx = 0;        /* upper left corner of scroll */
  1164. X    rg.x.dx = (term.t_nrow << 8) | (term.t_ncol - 1);
  1165. X                /* lower right corner of scroll */
  1166. X#if    COLOR
  1167. X    if (dtype != CDMONO)
  1168. X        attr = ((ctrans[gbcolor] & 15) << 4) | (ctrans[gfcolor] & 15);
  1169. X    else
  1170. X        attr = 0;
  1171. X#else
  1172. X    attr = 0;
  1173. X#endif
  1174. X    rg.h.bh = attr;
  1175. X    int86(0x10, &rg, &rg);
  1176. X}
  1177. X
  1178. Xibmrev(state)        /* change reverse video state */
  1179. X
  1180. Xint state;    /* TRUE = reverse, FALSE = normal */
  1181. X
  1182. X{
  1183. X    /* This never gets used under the IBM-PC driver */
  1184. X}
  1185. X
  1186. Xibmcres(res)    /* change screen resolution */
  1187. X
  1188. Xchar *res;    /* resolution to change to */
  1189. X
  1190. X{
  1191. X    int i;        /* index */
  1192. X
  1193. X    for (i = 0; i < NDRIVE; i++)
  1194. X        if (strcmp(res, drvname[i]) == 0) {
  1195. X            scinit(i);
  1196. X            return(TRUE);
  1197. X        }
  1198. X    return(FALSE);
  1199. X}
  1200. X
  1201. Xspal()    /* reset the pallette registers */
  1202. X
  1203. X{
  1204. X    /* nothin here now..... */
  1205. X}
  1206. X
  1207. Xibmbeep()
  1208. X{
  1209. X#if    MWC86
  1210. X    putcnb(BEL);
  1211. X#else
  1212. X    bdos(6, BEL, 0);
  1213. X#endif
  1214. X}
  1215. X
  1216. Xibmopen()
  1217. X{
  1218. X    scinit(CDSENSE);
  1219. X    revexist = TRUE;
  1220. X        ttopen();
  1221. X}
  1222. X
  1223. Xibmclose()
  1224. X
  1225. X{
  1226. X#if    COLOR
  1227. X    ibmfcol(7);
  1228. X    ibmbcol(0);
  1229. X#endif
  1230. X    /* if we had the EGA open... close it */
  1231. X    if (dtype == CDEGA)
  1232. X        egaclose();
  1233. X
  1234. X    ttclose();
  1235. X}
  1236. X
  1237. Xibmkopen()    /* open the keyboard */
  1238. X
  1239. X{
  1240. X}
  1241. X
  1242. Xibmkclose()    /* close the keyboard */
  1243. X
  1244. X{
  1245. X}
  1246. X
  1247. Xscinit(type)    /* initialize the screen head pointers */
  1248. X
  1249. Xint type;    /* type of adapter to init for */
  1250. X
  1251. X{
  1252. X    union {
  1253. X        long laddr;    /* long form of address */
  1254. X        int *paddr;    /* pointer form of address */
  1255. X    } addr;
  1256. X    int i;
  1257. X
  1258. X    /* if asked...find out what display is connected */
  1259. X    if (type == CDSENSE)
  1260. X        type = getboard();
  1261. X
  1262. X    /* if we have nothing to do....don't do it */
  1263. X    if (dtype == type)
  1264. X        return(TRUE);
  1265. X
  1266. X    /* if we try to switch to EGA and there is none, don't */
  1267. X    if (type == CDEGA && egaexist != TRUE)
  1268. X        return(FALSE);
  1269. X
  1270. X    /* if we had the EGA open... close it */
  1271. X    if (dtype == CDEGA)
  1272. X        egaclose();
  1273. X
  1274. X    /* and set up the various parameters as needed */
  1275. X    switch (type) {
  1276. X        case CDMONO:    /* Monochrome adapter */
  1277. X                scadd = SCADM;
  1278. X                newsize(TRUE, 25);
  1279. X                break;
  1280. X
  1281. X        case CDCGA:    /* Color graphics adapter */
  1282. X                scadd = SCADC;
  1283. X                newsize(TRUE, 25);
  1284. X                break;
  1285. X
  1286. X        case CDEGA:    /* Enhanced graphics adapter */
  1287. X                scadd = SCADE;
  1288. X                egaopen();
  1289. X                newsize(TRUE, 43);
  1290. X                break;
  1291. X    }
  1292. X
  1293. X    /* reset the $sres environment variable */
  1294. X    strcpy(sres, drvname[type]);
  1295. X    dtype = type;
  1296. X
  1297. X    /* initialize the screen pointer array */
  1298. X    for (i = 0; i < NROW; i++) {
  1299. X        addr.laddr = scadd + (long)(NCOL * i * 2);
  1300. X        scptr[i] = addr.paddr;
  1301. X    }
  1302. X    return(TRUE);
  1303. X}
  1304. X
  1305. X/* getboard:    Determine which type of display board is attached.
  1306. X        Current known types include:
  1307. X
  1308. X        CDMONO    Monochrome graphics adapter
  1309. X        CDCGA    Color Graphics Adapter
  1310. X        CDEGA    Extended graphics Adapter
  1311. X*/
  1312. X
  1313. X/* getboard:    Detect the current display adapter
  1314. X        if MONO        set to MONO
  1315. X           CGA        set to CGA    EGAexist = FALSE
  1316. X           EGA        set to CGA    EGAexist = TRUE
  1317. X*/
  1318. X
  1319. Xint getboard()
  1320. X
  1321. X{
  1322. X    int type;    /* board type to return */
  1323. X
  1324. X    type = CDCGA;
  1325. X    int86(0x11, &rg, &rg);
  1326. X    if ((((rg.x.ax >> 4) & 3) == 3))
  1327. X        type = CDMONO;
  1328. X
  1329. X    /* test if EGA present */
  1330. X    rg.x.ax = 0x1200;
  1331. X    rg.x.bx = 0xff10;
  1332. X    int86(0x10,&rg, &rg);        /* If EGA, bh=0-1 and bl=0-3 */
  1333. X    egaexist = !(rg.x.bx & 0xfefc);    /* Yes, it's EGA */
  1334. X    return(type);
  1335. X}
  1336. X
  1337. Xegaopen()    /* init the computer to work with the EGA */
  1338. X
  1339. X{
  1340. X    /* put the beast into EGA 43 row mode */
  1341. X    rg.x.ax = 3;
  1342. X    int86(16, &rg, &rg);
  1343. X
  1344. X    rg.h.ah = 17;        /* set char. generator function code */
  1345. X    rg.h.al = 18;        /*  to 8 by 8 double dot ROM         */
  1346. X    rg.h.bl = 0;        /* block 0                           */
  1347. X    int86(16, &rg, &rg);
  1348. X
  1349. X    rg.h.ah = 18;        /* alternate select function code    */
  1350. X    rg.h.al = 0;        /* clear AL for no good reason       */
  1351. X    rg.h.bl = 32;        /* alt. print screen routine         */
  1352. X    int86(16, &rg, &rg);
  1353. X
  1354. X    rg.h.ah = 1;        /* set cursor size function code */
  1355. X    rg.x.cx = 0x0607;    /* turn cursor on code */
  1356. X    int86(0x10, &rg, &rg);
  1357. X
  1358. X    outp(0x3d4, 10);    /* video bios bug patch */
  1359. X    outp(0x3d5, 6);
  1360. X}
  1361. X
  1362. Xegaclose()
  1363. X
  1364. X{
  1365. X    /* put the beast into 80 column mode */
  1366. X    rg.x.ax = 3;
  1367. X    int86(16, &rg, &rg);
  1368. X}
  1369. X
  1370. Xscwrite(row, outstr, forg, bacg)    /* write a line out*/
  1371. X
  1372. Xint row;    /* row of screen to place outstr on */
  1373. Xchar *outstr;    /* string to write out (must be term.t_ncol long) */
  1374. Xint forg;    /* forground color of string to write */
  1375. Xint bacg;    /* background color */
  1376. X
  1377. X{
  1378. X    unsigned int attr;    /* attribute byte mask to place in RAM */
  1379. X    unsigned int *lnptr;    /* pointer to the destination line */
  1380. X    int i;
  1381. X
  1382. X    /* build the attribute byte and setup the screen pointer */
  1383. X#if    COLOR
  1384. X    if (dtype != CDMONO)
  1385. X        attr = (((ctrans[bacg] & 15) << 4) | (ctrans[forg] & 15)) << 8;
  1386. X    else
  1387. X        attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
  1388. X#else
  1389. X    attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
  1390. X#endif
  1391. X    lnptr = &sline[0];
  1392. X    for (i=0; i<term.t_ncol; i++)
  1393. X        *lnptr++ = (outstr[i] & 255) | attr;
  1394. X
  1395. X    if (flickcode && (dtype == CDCGA)) {
  1396. X        /* wait for vertical retrace to be off */
  1397. X        while ((inp(0x3da) & 8))
  1398. X            ;
  1399. X    
  1400. X        /* and to be back on */
  1401. X        while ((inp(0x3da) & 8) == 0)
  1402. X            ;
  1403. X    }
  1404. X
  1405. X    /* and send the string out */
  1406. X    movmem(&sline[0], scptr[row],term.t_ncol*2);
  1407. X}
  1408. X
  1409. X#if    FLABEL
  1410. Xfnclabel(f, n)        /* label a function key */
  1411. X
  1412. Xint f,n;    /* default flag, numeric argument [unused] */
  1413. X
  1414. X{
  1415. X    /* on machines with no function keys...don't bother */
  1416. X    return(TRUE);
  1417. X}
  1418. X#endif
  1419. X#else
  1420. Xibmhello()
  1421. X{
  1422. X}
  1423. X#endif
  1424. X
  1425. FRIDAY_NIGHT
  1426. echo mes.6 completed!
  1427. # That's all folks!
  1428.  
  1429.  
  1430.