home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / spawnvp.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  2KB  |  49 lines

  1. /***
  2. *spawnvp.c - spawn a child process; search along PATH
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _spawnvp() - spawn a child process; search along PATH
  8. *
  9. *******************************************************************************/
  10.  
  11. #include <cruntime.h>
  12. #include <stdlib.h>
  13. #include <process.h>
  14. #include <tchar.h>
  15.  
  16. /***
  17. *int _spawnvp(modeflag, filename, argv) - spawn a child process (search PATH)
  18. *
  19. *Purpose:
  20. *       Spawns a child process, with search along PATH variable.
  21. *       formats the parameters and calls _spawnve to do the actual work. The
  22. *       NULL environment pointer indicates the new process will inherit the
  23. *       parents process's environment.  NOTE - at least one argument must be
  24. *       present.  This argument is always, by convention, the name of the file
  25. *       being spawned.
  26. *
  27. *Entry:
  28. *       int modeflag   - mode to spawn (WAIT, NOWAIT, or OVERLAY)
  29. *                        only WAIT and OVERLAY currently supported
  30. *       _TSCHAR *pathname - name of file to spawn
  31. *       _TSCHAR **argv    - vector of arguments
  32. *
  33. *Exit:
  34. *       returns exit code of child process
  35. *       returns -1 if fails
  36. *
  37. *Exceptions:
  38. *
  39. *******************************************************************************/
  40.  
  41. int __cdecl _tspawnvp (
  42.         int modeflag,
  43.         REG3 const _TSCHAR *filename,
  44.         const _TSCHAR * const *argv
  45.         )
  46. {
  47.         return _tspawnvpe(modeflag, filename, argv, NULL);
  48. }
  49.