I'm adding this as a function, as in knot-resolver 6.x we have
one more place where it is used, and I find this more readable.
}
/* Add one extra label to cur_top, i.e. descend one level below current zone cut */
const knot_dname_t * const cut_next = rr->owner +
- knot_dname_prefixlen(rr->owner, next_depth - 1, NULL);
+ kr_dname_prefixlen(rr->owner, next_depth - 1);
/* Spawn that DS sub-query. */
struct kr_query * const next = kr_rplan_push(&req->rplan, qry, cut_next,
/** Simply return de->dname. (useful from Lua) */
KR_EXPORT const char * kr_dirent_name(const struct dirent *de);
+
+/* trivial libknot versions compatibility */
+static inline size_t kr_dname_prefixlen(const uint8_t *name, unsigned nlabels)
+{
+ return knot_dname_prefixlen(name, nlabels
+ #if KNOT_VERSION_HEX < 0x030400
+ , NULL
+ #endif
+ );
+}
+