5 * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __CONNMAN_TASK_H
23 #define __CONNMAN_TASK_H
25 #include <dbus/dbus.h>
33 * @title: Task premitives
34 * @short_description: Functions for handling tasks
39 typedef void (* connman_task_exit_t) (struct connman_task *task,
40 int exit_code, void *user_data);
42 typedef void (* connman_task_notify_t) (struct connman_task *task,
43 DBusMessage *message, void *user_data);
45 struct connman_task *connman_task_create(const char *program);
46 void connman_task_destroy(struct connman_task *task);
48 const char *connman_task_get_path(struct connman_task *task);
50 int connman_task_add_argument(struct connman_task *task,
51 const char *name, const char *format, ...);
52 int connman_task_add_variable(struct connman_task *task,
53 const char *key, const char *format, ...);
55 int connman_task_set_notify(struct connman_task *task, const char *member,
56 connman_task_notify_t function, void *user_data);
58 int connman_task_run(struct connman_task *task,
59 connman_task_exit_t function, void *user_data,
60 int *stdin_fd, int *stdout_fd, int *stderr_fd);
61 int connman_task_stop(struct connman_task *task);
67 #endif /* __CONNMAN_TASK_H */