118c2aff7Sartem /*************************************************************************** 218c2aff7Sartem * CVSID: $Id$ 318c2aff7Sartem * 418c2aff7Sartem * runner.h - Process running interface 518c2aff7Sartem * 618c2aff7Sartem * Copyright (C) 2006 Sjoerd Simons, <sjoerd@luon.net> 718c2aff7Sartem * 818c2aff7Sartem * Licensed under the Academic Free License version 2.1 918c2aff7Sartem * 1018c2aff7Sartem * This program is free software; you can redistribute it and/or modify 1118c2aff7Sartem * it under the terms of the GNU General Public License as published by 1218c2aff7Sartem * the Free Software Foundation; either version 2 of the License, or 1318c2aff7Sartem * (at your option) any later version. 1418c2aff7Sartem * 1518c2aff7Sartem * This program is distributed in the hope that it will be useful, 1618c2aff7Sartem * but WITHOUT ANY WARRANTY; without even the implied warranty of 1718c2aff7Sartem * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1818c2aff7Sartem * GNU General Public License for more details. 1918c2aff7Sartem * 2018c2aff7Sartem * You should have received a copy of the GNU General Public License 2118c2aff7Sartem * along with this program; if not, write to the Free Software 2218c2aff7Sartem * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2318c2aff7Sartem * 2418c2aff7Sartem **************************************************************************/ 2518c2aff7Sartem #ifndef RUNNER_H 2618c2aff7Sartem #define RUNNER_H 2718c2aff7Sartem 2818c2aff7Sartem #define DBUS_API_SUBJECT_TO_CHANGE 2918c2aff7Sartem #include <dbus/dbus-glib-lowlevel.h> 3018c2aff7Sartem 3118c2aff7Sartem #include <glib.h> 3218c2aff7Sartem 3318c2aff7Sartem typedef struct { 3418c2aff7Sartem gchar *udi; 3518c2aff7Sartem gchar **environment; 3618c2aff7Sartem gchar **argv; 3718c2aff7Sartem gchar *input; 3818c2aff7Sartem gboolean error_on_stderr; 39*3ab06c27SMilan Jurik gboolean is_singleton; 4018c2aff7Sartem guint32 timeout; 4118c2aff7Sartem } run_request; 4218c2aff7Sartem 4318c2aff7Sartem run_request *new_run_request(void); 4418c2aff7Sartem void del_run_request(run_request *r); 4518c2aff7Sartem 4618c2aff7Sartem /* Run the given request and reply it's result on msg */ 4718c2aff7Sartem gboolean run_request_run(run_request *r, DBusConnection *con, DBusMessage *msg, GPid *out_pid); 4818c2aff7Sartem 4918c2aff7Sartem /* Kill all running request for a udi */ 5018c2aff7Sartem void run_kill_udi(gchar *udi); 5118c2aff7Sartem 5218c2aff7Sartem /* Kill all running request*/ 53*3ab06c27SMilan Jurik void run_kill_all(void); 5418c2aff7Sartem 5518c2aff7Sartem /* initialise the actual runner data */ 56*3ab06c27SMilan Jurik void run_init(void); 5718c2aff7Sartem 5818c2aff7Sartem #endif /* RUNNER_H */ 59