if (!np)
goto poison;
} else {
- /* Initially, the header is allocated as part of of
+ /* Initially, the header is allocated as part of
* the sd_bus_message itself, let's replace it by
* dynamic data */
return sd_bus_message_new_method_error(call, m, &berror);
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_new_method_errnof(
sd_bus_message *call,
sd_bus_message **m,
return sd_bus_message_new_method_error(call, m, &berror);
}
-#endif // 0
void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m) {
assert(bus);
return NULL;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) {
assert_return(m, -EINVAL);
assert_return(type, -EINVAL);
return !(m->header->flags & BUS_MESSAGE_NO_AUTO_START);
}
-#endif // 0
_public_ int sd_bus_message_get_allow_interactive_authorization(sd_bus_message *m) {
assert_return(m, -EINVAL);
return &m->error;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_get_monotonic_usec(sd_bus_message *m, uint64_t *usec) {
assert_return(m, -EINVAL);
assert_return(usec, -EINVAL);
*seqnum = m->seqnum;
return 0;
}
-#endif // 0
_public_ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m) {
assert_return(m, NULL);
return &m->creds;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_is_signal(
sd_bus_message *m,
const char *interface,
return 1;
}
-#endif // 0
_public_ int sd_bus_message_is_method_call(
sd_bus_message *m,
return 1;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_set_expect_reply(sd_bus_message *m, int b) {
assert_return(m, -EINVAL);
assert_return(!m->sealed, -EPERM);
return 0;
}
-#endif // 0
static struct bus_container *message_get_container(sd_bus_message *m) {
assert(m);
return message_append_basic(m, type, p, NULL);
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_append_string_space(
sd_bus_message *m,
size_t size,
return 0;
}
-#endif // 0
static int bus_message_open_array(
sd_bus_message *m,
return 1;
}
-int bus_message_append_ap(
+_public_ int sd_bus_message_appendv(
sd_bus_message *m,
const char *types,
va_list ap) {
unsigned stack_ptr = 0;
int r;
- assert(m);
-
- if (!types)
- return 0;
+ assert_return(m, -EINVAL);
+ assert_return(types, -EINVAL);
+ assert_return(!m->sealed, -EPERM);
+ assert_return(!m->poisoned, -ESTALE);
n_array = (unsigned) -1;
n_struct = strlen(types);
assert_return(!m->poisoned, -ESTALE);
va_start(ap, types);
- r = bus_message_append_ap(m, types, ap);
+ r = sd_bus_message_appendv(m, types, ap);
va_end(ap);
return r;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_append_array_space(
sd_bus_message *m,
char type,
return 0;
}
-#endif // 0
_public_ int sd_bus_message_append_strv(sd_bus_message *m, char **l) {
char **i;
/* The actual user data is finished now, we just complete the
variant and struct now (at least on gvariant). Remember
- this position, so that during parsing we know where to to
+ this position, so that during parsing we know where to
put the outer container end. */
m->user_body_size = m->body_size;
}
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_at_end(sd_bus_message *m, int complete) {
assert_return(m, -EINVAL);
assert_return(m->sealed, -EPERM);
return false;
}
-#endif // 0
static struct bus_body_part* find_part(sd_bus_message *m, size_t index, size_t sz, void **p) {
struct bus_body_part *part;
assert(str);
r = bus_message_get_arg_skip(m, i, &type, NULL);
- if (r < 0)
- return r;
+ if (r < 0)
+ return r;
if (!IN_SET(type, SD_BUS_TYPE_STRING, SD_BUS_TYPE_OBJECT_PATH, SD_BUS_TYPE_SIGNATURE))
return -ENXIO;
assert(strv);
r = bus_message_get_arg_skip(m, i, &type, &contents);
- if (r < 0)
- return r;
+ if (r < 0)
+ return r;
if (type != SD_BUS_TYPE_ARRAY)
return -ENXIO;
return strempty(c->signature);
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_is_empty(sd_bus_message *m) {
assert_return(m, -EINVAL);
return streq(strempty(m->root_container.signature), strempty(signature));
}
-#endif // 0
_public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) {
bool done_something = false;
return done_something;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_verify_type(sd_bus_message *m, char type, const char *contents) {
const char *c;
char t;
return 1;
}
-#endif // 0
_public_ sd_bus *sd_bus_message_get_bus(sd_bus_message *m) {
assert_return(m, NULL);
return message_append_field_string(m, BUS_MESSAGE_HEADER_SENDER, SD_BUS_TYPE_STRING, sender, &m->sender);
}
+#endif // 0
_public_ int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) {
assert_return(m, -EINVAL);
m->priority = priority;
return 0;
}
-#endif // 0