home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 October / VPR9710A.ISO / BENCH / DJ1SRC_K / 105 / STUB.C < prev    next >
C/C++ Source or Header  |  1997-05-02  |  1KB  |  41 lines

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