home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cl5sr386.zip / GO32 / STUB.C < prev    next >
C/C++ Source or Header  |  1992-04-13  |  1KB  |  39 lines

  1. /* This is file STUB.C */
  2. /*
  3. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15. #include <process.h>
  16. #include <dos.h>
  17.  
  18. char hex[] = "0123456789abcdef";
  19.  
  20. x2s(int v, char *s)
  21. {
  22.   int i;
  23.   for (i=0; i<4; i++)
  24.   {
  25.     s[3-i] = hex[v&15];
  26.     v >>= 4;
  27.   }
  28.   s[4] = 0;
  29. }
  30.  
  31. main(int argc, char **argv)
  32. {
  33.   char s_argc[5], s_seg[5], s_argv[5];
  34.   x2s(argc, s_argc);
  35.   x2s(_DS, s_seg);
  36.   x2s((int)argv, s_argv);
  37.   return spawnlp(P_WAIT, "go32", "go32", "!proxy", s_argc, s_seg, s_argv, 0);
  38. }
  39.