- Internal API for C primitives with keywords - necessary for many of
the new Mule APIs being defined.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
DEFUN_WITH_KEYWORDS (Ffoo, "foo", 2, 5, 6, ALLOW_OTHER_KEYWORDS,
(ichi, ARG_NIL), (ni, ARG_NIL), (san, ARG_UNBOUND), 0,
(arg1, arg2, arg3, arg4, arg5) /*
*/
)
{
...
}
-> C fun of 12 args:
(arg1, ... arg5, ichi, ..., roku, other keywords)
Circled in blue is actual example declaration
DEFUN_WITH_KEYWORDS (Ffoo, "foo", 1,2,0 (bar, baz) <- arg list
[ MIN ARGS, MAX ARGS, something that could be REST, SPECIFY_DEFAULT or
REST_SPEC]
[#KEYWORDS [ ALLOW_OTHER, SPECIFY_DEFAULT, ALLOW_OTHER_SPECIFY_DEFAULT
6, ALLOW_OTHER_SPECIFY_DEFAULT,
(ichi, 0) (ni, 0), (san, DEFAULT_UNBOUND), (shi, "t"), (go, "5"),
(roku, "(current-buffer)")
<- specifies arguments, default values (string to be read into Lisp
data during init; then forms evalled at fn ref time.
,0 <- [INTERACTIVE SPEC] /*
DOC
*/ )
LO = Lisp_Object
-> LO Ffoo (LO bar, LO baz, LO ichi, LO ni, LO san, LO shi, LO go,
LO roku, int numkeywords, LO *other_keywords)
#define DEFUN_WITH_KEYWORDS (fun, funstr, minargs, maxargs, argspec, \
#args, num_keywords, keywordspec, keywords, intspec) \
LO fun (DWK_ARGS (maxargs, args) \
DWK_KEYWORDS (num_keywords, keywordspec, keywords))
#define DWK_KEYWORDS (num_keywords, keywordspec, keywords) \
DWK_KEYWORDS ## keywordspec (keywords)
DWK_OTHER_KEYWORDS ## keywordspec)
#define DWK_KEYWORDS_ALLOW_OTHER (x,y)
DWK_KEYWORDS (x,y)
#define DWK_KEYWORDS_ALLOW_OTHER_SPECIFICATIONS (x,y)
DWK_KEYWORDS_SPECIFY_DEFAULT (x,y)
#define DWK_KEYWORDS_SPECIFY_DEFAULT (numkey, key)
ARGLIST_CAR ## numkey key
#define ARGLT_GRZ (x,y) LO CAR x, LO CAR y