From 51a1da3272c58e631fc5cecb181327bcceb5f311 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Jan 2015 00:59:49 +0100 Subject: Allow to configure methods per peer group --- src/fastd.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index 8af0556..6e4cda6 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -450,6 +450,18 @@ static inline const char * fastd_string_stack_get(const fastd_string_stack_t *st return stack ? stack->str : NULL; } +/** */ +static inline bool fastd_string_stack_contains(const fastd_string_stack_t *stack, const char *str) { + while (stack) { + if (strcmp(stack->str, str) == 0) + return true; + + stack = stack->next; + } + + return false; +} + /** Frees a whole string stack */ static inline void fastd_string_stack_free(fastd_string_stack_t *str) { while (str) { -- cgit v1.2.3