xref: /titanic_53/usr/src/cmd/hal/hald-runner/runner.h (revision 18c2aff776a775d34a4c9893a4c72e0434d68e36)
1*18c2aff7Sartem /***************************************************************************
2*18c2aff7Sartem  * CVSID: $Id$
3*18c2aff7Sartem  *
4*18c2aff7Sartem  * runner.h - Process running interface
5*18c2aff7Sartem  *
6*18c2aff7Sartem  * Copyright (C) 2006 Sjoerd Simons, <sjoerd@luon.net>
7*18c2aff7Sartem  *
8*18c2aff7Sartem  * Licensed under the Academic Free License version 2.1
9*18c2aff7Sartem  *
10*18c2aff7Sartem  * This program is free software; you can redistribute it and/or modify
11*18c2aff7Sartem  * it under the terms of the GNU General Public License as published by
12*18c2aff7Sartem  * the Free Software Foundation; either version 2 of the License, or
13*18c2aff7Sartem  * (at your option) any later version.
14*18c2aff7Sartem  *
15*18c2aff7Sartem  * This program is distributed in the hope that it will be useful,
16*18c2aff7Sartem  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*18c2aff7Sartem  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*18c2aff7Sartem  * GNU General Public License for more details.
19*18c2aff7Sartem  *
20*18c2aff7Sartem  * You should have received a copy of the GNU General Public License
21*18c2aff7Sartem  * along with this program; if not, write to the Free Software
22*18c2aff7Sartem  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23*18c2aff7Sartem  *
24*18c2aff7Sartem  **************************************************************************/
25*18c2aff7Sartem #ifndef RUNNER_H
26*18c2aff7Sartem #define RUNNER_H
27*18c2aff7Sartem 
28*18c2aff7Sartem #define DBUS_API_SUBJECT_TO_CHANGE
29*18c2aff7Sartem #include <dbus/dbus-glib-lowlevel.h>
30*18c2aff7Sartem 
31*18c2aff7Sartem #include <glib.h>
32*18c2aff7Sartem 
33*18c2aff7Sartem typedef struct {
34*18c2aff7Sartem 	gchar *udi;
35*18c2aff7Sartem 	gchar **environment;
36*18c2aff7Sartem 	gchar **argv;
37*18c2aff7Sartem 	gchar *input;
38*18c2aff7Sartem 	gboolean error_on_stderr;
39*18c2aff7Sartem 	guint32 timeout;
40*18c2aff7Sartem } run_request;
41*18c2aff7Sartem 
42*18c2aff7Sartem run_request *new_run_request(void);
43*18c2aff7Sartem void del_run_request(run_request *r);
44*18c2aff7Sartem 
45*18c2aff7Sartem /* Run the given request and reply it's result on msg */
46*18c2aff7Sartem gboolean run_request_run(run_request *r, DBusConnection *con, DBusMessage *msg, GPid *out_pid);
47*18c2aff7Sartem 
48*18c2aff7Sartem /* Kill all running request for a udi */
49*18c2aff7Sartem void run_kill_udi(gchar *udi);
50*18c2aff7Sartem 
51*18c2aff7Sartem /* Kill all running request*/
52*18c2aff7Sartem void run_kill_all();
53*18c2aff7Sartem 
54*18c2aff7Sartem /* initialise the actual runner data */
55*18c2aff7Sartem void run_init();
56*18c2aff7Sartem 
57*18c2aff7Sartem #endif /*  RUNNER_H */
58