X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/ec2ae5fa0ae79baedb567ad18e09e17305aa89d1..0902e6e2feabad072f0b5d7f23ae2a2a4d923d0a:/secnet.h?ds=sidebyside diff --git a/secnet.h b/secnet.h index 6724698..7d1edb0 100644 --- a/secnet.h +++ b/secnet.h @@ -138,6 +138,14 @@ extern uint32_t dict_read_number(dict_t *dict, cstring_t key, bool_t required, /* return value can safely be assigned to int32_t */ extern bool_t dict_read_bool(dict_t *dict, cstring_t key, bool_t required, cstring_t desc, struct cloc loc, bool_t def); +const char **dict_read_string_array(dict_t *dict, cstring_t key, + bool_t required, cstring_t desc, + struct cloc loc, const char *const *def); + /* Return value is a NULL-terminated array obtained from malloc; + * Individual string values are still owned by config file machinery + * and must not be modified or freed. Returns NULL if key not + * found. */ + struct flagstr { cstring_t name; uint32_t value; @@ -298,7 +306,9 @@ struct buffer_if; to MAX_PEER_ADDRS (ie there were too many). */ typedef void resolve_answer_fn(void *st, const struct comm_addr *addrs, int naddrs, int was_naddrs, - const char *failwhy); + const char *name, const char *failwhy); + /* name is the same ptr as passed to request, so its lifetime must + * be suitable*/ typedef bool_t resolve_request_fn(void *st, cstring_t name, int remoteport, struct comm_if *comm, resolve_answer_fn *cb, void *cst);