summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd-bus/bus-internal.h6
-rw-r--r--src/libsystemd-bus/bus-match.c8
-rw-r--r--src/libsystemd-bus/bus-match.h6
-rw-r--r--src/libsystemd-bus/sd-bus.c22
-rw-r--r--src/libsystemd-bus/sd-bus.h23
5 files changed, 31 insertions, 34 deletions
diff --git a/src/libsystemd-bus/bus-internal.h b/src/libsystemd-bus/bus-internal.h
index 1dcb383038..a11dc8c876 100644
--- a/src/libsystemd-bus/bus-internal.h
+++ b/src/libsystemd-bus/bus-internal.h
@@ -35,7 +35,7 @@
#include "bus-match.h"
struct reply_callback {
- sd_message_handler_t callback;
+ sd_bus_message_handler_t callback;
void *userdata;
usec_t timeout;
uint64_t serial;
@@ -43,14 +43,14 @@ struct reply_callback {
};
struct filter_callback {
- sd_message_handler_t callback;
+ sd_bus_message_handler_t callback;
void *userdata;
LIST_FIELDS(struct filter_callback, callbacks);
};
struct object_callback {
- sd_message_handler_t callback;
+ sd_bus_message_handler_t callback;
void *userdata;
char *path;
diff --git a/src/libsystemd-bus/bus-match.c b/src/libsystemd-bus/bus-match.c
index ff1edfaaed..972ac8e00e 100644
--- a/src/libsystemd-bus/bus-match.c
+++ b/src/libsystemd-bus/bus-match.c
@@ -481,7 +481,7 @@ static int bus_match_find_compare_value(
static int bus_match_add_leaf(
struct bus_match_node *where,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata,
struct bus_match_node **ret) {
@@ -511,7 +511,7 @@ static int bus_match_add_leaf(
static int bus_match_find_leaf(
struct bus_match_node *where,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata,
struct bus_match_node **ret) {
@@ -778,7 +778,7 @@ fail:
int bus_match_add(
struct bus_match_node *root,
const char *match,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata,
struct bus_match_node **ret) {
@@ -819,7 +819,7 @@ finish:
int bus_match_remove(
struct bus_match_node *root,
const char *match,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata) {
struct match_component *components = NULL;
diff --git a/src/libsystemd-bus/bus-match.h b/src/libsystemd-bus/bus-match.h
index 0a63b55403..a31c5d67dc 100644
--- a/src/libsystemd-bus/bus-match.h
+++ b/src/libsystemd-bus/bus-match.h
@@ -58,7 +58,7 @@ struct bus_match_node {
char *str;
} value;
struct {
- sd_message_handler_t callback;
+ sd_bus_message_handler_t callback;
void *userdata;
} leaf;
struct {
@@ -70,8 +70,8 @@ struct bus_match_node {
int bus_match_run(sd_bus *bus, struct bus_match_node *root, int ret, sd_bus_message *m);
-int bus_match_add(struct bus_match_node *root, const char *match, sd_message_handler_t callback, void *userdata, struct bus_match_node **ret);
-int bus_match_remove(struct bus_match_node *root, const char *match, sd_message_handler_t callback, void *userdata);
+int bus_match_add(struct bus_match_node *root, const char *match, sd_bus_message_handler_t callback, void *userdata, struct bus_match_node **ret);
+int bus_match_remove(struct bus_match_node *root, const char *match, sd_bus_message_handler_t callback, void *userdata);
void bus_match_free(struct bus_match_node *node);
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 0a263ea68c..9b9281dde3 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -1117,7 +1117,7 @@ static int timeout_compare(const void *a, const void *b) {
int sd_bus_send_with_reply(
sd_bus *bus,
sd_bus_message *m,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata,
uint64_t usec,
uint64_t *serial) {
@@ -1946,7 +1946,7 @@ int sd_bus_flush(sd_bus *bus) {
}
}
-int sd_bus_add_filter(sd_bus *bus, sd_message_handler_t callback, void *userdata) {
+int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata) {
struct filter_callback *f;
if (!bus)
@@ -1964,7 +1964,7 @@ int sd_bus_add_filter(sd_bus *bus, sd_message_handler_t callback, void *userdata
return 0;
}
-int sd_bus_remove_filter(sd_bus *bus, sd_message_handler_t callback, void *userdata) {
+int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata) {
struct filter_callback *f;
if (!bus)
@@ -1987,7 +1987,7 @@ static int bus_add_object(
sd_bus *bus,
bool fallback,
const char *path,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata) {
struct object_callback *c;
@@ -2032,7 +2032,7 @@ static int bus_remove_object(
sd_bus *bus,
bool fallback,
const char *path,
- sd_message_handler_t callback,
+ sd_bus_message_handler_t callback,
void *userdata) {
struct object_callback *c;
@@ -2059,23 +2059,23 @@ static int bus_remove_object(
return 1;
}
-int sd_bus_add_object(sd_bus *bus, const char *path, sd_message_handler_t callback, void *userdata) {
+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_message_handler_t callback, void *userdata) {
+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_message_handler_t callback, void *userdata) {
+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_message_handler_t callback, void *userdata) {
+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);
}
-int sd_bus_add_match(sd_bus *bus, const char *match, sd_message_handler_t callback, void *userdata) {
+int sd_bus_add_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata) {
int r = 0;
if (!bus)
@@ -2101,7 +2101,7 @@ int sd_bus_add_match(sd_bus *bus, const char *match, sd_message_handler_t callba
return r;
}
-int sd_bus_remove_match(sd_bus *bus, const char *match, sd_message_handler_t callback, void *userdata) {
+int sd_bus_remove_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata) {
int r = 0, q = 0;
if (!bus)
diff --git a/src/libsystemd-bus/sd-bus.h b/src/libsystemd-bus/sd-bus.h
index e0970cdec8..413b7dcee2 100644
--- a/src/libsystemd-bus/sd-bus.h
+++ b/src/libsystemd-bus/sd-bus.h
@@ -33,9 +33,6 @@ extern "C" {
#endif
/* TODO:
- * - sd_message_handler_t needs to be renamed to sd_bus_message_handler_t
- *
- * Later:
* - add page donation logic
* - api for appending/reading fixed arrays
* - merge busctl into systemctl or so?
@@ -51,7 +48,7 @@ typedef struct {
int need_free;
} sd_bus_error;
-typedef int (*sd_message_handler_t)(sd_bus *bus, int ret, sd_bus_message *m, void *userdata);
+typedef int (*sd_bus_message_handler_t)(sd_bus *bus, int ret, sd_bus_message *m, void *userdata);
/* Connections */
@@ -78,7 +75,7 @@ int sd_bus_can_send(sd_bus *bus, char type);
int sd_bus_get_peer(sd_bus *bus, sd_id128_t *peer);
int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial);
-int sd_bus_send_with_reply(sd_bus *bus, sd_bus_message *m, sd_message_handler_t callback, void *userdata, uint64_t usec, uint64_t *serial);
+int sd_bus_send_with_reply(sd_bus *bus, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t usec, uint64_t *serial);
int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial);
int sd_bus_send_with_reply_and_block(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error *error, sd_bus_message **r);
@@ -89,17 +86,17 @@ int sd_bus_process(sd_bus *bus, sd_bus_message **r);
int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec);
int sd_bus_flush(sd_bus *bus);
-int sd_bus_add_filter(sd_bus *bus, sd_message_handler_t callback, void *userdata);
-int sd_bus_remove_filter(sd_bus *bus, sd_message_handler_t callback, void *userdata);
+int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata);
+int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *userdata);
-int sd_bus_add_object(sd_bus *bus, const char *path, sd_message_handler_t callback, void *userdata);
-int sd_bus_remove_object(sd_bus *bus, const char *path, sd_message_handler_t callback, void *userdata);
+int sd_bus_add_object(sd_bus *bus, const char *path, sd_bus_message_handler_t callback, void *userdata);
+int sd_bus_remove_object(sd_bus *bus, const char *path, sd_bus_message_handler_t callback, void *userdata);
-int sd_bus_add_fallback(sd_bus *bus, const char *prefix, sd_message_handler_t callback, void *userdata);
-int sd_bus_remove_fallback(sd_bus *bus, const char *prefix, sd_message_handler_t callback, void *userdata);
+int sd_bus_add_fallback(sd_bus *bus, const char *prefix, sd_bus_message_handler_t callback, void *userdata);
+int sd_bus_remove_fallback(sd_bus *bus, const char *prefix, sd_bus_message_handler_t callback, void *userdata);
-int sd_bus_add_match(sd_bus *bus, const char *match, sd_message_handler_t callback, void *userdata);
-int sd_bus_remove_match(sd_bus *bus, const char *match, sd_message_handler_t callback, void *userdata);
+int sd_bus_add_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata);
+int sd_bus_remove_match(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata);
/* Message object */