First NIT release and new clean mercurial repository
[nit.git] / lib / standard / 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 typedef struct se_exec_data se_exec_data_t;
24 struct se_exec_data {
25 pid_t id;
26 int running;
27 int status;
28 int in_fd;
29 int out_fd;
30 int err_fd;
31 };
32
33 #define string_NativeString_NativeString_system_0(self) (system(self))
34
35 #define exec_NativeProcess_NativeProcess_id_0(self) (((se_exec_data_t*)self)->id)
36 #define exec_NativeProcess_NativeProcess_status_0(self) (((se_exec_data_t*)self)->status)
37 #define exec_NativeProcess_NativeProcess_kill_1(self, p0) do{kill(((se_exec_data_t*)(self))->id, (p0));}while(0)
38
39 #define exec_NativeProcess_NativeProcess_in_fd_0(self) (((se_exec_data_t*)self)->in_fd)
40 #define exec_NativeProcess_NativeProcess_out_fd_0(self) (((se_exec_data_t*)self)->out_fd)
41 #define exec_NativeProcess_NativeProcess_err_fd_0(self) (((se_exec_data_t*)self)->err_fd)
42
43 int exec_NativeProcess_NativeProcess_is_finished_0(void*);
44 void exec_NativeProcess_NativeProcess_wait_0(void*);
45 se_exec_data_t* exec_Process_Process_basic_exec_execute_4(int, char *, char *, int, int);
46
47 #endif