diff options
| author | Christian Hopps <chopps@labn.net> | 2023-10-10 04:28:07 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-12-28 17:52:57 +0000 |
| commit | d58653a5ba004f1d55981e8a69bcbdb82b87d354 (patch) | |
| tree | cc2a9b89a05ff8a2fc790dc7bf53700e4237a9ef /lib/frrstr.h | |
| parent | db0211d48a78730cd93b0610888f35120e0c7afe (diff) | |
lib: northbound: improve xpath functionality
Allow user to leave keys off of a list entry node at the end of the xpath. This
will return all list entries. Previously there was no way to just get the list
entries. One had to leave off the last list entry node which would then return
all list nodes as well as all the siblings at the same level.
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/frrstr.h')
| -rw-r--r-- | lib/frrstr.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/frrstr.h b/lib/frrstr.h index 9a4fe257a2..33a4992001 100644 --- a/lib/frrstr.h +++ b/lib/frrstr.h @@ -167,13 +167,19 @@ int all_digit(const char *str); */ char *frrstr_hex(char *buff, size_t bufsiz, const uint8_t *str, size_t num); - /* * Advance past a given char `skipc` in a string, while honoring quoting and * backslash escapes (i.e., ignore `skipc` which occur in quoted sections). */ const char *frrstr_skip_over_char(const char *s, int skipc); +/* + * Advance back from end to a given char `toc` in a string, while honoring + * quoting and backslash escapes. `toc` chars inside quote or escaped are + * ignored. + */ +const char *frrstr_back_to_char(const char *s, int toc); + #ifdef __cplusplus } #endif |
