From 06b58933ad0f46995c2a676671f92a335dfdfe05 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 7 Dec 2011 21:47:25 +0000 Subject: Merging non-SASL authentication patch from #863. This also implements hidden-default settings, which means a setting is hidden unless it was changed from the default. This seems like appropriate behaviour for something as obscure as this. --- set.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'set.c') diff --git a/set.c b/set.c index 17befba9..b35be708 100644 --- a/set.c +++ b/set.c @@ -111,6 +111,14 @@ int set_getbool( set_t **head, const char *key ) return bool2int( s ); } +int set_isvisible( set_t *set ) +{ + /* the default value is not stored in value, only in def */ + return !( ( set->flags & SET_HIDDEN ) || + ( ( set->flags & SET_HIDDEN_DEFAULT ) && + ( set->value == NULL ) ) ); +} + int set_setstr( set_t **head, const char *key, char *value ) { set_t *s = set_find( head, key ); -- cgit v1.2.3