- union tvec_regval rv;
- static const struct tvec_regdef rd =
- { "@show", -1, &tvty_ienum, 0, { &tvenum_bool } };
-
- if (STRCMP(name, ==, "@show")) {
- if (tvty_ienum.parse(&rv, &rd, tv)) return (-1);
- if (tctx) {
- if (rv.i) tctx->f |= SF_SHOW;
- else tctx->f &= ~SF_SHOW;
- }
- return (1);
- } else
- return (0);
+
+ if (STRCMP(var, ==, "@show")) {
+ if (rv->i) tctx->f |= SF_SHOW;
+ } else assert(!"unknown var");
+ return (0);
+}
+
+static const struct tvec_vardef show_var =
+ { sizeof(struct tvec_reg), common_setvar,
+ { "@show", &tvty_ienum, -1, 0, { &tvenum_bool } } };
+
+static const struct tvec_vardef *common_findvar
+ (struct tvec_state *tv, const char *var, void **ctx_out, void *ctx)
+{
+ if (STRCMP(var, ==, "@show")) { *ctx_out = ctx; return (&show_var); }
+ return (0);