Log the last error too if the tests fail without default printer.
[wine/multimedia.git] / include / msvcrt / process.h
blob1593dce5e5ed84ceec96afd6391972b5c4c54ed1
1 /*
2 * Process definitions
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8 #ifndef __WINE_PROCESS_H
9 #define __WINE_PROCESS_H
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
12 #endif
14 #ifndef MSVCRT
15 # ifdef USE_MSVCRT_PREFIX
16 # define MSVCRT(x) MSVCRT_##x
17 # else
18 # define MSVCRT(x) x
19 # endif
20 #endif
22 #ifndef MSVCRT_WCHAR_T_DEFINED
23 #define MSVCRT_WCHAR_T_DEFINED
24 #ifndef __cplusplus
25 typedef unsigned short MSVCRT(wchar_t);
26 #endif
27 #endif
29 /* Process creation flags */
30 #define _P_WAIT 0
31 #define _P_NOWAIT 1
32 #define _P_OVERLAY 2
33 #define _P_NOWAITO 3
34 #define _P_DETACH 4
36 #define _WAIT_CHILD 0
37 #define _WAIT_GRANDCHILD 1
39 #ifndef __stdcall
40 # ifdef __i386__
41 # ifdef __GNUC__
42 # define __stdcall __attribute__((__stdcall__))
43 # elif defined(_MSC_VER)
44 /* Nothing needs to be done. __stdcall already exists */
45 # else
46 # error You need to define __stdcall for your compiler
47 # endif
48 # else /* __i386__ */
49 # define __stdcall
50 # endif /* __i386__ */
51 #endif /* __stdcall */
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
57 typedef void (*_beginthread_start_routine_t)(void *);
58 typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
60 unsigned long _beginthread(_beginthread_start_routine_t,unsigned int,void*);
61 unsigned long _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*);
62 int _cwait(int*,int,int);
63 void _endthread(void);
64 void _endthreadex(unsigned int);
65 int _execl(const char*,const char*,...);
66 int _execle(const char*,const char*,...);
67 int _execlp(const char*,const char*,...);
68 int _execlpe(const char*,const char*,...);
69 int _execv(const char*,char* const *);
70 int _execve(const char*,char* const *,const char* const *);
71 int _execvp(const char*,char* const *);
72 int _execvpe(const char*,char* const *,const char* const *);
73 int _getpid(void);
74 int _spawnl(int,const char*,const char*,...);
75 int _spawnle(int,const char*,const char*,...);
76 int _spawnlp(int,const char*,const char*,...);
77 int _spawnlpe(int,const char*,const char*,...);
78 int _spawnv(int,const char*,const char* const *);
79 int _spawnve(int,const char*,const char* const *,const char* const *);
80 int _spawnvp(int,const char*,const char* const *);
81 int _spawnvpe(int,const char*,const char* const *,const char* const *);
83 void MSVCRT(_c_exit)(void);
84 void MSVCRT(_cexit)(void);
85 void MSVCRT(_exit)(int);
86 void MSVCRT(abort)(void);
87 void MSVCRT(exit)(int);
88 int MSVCRT(system)(const char*);
90 #ifndef MSVCRT_WPROCESS_DEFINED
91 #define MSVCRT_WPROCESS_DEFINED
92 int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
93 int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
94 int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
95 int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
96 int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
97 int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
98 int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
99 int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
100 int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
101 int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
102 int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
103 int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
104 int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
105 int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
106 int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
107 int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
108 int _wsystem(const MSVCRT(wchar_t)*);
109 #endif /* MSVCRT_WPROCESS_DEFINED */
111 #ifdef __cplusplus
113 #endif
116 #ifndef USE_MSVCRT_PREFIX
117 #define P_WAIT _P_WAIT
118 #define P_NOWAIT _P_NOWAIT
119 #define P_OVERLAY _P_OVERLAY
120 #define P_NOWAITO _P_NOWAITO
121 #define P_DETACH _P_DETACH
123 #define WAIT_CHILD _WAIT_CHILD
124 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
126 static inline int cwait(int *status, int pid, int action) { return _cwait(status, pid, action); }
127 static inline int getpid(void) { return _getpid(); }
128 static inline int execv(const char* name, char* const* argv) { return _execv(name, argv); }
129 static inline int execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); }
130 static inline int execvp(const char* name, char* const* argv) { return _execvp(name, argv); }
131 static inline int execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); }
132 static inline int spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); }
133 static inline int spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); }
134 static inline int spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); }
135 static inline int spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
137 #ifdef __GNUC__
138 extern int execl(const char*,const char*,...) __attribute__((alias("_execl")));
139 extern int execle(const char*,const char*,...) __attribute__((alias("_execle")));
140 extern int execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
141 extern int execlpe(const char*,const char*,...) __attribute__((alias("_execlpe")));
142 extern int spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl")));
143 extern int spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle")));
144 extern int spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp")));
145 extern int spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe")));
146 #else
147 #define execl _execl
148 #define execle _execle
149 #define execlp _execlp
150 #define execlpe _execlpe
151 #define spawnl _spawnl
152 #define spawnle _spawnle
153 #define spawnlp _spawnlp
154 #define spawnlpe _spawnlpe
155 #endif /* __GNUC__ */
157 #endif /* USE_MSVCRT_PREFIX */
159 #endif /* __WINE_PROCESS_H */