| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
typedef struct BusObjectVtablePair { |
| 7 |
const sd_bus_vtable *vtable; |
| 8 |
sd_bus_object_find_t object_find; |
| 9 |
} BusObjectVtablePair; |
| 10 |
|
| 11 |
typedef struct BusObjectImplementation { |
| 12 |
const char *path; |
| 13 |
const char *interface; |
| 14 |
const sd_bus_vtable **vtables; |
| 15 |
const BusObjectVtablePair *fallback_vtables; |
| 16 |
sd_bus_node_enumerator_t node_enumerator; |
| 17 |
bool manager; |
| 18 |
const BusObjectImplementation **children; |
| 19 |
} BusObjectImplementation; |
| 20 |
|
| 21 |
#define BUS_VTABLES(...) ((const sd_bus_vtable* []){ __VA_ARGS__, NULL }) |
| 22 |
#define BUS_FALLBACK_VTABLES(...) ((const BusObjectVtablePair[]) { __VA_ARGS__, {} }) |
| 23 |
#define BUS_IMPLEMENTATIONS(...) ((const BusObjectImplementation* []) { __VA_ARGS__, NULL }) |
| 24 |
|
| 25 |
int bus_add_implementation(sd_bus *bus, const BusObjectImplementation *impl, void *userdata); |
| 26 |
int bus_introspect_implementations( |
| 27 |
FILE *out, |
| 28 |
const char *pattern, |
| 29 |
const BusObjectImplementation* const *bus_objects); |