home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / bloodshed / devcpp-4.9.9.2_setup.exe / process.h < prev    next >
C/C++ Source or Header  |  2005-01-29  |  5KB  |  139 lines

  1. /* 
  2.  * process.h
  3.  * This file has no copyright assigned and is placed in the Public Domain.
  4.  * This file is a part of the mingw-runtime package.
  5.  * No warranty is given; refer to the file DISCLAIMER within the package.
  6.  *
  7.  * Function calls for spawning child processes.
  8.  *
  9.  */
  10.  
  11. #ifndef    _PROCESS_H_
  12. #define    _PROCESS_H_
  13.  
  14. /* All the headers include this file. */
  15. #include <_mingw.h>
  16.  
  17. /* Includes a definition of _pid_t and pid_t */
  18. #include <sys/types.h>
  19.  
  20. /*
  21.  * Constants for cwait actions.
  22.  * Obsolete for Win32.
  23.  */
  24. #define    _WAIT_CHILD        0
  25. #define    _WAIT_GRANDCHILD    1
  26.  
  27. #ifndef    _NO_OLDNAMES
  28. #define    WAIT_CHILD        _WAIT_CHILD
  29. #define    WAIT_GRANDCHILD        _WAIT_GRANDCHILD
  30. #endif    /* Not _NO_OLDNAMES */
  31.  
  32. /*
  33.  * Mode constants for spawn functions.
  34.  */
  35. #define    _P_WAIT        0
  36. #define    _P_NOWAIT    1
  37. #define    _P_OVERLAY    2
  38. #define    _OLD_P_OVERLAY    _P_OVERLAY
  39. #define    _P_NOWAITO    3
  40. #define    _P_DETACH    4
  41.  
  42. #ifndef    _NO_OLDNAMES
  43. #define    P_WAIT        _P_WAIT
  44. #define    P_NOWAIT    _P_NOWAIT
  45. #define    P_OVERLAY    _P_OVERLAY
  46. #define    OLD_P_OVERLAY    _OLD_P_OVERLAY
  47. #define    P_NOWAITO    _P_NOWAITO
  48. #define    P_DETACH    _P_DETACH
  49. #endif    /* Not _NO_OLDNAMES */
  50.  
  51.  
  52. #ifndef RC_INVOKED
  53.  
  54. #ifdef    __cplusplus
  55. extern "C" {
  56. #endif
  57.  
  58. _CRTIMP void __cdecl _cexit(void);
  59. _CRTIMP void __cdecl _c_exit(void);
  60.  
  61. _CRTIMP int __cdecl _cwait (int*, _pid_t, int);
  62.  
  63. _CRTIMP _pid_t __cdecl _getpid(void);
  64.  
  65. _CRTIMP int __cdecl _execl    (const char*, const char*, ...);
  66. _CRTIMP int __cdecl _execle    (const char*, const char*, ...);
  67. _CRTIMP int __cdecl _execlp    (const char*, const char*, ...);
  68. _CRTIMP int __cdecl _execlpe    (const char*, const char*, ...);
  69. _CRTIMP int __cdecl _execv    (const char*, const char* const*);
  70. _CRTIMP int __cdecl _execve    (const char*, const char* const*, const char* const*);
  71. _CRTIMP int __cdecl _execvp    (const char*, const char* const*);
  72. _CRTIMP int __cdecl _execvpe    (const char*, const char* const*, const char* const*);
  73.  
  74. _CRTIMP int __cdecl _spawnl    (int, const char*, const char*, ...);
  75. _CRTIMP int __cdecl _spawnle    (int, const char*, const char*, ...);
  76. _CRTIMP int __cdecl _spawnlp    (int, const char*, const char*, ...);
  77. _CRTIMP int __cdecl _spawnlpe    (int, const char*, const char*, ...);
  78. _CRTIMP int __cdecl _spawnv    (int, const char*, const char* const*);
  79. _CRTIMP int __cdecl _spawnve    (int, const char*, const char* const*, const char* const*);
  80. _CRTIMP int __cdecl _spawnvp    (int, const char*, const char* const*);
  81. _CRTIMP int __cdecl _spawnvpe    (int, const char*, const char* const*, const char* const*);
  82.  
  83.  
  84. /*
  85.  * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
  86.  * They are provided by MSVCRT.
  87.  *
  88.  * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
  89.  * making for race conditions if you are not careful. Basically you have to
  90.  * make sure that no-one is going to do *anything* with the thread handle
  91.  * after the thread calls _endthread or returns from the thread function.
  92.  *
  93.  * NOTE: No old names for these functions. Use the underscore.
  94.  */
  95. _CRTIMP unsigned long __cdecl
  96.     _beginthread    (void (*)(void *), unsigned, void*);
  97. _CRTIMP void __cdecl _endthread    (void);
  98.  
  99. #ifdef    __MSVCRT__
  100. _CRTIMP unsigned long __cdecl
  101.     _beginthreadex    (void *, unsigned, unsigned (__stdcall *) (void *), 
  102.              void*, unsigned, unsigned*);
  103. _CRTIMP void __cdecl _endthreadex (unsigned);
  104. #endif
  105.  
  106.  
  107. #ifndef    _NO_OLDNAMES
  108. /*
  109.  * Functions without the leading underscore, for portability. These functions
  110.  * live in liboldnames.a.
  111.  */
  112. _CRTIMP int  __cdecl cwait (int*, pid_t, int);
  113. _CRTIMP pid_t __cdecl getpid (void);
  114. _CRTIMP int __cdecl execl (const char*, const char*, ...);
  115. _CRTIMP int __cdecl execle (const char*, const char*, ...);
  116. _CRTIMP int __cdecl execlp (const char*, const char*, ...);
  117. _CRTIMP int __cdecl execlpe (const char*, const char*, ...);
  118. _CRTIMP int __cdecl execv (const char*, const char* const*);
  119. _CRTIMP int __cdecl execve (const char*, const char* const*, const char* const*);
  120. _CRTIMP int __cdecl execvp (const char*, const char* const*);
  121. _CRTIMP int __cdecl execvpe (const char*, const char* const*, const char* const*);
  122. _CRTIMP int __cdecl spawnl (int, const char*, const char*, ...);
  123. _CRTIMP int __cdecl spawnle (int, const char*, const char*, ...);
  124. _CRTIMP int __cdecl spawnlp (int, const char*, const char*, ...);
  125. _CRTIMP int __cdecl spawnlpe (int, const char*, const char*, ...);
  126. _CRTIMP int __cdecl spawnv (int, const char*, const char* const*);
  127. _CRTIMP int __cdecl spawnve (int, const char*, const char* const*, const char* const*);
  128. _CRTIMP int __cdecl spawnvp (int, const char*, const char* const*);
  129. _CRTIMP int __cdecl spawnvpe (int, const char*, const char* const*, const char* const*);
  130. #endif    /* Not _NO_OLDNAMES */
  131.  
  132. #ifdef    __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif    /* Not RC_INVOKED */
  137.  
  138. #endif    /* _PROCESS_H_ not defined */
  139.