home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8708 / 36 < prev    next >
Encoding:
Internet Message Format  |  1990-07-13  |  1.3 KB

  1. From: jpn@teddy.UUCP (John P. Nelson)
  2. Newsgroups: comp.sources.misc
  3. Subject: Re: MicroGnu for MSDOS
  4. Message-ID: <4227@ncoast.UUCP>
  5. Date: 22 Aug 87 16:43:16 GMT
  6. Sender: allbery@ncoast.UUCP
  7. Organization: GenRad, Inc., Concord, Mass.
  8. Lines: 47
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/8708/36
  11.  
  12. My face is a bit red.  My recent posting of MicroGnu for MSDOS was
  13. missing a file, spawn.c (actually sys/msdos/spawn.c).  Here is spawn.c
  14. (not shar format)
  15.  
  16. /*
  17.  * Name:    MicroEMACS spawn.c
  18.  *        Spawn CLI for MSDOS (MSC4.0)
  19.  *
  20.  */
  21. #include    "def.h"
  22. #include    <process.h>
  23.  
  24. extern    char    *getenv();
  25.  
  26. /*
  27.  * On MSDOS, we got no job control like system V, so always
  28.  * run a subshell. Bound to "C-C", and used
  29.  * as a subcommand by "C-Z". (daveb)
  30.  *
  31.  * Returns 0 if the shell executed OK, something else if
  32.  * we couldn't start shell or it exited badly.
  33.  */
  34. spawncli(f, n, k)
  35. {
  36.     char *comspec;
  37.     int        errp = FALSE;
  38.  
  39.     ttcolor(CTEXT);
  40.     ttnowindow();
  41.     ttmove(nrow-1, 0);
  42.     if (epresf != FALSE) {
  43.         tteeol();
  44.         epresf = FALSE;
  45.     }
  46.     ttclose();
  47.     sgarbf = TRUE;                /* Force repaint.    */
  48.     if ((comspec = getenv("COMSPEC")) == NULL)
  49.         errp = -1;
  50.     else
  51.         errp = spawnl(P_WAIT, comspec, "COMMAND.COM", (char *)NULL);
  52.  
  53.     ttopen();
  54.     if(errp == -1)
  55.         ewprintf("Failed to create process");
  56.  
  57.     return ( errp );
  58. }
  59.