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

  1. /***
  2. *execv.c - execute a file
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _execv() - execute a file
  8. *
  9. *******************************************************************************/
  10.  
  11. #include <cruntime.h>
  12. #include <stdlib.h>
  13. #include <process.h>
  14. #include <tchar.h>
  15. #include <dbgint.h>
  16.  
  17. /***
  18. *int _execv(filename, argvector) - execute a file
  19. *
  20. *Purpose:
  21. *       Executes a file with given arguments.  Passes arguments to _execve and
  22. *       uses pointer to the default environment.
  23. *
  24. *Entry:
  25. *       _TSCHAR *filename        - file to execute
  26. *       _TSCHAR **argvector - vector of arguments.
  27. *
  28. *Exit:
  29. *       destroys calling process (hopefully)
  30. *       if fails, returns -1
  31. *
  32. *Exceptions:
  33. *
  34. *******************************************************************************/
  35.  
  36. int __cdecl _texecv (
  37.         const _TSCHAR *filename,
  38.         const _TSCHAR * const *argvector
  39.         )
  40. {
  41.         _ASSERTE(filename != NULL);
  42.         _ASSERTE(*filename != _T('\0'));
  43.         _ASSERTE(argvector != NULL);
  44.         _ASSERTE(*argvector != NULL);
  45.         _ASSERTE(**argvector != _T('\0'));
  46.  
  47.         return(_texecve(filename,argvector,NULL));
  48. }
  49.