/* Slight hack. The @KWCALL@ macro sets GCC and similar compilers up to
* check for a sentinal null pointer at the end of the variable-length
* argument tail. Alas, if there are no keywords at all, then the null
/* Slight hack. The @KWCALL@ macro sets GCC and similar compilers up to
* check for a sentinal null pointer at the end of the variable-length
* argument tail. Alas, if there are no keywords at all, then the null
* empty, with the result that the compiler gives an annoying warning.
* Supplying an extra argument here is obviously harmless, and makes the
* otherwise useful warning go away in this case where it's not wanted.
* empty, with the result that the compiler gives an annoying warning.
* Supplying an extra argument here is obviously harmless, and makes the
* otherwise useful warning go away in this case where it's not wanted.
#define K(kw, val) #kw, (val),
#define K(kw, val) #kw, (val),
*
* Arguments: @const struct kwval *v@ = base address of argument vector
* @size_t n@ = length of argument vector
*
* Arguments: @const struct kwval *v@ = base address of argument vector
* @size_t n@ = length of argument vector
#define KWSET__STRUCTMEM(type, name, dflt) type name;
/* --- @KWSET_PARSEFN@ --- *
#define KWSET__STRUCTMEM(type, name, dflt) type name;
/* --- @KWSET_PARSEFN@ --- *
aap = va_arg(*ap, va_list *); \
kk = va_arg(*aap, const char *); \
set##_kwparse(kw, kk, aap, 0, 0); \
aap = va_arg(*ap, va_list *); \
kk = va_arg(*aap, const char *); \
set##_kwparse(kw, kk, aap, 0, 0); \
vv = va_arg(*ap, const struct kwval *); \
nn = va_arg(*ap, size_t); \
set##_kwparse(kw, 0, 0, vv, nn); \
vv = va_arg(*ap, const struct kwval *); \
nn = va_arg(*ap, size_t); \
set##_kwparse(kw, 0, 0, vv, nn); \
aap = *(va_list *const *)v->val; \
kk = va_arg(*aap, const char *); \
set##_kwparse(kw, kk, aap, 0, 0); \
} else if (!strcmp(v->kw, "kw.tab")) { \
t = (const struct kwtab *)v->val; \
set##_kwparse(kw, 0, 0, t->v, t->n); \
aap = *(va_list *const *)v->val; \
kk = va_arg(*aap, const char *); \
set##_kwparse(kw, kk, aap, 0, 0); \
} else if (!strcmp(v->kw, "kw.tab")) { \
t = (const struct kwtab *)v->val; \
set##_kwparse(kw, 0, 0, t->v, t->n); \
kw->name##_suppliedp = 1; \
kw->name = va_arg(*ap, type); \
kw->name##_suppliedp = 1; \
kw->name = va_arg(*ap, type); \
* Use: Copies arguments from the source structure @kw@ into the
* vector @v@. The structure @kw@ must have type @struct
* fromset_kwargs *@. The argument @v@ must have type @struct
* Use: Copies arguments from the source structure @kw@ into the
* vector @v@. The structure @kw@ must have type @struct
* fromset_kwargs *@. The argument @v@ must have type @struct
- * kwval *@ (after array-to- pointer decay), and there must be a
- * variable @v_n@ of sufficiently large integral type suitably
+ * kwval *@ (after array-to-pointer decay), and there must be a
+ * variable @n@ of sufficiently large integral type suitably
* initialized. Elements of the vector, starting with element
* @n@, will be filled in with those keyword arguments defined
* in @toset@ -- which must be a subset of @srcsrc@ from @kw@
* initialized. Elements of the vector, starting with element
* @n@, will be filled in with those keyword arguments defined
* in @toset@ -- which must be a subset of @srcsrc@ from @kw@