2001-04-11 01:21:43 +02:00
|
|
|
/*
|
|
|
|
* Process definitions
|
|
|
|
*
|
|
|
|
* Derived from the mingw header written by Colin Peters.
|
|
|
|
* Modified for Wine use by Jon Griffiths and Francois Gouget.
|
|
|
|
* This file is in the public domain.
|
|
|
|
*/
|
|
|
|
#ifndef __WINE_PROCESS_H
|
|
|
|
#define __WINE_PROCESS_H
|
2003-07-19 00:57:15 +02:00
|
|
|
#ifndef __WINE_USE_MSVCRT
|
2001-10-22 20:59:23 +02:00
|
|
|
#define __WINE_USE_MSVCRT
|
2003-07-19 00:57:15 +02:00
|
|
|
#endif
|
2001-04-11 01:21:43 +02:00
|
|
|
|
2004-06-25 03:19:15 +02:00
|
|
|
#ifndef _WCHAR_T_DEFINED
|
|
|
|
#define _WCHAR_T_DEFINED
|
2002-12-18 21:17:20 +01:00
|
|
|
#ifndef __cplusplus
|
2004-06-25 03:19:15 +02:00
|
|
|
typedef unsigned short wchar_t;
|
2002-12-18 21:17:20 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
2001-04-11 01:21:43 +02:00
|
|
|
|
|
|
|
/* Process creation flags */
|
|
|
|
#define _P_WAIT 0
|
|
|
|
#define _P_NOWAIT 1
|
|
|
|
#define _P_OVERLAY 2
|
|
|
|
#define _P_NOWAITO 3
|
|
|
|
#define _P_DETACH 4
|
|
|
|
|
|
|
|
#define _WAIT_CHILD 0
|
|
|
|
#define _WAIT_GRANDCHILD 1
|
|
|
|
|
2003-01-15 04:31:49 +01:00
|
|
|
#ifndef __stdcall
|
|
|
|
# ifdef __i386__
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# define __stdcall __attribute__((__stdcall__))
|
|
|
|
# elif defined(_MSC_VER)
|
|
|
|
/* Nothing needs to be done. __stdcall already exists */
|
|
|
|
# else
|
|
|
|
# error You need to define __stdcall for your compiler
|
|
|
|
# endif
|
|
|
|
# else /* __i386__ */
|
|
|
|
# define __stdcall
|
|
|
|
# endif /* __i386__ */
|
|
|
|
#endif /* __stdcall */
|
2001-04-11 01:21:43 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-01-15 04:31:49 +01:00
|
|
|
typedef void (*_beginthread_start_routine_t)(void *);
|
2002-02-02 19:42:11 +01:00
|
|
|
typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
|
2001-06-19 05:46:27 +02:00
|
|
|
|
|
|
|
unsigned long _beginthread(_beginthread_start_routine_t,unsigned int,void*);
|
|
|
|
unsigned long _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*);
|
2001-04-11 01:21:43 +02:00
|
|
|
int _cwait(int*,int,int);
|
|
|
|
void _endthread(void);
|
2001-06-19 05:46:27 +02:00
|
|
|
void _endthreadex(unsigned int);
|
2001-04-11 01:21:43 +02:00
|
|
|
int _execl(const char*,const char*,...);
|
|
|
|
int _execle(const char*,const char*,...);
|
|
|
|
int _execlp(const char*,const char*,...);
|
|
|
|
int _execlpe(const char*,const char*,...);
|
|
|
|
int _execv(const char*,char* const *);
|
|
|
|
int _execve(const char*,char* const *,const char* const *);
|
|
|
|
int _execvp(const char*,char* const *);
|
|
|
|
int _execvpe(const char*,char* const *,const char* const *);
|
|
|
|
int _getpid(void);
|
|
|
|
int _spawnl(int,const char*,const char*,...);
|
|
|
|
int _spawnle(int,const char*,const char*,...);
|
|
|
|
int _spawnlp(int,const char*,const char*,...);
|
|
|
|
int _spawnlpe(int,const char*,const char*,...);
|
|
|
|
int _spawnv(int,const char*,const char* const *);
|
|
|
|
int _spawnve(int,const char*,const char* const *,const char* const *);
|
2001-11-19 03:09:49 +01:00
|
|
|
int _spawnvp(int,const char*,const char* const *);
|
2001-04-11 01:21:43 +02:00
|
|
|
int _spawnvpe(int,const char*,const char* const *,const char* const *);
|
|
|
|
|
2004-06-25 03:19:15 +02:00
|
|
|
void _c_exit(void);
|
|
|
|
void _cexit(void);
|
|
|
|
void _exit(int);
|
|
|
|
void abort(void);
|
|
|
|
void exit(int);
|
|
|
|
int system(const char*);
|
|
|
|
|
|
|
|
#ifndef _WPROCESS_DEFINED
|
|
|
|
#define _WPROCESS_DEFINED
|
|
|
|
int _wexecl(const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wexecle(const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wexeclp(const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wexeclpe(const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wexecv(const wchar_t*,const wchar_t* const *);
|
|
|
|
int _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int _wexecvp(const wchar_t*,const wchar_t* const *);
|
|
|
|
int _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int _wspawnl(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wspawnle(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wspawnlp(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int _wspawnv(int,const wchar_t*,const wchar_t* const *);
|
|
|
|
int _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int _wspawnvp(int,const wchar_t*,const wchar_t* const *);
|
|
|
|
int _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int _wsystem(const wchar_t*);
|
|
|
|
#endif /* _WPROCESS_DEFINED */
|
2001-04-11 01:21:43 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#define P_WAIT _P_WAIT
|
|
|
|
#define P_NOWAIT _P_NOWAIT
|
|
|
|
#define P_OVERLAY _P_OVERLAY
|
|
|
|
#define P_NOWAITO _P_NOWAITO
|
|
|
|
#define P_DETACH _P_DETACH
|
|
|
|
|
|
|
|
#define WAIT_CHILD _WAIT_CHILD
|
|
|
|
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
|
|
|
|
|
2003-03-22 22:15:41 +01:00
|
|
|
static inline int cwait(int *status, int pid, int action) { return _cwait(status, pid, action); }
|
|
|
|
static inline int getpid(void) { return _getpid(); }
|
|
|
|
static inline int execv(const char* name, char* const* argv) { return _execv(name, argv); }
|
|
|
|
static inline int execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); }
|
|
|
|
static inline int execvp(const char* name, char* const* argv) { return _execvp(name, argv); }
|
|
|
|
static inline int execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); }
|
|
|
|
static inline int spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); }
|
|
|
|
static inline int spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); }
|
|
|
|
static inline int spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); }
|
|
|
|
static inline int spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
|
2003-03-26 02:29:56 +01:00
|
|
|
|
2005-04-25 12:48:59 +02:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ < 4)
|
2003-03-26 02:29:56 +01:00
|
|
|
extern int execl(const char*,const char*,...) __attribute__((alias("_execl")));
|
|
|
|
extern int execle(const char*,const char*,...) __attribute__((alias("_execle")));
|
|
|
|
extern int execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
|
|
|
|
extern int execlpe(const char*,const char*,...) __attribute__((alias("_execlpe")));
|
|
|
|
extern int spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl")));
|
|
|
|
extern int spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle")));
|
|
|
|
extern int spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp")));
|
|
|
|
extern int spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe")));
|
|
|
|
#else
|
|
|
|
#define execl _execl
|
|
|
|
#define execle _execle
|
|
|
|
#define execlp _execlp
|
|
|
|
#define execlpe _execlpe
|
|
|
|
#define spawnl _spawnl
|
|
|
|
#define spawnle _spawnle
|
|
|
|
#define spawnlp _spawnlp
|
|
|
|
#define spawnlpe _spawnlpe
|
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
2001-04-11 01:21:43 +02:00
|
|
|
#endif /* __WINE_PROCESS_H */
|