static int confnode_if_close_dir(struct confnode *parent,
const struct line *line);
static int confnode_if_dotconfig_write(const struct confnode *n, FILE *f);
+static int confnode_if_get_default_strvalue(const struct confnode *n, char *buf,
+ unsigned buflen);
static const char *confnode_if_get_type_str(const struct confnode *n);
static void confnode_if_display_short(const struct confnode *n);
static void confnode_if_display_long(const struct confnode *n);
.set_user_strvalue = NULL,
.get_user_strvalue = NULL,
.set_default_strvalue = NULL,
- .get_default_strvalue = NULL,
+ .get_default_strvalue = confnode_if_get_default_strvalue,
.get_type_str = confnode_if_get_type_str,
.display_short = confnode_if_display_short,
.display_long = confnode_if_display_long,
return 0;
}
+static int confnode_if_get_default_strvalue(const struct confnode *n, char *buf,
+ unsigned buflen)
+{
+ const struct confnode *n2;
+
+ n2 = conf_htable_lookup(n->value);
+ if (n2 == NULL)
+ return -1;
+
+ /* XXX evaluate expression here instead */
+ return confnode_get_value(n2, buf, buflen);
+}
+
/* Return a string identifying the node type ("config", "menuconfig",
* "choice", ...) */
static const char *confnode_if_get_type_str(const struct confnode *n)