X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Frune%2Frune.h;h=c373269aa0c90fcf4372b8b67a7097da71c43418;hb=ab87e56bec6a8727a1bbfae7858fb5b0122539a7;hp=b67b78281edad3ba2659b1a54798f932e78840f6;hpb=17a0d069aacb7b690e802de46ceb5d66d4bdba1d;p=ccan diff --git a/ccan/rune/rune.h b/ccan/rune/rune.h index b67b7828..c373269a 100644 --- a/ccan/rune/rune.h +++ b/ccan/rune/rune.h @@ -376,4 +376,25 @@ char *rune_to_string(const tal_t *ctx, const struct rune *rune); struct rune_restr *rune_restr_from_string(const tal_t *ctx, const char *str, size_t len); + +/** + * rune_condition_is_valid: is this a valid condition? + * @cond: potential condition character. + * + * Returns true if it's one of enum rune_condition. + */ +bool rune_condition_is_valid(enum rune_condition cond); + +/** + * rune_altern_fieldname_len: how much of this string is condition? + * @alternstr: potential alternative string + * @alternstrlen: length + * + * This helps parsing your own runes. + * + * Returns the first possible condition (check with rune_condition_is_valid) + * or alternstrlen if none found. + */ +size_t rune_altern_fieldname_len(const char *alternstr, size_t alternstrlen); + #endif /* CCAN_RUNE_RUNE_H */