Merge branch 'ni' into wip
[nit.git] / c_src / exec_nit.h
1 #ifndef __EXEC_NIT_H
2 #define __EXEC_NIT_H
3 /* This file is part of NIT ( http://www.nitlanguage.org ).
4 *
5 * Copyright 2004-2008 Jean Privat <jean@pryen.org>
6 * Copyright 2008 Floréal Morandat <morandat@lirmm.fr>
7 *
8 * This file is free software, which comes along with NIT. This software is
9 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
12 * is kept unaltered, and a notification of the changes is added.
13 * You are allowed to redistribute it and sell it, alone or is a part of
14 * another product.
15 */
16
17 #define _POSIX_C_SOURCE 1
18 #include <unistd.h>
19 #include <sys/types.h>
20 #include <sys/wait.h>
21 #include <signal.h>
22
23 #include <exec._nitni.h>
24
25 typedef struct se_exec_data se_exec_data_t;
26 struct se_exec_data {
27 pid_t id;
28 int running;
29 int status;
30 int in_fd;
31 int out_fd;
32 int err_fd;
33 };
34
35 #define string_NativeString_NativeString_system_0(self) (system(self))
36
37 #define exec_NativeProcess_NativeProcess_id_0(self) (((se_exec_data_t*)self)->id)
38 #define exec_NativeProcess_NativeProcess_status_0(self) (((se_exec_data_t*)self)->status)
39
40 #define exec_NativeProcess_NativeProcess_in_fd_0(self) (((se_exec_data_t*)self)->in_fd)
41 #define exec_NativeProcess_NativeProcess_out_fd_0(self) (((se_exec_data_t*)self)->out_fd)
42 #define exec_NativeProcess_NativeProcess_err_fd_0(self) (((se_exec_data_t*)self)->err_fd)
43
44 int exec_NativeProcess_NativeProcess_is_finished_0(void*);
45 void exec_NativeProcess_NativeProcess_wait_0(void*);
46 se_exec_data_t* exec_Process_Process_basic_exec_execute_4(Process, char *, char *, int, int);
47
48 #endif