home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / memacs400_src.lzh / MEMACS400 / SRC / mpe.c < prev    next >
Text File  |  1996-04-25  |  16KB  |  819 lines

  1. /***
  2.     MPE driver/Microemacs 3.10b/3.10k,
  3.     Copyright 1995 D. Lawrence, C. Smith
  4.  ***/
  5.  
  6. /** Include files **/
  7. #include <stdio.h>            /* Standard I/O definitions    */
  8. #include "estruct.h"            /* Emacs definitions        */
  9.  
  10. /** Do nothing routine **/
  11. int scnothing()
  12. {
  13.     return(0);
  14. }
  15.  
  16. /** Only compile for MPE machines **/
  17. #if MPE
  18.  
  19. /** Include files **/
  20. #include "eproto.h"            /* Function definitions        */
  21. #include "edef.h"            /* Global variable definitions    */
  22. #include "elang.h"            /* Language definitions        */
  23.  
  24. /** Parameters **/
  25. #define NKEYENT        300        /* Number of keymap entries    */
  26. #define NINCHAR        64        /* Input buffer size        */
  27. #define NOUTCHAR    256        /* Output buffer size        */
  28. #define MARGIN        8        /* Margin size            */
  29. #define SCRSIZ        64        /* Scroll for margin        */
  30. #define NPAUSE        10        /* # times thru update to pause */
  31.  
  32. /** Constants **/
  33. #define CCE        2        /* Command successful        */
  34. #define TIMEOUT        255        /* No character available    */
  35.  
  36. /** Intrinsics **/
  37. #pragma intrinsic FCLOSE        /* File close intrinsic        */
  38. #pragma intrinsic FREAD            /* File read intrinsic        */
  39. #pragma intrinsic FOPEN            /* File open intrinsic        */
  40. #pragma intrinsic FCONTROL        /* File control intrinsic    */
  41. #pragma intrinsic FDEVICECONTROL    /* Device control intrinsic    */
  42. #pragma intrinsic FWRITE        /* File write intrinsic        */
  43.  
  44. /** Local variables **/
  45. static short mpetermin;            /* Terminal input        */
  46. static short mpetermout;        /* Terminal output        */
  47. static short mpetype;            /* Terminal type        */
  48. static short mpeoecho;            /* Old echo mode        */
  49. static short mpeotahd;            /* Old typeahead mode        */
  50. #if COLOR
  51. static int cfcolor = -1;        /* Current forground color    */
  52. static int cbcolor = -1;        /* Current background color    */
  53. #endif /* COLOR */
  54. static int inbuf[NINCHAR];        /* Input buffer            */
  55. static int * inbufh =            /* Head of input buffer        */
  56.     inbuf;
  57. static int * inbuft =            /* Tail of input buffer        */
  58.     inbuf;
  59. static unsigned char outbuf[NOUTCHAR];    /* Output buffer        */
  60. static unsigned char * outbuft =     /* Output buffer tail        */
  61.     outbuf;
  62.  
  63. /** Terminal definition block **/
  64. int scopen(), scclose(), ttgetc(), ttputc(), ttflush();
  65. int scmove(), sceeol(), sceeop(), scbeep(), screv();
  66. #if COLOR
  67. int scfcol(), scbcol();
  68. #endif /* COLOR */
  69. TERM term = {
  70.     23,                /* Maximum number of rows    */
  71.     23,                /* Current number of rows    */
  72.     80,                /* Maximum number of columns    */
  73.     80,                /* Current number of columns    */
  74.     0,                /* Origin row            */
  75.     0,                /* Origin column        */
  76.     MARGIN,                /* Margin for extending lines    */
  77.     SCRSIZ,                /* Scroll size for extending    */
  78.     NPAUSE,                /* # times thru update to pause    */
  79.     scopen,                /* Open terminal routine    */
  80.     scclose,            /* Close terminal routine    */
  81.     scnothing,            /* Open keyboard routine    */
  82.     scnothing,            /* Close keyboard routine    */
  83.     ttgetc,                /* Get character routine    */
  84.     ttputc,                /* Put character routine    */
  85.     ttflush,            /* Flush output routine        */
  86.     scmove,                /* Move cursor routine        */
  87.     sceeol,                /* Erase to end of line routine    */
  88.     sceeop,                /* Erase to end of page routine    */
  89.     sceeop,                /* Clear desk            */
  90.     scbeep,                /* Beep! routine        */
  91.     screv,                /* Set reverse video routine    */
  92.     scnothing,            /* Set resolution routine    */
  93. #if COLOR
  94.     scfcol,                /* Set forground color routine    */
  95.     scbcol                /* Set background color routine    */
  96. #endif /* COLOR */
  97. #if INSDEL
  98.     scnothing,            /* Insert a screen line        */
  99.     scnothing,            /* Delete a screen line        */
  100. #endif /* INSDEL */
  101. };
  102.  
  103. /** Open terminal device **/
  104. int ttopen()
  105. {
  106.     short value;
  107.     short error;
  108.  
  109.     /* Open terminal for input */
  110.     mpetermin = FOPEN(0, 0444, 0, -80);
  111.     if (ccode() != CCE) {
  112. #ifdef DEBUG
  113.         printf("Cannot open $STDIN\n");
  114. #endif /* DEBUG */
  115.         goto error_stdin;
  116.     }
  117.  
  118.     /* Open terminal for output */
  119.     mpetermout = FOPEN(0, 0414, 1, -80);
  120.     if (ccode() != CCE) {
  121. #ifdef DEBUG
  122.         printf("Cannot open $STDLIST\n");
  123. #endif /* DEBUG */
  124.         goto error_stdlist;
  125.     }
  126.  
  127.     /* Get terminal type */
  128.     FCONTROL(mpetermin, 39, &mpetype);
  129.     if (ccode() != CCE) {
  130. #ifdef DEBUG
  131.         printf("FCONTROL(39) failed\n");
  132. #endif /* DEBUG */
  133.         goto error_other;
  134.     }
  135.  
  136.     /* Set transparent editing mode */
  137. #ifdef DEBUG
  138.     value = '*';
  139. #else
  140.     value = '\377';
  141. #endif
  142.     FDEVICECONTROL(mpetermin, &value, 1, 192, 15, 2, &error);
  143.     if (ccode() != CCE) {
  144. #ifdef DEBUG
  145.         printf("FDEVICECONTROL(15) failed; error %d\n", error);
  146. #endif /* DEBUG */
  147.         goto error_other;
  148.     }
  149.  
  150.     /* Turn off echo */
  151.     mpeoecho = 0;
  152.     FDEVICECONTROL(mpetermin, &mpeoecho, 1, 192, 4, 3, &error);
  153.     if (ccode() != CCE) {
  154. #ifdef DEBUG
  155.         printf("FDEVICECONTROL(4) failed; error %d\n", error);
  156. #endif /* DEBUG */
  157.         goto error_other;
  158.     }
  159.  
  160.     /* Set type ahead */
  161.     mpeotahd = 1;
  162.     FDEVICECONTROL(mpetermin, &mpeotahd, 1, 192, 51, 3, &error);
  163.     if (ccode() != CCE) {
  164. #ifdef DEBUG
  165.         printf("FDEVICECONTROL(51) failed; error %d\n", error);
  166. #endif /* DEBUG */
  167.         goto error_other;
  168.     }
  169.  
  170.     /* Success */
  171.     return(0);
  172.  
  173. error_other:
  174.     FCLOSE(mpetermout, 0, 0);
  175. error_stdlist:
  176.     FCLOSE(mpetermin, 0, 0);
  177. error_stdin:
  178.     return -1;
  179. }
  180.  
  181. /** Close terminal device **/
  182. int ttclose()
  183. {
  184.     short value;
  185.     short error;
  186.  
  187.     /* Cancel transparent editing mode */
  188.     value = 0;
  189.     FDEVICECONTROL(mpetermin, &value, 1, 192, 15, 2, &error);
  190. #ifdef DEBUG
  191.     if (ccode() != CCE) {
  192.         printf("FDEVICECONTROL(15) failed; error %d\n", error);
  193.     }
  194. #endif /* DEBUG */
  195.  
  196.     /* Restore echoing */
  197.     FDEVICECONTROL(mpetermin, &mpeoecho, 1, 192, 4, 2, &error);
  198. #ifdef DEBUG
  199.     if (ccode() != CCE) {
  200.         printf("FDEVICECONTROL(4) failed; error %d\n", error);
  201.     }
  202. #endif /* DEBUG */
  203.  
  204.     /* Restore type ahead */
  205.     FDEVICECONTROL(mpetermin, &mpeotahd, 1, 192, 51, 2, &error);
  206. #ifdef DEBUG
  207.     if (ccode() != CCE) {
  208.         printf("FDEVICECONTROL(51) failed; error %d\n", error);
  209.     }
  210. #endif /* DEBUG */
  211.  
  212.     /* Close terminal */
  213.     FCLOSE(mpetermin, 0, 0);
  214.     FCLOSE(mpetermout, 0, 0);
  215.  
  216.     /* Success */
  217.     return(0);
  218. }
  219.  
  220. /** Flush output buffer to display **/
  221. int ttflush()
  222. {
  223.     int len;
  224.  
  225.     /* Compute length of write */
  226.     len = outbuft - outbuf;
  227.     if (len == 0)
  228.         return(0);
  229.  
  230.     /* Reset buffer position */
  231.     outbuft = outbuf;
  232.  
  233.     /* Perform write to screen */
  234.     FWRITE(mpetermout, outbuf, -len, 0320);
  235. #ifdef DEBUG
  236.     if (ccode() != CCE) {
  237.         printf("FWRITE fails\n");
  238.     }
  239. #endif
  240.     return 0;
  241. }
  242.  
  243. /** Put character onto display **/
  244. int ttputc(ch)
  245. char ch;                /* Character to display        */
  246. {
  247.     /* Check for buffer full */
  248.     if (outbuft == &outbuf[sizeof(outbuf)])
  249.         ttflush();
  250.  
  251.     /* Add to buffer */
  252.     *outbuft++ = ch;
  253.     return(0);
  254. }
  255.  
  256. /** Put out sequence, with padding **/
  257. void putpad(pad, seq)
  258. int pad;                /* Number of padding characters    */
  259. char * seq;                /* Character sequence        */
  260. {
  261.     /* Check for null */
  262.     if (!seq)
  263.         return;
  264.  
  265.     /* Output sequence */
  266.     while (*seq)
  267.         ttputc(*seq++);
  268.  
  269.     /* Output padding */
  270.     while (pad-- > 0)
  271.         ttputc('\0');
  272. }
  273.  
  274. /** Grab input characters, with wait **/
  275. unsigned char grabwait()
  276. {
  277.     char ch;
  278.     int count;
  279.  
  280.     /* Read character */
  281.     count = FREAD(mpetermin, &ch, -1);
  282.     if (count != 1) {
  283.         puts("** Horrible read error occured **");
  284.         exit(1);
  285.     }
  286.  
  287.     /* Return new character */
  288.     return ch;
  289. }
  290.  
  291. /** Grab input characters, short wait **/
  292. unsigned char grabnowait()
  293. {
  294.     char ch;
  295.     int count;
  296.     short value;
  297.     short error;
  298.  
  299.     /* Set read timeout */
  300.     value = 1;
  301.     FDEVICECONTROL(mpetermin, &value, 1, 192, 2, 2, &error);
  302. #ifdef DEBUG
  303.     if (ccode() != CCE) {
  304.         printf("FDEVICECONTROL(2) failed; error %d\n", error);
  305.     }
  306. #endif /* DEBUG */
  307.  
  308.     /* Read character */
  309.     count = FREAD(mpetermin, &ch, -1);
  310.     if (count == 0)
  311.         return TIMEOUT;
  312.     if (count != 1) {
  313.         puts("** Horrible read error occured **");
  314.         exit(1);
  315.     }
  316.  
  317.     /* Return new character */
  318.     return ch;
  319. }
  320.  
  321. /** Queue input character **/
  322. void qin(ch)
  323. int ch;                    /* Character to add        */
  324. {
  325.     /* Check for overflow */
  326.     if (inbuft == &inbuf[sizeof(inbuf)]) {
  327.         
  328.         /* Annoy user */
  329.         scbeep();
  330.         return;
  331.     }
  332.     
  333.     /* Add character */
  334.     *inbuft++ = ch;
  335. }
  336.  
  337. /*
  338.  * qrep - replace a key sequence with a single character in the input buffer.
  339.  */
  340. #if PROTO
  341. VOID qrep(int ch)
  342. #else
  343. VOID qrep( ch)
  344. int ch;
  345. #endif
  346. {
  347.     inbuft = inbuf;
  348.     qin(ch);
  349. }
  350.  
  351. /** Return cooked characters **/
  352. int ttgetc()
  353. {
  354.     int ch;
  355.  
  356.     /* Loop until character found */
  357.     while (1) {
  358.     
  359.         /* Get input from buffer, if available */
  360.         if (inbufh != inbuft) {
  361.             ch = *inbufh++;
  362.             if (inbufh == inbuft)
  363.                 inbufh = inbuft = inbuf;
  364.             break;
  365.         } else
  366.  
  367.             /* Fill input buffer */
  368.             cook();
  369.     }
  370.     
  371.     /* Return next character */
  372.     return ch;
  373. }
  374.  
  375. #if TYPEAH
  376. int typahead()
  377. {
  378.     /* See if internal buffer is non-empty */
  379.     if (inbufh != inbuft)
  380.         return 1;
  381.  
  382.     /* Now check with system */
  383.     /* Offhand, I don't see a function call but I'm sure there is a way */
  384.     return 0;
  385. }
  386. #endif /* TYPEAH */
  387.  
  388. /** Initialize screen package **/
  389. int scopen()
  390. {
  391.     strcpy(os, "MPE");
  392.  
  393.     /* Open terminal device */
  394.     if (ttopen()) {
  395.         puts("Cannot open terminal");
  396.         exit(1);
  397.     }
  398.  
  399.     /* Success */
  400.     return(0);
  401. }
  402.  
  403. /** Close screen package **/
  404. int scclose()
  405. {
  406.     /* Close terminal device */
  407.     ttclose();
  408.  
  409.     /* Success */
  410.     return(0);
  411. }
  412.  
  413. /** Move cursor **/
  414. int scmove(row, col)
  415. int row;                /* Row number            */
  416. int col;                /* Column number        */
  417. {
  418.     char buffer[12];
  419.  
  420.     /* Output addressing */
  421.     sprintf(buffer, "\033&a%dc%dY", col, row);
  422.     putpad(6, buffer);
  423.  
  424.     /* Success */
  425.     return(0);
  426. }
  427.  
  428. /** Erase to end of line **/
  429. int sceeol()
  430. {
  431.     /* Send erase sequence */
  432.     putpad(0, "\033K");
  433.  
  434.     /* Success */
  435.     return(0);
  436. }
  437.  
  438. /** Clear screen **/
  439. int sceeop()
  440. {
  441. #if COLOR
  442.     scfcol(gfcolor);
  443.     scbcol(gbcolor);
  444. #endif /* COLOR */
  445.  
  446.     /* Send clear sequence */
  447.     putpad(0, "\033H\033J");
  448.  
  449.     /* Success */
  450.     return(0);
  451. }
  452.  
  453. /** Set reverse video state **/
  454. int screv(state)
  455. int state;                /* New state            */
  456. {
  457. #if COLOR
  458.     int ftmp, btmp;        /* temporaries for colors */
  459. #endif /* COLOR */
  460.  
  461.     /* Set reverse video state */
  462.     putpad(0, state ? "\033&dJ" : "\033&d@");
  463.  
  464. #if COLOR
  465.     if (state == FALSE) {
  466.         ftmp = cfcolor;
  467.         btmp = cbcolor;
  468.         cfcolor = -1;
  469.         cbcolor = -1;
  470.         scfcol(ftmp);
  471.         scbcol(btmp);
  472.     }
  473. #endif /* COLOR */
  474.  
  475.     /* Success */
  476.     return(0);
  477. }
  478.  
  479. /** Beep **/
  480. scbeep()
  481. {
  482.     /* The old standby method */
  483.     ttputc('\7');
  484.  
  485.     /* Success */
  486.     return(0);
  487. }
  488.  
  489. #if COLOR
  490. /** Set foreground color **/
  491. int scfcol(color)
  492. int color;        /* Color to set            */
  493. {
  494.     /* Skip if already the correct color */
  495.     if (color == cfcolor)
  496.         return;
  497.  
  498.     /* Set the color */
  499.     cfcolor = color;
  500.     return(0);
  501. }
  502.  
  503. /** Set background color **/
  504. int scbcol(color)
  505. int color;            /* Color to set            */
  506. {
  507.     /* Skip if already the correct color */
  508.     if (color == cbcolor)
  509.         return;
  510.  
  511.     /* Set the color */
  512.         cbcolor = color;
  513.     return(0);
  514. }
  515. #endif /* COLOR */
  516.  
  517. /** Set palette **/
  518. int spal(cmd)
  519. char * cmd;                /* Palette command        */
  520. {
  521.     int code, dokeymap;
  522.     char * cp;
  523.  
  524.     /* Check for keymapping command */
  525.     if (strncmp(cmd, "KEYMAP ", 7) == 0)
  526.         dokeymap = 1;
  527.     else if (strncmp(cmd, "CLRMAP ", 7) == 0)
  528.         dokeymap = 0;
  529.     else
  530.         return(0);
  531.     cmd += 7;
  532.  
  533.     /* Look for space */
  534.     for (cp = cmd; *cp != '\0'; cp++)
  535.         if (*cp == ' ') {
  536.             *cp++ = '\0';
  537.             break;
  538.         }
  539.     if (*cp == '\0')
  540.         return 1;
  541.  
  542.     /* Perform operation */
  543.     if (dokeymap) {
  544.  
  545.         /* Convert to keycode */
  546.         code = stock(cmd);
  547.  
  548.         /* Add to tree */
  549.         addkey(cp, code);
  550.     } else {
  551.  
  552.         /* Convert to color number */
  553.         code = atoi(cmd);
  554.         if (code < 0 || code > 15)
  555.             return 1;
  556.  
  557. #if COLOR
  558.         /* Move color code to capability structure */
  559. #endif /* COLOR */
  560.     }
  561.     return(0);
  562. }
  563.  
  564. /** Get time of day **/
  565. char * timeset()
  566. {
  567.     long int buf; /* Should be time_t */
  568.     char * sp, * cp;
  569.  
  570.     char * ctime();
  571.  
  572.     /* Get system time */
  573.     time(&buf);
  574.  
  575.     /* Pass system time to converter */
  576.     sp = ctime(&buf);
  577.  
  578.     /* Eat newline character */
  579.     for (cp = sp; *cp; cp++)
  580.         if (*cp == '\n') {
  581.             *cp = '\0';
  582.             break;
  583.         }
  584.     return sp;
  585. }
  586.  
  587. /** Callout to system to perform command **/
  588. int callout(cmd)
  589. char * cmd;                /* Command to execute        */
  590. {
  591.     int status;
  592.  
  593.     /* Close down */
  594.     scmove(term.t_nrow, 0);
  595.     ttflush();
  596.     ttclose();
  597.  
  598.     /* Do command */
  599.     status = system(cmd) == 0;
  600.  
  601.     /* Restart system */
  602.         sgarbf = TRUE;
  603.     if (ttopen()) {
  604.         puts("** Error reopening terminal device **");
  605.         exit(1);
  606.     }
  607.  
  608.     /* Success */
  609.         return status;
  610. }
  611.  
  612. /** Create subshell **/
  613. int spawncli(f, n)
  614. int f;                    /* Flags            */
  615. int n;                    /* Argument count        */
  616. {
  617.     char * sh;
  618.  
  619.     /* Don't allow this command if restricted */
  620.     if (restflag)
  621.         return resterr();
  622.  
  623.     /* Do shell */
  624.     return callout("ci.pub.sys");
  625. }
  626.  
  627. /** Spawn a command **/
  628. int spawn(f, n)
  629. int f;                    /* Flags            */
  630. int n;                    /* Argument count        */
  631. {
  632.     char line[NLINE];
  633.     int s;
  634.  
  635.     /* Don't allow this command if restricted */
  636.     if (restflag)
  637.         return resterr();
  638.  
  639.     /* Get command line */
  640.     s = mlreply("!", line, NLINE);
  641.     if (!s)
  642.         return s;
  643.  
  644.     /* Perform the command */
  645.     s = callout(line);
  646.  
  647.     /* if we are interactive, pause here */
  648.     if (clexec == FALSE) {
  649.             mlwrite("[End]");
  650.         ttflush();
  651.         ttgetc();
  652.         }
  653.         return s;
  654. }
  655.  
  656. /** Execute program **/
  657. int execprg(f, n)
  658. int f;                    /* Flags            */
  659. int n;                    /* Argument count        */
  660. {
  661.     /* Same as spawn */
  662.     return spawn(f, n);
  663. }
  664.  
  665. /** Pipe output of program to buffer **/
  666. int pipecmd(f, n)
  667. int f;                    /* Flags            */
  668. int n;                    /* Argument count        */
  669. {
  670.     char line[NLINE];
  671.     int s;
  672.     BUFFER * bp;
  673.     EWINDOW * wp;
  674.     static char filnam[] = "command";
  675.  
  676.     /* Don't allow this command if restricted */
  677.     if (restflag)
  678.         return resterr();
  679.  
  680.     /* Get pipe-in command */
  681.     s = mlreply("@", line, NLINE);
  682.     if (!s)
  683.         return s;
  684.  
  685.     /* Get rid of the command output buffer if it exists */
  686.     bp = bfind(filnam, FALSE, 0);
  687.     if (bp) {
  688.         /* Try to make sure we are off screen */
  689.         wp = wheadp;
  690.         while (wp) {
  691.             if (wp->w_bufp == bp) {
  692.                 onlywind(FALSE, 1);
  693.                 break;
  694.             }
  695.             wp = wp->w_wndp;
  696.         }
  697.         if (!zotbuf(bp))
  698.             return(0);
  699.     }
  700.  
  701.     /* Add output specification */
  702.     strcat(line, ">");
  703.     strcat(line, filnam);
  704.  
  705.     /* Do command */
  706.     s = callout(line);
  707.     if (!s)
  708.         return s;
  709.  
  710.     /* Split the current window to make room for the command output */
  711.     if (!splitwind(FALSE, 1))
  712.         return(0);
  713.  
  714.     /* ...and read the stuff in */
  715.     if (!getfile(filnam, FALSE))
  716.         return(0);
  717.  
  718.     /* Make this window in VIEW mode, update all mode lines */
  719.     curwp->w_bufp->b_mode |= MDVIEW;
  720.     wp = wheadp;
  721.     while (wp) {
  722.         wp->w_flag |= WFMODE;
  723.         wp = wp->w_wndp;
  724.     }
  725.  
  726.     /* ...and get rid of the temporary file */
  727.     unlink(filnam);
  728.     return 1;
  729. }
  730.  
  731. /** Filter buffer through command **/
  732. int filter(f, n)
  733. int f;                    /* Flags            */
  734. int n;                    /* Argument count        */
  735. {
  736.     char line[NLINE], tmpnam[NFILEN];
  737.     int s;
  738.     BUFFER * bp;
  739.     static char bname1[] = "fltinp";
  740.     static char filnam1[] = "fltinp";
  741.     static char filnam2[] = "fltout";
  742.  
  743.     /* Don't allow this command if restricted */
  744.     if (restflag)
  745.         return resterr();
  746.  
  747.     /* Don't allow filtering of VIEW mode buffer */
  748.     if (curbp->b_mode & MDVIEW)
  749.         return rdonly();
  750.  
  751.     /* Get the filter name and its args */
  752.     s = mlreply("#", line, NLINE);
  753.     if (!s)
  754.         return s;
  755.  
  756.     /* Setup the proper file names */
  757.     bp = curbp;
  758.     strcpy(tmpnam, bp->b_fname);    /* Save the original name */
  759.     strcpy(bp->b_fname, bname1);    /* Set it to our new one */
  760.  
  761.     /* Write it out, checking for errors */
  762.     if (!writeout(filnam1, "w")) {
  763.         mlwrite("[Cannot write filter file]");
  764.         strcpy(bp->b_fname, tmpnam);
  765.         return(0);
  766.     }
  767.  
  768.     /* Setup input and output */
  769.     strcat(line," <fltinp >fltout");
  770.  
  771.     /* Perform command */
  772.     s = callout(line);
  773.  
  774.     /* If successful, read in file */
  775.     if (s) {
  776.         s = readin(filnam2, FALSE);
  777.         if (s)
  778.             /* Mark buffer as changed */
  779.             bp->b_flag |= BFCHG;
  780.     }
  781.             
  782.  
  783.     /* Reset file name */
  784.     strcpy(bp->b_fname, tmpnam);
  785.  
  786.     /* and get rid of the temporary file */
  787.     unlink(filnam1);
  788.     unlink(filnam2);
  789.  
  790.     /* Show status */
  791.     if (!s)
  792.         mlwrite("[Execution failed]");
  793.     return s;
  794. }
  795.  
  796. #if FLABEL
  797. int fnclabel(f, n)    /* label a function key */
  798. int f,n;    /* default flag, numeric argument [unused] */
  799. {
  800.     /* on machines with no function keys...don't bother */
  801.     return(TRUE);
  802. }
  803. #endif /* FLABEL */
  804.  
  805. /** Get first filename from pattern **/
  806. char *getffile(fspec)
  807. char *fspec;                /* Filename specification    */
  808. {
  809.     return(NULL);
  810. }
  811.  
  812. /** Get next filename from pattern **/
  813. char *getnfile()
  814. {
  815.     return(NULL);
  816. }
  817.  
  818. #endif /* MPE */
  819.