diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-11-06 02:33:42 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-11-06 14:56:47 -0500 |
commit | d9f644e2cdc81089f76314ee1a264895ca391371 (patch) | |
tree | 43f83c1b4e72924debd93b44cd6f43f9a21710d7 | |
parent | 34a6778fb9d1065f3fbb8e2243b9f0f25d1d18f1 (diff) |
bus: export libsystemd-bus as a public library
Old static libsystemd-bus.la becomes libsystemd-bus-internal.la.
memfd functions are also exported in the same library.
(Best viewed with --color-words -U0).
-rw-r--r-- | Makefile.am | 194 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-control.c | 16 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-convenience.c | 20 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-error.c | 20 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 150 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-objects.c | 52 | ||||
-rw-r--r-- | src/libsystemd-bus/libsystemd-bus.sym | 197 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 98 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-memfd.c | 24 |
9 files changed, 535 insertions, 236 deletions
diff --git a/Makefile.am b/Makefile.am index ed618847e8..016ce5e3b9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,6 +59,10 @@ LIBSYSTEMD_JOURNAL_CURRENT=11 LIBSYSTEMD_JOURNAL_REVISION=3 LIBSYSTEMD_JOURNAL_AGE=11 +LIBSYSTEMD_BUS_CURRENT=0 +LIBSYSTEMD_BUS_REVISION=0 +LIBSYSTEMD_BUS_AGE=0 + # Dirs of external packages dbuspolicydir=@dbuspolicydir@ dbussessionservicedir=@dbussessionservicedir@ @@ -1477,7 +1481,10 @@ systemd_analyze_CFLAGS = \ systemd_analyze_LDADD = \ libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon.la \ + libsystemd-shared.la # ------------------------------------------------------------------------------ systemd_initctl_SOURCES = \ @@ -1488,9 +1495,10 @@ systemd_initctl_CFLAGS = \ $(DBUS_CFLAGS) systemd_initctl_LDADD = \ - libsystemd-shared.la \ - libsystemd-daemon.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la # ------------------------------------------------------------------------------ systemd_update_utmp_SOURCES = \ @@ -1502,8 +1510,10 @@ systemd_update_utmp_CFLAGS = \ $(AUDIT_CFLAGS) systemd_update_utmp_LDADD = \ + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ libsystemd-shared.la \ - libsystemd-bus.la \ $(AUDIT_LIBS) # ------------------------------------------------------------------------------ @@ -1656,8 +1666,10 @@ systemd_fsck_CFLAGS = \ $(DBUS_CFLAGS) systemd_fsck_LDADD = \ + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ libsystemd-shared.la \ - libsystemd-bus.la \ libudev.la # ------------------------------------------------------------------------------ @@ -1785,8 +1797,10 @@ systemd_cgroups_agent_SOURCES = \ src/cgroups-agent/cgroups-agent.c systemd_cgroups_agent_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la # ------------------------------------------------------------------------------ systemctl_SOURCES = \ @@ -1853,10 +1867,10 @@ systemd_nspawn_SOURCES = \ systemd_nspawn_LDADD = \ libsystemd-label.la \ libsystemd-capability.la \ - libsystemd-shared.la \ - libsystemd-daemon.la \ + libsystemd-bus-internal.la \ libsystemd-id128-internal.la \ - libsystemd-bus.la + libsystemd-shared.la \ + libsystemd-daemon.la # ------------------------------------------------------------------------------ systemd_run_SOURCES = \ @@ -1865,10 +1879,10 @@ systemd_run_SOURCES = \ systemd_run_LDADD = \ libsystemd-label.la \ libsystemd-capability.la \ + libsystemd-bus-internal.la \ libsystemd-shared.la \ libsystemd-daemon.la \ - libsystemd-id128-internal.la \ - libsystemd-bus.la + libsystemd-id128-internal.la # ------------------------------------------------------------------------------ systemd_stdio_bridge_SOURCES = \ @@ -1984,9 +1998,23 @@ libsystemd_bus_la_CFLAGS = \ $(AM_CFLAGS) \ -pthread -noinst_LTLIBRARIES += \ +libsystemd_bus_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -version-info $(LIBSYSTEMD_BUS_CURRENT):$(LIBSYSTEMD_BUS_REVISION):$(LIBSYSTEMD_BUS_AGE) \ + -Wl,--version-script=$(top_srcdir)/src/libsystemd-bus/libsystemd-bus.sym + +lib_LTLIBRARIES += \ libsystemd-bus.la +libsystemd_bus_internal_la_SOURCES = \ + $(libsystemd_bus_la_SOURCES) + +libsystemd_bus_internal_la_CFLAGS = \ + $(libsystemd_bus_la_CFLAGS) + +noinst_LTLIBRARIES += \ + libsystemd-bus-internal.la + tests += \ test-bus-marshal \ test-bus-signature \ @@ -2009,8 +2037,10 @@ test_bus_marshal_SOURCES = \ src/libsystemd-bus/test-bus-marshal.c test_bus_marshal_LDADD = \ + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ libsystemd-shared.la \ - libsystemd-bus.la \ + libsystemd-daemon.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) @@ -2024,7 +2054,7 @@ test_bus_signature_SOURCES = \ test_bus_signature_LDADD = \ libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la test_bus_chat_SOURCES = \ src/libsystemd-bus/test-bus-chat.c @@ -2034,9 +2064,10 @@ test_bus_chat_CFLAGS = \ -pthread test_bus_chat_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_server_SOURCES = \ src/libsystemd-bus/test-bus-server.c @@ -2046,9 +2077,10 @@ test_bus_server_CFLAGS = \ -pthread test_bus_server_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_objects_SOURCES = \ src/libsystemd-bus/test-bus-objects.c @@ -2058,77 +2090,87 @@ test_bus_objects_CFLAGS = \ -pthread test_bus_objects_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_match_SOURCES = \ src/libsystemd-bus/test-bus-match.c test_bus_match_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_kernel_SOURCES = \ src/libsystemd-bus/test-bus-kernel.c test_bus_kernel_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_kernel_bloom_SOURCES = \ src/libsystemd-bus/test-bus-kernel-bloom.c test_bus_kernel_bloom_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_kernel_benchmark_SOURCES = \ src/libsystemd-bus/test-bus-kernel-benchmark.c test_bus_kernel_benchmark_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_memfd_SOURCES = \ src/libsystemd-bus/test-bus-memfd.c test_bus_memfd_LDADD = \ libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la test_bus_zero_copy_SOURCES = \ src/libsystemd-bus/test-bus-zero-copy.c test_bus_zero_copy_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la test_bus_introspect_SOURCES = \ src/libsystemd-bus/test-bus-introspect.c test_bus_introspect_LDADD = \ libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la test_event_SOURCES = \ src/libsystemd-bus/test-event.c test_event_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la busctl_SOURCES = \ src/libsystemd-bus/busctl.c busctl_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la # ------------------------------------------------------------------------------ if ENABLE_GTK_DOC @@ -3204,12 +3246,12 @@ systemd_socket_proxyd_SOURCES = \ src/socket-proxy/socket-proxyd.c systemd_socket_proxyd_LDADD = \ - libsystemd-shared.la \ libsystemd-logs.la \ + libsystemd-bus-internal.la \ libsystemd-journal-internal.la \ libsystemd-id128-internal.la \ - libsystemd-daemon.la \ - libsystemd-bus.la + libsystemd-shared.la \ + libsystemd-daemon.la # ------------------------------------------------------------------------------ if ENABLE_COREDUMP @@ -3495,9 +3537,10 @@ systemd_hostnamed_SOURCES = \ systemd_hostnamed_LDADD = \ libsystemd-label.la \ - libsystemd-shared.la \ - libsystemd-daemon.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la rootlibexec_PROGRAMS += \ systemd-hostnamed @@ -3521,9 +3564,10 @@ hostnamectl_SOURCES = \ src/hostname/hostnamectl.c hostnamectl_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la bin_PROGRAMS += \ hostnamectl @@ -3549,9 +3593,10 @@ systemd_localed_SOURCES = \ systemd_localed_LDADD = \ libsystemd-label.la \ - libsystemd-shared.la \ - libsystemd-daemon.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la nodist_systemunit_DATA += \ units/systemd-localed.service @@ -3584,9 +3629,10 @@ localectl_SOURCES = \ src/locale/localectl.c localectl_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la \ - libsystemd-id128-internal.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la bin_PROGRAMS += \ localectl @@ -3612,8 +3658,10 @@ systemd_timedated_SOURCES = \ systemd_timedated_LDADD = \ libsystemd-label.la \ + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ libsystemd-shared.la \ - libsystemd-daemon.la \ libsystemd-bus.la rootlibexec_PROGRAMS += \ @@ -3646,8 +3694,10 @@ timedatectl_CFLAGS = \ $(DBUS_CFLAGS) timedatectl_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la bin_PROGRAMS += \ timedatectl @@ -3708,7 +3758,7 @@ libsystemd_machine_core_la_LIBADD = \ libsystemd-audit.la \ libsystemd-shared.la \ libsystemd-daemon.la \ - libsystemd-bus.la \ + libsystemd-bus-internal.la \ libsystemd-id128-internal.la \ libudev.la @@ -3723,8 +3773,10 @@ machinectl_CFLAGS = \ $(DBUS_CFLAGS) machinectl_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la rootbin_PROGRAMS += \ machinectl @@ -3806,7 +3858,7 @@ libsystemd_logind_core_la_LIBADD = \ libsystemd-shared.la \ libsystemd-daemon.la \ libsystemd-id128-internal.la \ - libsystemd-bus.la \ + libsystemd-bus-internal.la \ libudev.la if HAVE_ACL @@ -3861,8 +3913,10 @@ systemd_inhibit_CFLAGS = \ $(DBUS_CFLAGS) systemd_inhibit_LDADD = \ - libsystemd-shared.la \ - libsystemd-bus.la + libsystemd-bus-internal.la \ + libsystemd-id128-internal.la \ + libsystemd-daemon-internal.la \ + libsystemd-shared.la rootbin_PROGRAMS += \ systemd-inhibit diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c index 836570d41e..4b43331642 100644 --- a/src/libsystemd-bus/bus-control.c +++ b/src/libsystemd-bus/bus-control.c @@ -35,7 +35,7 @@ #include "bus-bloom.h" #include "bus-util.h" -int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { +_public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { int r; if (!bus) @@ -53,7 +53,7 @@ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { return 0; } -int sd_bus_request_name(sd_bus *bus, const char *name, int flags) { +_public_ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; uint32_t ret; int r; @@ -111,7 +111,7 @@ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) { } } -int sd_bus_release_name(sd_bus *bus, const char *name) { +_public_ int sd_bus_release_name(sd_bus *bus, const char *name) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; uint32_t ret; int r; @@ -166,7 +166,7 @@ int sd_bus_release_name(sd_bus *bus, const char *name) { return ret; } -int sd_bus_list_names(sd_bus *bus, char ***l) { +_public_ int sd_bus_list_names(sd_bus *bus, char ***l) { _cleanup_bus_message_unref_ sd_bus_message *reply1 = NULL, *reply2 = NULL; char **x = NULL; int r; @@ -220,7 +220,7 @@ int sd_bus_list_names(sd_bus *bus, char ***l) { return 0; } -int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) { +_public_ int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; const char *found; int r; @@ -264,7 +264,7 @@ int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) { return 0; } -int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) { +_public_ int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; uint32_t u; int r; @@ -301,7 +301,7 @@ int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) { return 0; } -int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid) { +_public_ int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; uint32_t u; int r; @@ -538,7 +538,7 @@ int bus_remove_match_internal( return 0; } -int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) { +_public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; const char *mid; int r; diff --git a/src/libsystemd-bus/bus-convenience.c b/src/libsystemd-bus/bus-convenience.c index 7c9824258b..0ccc259ea2 100644 --- a/src/libsystemd-bus/bus-convenience.c +++ b/src/libsystemd-bus/bus-convenience.c @@ -25,7 +25,7 @@ #include "bus-util.h" #include "bus-type.h" -int sd_bus_emit_signal( +_public_ int sd_bus_emit_signal( sd_bus *bus, const char *path, const char *interface, @@ -56,7 +56,7 @@ int sd_bus_emit_signal( return sd_bus_send(bus, m, NULL); } -int sd_bus_call_method( +_public_ int sd_bus_call_method( sd_bus *bus, const char *destination, const char *path, @@ -90,7 +90,7 @@ int sd_bus_call_method( return sd_bus_send_with_reply_and_block(bus, m, 0, error, reply); } -int sd_bus_reply_method_return( +_public_ int sd_bus_reply_method_return( sd_bus *bus, sd_bus_message *call, const char *types, ...) { @@ -125,7 +125,7 @@ int sd_bus_reply_method_return( return sd_bus_send(bus, m, NULL); } -int sd_bus_reply_method_error( +_public_ int sd_bus_reply_method_error( sd_bus *bus, sd_bus_message *call, const sd_bus_error *e) { @@ -151,7 +151,7 @@ int sd_bus_reply_method_error( return sd_bus_send(bus, m, NULL); } -int sd_bus_reply_method_errorf( +_public_ int sd_bus_reply_method_errorf( sd_bus *bus, sd_bus_message *call, const char *name, @@ -182,7 +182,7 @@ int sd_bus_reply_method_errorf( return sd_bus_reply_method_error(bus, call, &error); } -int sd_bus_reply_method_errno( +_public_ int sd_bus_reply_method_errno( sd_bus *bus, sd_bus_message *call, int error, @@ -208,7 +208,7 @@ int sd_bus_reply_method_errno( return sd_bus_reply_method_error(bus, call, &berror); } -int sd_bus_reply_method_errnof( +_public_ int sd_bus_reply_method_errnof( sd_bus *bus, sd_bus_message *call, int error, @@ -235,7 +235,7 @@ int sd_bus_reply_method_errnof( return sd_bus_reply_method_error(bus, call, &berror); } -int sd_bus_get_property( +_public_ int sd_bus_get_property( sd_bus *bus, const char *destination, const char *path, @@ -270,7 +270,7 @@ int sd_bus_get_property( return 0; } -int sd_bus_get_property_trivial( +_public_ int sd_bus_get_property_trivial( sd_bus *bus, const char *destination, const char *path, @@ -305,7 +305,7 @@ int sd_bus_get_property_trivial( return 0; } -int sd_bus_set_property( +_public_ int sd_bus_set_property( sd_bus *bus, const char *destination, const char *path, diff --git a/src/libsystemd-bus/bus-error.c b/src/libsystemd-bus/bus-error.c index 35e2614640..1a467cfdb0 100644 --- a/src/libsystemd-bus/bus-error.c +++ b/src/libsystemd-bus/bus-error.c @@ -38,7 +38,7 @@ bool bus_error_is_dirty(sd_bus_error *e) { return e->name || e->message || e->need_free; } -void sd_bus_error_free(sd_bus_error *e) { +_public_ void sd_bus_error_free(sd_bus_error *e) { if (!e) return; @@ -51,7 +51,7 @@ void sd_bus_error_free(sd_bus_error *e) { e->need_free = false; } -int sd_bus_error_set(sd_bus_error *e, const char *name, const char *message) { +_public_ int sd_bus_error_set(sd_bus_error *e, const char *name, const char *message) { char *n, *m = NULL; if (!e) @@ -106,7 +106,7 @@ int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, va_li return 0; } -int sd_bus_error_setf(sd_bus_error *e, const char *name, const char *format, ...) { +_public_ int sd_bus_error_setf(sd_bus_error *e, const char *name, const char *format, ...) { if (format) { int r; @@ -122,7 +122,7 @@ int sd_bus_error_setf(sd_bus_error *e, const char *name, const char *format, ... return sd_bus_error_set(e, name, NULL); } -int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) { +_public_ int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) { char *x, *y = NULL; if (!dest) @@ -150,7 +150,7 @@ int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) { return 0; } -int sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *message) { +_public_ int sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *message) { if (!e) return 0; @@ -161,21 +161,21 @@ int sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *messag return 0; } -int sd_bus_error_is_set(const sd_bus_error *e) { +_public_ int sd_bus_error_is_set(const sd_bus_error *e) { if (!e) return 0; return !!e->name; } -int sd_bus_error_has_name(const sd_bus_error *e, const char *name) { +_public_ int sd_bus_error_has_name(const sd_bus_error *e, const char *name) { if (!e) return 0; return streq_ptr(e->name, name); } -int sd_bus_error_get_errno(const sd_bus_error* e) { +_public_ int sd_bus_error_get_errno(const sd_bus_error* e) { /* Better replce this with a gperf table */ @@ -380,7 +380,7 @@ static sd_bus_error map_from_errno(int error) { return SD_BUS_ERROR_MAKE(SD_BUS_ERROR_FAILED, "Operation failed"); } -int sd_bus_error_set_errno(sd_bus_error *e, int error) { +_public_ int sd_bus_error_set_errno(sd_bus_error *e, int error) { sd_bus_error x; x = map_from_errno(error); @@ -425,7 +425,7 @@ fallback: return bus_error_set_strerror_or_const(e, x.name, error, x.message); } -int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *format, ...) { +_public_ int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *format, ...) { int r; if (!e) diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 437f6dfd49..aaa19df39a 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -440,7 +440,7 @@ static sd_bus_message *message_new(sd_bus *bus, uint8_t type) { return m; } -int sd_bus_message_new_signal( +_public_ int sd_bus_message_new_signal( sd_bus *bus, const char *path, const char *interface, @@ -480,7 +480,7 @@ fail: return r; } -int sd_bus_message_new_method_call( +_public_ int sd_bus_message_new_method_call( sd_bus *bus, const char *destination, const char *path, @@ -571,7 +571,7 @@ fail: return r; } -int sd_bus_message_new_method_return( +_public_ int sd_bus_message_new_method_return( sd_bus *bus, sd_bus_message *call, sd_bus_message **m) { @@ -579,7 +579,7 @@ int sd_bus_message_new_method_return( return message_new_reply(bus, call, SD_BUS_MESSAGE_METHOD_RETURN, m); } -int sd_bus_message_new_method_error( +_public_ int sd_bus_message_new_method_error( sd_bus *bus, sd_bus_message *call, const sd_bus_error *e, @@ -613,7 +613,7 @@ fail: return r; } -int sd_bus_message_new_method_errorf( +_public_ int sd_bus_message_new_method_errorf( sd_bus *bus, sd_bus_message *call, sd_bus_message **m, @@ -638,7 +638,7 @@ int sd_bus_message_new_method_errorf( return sd_bus_message_new_method_error(bus, call, &error, m); } -int sd_bus_message_new_method_errno( +_public_ int sd_bus_message_new_method_errno( sd_bus *bus, sd_bus_message *call, int error, @@ -655,7 +655,7 @@ int sd_bus_message_new_method_errno( return sd_bus_message_new_method_error(bus, call, &berror, m); } -int sd_bus_message_new_method_errnof( +_public_ int sd_bus_message_new_method_errnof( sd_bus *bus, sd_bus_message *call, sd_bus_message **m, @@ -724,7 +724,7 @@ fail: return r; } -sd_bus_message* sd_bus_message_ref(sd_bus_message *m) { +_public_ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) { assert_return(m, NULL); assert(m->n_ref > 0); @@ -733,7 +733,7 @@ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) { return m; } -sd_bus_message* sd_bus_message_unref(sd_bus_message *m) { +_public_ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) { assert_return(m, NULL); assert(m->n_ref > 0); @@ -745,7 +745,7 @@ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) { return NULL; } -int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) { +_public_ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) { assert_return(m, -EINVAL); assert_return(type, -EINVAL); @@ -753,7 +753,7 @@ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) { return 0; } -int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) { +_public_ int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) { assert_return(m, -EINVAL); assert_return(serial, -EINVAL); assert_return(m->header->serial != 0, -ENOENT); @@ -762,7 +762,7 @@ int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) { return 0; } -int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) { +_public_ int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) { assert_return(m, -EINVAL); assert_return(serial, -EINVAL); assert_return(m->reply_serial != 0, -ENOENT); @@ -771,49 +771,50 @@ int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) { return 0; } -int sd_bus_message_get_no_reply(sd_bus_message *m) { +_public_ int sd_bus_message_get_no_reply(sd_bus_message *m) { assert_return(m, -EINVAL); return m->header->type == SD_BUS_MESSAGE_METHOD_CALL ? !!(m->header->flags & SD_BUS_MESSAGE_NO_REPLY_EXPECTED) : 0; } -const char *sd_bus_message_get_path(sd_bus_message *m) { +_public_ const char *sd_bus_message_get_path(sd_bus_message *m) { assert_return(m, NULL); return m->path; } -const char *sd_bus_message_get_interface(sd_bus_message *m) { +_public_ const char *sd_bus_message_get_interface(sd_bus_message *m) { assert_return(m, NULL); return m->interface; } -const char *sd_bus_message_get_member(sd_bus_message *m) { +_public_ const char *sd_bus_message_get_member(sd_bus_message *m) { assert_return(m, NULL); return m->member; } -const char *sd_bus_message_get_destination(sd_bus_message *m) { + +_public_ const char *sd_bus_message_get_destination(sd_bus_message *m) { assert_return(m, NULL); return m->destination; } -const char *sd_bus_message_get_sender(sd_bus_message *m) { +_public_ const char *sd_bus_message_get_sender(sd_bus_message *m) { assert_return(m, NULL); return m->sender; } -const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) { +_public_ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) { assert_return(m, NULL); assert_return(sd_bus_error_is_set(&m->error), NULL); return &m->error; } -int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) { +_public_ int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) { assert_return(m, -EINVAL); assert_return(uid, -EINVAL); assert_return(m->uid_valid, -ESRCH); @@ -822,7 +823,7 @@ int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) { return 0; } -int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) { +_public_ int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) { assert_return(m, -EINVAL); assert_return(gid, -EINVAL); assert_return(m->gid_valid, -ESRCH); @@ -831,7 +832,7 @@ int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) { return 0; } -int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) { +_public_ int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) { assert_return(m, -EINVAL); assert_return(pid, -EINVAL); assert_return(m->pid > 0, -ESRCH); @@ -840,7 +841,7 @@ int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) { return 0; } -int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) { +_public_ int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) { assert_return(m, -EINVAL); assert_return(tid, -EINVAL); assert_return(m->tid > 0, -ESRCH); @@ -849,7 +850,7 @@ int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) { return 0; } -int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) { +_public_ int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) { assert_return(m, -EINVAL); assert_return(usec, -EINVAL); assert_return(m->pid_starttime > 0, -ESRCH); @@ -858,7 +859,7 @@ int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) { return 0; } -int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) { assert_return(m, -EINVAL); assert_return(m->label, -ESRCH); @@ -866,7 +867,7 @@ int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) { +_public_ int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) { assert_return(m, -EINVAL); assert_return(usec, -EINVAL); assert_return(m->monotonic > 0, -ESRCH); @@ -875,7 +876,7 @@ int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) { return 0; } -int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) { +_public_ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) { assert_return(m, -EINVAL); assert_return(usec, -EINVAL); assert_return(m->realtime > 0, -ESRCH); @@ -884,7 +885,7 @@ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) { return 0; } -int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) { assert_return(m, -EINVAL); assert_return(ret, -EINVAL); assert_return(m->comm, -ESRCH); @@ -893,7 +894,7 @@ int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) { assert_return(m, -EINVAL); assert_return(ret, -EINVAL); assert_return(m->tid_comm, -ESRCH); @@ -902,7 +903,7 @@ int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) { assert_return(m, -EINVAL); assert_return(ret, -EINVAL); assert_return(m->exe, -ESRCH); @@ -911,7 +912,7 @@ int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) { assert_return(m, -EINVAL); assert_return(ret, -EINVAL); assert_return(m->cgroup, -ESRCH); @@ -920,7 +921,7 @@ int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) { int r; assert_return(m, -EINVAL); @@ -937,7 +938,7 @@ int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) { int r; assert_return(m, -EINVAL); @@ -954,7 +955,7 @@ int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_session(sd_bus_message *m, const char **ret) { +_public_ int sd_bus_message_get_session(sd_bus_message *m, const char **ret) { int r; assert_return(m, -EINVAL); @@ -971,7 +972,7 @@ int sd_bus_message_get_session(sd_bus_message *m, const char **ret) { return 0; } -int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) { +_public_ int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) { assert_return(m, -EINVAL); assert_return(uid, -EINVAL); assert_return(m->cgroup, -ESRCH); @@ -979,7 +980,7 @@ int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) { return cg_path_get_owner_uid(m->cgroup, uid); } -int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) { +_public_ int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) { size_t n, i; const char *p; bool first; @@ -1008,7 +1009,7 @@ int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) { return 0; } -int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) { +_public_ int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) { assert_return(m, -EINVAL); assert_return(sessionid, -EINVAL); assert_return(m->audit, -ESRCH); @@ -1017,7 +1018,7 @@ int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) { return 0; } -int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) { +_public_ int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) { assert_return(m, -EINVAL); assert_return(uid, -EINVAL); assert_return(m->audit, -ESRCH); @@ -1026,7 +1027,7 @@ int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) { return 0; } -int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) { +_public_ int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) { unsigned sz; assert_return(m, -EINVAL); @@ -1040,7 +1041,9 @@ int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) { return !!(m->capability[2 * sz + (capability / 8)] & (1 << (capability % 8))); } -int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member) { +_public_ int sd_bus_message_is_signal(sd_bus_message *m, + const char *interface, + const char *member) { assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_SIGNAL) @@ -1055,7 +1058,9 @@ int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const cha return 1; } -int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member) { +_public_ int sd_bus_message_is_method_call(sd_bus_message *m, + const char *interface, + const char *member) { assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_METHOD_CALL) @@ -1070,7 +1075,7 @@ int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, cons return 1; } -int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) { +_public_ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) { assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_METHOD_ERROR) @@ -1082,7 +1087,7 @@ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) { return 1; } -int sd_bus_message_set_no_reply(sd_bus_message *m, int b) { +_public_ int sd_bus_message_set_no_reply(sd_bus_message *m, int b) { assert_return(m, -EINVAL); assert_return(!m->sealed, -EPERM); assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EPERM); @@ -1474,11 +1479,11 @@ fail: return r; } -int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p) { +_public_ int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p) { return message_append_basic(m, type, p, NULL); } -int sd_bus_message_append_string_space(sd_bus_message *m, size_t size, char **s) { +_public_ int sd_bus_message_append_string_space(sd_bus_message *m, size_t size, char **s) { struct bus_container *c; void *a; @@ -1740,7 +1745,7 @@ static int bus_message_open_dict_entry( return 0; } -int sd_bus_message_open_container( +_public_ int sd_bus_message_open_container( sd_bus_message *m, char type, const char *contents) { @@ -1806,7 +1811,7 @@ int sd_bus_message_open_container( return 0; } -int sd_bus_message_close_container(sd_bus_message *m) { +_public_ int sd_bus_message_close_container(sd_bus_message *m) { struct bus_container *c; assert_return(m, -EINVAL); @@ -2061,7 +2066,7 @@ int bus_message_append_ap( return 0; } -int sd_bus_message_append(sd_bus_message *m, const char *types, ...) { +_public_ int sd_bus_message_append(sd_bus_message *m, const char *types, ...) { va_list ap; int r; @@ -2077,7 +2082,10 @@ int sd_bus_message_append(sd_bus_message *m, const char *types, ...) { return r; } -int sd_bus_message_append_array_space(sd_bus_message *m, char type, size_t size, void **ptr) { +_public_ int sd_bus_message_append_array_space(sd_bus_message *m, + char type, + size_t size, + void **ptr) { ssize_t align, sz; void *a; int r; @@ -2113,7 +2121,10 @@ int sd_bus_message_append_array_space(sd_bus_message *m, char type, size_t size, return 0; } -int sd_bus_message_append_array(sd_bus_message *m, char type, const void *ptr, size_t size) { +_public_ int sd_bus_message_append_array(sd_bus_message *m, + char type, + const void *ptr, + size_t size) { int r; void *p; @@ -2133,7 +2144,9 @@ int sd_bus_message_append_array(sd_bus_message *m, char type, const void *ptr, s return 0; } -int sd_bus_message_append_array_memfd(sd_bus_message *m, char type, sd_memfd *memfd) { +_public_ int sd_bus_message_append_array_memfd(sd_bus_message *m, + char type, + sd_memfd *memfd) { _cleanup_close_ int copy_fd = -1; struct bus_body_part *part; ssize_t align, sz; @@ -2199,7 +2212,7 @@ int sd_bus_message_append_array_memfd(sd_bus_message *m, char type, sd_memfd *me return sd_bus_message_close_container(m); } -int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd *memfd) { +_public_ int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd *memfd) { _cleanup_close_ int copy_fd = -1; struct bus_body_part *part; struct bus_container *c; @@ -2275,7 +2288,7 @@ int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd *memfd) { return 0; } -int sd_bus_message_append_strv(sd_bus_message *m, char **l) { +_public_ int sd_bus_message_append_strv(sd_bus_message *m, char **l) { char **i; int r; @@ -2555,7 +2568,7 @@ static bool validate_object_path(const char *s, size_t l) { return true; } -int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) { +_public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) { struct bus_container *c; void *q; int r; @@ -2886,7 +2899,9 @@ static int bus_message_enter_dict_entry( return 1; } -int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *contents) { +_public_ int sd_bus_message_enter_container(sd_bus_message *m, + char type, + const char *contents) { struct bus_container *c, *w; uint32_t *array_size = NULL; char *signature; @@ -2983,7 +2998,7 @@ int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *con return 1; } -int sd_bus_message_exit_container(sd_bus_message *m) { +_public_ int sd_bus_message_exit_container(sd_bus_message *m) { struct bus_container *c; assert_return(m, -EINVAL); @@ -3031,7 +3046,7 @@ static void message_quit_container(sd_bus_message *m) { c->index = c->saved_index; } -int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **contents) { +_public_ int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **contents) { struct bus_container *c; int r; @@ -3151,7 +3166,7 @@ eof: return 0; } -int sd_bus_message_rewind(sd_bus_message *m, int complete) { +_public_ int sd_bus_message_rewind(sd_bus_message *m, int complete) { struct bus_container *c; assert_return(m, -EINVAL); @@ -3370,7 +3385,7 @@ static int message_read_ap( return 1; } -int sd_bus_message_read(sd_bus_message *m, const char *types, ...) { +_public_ int sd_bus_message_read(sd_bus_message *m, const char *types, ...) { va_list ap; int r; @@ -3385,7 +3400,7 @@ int sd_bus_message_read(sd_bus_message *m, const char *types, ...) { return r; } -int sd_bus_message_skip(sd_bus_message *m, const char *types) { +_public_ int sd_bus_message_skip(sd_bus_message *m, const char *types) { int r; assert_return(m, -EINVAL); @@ -3527,7 +3542,10 @@ int sd_bus_message_skip(sd_bus_message *m, const char *types) { } } -int sd_bus_message_read_array(sd_bus_message *m, char type, const void **ptr, size_t *size) { +_public_ int sd_bus_message_read_array(sd_bus_message *m, + char type, + const void **ptr, + size_t *size) { struct bus_container *c; void *p; size_t sz; @@ -4065,7 +4083,7 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) { return 0; } -int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) { +_public_ int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) { assert_return(m, -EINVAL); assert_return(destination, -EINVAL); assert_return(!m->sealed, -EPERM); @@ -4489,7 +4507,7 @@ int bus_header_message_size(struct bus_header *h, size_t *sum) { return 0; } -int sd_bus_message_get_errno(sd_bus_message *m) { +_public_ int sd_bus_message_get_errno(sd_bus_message *m) { assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_METHOD_ERROR) @@ -4498,7 +4516,7 @@ int sd_bus_message_get_errno(sd_bus_message *m) { return sd_bus_error_get_errno(&m->error); } -const char* sd_bus_message_get_signature(sd_bus_message *m, int complete) { +_public_ const char* sd_bus_message_get_signature(sd_bus_message *m, int complete) { struct bus_container *c; assert_return(m, NULL); @@ -4507,7 +4525,7 @@ const char* sd_bus_message_get_signature(sd_bus_message *m, int complete) { return c->signature ?: ""; } -int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { +_public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { bool done_something = false; int r; @@ -4586,7 +4604,7 @@ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { return done_something; } -int sd_bus_message_verify_type(sd_bus_message *m, char type, const char *contents) { +_public_ int sd_bus_message_verify_type(sd_bus_message *m, char type, const char *contents) { const char *c; char t; int r; diff --git a/src/libsystemd-bus/bus-objects.c b/src/libsystemd-bus/bus-objects.c index 93bd3ad86c..8369068bd0 100644 --- a/src/libsystemd-bus/bus-objects.c +++ b/src/libsystemd-bus/bus-objects.c @@ -1389,19 +1389,35 @@ static int bus_remove_object( return 1; } -int sd_bus_add_object(sd_bus *bus, const char *path, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_add_object(sd_bus *bus, + const char *path, + sd_bus_message_handler_t callback, + void *userdata) { + return bus_add_object(bus, false, path, callback, userdata); } -int sd_bus_remove_object(sd_bus *bus, const char *path, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_remove_object(sd_bus *bus, + const char *path, + sd_bus_message_handler_t callback, + void *userdata) { + return bus_remove_object(bus, false, path, callback, userdata); } -int sd_bus_add_fallback(sd_bus *bus, const char *prefix, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_add_fallback(sd_bus *bus, + const char *prefix, + sd_bus_message_handler_t callback, + void *userdata) { + return bus_add_object(bus, true, prefix, callback, userdata); } -int sd_bus_remove_fallback(sd_bus *bus, const char *prefix, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_remove_fallback(sd_bus *bus, + const char *prefix, + sd_bus_message_handler_t callback, + void *userdata) { + return bus_remove_object(bus, true, prefix, callback, userdata); } @@ -1686,7 +1702,7 @@ static int remove_object_vtable_internal( return 1; } -int sd_bus_add_object_vtable( +_public_ int sd_bus_add_object_vtable( sd_bus *bus, const char *path, const char *interface, @@ -1696,7 +1712,7 @@ int sd_bus_add_object_vtable( return add_object_vtable_internal(bus, path, interface, vtable, false, NULL, userdata); } -int sd_bus_remove_object_vtable( +_public_ int sd_bus_remove_object_vtable( sd_bus *bus, const char *path, const char *interface) { @@ -1704,7 +1720,7 @@ int sd_bus_remove_object_vtable( return remove_object_vtable_internal(bus, path, interface, false); } -int sd_bus_add_fallback_vtable( +_public_ int sd_bus_add_fallback_vtable( sd_bus *bus, const char *path, const char *interface, @@ -1715,7 +1731,7 @@ int sd_bus_add_fallback_vtable( return add_object_vtable_internal(bus, path, interface, vtable, true, find, userdata); } -int sd_bus_remove_fallback_vtable( +_public_ int sd_bus_remove_fallback_vtable( sd_bus *bus, const char *path, const char *interface) { @@ -1723,7 +1739,7 @@ int sd_bus_remove_fallback_vtable( return remove_object_vtable_internal(bus, path, interface, true); } -int sd_bus_add_node_enumerator( +_public_ int sd_bus_add_node_enumerator( sd_bus *bus, const char *path, sd_bus_node_enumerator_t callback, @@ -1764,7 +1780,7 @@ fail: return r; } -int sd_bus_remove_node_enumerator( +_public_ int sd_bus_remove_node_enumerator( sd_bus *bus, const char *path, sd_bus_node_enumerator_t callback, @@ -1939,7 +1955,7 @@ static int emit_properties_changed_on_interface( return 1; } -int sd_bus_emit_properties_changed_strv( +_public_ int sd_bus_emit_properties_changed_strv( sd_bus *bus, const char *path, const char *interface, @@ -1981,7 +1997,7 @@ int sd_bus_emit_properties_changed_strv( return -ENOENT; } -int sd_bus_emit_properties_changed( +_public_ int sd_bus_emit_properties_changed( sd_bus *bus, const char *path, const char *interface, @@ -2097,7 +2113,7 @@ static int interfaces_added_append_one( return -ENOENT; } -int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces) { +_public_ int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces) { BUS_DONT_DESTROY(bus); _cleanup_bus_message_unref_ sd_bus_message *m = NULL; @@ -2161,7 +2177,7 @@ int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **inte return sd_bus_send(bus, m, NULL); } -int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char *interface, ...) { +_public_ int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char *interface, ...) { char **interfaces; assert_return(bus, -EINVAL); @@ -2174,7 +2190,7 @@ int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char *inte return sd_bus_emit_interfaces_added_strv(bus, path, interfaces); } -int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char **interfaces) { +_public_ int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char **interfaces) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; @@ -2201,7 +2217,7 @@ int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char **in return sd_bus_send(bus, m, NULL); } -int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const char *interface, ...) { +_public_ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const char *interface, ...) { char **interfaces; assert_return(bus, -EINVAL); @@ -2214,7 +2230,7 @@ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const char *in return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces); } -int sd_bus_add_object_manager(sd_bus *bus, const char *path) { +_public_ int sd_bus_add_object_manager(sd_bus *bus, const char *path) { struct node *n; assert_return(bus, -EINVAL); @@ -2230,7 +2246,7 @@ int sd_bus_add_object_manager(sd_bus *bus, const char *path) { return 0; } -int sd_bus_remove_object_manager(sd_bus *bus, const char *path) { +_public_ int sd_bus_remove_object_manager(sd_bus *bus, const char *path) { struct node *n; assert_return(bus, -EINVAL); diff --git a/src/libsystemd-bus/libsystemd-bus.sym b/src/libsystemd-bus/libsystemd-bus.sym new file mode 100644 index 0000000000..850f370c5b --- /dev/null +++ b/src/libsystemd-bus/libsystemd-bus.sym @@ -0,0 +1,197 @@ +/*** + This file is part of systemd. + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. +***/ + +LIBSYSTEMD_BUS_209 { +global: + /* Same order as in sd-bus.h should be used */ + + /* Connections */ + sd_bus_open_user; + sd_bus_open_system; + sd_bus_open_system_remote; + sd_bus_open_system_container; + sd_bus_new; + sd_bus_set_address; + sd_bus_set_fd; + sd_bus_set_exec; + sd_bus_set_bus_client; + sd_bus_set_server; + sd_bus_set_anonymous; + sd_bus_negotiate_fds; + sd_bus_negotiate_attach_comm; + sd_bus_negotiate_attach_exe; + sd_bus_negotiate_attach_cmdline; + sd_bus_negotiate_attach_cgroup; + sd_bus_negotiate_attach_caps; + sd_bus_negotiate_attach_selinux_context; + sd_bus_negotiate_attach_audit; + sd_bus_start; + sd_bus_close; + sd_bus_ref; + sd_bus_unref; + sd_bus_is_open; + sd_bus_can_send; + sd_bus_get_server_id; + sd_bus_send; + sd_bus_send_with_reply; + sd_bus_send_with_reply_cancel; + sd_bus_send_with_reply_and_block; + sd_bus_get_fd; + sd_bus_get_events; + sd_bus_get_timeout; + sd_bus_process; + sd_bus_wait; + sd_bus_flush; + sd_bus_get_current; + sd_bus_attach_event; + sd_bus_detach_event; + sd_bus_add_filter; + sd_bus_remove_filter; + sd_bus_add_match; + sd_bus_remove_match; + sd_bus_add_object; + sd_bus_remove_object; + sd_bus_add_fallback; + sd_bus_remove_fallback; + sd_bus_add_object_vtable; + sd_bus_remove_object_vtable; + sd_bus_add_fallback_vtable; + sd_bus_remove_fallback_vtable; + sd_bus_add_node_enumerator; + sd_bus_remove_node_enumerator; + sd_bus_add_object_manager; + sd_bus_remove_object_manager; + + /* Message object */ + sd_bus_message_new_signal; + sd_bus_message_new_method_call; + sd_bus_message_new_method_return; + sd_bus_message_new_method_error; + sd_bus_message_new_method_errorf; + sd_bus_message_new_method_errno; + sd_bus_message_new_method_errnof; + sd_bus_message_ref; + sd_bus_message_unref; + sd_bus_message_get_type; + sd_bus_message_get_serial; + sd_bus_message_get_reply_serial; + sd_bus_message_get_no_reply; + sd_bus_message_get_signature; + sd_bus_message_get_path; + sd_bus_message_get_interface; + sd_bus_message_get_member; + sd_bus_message_get_destination; + sd_bus_message_get_sender; + sd_bus_message_get_error; + sd_bus_message_get_errno; + sd_bus_message_get_monotonic_timestamp; + sd_bus_message_get_realtime_timestamp; + sd_bus_message_get_uid; + sd_bus_message_get_gid; + sd_bus_message_get_pid; + sd_bus_message_get_tid; + sd_bus_message_get_pid_starttime; + sd_bus_message_get_selinux_context; + sd_bus_message_get_comm; + sd_bus_message_get_tid_comm; + sd_bus_message_get_exe; + sd_bus_message_get_cgroup; + sd_bus_message_get_cmdline; + sd_bus_message_get_unit; + sd_bus_message_get_user_unit; + sd_bus_message_get_session; + sd_bus_message_get_owner_uid; + sd_bus_message_get_audit_sessionid; + sd_bus_message_get_audit_loginuid; + sd_bus_message_has_effective_cap; + sd_bus_message_is_signal; + sd_bus_message_is_method_call; + sd_bus_message_is_method_error; + sd_bus_message_set_no_reply; + sd_bus_message_set_destination; + sd_bus_message_append; + sd_bus_message_append_basic; + sd_bus_message_append_array; + sd_bus_message_append_array_space; + sd_bus_message_append_array_memfd; + sd_bus_message_append_string_space; + sd_bus_message_append_string_memfd; + sd_bus_message_append_strv; + sd_bus_message_open_container; + sd_bus_message_close_container; + sd_bus_message_copy; + sd_bus_message_read; + sd_bus_message_read_basic; + sd_bus_message_read_array; + sd_bus_message_read_strv; + sd_bus_message_skip; + sd_bus_message_enter_container; + sd_bus_message_exit_container; + sd_bus_message_peek_type; + sd_bus_message_verify_type; + sd_bus_message_at_end; + sd_bus_message_rewind; + + /* Convenience calls */ + sd_bus_call_method; + sd_bus_get_property; + sd_bus_get_property_trivial; + sd_bus_set_property; + sd_bus_reply_method_return; + sd_bus_reply_method_error; + sd_bus_reply_method_errorf; + sd_bus_reply_method_errno; + sd_bus_reply_method_errnof; + sd_bus_emit_signal; + sd_bus_emit_properties_changed_strv; + sd_bus_emit_properties_changed; + sd_bus_emit_interfaces_added_strv; + sd_bus_emit_interfaces_added; + sd_bus_emit_interfaces_removed_strv; + sd_bus_emit_interfaces_removed; + + /* Bus management */ + sd_bus_get_unique_name; + sd_bus_request_name; + sd_bus_release_name; + sd_bus_list_names; + sd_bus_get_owner; + sd_bus_get_owner_uid; + sd_bus_get_owner_pid; + sd_bus_get_owner_machine_id; + + /* Error structures */ + sd_bus_error_free; + sd_bus_error_set; + sd_bus_error_setf; + sd_bus_error_set_const; + sd_bus_error_set_errno; + sd_bus_error_set_errnof; + sd_bus_error_get_errno; + sd_bus_error_copy; + sd_bus_error_is_set; + sd_bus_error_has_name; + + /* mem-fd functions */ + sd_memfd_new; + sd_memfd_make; + sd_memfd_new_and_map; + sd_memfd_free; + sd_memfd_get_fd; + sd_memfd_get_file; + sd_memfd_dup_fd; + sd_memfd_map; + sd_memfd_set_sealed; + sd_memfd_get_sealed; + sd_memfd_get_size; + sd_memfd_set_size; + +local: + *; +}; diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index e68f127b70..fceab505ac 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -159,7 +159,7 @@ static void bus_free(sd_bus *b) { free(b); } -int sd_bus_new(sd_bus **ret) { +_public_ int sd_bus_new(sd_bus **ret) { sd_bus *r; assert_return(ret, -EINVAL); @@ -188,7 +188,7 @@ int sd_bus_new(sd_bus **ret) { return 0; } -int sd_bus_set_address(sd_bus *bus, const char *address) { +_public_ int sd_bus_set_address(sd_bus *bus, const char *address) { char *a; assert_return(bus, -EINVAL); @@ -206,7 +206,7 @@ int sd_bus_set_address(sd_bus *bus, const char *address) { return 0; } -int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) { +_public_ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(input_fd >= 0, -EINVAL); @@ -218,7 +218,7 @@ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) { return 0; } -int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) { +_public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) { char *p, **a; assert_return(bus, -EINVAL); @@ -246,7 +246,7 @@ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) { return 0; } -int sd_bus_set_bus_client(sd_bus *bus, int b) { +_public_ int sd_bus_set_bus_client(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -255,7 +255,7 @@ int sd_bus_set_bus_client(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_fds(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_fds(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -264,7 +264,7 @@ int sd_bus_negotiate_fds(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_comm(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_comm(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -273,7 +273,7 @@ int sd_bus_negotiate_attach_comm(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_exe(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_exe(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -282,7 +282,7 @@ int sd_bus_negotiate_attach_exe(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_cmdline(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_cmdline(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -291,7 +291,7 @@ int sd_bus_negotiate_attach_cmdline(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_cgroup(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_cgroup(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -300,7 +300,7 @@ int sd_bus_negotiate_attach_cgroup(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_caps(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_caps(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -309,7 +309,7 @@ int sd_bus_negotiate_attach_caps(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_selinux_context(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_selinux_context(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -318,7 +318,7 @@ int sd_bus_negotiate_attach_selinux_context(sd_bus *bus, int b) { return 0; } -int sd_bus_negotiate_attach_audit(sd_bus *bus, int b) { +_public_ int sd_bus_negotiate_attach_audit(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -327,7 +327,7 @@ int sd_bus_negotiate_attach_audit(sd_bus *bus, int b) { return 0; } -int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) { +_public_ int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) { assert_return(bus, -EINVAL); assert_return(b || sd_id128_equal(server_id, SD_ID128_NULL), -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); @@ -338,7 +338,7 @@ int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) { return 0; } -int sd_bus_set_anonymous(sd_bus *bus, int b) { +_public_ int sd_bus_set_anonymous(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -982,7 +982,7 @@ static int bus_start_fd(sd_bus *b) { return bus_socket_take_fd(b); } -int sd_bus_start(sd_bus *bus) { +_public_ int sd_bus_start(sd_bus *bus) { int r; assert_return(bus, -EINVAL); @@ -1007,7 +1007,7 @@ int sd_bus_start(sd_bus *bus) { return bus_send_hello(bus); } -int sd_bus_open_system(sd_bus **ret) { +_public_ int sd_bus_open_system(sd_bus **ret) { const char *e; sd_bus *b; int r; @@ -1043,7 +1043,7 @@ fail: return r; } -int sd_bus_open_user(sd_bus **ret) { +_public_ int sd_bus_open_user(sd_bus **ret) { const char *e; sd_bus *b; size_t l; @@ -1092,7 +1092,7 @@ fail: return r; } -int sd_bus_open_system_remote(const char *host, sd_bus **ret) { +_public_ int sd_bus_open_system_remote(const char *host, sd_bus **ret) { _cleanup_free_ char *e = NULL; char *p = NULL; sd_bus *bus; @@ -1128,7 +1128,7 @@ int sd_bus_open_system_remote(const char *host, sd_bus **ret) { return 0; } -int sd_bus_open_system_container(const char *machine, sd_bus **ret) { +_public_ int sd_bus_open_system_container(const char *machine, sd_bus **ret) { _cleanup_free_ char *e = NULL; sd_bus *bus; char *p; @@ -1164,7 +1164,7 @@ int sd_bus_open_system_container(const char *machine, sd_bus **ret) { return 0; } -void sd_bus_close(sd_bus *bus) { +_public_ void sd_bus_close(sd_bus *bus) { if (!bus) return; if (bus->state == BUS_CLOSED) @@ -1186,7 +1186,7 @@ void sd_bus_close(sd_bus *bus) { * freed. */ } -sd_bus *sd_bus_ref(sd_bus *bus) { +_public_ sd_bus *sd_bus_ref(sd_bus *bus) { assert_return(bus, NULL); assert_se(REFCNT_INC(bus->n_ref) >= 2); @@ -1194,7 +1194,7 @@ sd_bus *sd_bus_ref(sd_bus *bus) { return bus; } -sd_bus *sd_bus_unref(sd_bus *bus) { +_public_ sd_bus *sd_bus_unref(sd_bus *bus) { assert_return(bus, NULL); if (REFCNT_DEC(bus->n_ref) <= 0) @@ -1203,7 +1203,7 @@ sd_bus *sd_bus_unref(sd_bus *bus) { return NULL; } -int sd_bus_is_open(sd_bus *bus) { +_public_ int sd_bus_is_open(sd_bus *bus) { assert_return(bus, -EINVAL); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -1211,7 +1211,7 @@ int sd_bus_is_open(sd_bus *bus) { return BUS_IS_OPEN(bus->state); } -int sd_bus_can_send(sd_bus *bus, char type) { +_public_ int sd_bus_can_send(sd_bus *bus, char type) { int r; assert_return(bus, -EINVAL); @@ -1232,7 +1232,7 @@ int sd_bus_can_send(sd_bus *bus, char type) { return bus_type_is_valid(type); } -int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *server_id) { +_public_ int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *server_id) { int r; assert_return(bus, -EINVAL); @@ -1339,7 +1339,7 @@ static int dispatch_rqueue(sd_bus *bus, sd_bus_message **m) { return ret; } -int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) { +_public_ int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) { int r; assert_return(bus, -EINVAL); @@ -1440,7 +1440,7 @@ static int timeout_compare(const void *a, const void *b) { return 0; } -int sd_bus_send_with_reply( +_public_ int sd_bus_send_with_reply( sd_bus *bus, sd_bus_message *m, sd_bus_message_handler_t callback, @@ -1506,7 +1506,7 @@ int sd_bus_send_with_reply( return r; } -int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial) { +_public_ int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial) { struct reply_callback *c; assert_return(bus, -EINVAL); @@ -1549,7 +1549,7 @@ int bus_ensure_running(sd_bus *bus) { } } -int sd_bus_send_with_reply_and_block( +_public_ int sd_bus_send_with_reply_and_block( sd_bus *bus, sd_bus_message *m, uint64_t usec, @@ -1671,7 +1671,7 @@ int sd_bus_send_with_reply_and_block( } } -int sd_bus_get_fd(sd_bus *bus) { +_public_ int sd_bus_get_fd(sd_bus *bus) { assert_return(bus, -EINVAL); assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); @@ -1681,7 +1681,7 @@ int sd_bus_get_fd(sd_bus *bus) { return bus->input_fd; } -int sd_bus_get_events(sd_bus *bus) { +_public_ int sd_bus_get_events(sd_bus *bus) { int flags = 0; assert_return(bus, -EINVAL); @@ -1707,7 +1707,7 @@ int sd_bus_get_events(sd_bus *bus) { return flags; } -int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { +_public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { struct reply_callback *c; assert_return(bus, -EINVAL); @@ -2021,7 +2021,7 @@ null_message: return r; } -int sd_bus_process(sd_bus *bus, sd_bus_message **ret) { +_public_ int sd_bus_process(sd_bus *bus, sd_bus_message **ret) { BUS_DONT_DESTROY(bus); int r; @@ -2126,7 +2126,7 @@ static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) { return r > 0 ? 1 : 0; } -int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) { +_public_ int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) { assert_return(bus, -EINVAL); assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); @@ -2138,7 +2138,7 @@ int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) { return bus_poll(bus, false, timeout_usec); } -int sd_bus_flush(sd_bus *bus) { +_public_ int sd_bus_flush(sd_bus *bus) { int r; assert_return(bus, -EINVAL); @@ -2166,7 +2166,10 @@ int sd_bus_flush(sd_bus *bus) { } } -int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_add_filter(sd_bus *bus, + sd_bus_message_handler_t callback, + void *userdata) { + struct filter_callback *f; assert_return(bus, -EINVAL); @@ -2184,7 +2187,10 @@ int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *user return 0; } -int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_remove_filter(sd_bus *bus, + sd_bus_message_handler_t callback, + void *userdata) { + struct filter_callback *f; assert_return(bus, -EINVAL); @@ -2203,7 +2209,11 @@ int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *u return 0; } -int sd_bus_add_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_add_match(sd_bus *bus, + const char *match, + sd_bus_message_handler_t callback, + void *userdata) { + struct bus_match_component *components = NULL; unsigned n_components = 0; uint64_t cookie = 0; @@ -2237,7 +2247,11 @@ finish: return r; } -int sd_bus_remove_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata) { +_public_ int sd_bus_remove_match(sd_bus *bus, + const char *match, + sd_bus_message_handler_t callback, + void *userdata) { + struct bus_match_component *components = NULL; unsigned n_components = 0; int r = 0, q = 0; @@ -2352,7 +2366,7 @@ static int quit_callback(sd_event_source *event, void *userdata) { return 1; } -int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) { +_public_ int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) { int r; assert_return(bus, -EINVAL); @@ -2406,7 +2420,7 @@ fail: return r; } -int sd_bus_detach_event(sd_bus *bus) { +_public_ int sd_bus_detach_event(sd_bus *bus) { assert_return(bus, -EINVAL); assert_return(bus->event, -ENXIO); diff --git a/src/libsystemd-bus/sd-memfd.c b/src/libsystemd-bus/sd-memfd.c index bd14da3a70..c229bec18f 100644 --- a/src/libsystemd-bus/sd-memfd.c +++ b/src/libsystemd-bus/sd-memfd.c @@ -34,7 +34,7 @@ struct sd_memfd { FILE *f; }; -int sd_memfd_new(sd_memfd **m) { +_public_ int sd_memfd_new(sd_memfd **m) { _cleanup_close_ int kdbus = -1; sd_memfd *n; int fd; @@ -58,7 +58,7 @@ int sd_memfd_new(sd_memfd **m) { return 0; } -int sd_memfd_make(int fd, sd_memfd **m) { +_public_ int sd_memfd_make(int fd, sd_memfd **m) { sd_memfd *n; uint64_t sz; @@ -81,7 +81,7 @@ int sd_memfd_make(int fd, sd_memfd **m) { return 0; } -void sd_memfd_free(sd_memfd *m) { +_public_ void sd_memfd_free(sd_memfd *m) { if (!m) return; @@ -93,14 +93,14 @@ void sd_memfd_free(sd_memfd *m) { free(m); } -int sd_memfd_get_fd(sd_memfd *m) { +_public_ int sd_memfd_get_fd(sd_memfd *m) { if (!m) return -EINVAL; return m->fd; } -int sd_memfd_get_file(sd_memfd *m, FILE **f) { +_public_ int sd_memfd_get_file(sd_memfd *m, FILE **f) { if (!m) return -EINVAL; if (!f) @@ -116,7 +116,7 @@ int sd_memfd_get_file(sd_memfd *m, FILE **f) { return 0; } -int sd_memfd_dup_fd(sd_memfd *m) { +_public_ int sd_memfd_dup_fd(sd_memfd *m) { int fd; if (!m) @@ -129,7 +129,7 @@ int sd_memfd_dup_fd(sd_memfd *m) { return fd; } -int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p) { +_public_ int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p) { void *q; int sealed; @@ -152,7 +152,7 @@ int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p) { return 0; } -int sd_memfd_set_sealed(sd_memfd *m, int b) { +_public_ int sd_memfd_set_sealed(sd_memfd *m, int b) { int r; if (!m) @@ -165,7 +165,7 @@ int sd_memfd_set_sealed(sd_memfd *m, int b) { return 0; } -int sd_memfd_get_sealed(sd_memfd *m) { +_public_ int sd_memfd_get_sealed(sd_memfd *m) { int r, b; if (!m) @@ -178,7 +178,7 @@ int sd_memfd_get_sealed(sd_memfd *m) { return !!b; } -int sd_memfd_get_size(sd_memfd *m, uint64_t *sz) { +_public_ int sd_memfd_get_size(sd_memfd *m, uint64_t *sz) { int r; if (!m) @@ -193,7 +193,7 @@ int sd_memfd_get_size(sd_memfd *m, uint64_t *sz) { return r; } -int sd_memfd_set_size(sd_memfd *m, uint64_t sz) { +_public_ int sd_memfd_set_size(sd_memfd *m, uint64_t sz) { int r; if (!m) @@ -206,7 +206,7 @@ int sd_memfd_set_size(sd_memfd *m, uint64_t sz) { return r; } -int sd_memfd_new_and_map(sd_memfd **m, size_t sz, void **p) { +_public_ int sd_memfd_new_and_map(sd_memfd **m, size_t sz, void **p) { sd_memfd *n; int r; |