chiark / gitweb /
test: update test-engine.c to work again
[elogind.git] / src / dbus-execute.h
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 #ifndef foodbusexecutehfoo
4 #define foodbusexecutehfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <dbus/dbus.h>
26
27 #include "manager.h"
28
29 #define BUS_EXEC_CONTEXT_INTERFACE                                      \
30         "  <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
31         "  <property name=\"UMask\" type=\"u\" access=\"read\"/>\n"     \
32         "  <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/>\n" \
33         "  <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>\n" \
34         "  <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>\n" \
35         "  <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \
36         "  <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" \
37         "  <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n" \
38         "  <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" \
39         "  <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n"   \
40         "  <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
41         "  <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
42         "  <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
43         "  <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
44         "  <property name=\"User\" type=\"s\" access=\"read\"/>\n"      \
45         "  <property name=\"Group\" type=\"s\" access=\"read\"/>\n"     \
46         "  <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>\n"
47
48 #define BUS_EXEC_CONTEXT_PROPERTIES(interface, context)                 \
49         { interface, "Environment",                   bus_property_append_strv,   "as",    (context).environment                   }, \
50         { interface, "UMask",                         bus_property_append_mode,   "u",     &(context).umask                        }, \
51             /* RLimits */                                               \
52         { interface, "WorkingDirectory",              bus_property_append_string, "s",     (context).working_directory             }, \
53         { interface, "RootDirectory",                 bus_property_append_string, "s",     (context).root_directory                }, \
54             /* OOM Adjust */                                            \
55             /* Nice */                                                  \
56             /* IOPrio */                                                \
57             /* CPUSchedPolicy */                                        \
58             /* CPUSchedPriority */                                      \
59             /* CPUAffinity */                                           \
60             /* TimerSlackNS */                                          \
61         { interface, "CPUSchedulingResetOnFork",      bus_property_append_bool,   "b",     &(context).cpu_sched_reset_on_fork      }, \
62         { interface, "NonBlocking",                   bus_property_append_bool,   "b",     &(context).non_blocking                 }, \
63         { interface, "StandardInput",                 bus_execute_append_input,   "s",     &(context).std_input                    }, \
64         { interface, "StandardOutput",                bus_execute_append_output,  "s",     &(context).std_output                   }, \
65         { interface, "StandardError",                 bus_execute_append_output,  "s",     &(context).std_error                    }, \
66         { interface, "TTYPath",                       bus_property_append_string, "s",     (context).tty_path                      }, \
67         { interface, "SyslogPriority",                bus_property_append_int,    "i",     &(context).syslog_priority              }, \
68         { interface, "SyslogIdentifier",              bus_property_append_string, "s",     (context).syslog_identifier             }, \
69             /* CAPABILITIES */                                          \
70         { interface, "SecureBits",                    bus_property_append_int,    "i",     &(context).secure_bits                  }, \
71         { interface, "CapabilityBoundingSetDrop",     bus_property_append_uint64, "t",     &(context).capability_bounding_set_drop }, \
72         { interface, "User",                          bus_property_append_string, "s",     (context).user                          }, \
73         { interface, "Group",                         bus_property_append_string, "s",     (context).group                         }, \
74         { interface, "SupplementaryGroups",           bus_property_append_strv,   "as",    (context).supplementary_groups          }
75
76 int bus_execute_append_output(Manager *m, DBusMessageIter *i, const char *property, void *data);
77 int bus_execute_append_input(Manager *m, DBusMessageIter *i, const char *property, void *data);
78
79 #endif