.
.SS Type definitions
The header file defines two simple structure types.
-.PP
-.IP
-.nf
-.ft B
+.VS
struct kwval {
const char *kw;
const void *val;
};
-.fi
-.PP
+.VE
The
.B kwval
structure describes a keyword argument name/value pair.
makes the size of a
.B kwval
object independent of the actual argument type.)
-.PP
-.IP
-.nf
-.ft B
+.VS
struct kwtab {
const struct kwval *v;
size_t n;
};
-.fi
-.PP
+.VE
The
.B kwtab
structure describes a list of keyword arguments,
with no separation between them.
.PP
For example:
-.IP
-.nf
-.ft B
+.VS
#define example_KWSET(_) \e
.in +4m
_(int, x, 0) \e
_(const char *, y, NULL)
-.fi
-.ft P
-.PP
+.VE
Each
.I name
should be a distinct C identifier;
which can be achieved using this hook,
the following hacking answers whether
a function recognizes a particular keyword argument.
-.IP
-.nf
-.ft B
+.VS
#define KWARGS_TEST(k, val) KWARGS(K(k, val) K(kw.unknown, 0))
static jmp_buf kw_test_jmp;
/* now f is nonzero if `somefunc' accepts the `shiny' keyword
* (which we hope wants a double argument)
*/
-.ft P
-.fi
+.VE
.
.\"--------------------------------------------------------------------------
.SH BUGS
is contained in a single structure of type
.B struct
.IB C __ilayout \fR.
-.IP
-.nf
-.ft B
+.VS
struct \fIC\fB__ilayout {
\h'2n'union \fIC\fB__ichainu_\fIh\fB {
\h'4n'struct \fIC\fB__ichain_\fIh\fB {
};
typedef struct \fIC\fB__ichain_\fIh\fB \fIC\fB;
-.ft P
-.fi
-.PP
+.VE
The set of superclasses of
.IR C ,
including itself,
with chain head
.I H
has the following general structure.
-.IP
-.nf
-.ft B
+.VS
union \fIC\fB__vtu_\fIh\fB {
\h'2n'struct \fIC\fB__vt_\fIh\fB {
\h'4n'const \fIP\fB *_class;
};
extern const union \fIC\fB__vtu_\fIh\fB \fIC\fB__vtable_\fIh\fB;
-.ft P
-.fi
-.PP
+.VE
In the following,
let
.I M