bus-control.c revision de1c301ed165eb4d04a0c9d4babe97912b5233bb
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering This file is part of systemd.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering Copyright 2013 Lennart Poettering
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering systemd is free software; you can redistribute it and/or modify it
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering under the terms of the GNU Lesser General Public License as published by
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering (at your option) any later version.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering systemd is distributed in the hope that it will be useful, but
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering Lesser General Public License for more details.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering You should have received a copy of the GNU Lesser General Public License
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poetteringconst char *sd_bus_get_unique_name(sd_bus *bus) {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poetteringint sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering "org.freedesktop.DBus",
b237ef2cfac7ab0b33170809e8cb64628606207dTollef Fog Heen "org.freedesktop.DBus",
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremer "RequestName",
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering r = sd_bus_message_append(m, "su", name, flags);
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering r = sd_bus_send_with_reply_and_block(bus, m, (uint64_t) -1, NULL, &reply);
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremerint sd_bus_release_name(sd_bus *bus, const char *name) {
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremer _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremer "org.freedesktop.DBus",
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremer "org.freedesktop.DBus",
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremer "ReleaseName",
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart Poettering r = sd_bus_send_with_reply_and_block(bus, m, (uint64_t) -1, NULL, &reply);
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringint sd_bus_list_names(sd_bus *bus, char ***l) {
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner _cleanup_bus_message_unref_ sd_bus_message *m1 = NULL, *reply1 = NULL, *m2 = NULL, *reply2 = NULL;
f2b4af1cd4112df6ce56f8fc1e677639935e3d0eFabian Henze _cleanup_strv_free_ char **a = NULL, **b = NULL;
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering "org.freedesktop.DBus",
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering "org.freedesktop.DBus",
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering "org.freedesktop.DBus",
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering "org.freedesktop.DBus",
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering "ListActivatableNames",
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering r = sd_bus_send_with_reply_and_block(bus, m1, (uint64_t) -1, NULL, &reply1);
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner r = sd_bus_send_with_reply_and_block(bus, m2, (uint64_t) -1, NULL, &reply2);
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringint sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) {
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering "org.freedesktop.DBus",
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering "org.freedesktop.DBus",
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering "GetNameOwner",
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering r = sd_bus_send_with_reply_and_block(bus, m, (uint64_t) -1, NULL, &reply);
uint32_t u;
if (!bus)
return -EINVAL;
if (!name)
return -EINVAL;
if (!uid)
return -EINVAL;
bus,
uint32_t u;
if (!bus)
return -EINVAL;
if (!name)
return -EINVAL;
if (!pid)
return -EINVAL;
bus,
return -EIO;
if (!bus)
return -EINVAL;
if (!match)
return -EINVAL;
bus,
if (!bus)
return -EINVAL;
if (!match)
return -EINVAL;
bus,