1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00

bus: add userdata API for bus name tracker objects

This commit is contained in:
Lennart Poettering 2014-05-06 19:15:36 +02:00
parent e30bb6b53b
commit 04552566fa
3 changed files with 22 additions and 0 deletions

View File

@ -331,6 +331,8 @@ m4_ifdef(`ENABLE_KDBUS',
sd_bus_track_ref; sd_bus_track_ref;
sd_bus_track_unref; sd_bus_track_unref;
sd_bus_track_get_bus; sd_bus_track_get_bus;
sd_bus_track_get_userdata;
sd_bus_track_set_userdata;
sd_bus_track_add_sender; sd_bus_track_add_sender;
sd_bus_track_remove_sender; sd_bus_track_remove_sender;
sd_bus_track_add_name; sd_bus_track_add_name;

View File

@ -312,3 +312,20 @@ void bus_track_dispatch(sd_bus_track *track) {
sd_bus_track_unref(track); sd_bus_track_unref(track);
} }
_public_ void *sd_bus_track_get_userdata(sd_bus_track *track) {
assert_return(track, NULL);
return track->userdata;
}
_public_ void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata) {
void *ret;
assert_return(track, NULL);
ret = track->userdata;
track->userdata = userdata;
return ret;
}

View File

@ -358,7 +358,10 @@ int sd_bus_path_decode(const char *path, const char *prefix, char **ret_external
int sd_bus_track_new(sd_bus *bus, sd_bus_track **track, sd_bus_track_handler_t handler, void *userdata); int sd_bus_track_new(sd_bus *bus, sd_bus_track **track, sd_bus_track_handler_t handler, void *userdata);
sd_bus_track* sd_bus_track_ref(sd_bus_track *track); sd_bus_track* sd_bus_track_ref(sd_bus_track *track);
sd_bus_track* sd_bus_track_unref(sd_bus_track *track); sd_bus_track* sd_bus_track_unref(sd_bus_track *track);
sd_bus* sd_bus_track_get_bus(sd_bus_track *track); sd_bus* sd_bus_track_get_bus(sd_bus_track *track);
void *sd_bus_track_get_userdata(sd_bus_track *track);
void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata);
int sd_bus_track_add_sender(sd_bus_track *track, sd_bus_message *m); int sd_bus_track_add_sender(sd_bus_track *track, sd_bus_message *m);
int sd_bus_track_remove_sender(sd_bus_track *track, sd_bus_message *m); int sd_bus_track_remove_sender(sd_bus_track *track, sd_bus_message *m);