aboutsummaryrefslogtreecommitdiffstats
path: root/set.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-07 21:47:25 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-07 21:47:25 +0000
commit06b58933ad0f46995c2a676671f92a335dfdfe05 (patch)
tree8ae8e65299193bbdeeb1c36c97e0bc2dc2b8999d /set.c
parentaee8c19adbaffb8fe189c626d7e188e5ea008b0d (diff)
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.
Diffstat (limited to 'set.c')
-rw-r--r--set.c8
1 files changed, 8 insertions, 0 deletions
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 );