1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  *  Copyright (C) 2008  Kouhei Sutou <kou@cozmixng.org>
4  *
5  *  This library is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Lesser General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 #ifndef __CUT_PROCESS_H__
21 #define __CUT_PROCESS_H__
22 
23 #include <glib-object.h>
24 #include <cutter/cut-test-result.h>
25 
26 G_BEGIN_DECLS
27 
28 #define CUT_TYPE_PROCESS            (cut_process_get_type ())
29 #define CUT_PROCESS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CUT_TYPE_PROCESS, CutProcess))
30 #define CUT_PROCESS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CUT_TYPE_PROCESS, CutProcessClass))
31 #define CUT_IS_PROCESS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CUT_TYPE_PROCESS))
32 #define CUT_IS_PROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CUT_TYPE_PROCESS))
33 #define CUT_PROCESS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), CUT_TYPE_PROCESS, CutProcessClass))
34 
35 typedef struct _CutProcess      CutProcess;
36 typedef struct _CutProcessClass CutProcessClass;
37 
38 struct _CutProcess
39 {
40     GObject object;
41 };
42 
43 struct _CutProcessClass
44 {
45     GObjectClass parent_class;
46 };
47 
48 GType cut_process_get_type  (void) G_GNUC_CONST;
49 
50 CutProcess *cut_process_new (void);
51 int          cut_process_fork    (CutProcess *process);
52 int          cut_process_wait    (CutProcess *process,
53                                   unsigned int usec_timeout);
54 int          cut_process_get_pid (CutProcess *process);
55 const gchar *cut_process_get_stdout_message
56                                   (CutProcess *process);
57 const gchar *cut_process_get_stderr_message
58                                   (CutProcess *process);
59 gboolean     cut_process_send_test_result_to_parent
60                                   (CutProcess *process,
61                                    CutTestResult *result);
62 const gchar *cut_process_get_result_from_child
63                                   (CutProcess *process);
64 void         cut_process_exit     (CutProcess *process);
65 G_END_DECLS
66 
67 #endif /* __CUT_PROCESS_H__ */
68 
69 /*
70 vi:ts=4:nowrap:ai:expandtab:sw=4
71 */
72