home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / process.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  9.4 KB  |  234 lines

  1. /*  process.h
  2.  
  3.     Symbols and structures for process management.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 10.0
  9.  *
  10.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.8  $ */
  16.  
  17. #if !defined(__PROCESS_H)
  18. #define __PROCESS_H
  19.  
  20. #ifndef ___STDDEF_H
  21. #include <_stddef.h>
  22. #endif
  23.  
  24. #if !defined(RC_INVOKED)
  25.  
  26. #if defined(__STDC__)
  27. #pragma warn -nak
  28. #endif
  29.  
  30. #endif  /* !RC_INVOKED */
  31.  
  32. #ifdef __cplusplus
  33. namespace std {
  34. #endif /* __cplusplus */
  35.  
  36. /*  Modes available as first argument to the spawnxx functions. */
  37. #define P_WAIT           0  /* child runs separately, parent waits until exit */
  38. #define P_NOWAIT         1  /* both child & parent run concurrently */
  39. #define P_OVERLAY        2  /* child replaces parent, parent no longer exists */
  40. #define P_NOWAITO        3  /* ASYNCH,       toss RC    */
  41. #define P_DETACH         4  /* DETACHED,     toss RC    */
  42.  
  43. /* MSC versions of the spawnxx modes */
  44. #define _P_WAIT          0
  45. #define _P_NOWAIT        1
  46. #define _P_OVERLAY       2
  47. #define _P_NOWAITO       3
  48. /*      _P_DETACH           // This one conflicts with the Flag version below */
  49.  
  50. /* Flags that can be or'ed into the base spawnxx mode parameter */
  51. #define _P_MASK         (0x07)  /* used to mask off the P_xxx values */
  52.  
  53. #define _P_DETACH       (0x0010) /* Run child as a detached process (or'able version of P_DETACH) */
  54. #define _P_NEWCONSOLE   (0x0020) /* Run child in a new console window */
  55. #define _P_NEWPROCGROUP (0x0040) /* Child is the root of a new Process Group */
  56. #define _P_SUSPENDED    (0x0080) /* Child's main thread is created suspended */
  57. #define _P_NOCLOSE      (0x0100) /* Prevents the child's hProcess or hThread from being closed */
  58. #define _P_NEWWIN16     (0x0200) /* Run Win16 apps in a private WOW VDM */
  59. #define _P_SHAREDWIN16  (0x0400) /* Run all Win16 apps the same WOW VDM */
  60. #define _P_DEFERRORMODE (0x0800) /* Child does not inherit error mode of parent */
  61. #define _P_PRIO_IDLE    (0x1000) /* Run in IDLE priority class */
  62. #define _P_PRIO_NORM    (0x2000) /* Run in NORMAL priority class */
  63. #define _P_PRIO_HIGH    (0x4000) /* Run in HIGH priority class */
  64. #define _P_PRIO_REAL    (0x8000) /* Run in REALTIME priority class */
  65.  
  66. #define WAIT_CHILD      (0)
  67. #define WAIT_GRANDCHILD (1)
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73. int  _RTLENTRY _EXPFUNC getpid(void);
  74. void _RTLENTRY _EXPFUNC abort(void);
  75. void _RTLENTRY _EXPFUNC _cexit(void);
  76. void _RTLENTRY _EXPFUNC _c_exit(void);
  77. int  _RTLENTRY _EXPFUNC execl(const char * __path, const char * __arg0, ...);
  78. int  _RTLENTRY _EXPFUNC execle(const char * __path, const char * __arg0, ...);
  79. int  _RTLENTRY _EXPFUNC execlp(const char * __path, const char * __arg0, ...);
  80. int  _RTLENTRY _EXPFUNC execlpe(const char * __path, const char * __arg0, ...);
  81. int  _RTLENTRY _EXPFUNC execv(const char * __path, char * const * __argv);
  82. int  _RTLENTRY _EXPFUNC execve(const char * __path, char * const * __argv,
  83.                               char * const * __env);
  84. int  _RTLENTRY _EXPFUNC execvp(const char * __path, char * const * __argv);
  85. int  _RTLENTRY _EXPFUNC execvpe(const char * __path, char * const * __argv,
  86.                                 char * const * __env);
  87. void _RTLENTRY _EXPFUNC exit(int __status);
  88. void _RTLENTRY _EXPFUNC _exit(int __status);
  89. int  _RTLENTRY _EXPFUNC spawnl(int __mode, const char * __path, const char * __arg0, ...);
  90. int  _RTLENTRY _EXPFUNC spawnle(int __mode, const char * __path, const char * __arg0, ...);
  91. int  _RTLENTRY _EXPFUNC spawnlp(int __mode, const char * __path, const char * __arg0, ...);
  92. int  _RTLENTRY _EXPFUNC spawnlpe(int __mode, const char * __path, const char * __arg0, ...);
  93. int  _RTLENTRY _EXPFUNC spawnv(int __mode, const char * __path, char * const * __argv);
  94. int  _RTLENTRY _EXPFUNC spawnve(int __mode, const char * __path, char * const * __argv,
  95.                                char * const * __env);
  96. int  _RTLENTRY _EXPFUNC spawnvp(int __mode, const char * __path, char * const * __argv);
  97. int  _RTLENTRY _EXPFUNC spawnvpe(int __mode, const char * __path, char * const * __argv,
  98.                                 char * const * __env);
  99. int  _RTLENTRY _EXPFUNC system(const char * __command);
  100.  
  101.  
  102. int  _RTLENTRY _EXPFUNC _wexecl(const wchar_t * __path, const wchar_t * __arg0, ...);
  103. int  _RTLENTRY _EXPFUNC _wexecle(const wchar_t * __path, const wchar_t * __arg0, ...);
  104. int  _RTLENTRY _EXPFUNC _wexeclp(const wchar_t * __path, const wchar_t * __arg0, ...);
  105. int  _RTLENTRY _EXPFUNC _wexeclpe(const wchar_t * __path, const wchar_t * __arg0, ...);
  106. int  _RTLENTRY _EXPFUNC _wexecv(const wchar_t * __path, wchar_t * const * __argv);
  107. int  _RTLENTRY _EXPFUNC _wexecve(const wchar_t * __path, wchar_t * const * __argv,
  108.                               wchar_t * const * __env);
  109. int  _RTLENTRY _EXPFUNC _wexecvp(const wchar_t * __path, wchar_t * const * __argv);
  110. int  _RTLENTRY _EXPFUNC _wexecvpe(const wchar_t * __path, wchar_t * const * __argv,
  111.                                 wchar_t * const * __env);
  112. int  _RTLENTRY _EXPFUNC _wspawnl(int __mode, const wchar_t * __path, const wchar_t * __arg0, ...);
  113. int  _RTLENTRY _EXPFUNC _wspawnle(int __mode, const wchar_t * __path, const wchar_t * __arg0, ...);
  114. int  _RTLENTRY _EXPFUNC _wspawnlp(int __mode, const wchar_t * __path, const wchar_t * __arg0, ...);
  115. int  _RTLENTRY _EXPFUNC _wspawnlpe(int __mode, const wchar_t * __path, const wchar_t * __arg0, ...);
  116. int  _RTLENTRY _EXPFUNC _wspawnv(int __mode, const wchar_t * __path, wchar_t * const * __argv);
  117. int  _RTLENTRY _EXPFUNC _wspawnve(int __mode, const wchar_t * __path, wchar_t * const * __argv,
  118.                                wchar_t * const * __env);
  119. int  _RTLENTRY _EXPFUNC _wspawnvp(int __mode, const wchar_t * __path, wchar_t * const * __argv);
  120. int  _RTLENTRY _EXPFUNC _wspawnvpe(int __mode, const wchar_t * __path, wchar_t * const * __argv,
  121.                                 wchar_t * const * __env);
  122. int  _RTLENTRY _EXPFUNC _wsystem(const wchar_t * __command);
  123.  
  124.  
  125. #if defined(__MT__)
  126.  
  127. struct _thread_adoption_data_s { char __dummy; };
  128. typedef struct _thread_adoption_data_s* _PTHREAD_ADOPTION_DATA;
  129.  
  130. void                    _RTLENTRY _EXPFUNC     _unadopt_thread(_PTHREAD_ADOPTION_DATA __thd);
  131. _PTHREAD_ADOPTION_DATA  _RTLENTRY _EXPFUNC     _adopt_thread(void (_USERENTRY *__start_address)(void *),
  132.                                                              void *__arglist,
  133.                                                               int __free_flag);
  134.  
  135. unsigned long _RTLENTRY _EXPFUNC _beginthread  (void (_USERENTRY *__start)(void *),
  136.                                                 unsigned __stksize, void *__arg);
  137. unsigned long _RTLENTRY _EXPFUNC _beginthreadNT(void (_USERENTRY *__start)(void *),
  138.                                                 unsigned __stksize, void *__arg,
  139.                                                 void *__security_attr,
  140.                                                 unsigned long __create_flags,
  141.                                                 unsigned long *__thread_id);
  142.  
  143. unsigned long _RTLENTRY _EXPFUNC _beginthreadex(void *__security_attr,
  144.                                                 unsigned __stksize,
  145.                                                 unsigned (__stdcall *__start)(void *),
  146.                                                 void *__arg,
  147.                                                 unsigned __create_flags,
  148.                                                 unsigned *__thread_id);
  149.  
  150. void          _RTLENTRY _EXPFUNC _endthread    (void);
  151. void          _RTLENTRY _EXPFUNC _endthreadex  (unsigned __thread_retval);
  152.  
  153. #endif  /* __MT__ */
  154.  
  155. int  _RTLENTRY _EXPFUNC cwait          (int *__term_stat, int __pid, int __action);
  156. int  _RTLENTRY _EXPFUNC wait           (int *__term_stat);
  157.  
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161.  
  162.  
  163. #if !defined(RC_INVOKED)
  164.  
  165. #if defined(__STDC__)
  166. #pragma warn .nak
  167. #endif
  168.  
  169. #endif  /* !RC_INVOKED */
  170.  
  171. #ifdef __cplusplus
  172. } // std
  173. #endif /* __cplusplus */
  174.  
  175. #endif  /* __PROCESS_H */
  176.  
  177. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__PROCESS_H_USING_LIST)
  178. #define __PROCESS_H_USING_LIST
  179.     using std::getpid;
  180.     using std::abort;
  181.     using std::_cexit;
  182.     using std::_c_exit;
  183.     using std::execl;
  184.     using std::execle;
  185.     using std::execlp;
  186.     using std::execlpe;
  187.     using std::execv;
  188.     using std::execve;
  189.     using std::execvp;
  190.     using std::execvpe;
  191.     using std::exit;
  192.     using std::_exit;
  193.     using std::spawnl;
  194.     using std::spawnle;
  195.     using std::spawnlp;
  196.     using std::spawnlpe;
  197.     using std::spawnv;
  198.     using std::spawnve;
  199.     using std::spawnvp;
  200.     using std::spawnvpe;
  201.     using std::system;
  202.     using std::_wexecl;
  203.     using std::_wexecle;
  204.     using std::_wexeclp;
  205.     using std::_wexeclpe;
  206.     using std::_wexecv;
  207.     using std::_wexecve;
  208.     using std::_wexecvp;
  209.     using std::_wexecvpe;
  210.     using std::_wspawnl;
  211.     using std::_wspawnle;
  212.     using std::_wspawnlp;
  213.     using std::_wspawnlpe;
  214.     using std::_wspawnv;
  215.     using std::_wspawnve;
  216.     using std::_wspawnvp;
  217.     using std::_wspawnvpe;
  218.     using std::_wsystem;
  219. #if defined(__MT__)
  220.     using std::_PTHREAD_ADOPTION_DATA;
  221.     using std::_adopt_thread;
  222.     using std::_unadopt_thread;
  223.     using std::_beginthread;
  224.     using std::_beginthreadNT;
  225.     using std::_beginthreadex;
  226.     using std::_endthread;
  227.     using std::_endthreadex;
  228. #endif // __MT__
  229.     using std::cwait;
  230.     using std::wait;
  231. #endif /* __USING_CNAME__ */
  232.  
  233.  
  234.