home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / UTILITY / EXEC23.ZIP / EXTEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-11  |  804 b   |  35 lines

  1.  
  2. #include "compat.h"
  3.  
  4.  
  5. extern int do_exec (char *xfn, char *pars, int spwn,
  6.                           unsigned needed, char **envp);
  7.  
  8. void main (void)
  9. {
  10.    char fn [255], par [130], *com;
  11.    char far *x;
  12.    char far *y;
  13.  
  14.    x = farmalloc (64L * 1024L);  /* test swapping of non-contiguous memory */
  15.    y = farmalloc (64L * 1024L);
  16.     putenv ("XYZ=This is an environment string for the spawned process");
  17.    while (1)
  18.       {
  19.       printf ("\nEXEC filename,params ('.' to exit): ");
  20.       gets (fn);
  21.       if (fn [0] == '.')
  22.          return;
  23.       com = strchr (fn, ',');
  24.       if (com != NULL)
  25.          {
  26.          strcpy (par, &com [1]);
  27.          *com = 0;
  28.          }
  29.       else
  30.          par [0] = 0;
  31.  
  32.         printf ("\nDO_EXEC returns %04x\n", do_exec (fn, par, 1, 0xffff, environ));
  33.       }
  34. }
  35.