} Obj FuncALL_KEYWORDS(Obj self) { Obj l = NewEmptyPlist(); for (UInt i = 0; i < ARRAY_SIZE(AllKeywords); i++) { Obj s = MakeImmString(AllKeywords[i]); ASS_LIST(l, i+1, s); } MakeImmutable(l); return l; } static StructGVarFunc GVarFuncs [] = { GVAR_FUNC(ALL_KEYWORDS, 0, ""), { 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * * */ /**************************************************************************** ** *F InitLibrary( <module> ) . . . . . . . initialise library data structures */ static Int InitLibrary ( StructInitInfo * module )
return (Obj)0; } /**************************************************************************** ** *F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * * */ /**************************************************************************** ** *V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export */ static StructGVarFunc GVarFuncs [] = { GVAR_FUNC(CollectPolycyclic, 3, "pcp, list, word"), { 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *F InitKernel( <module> ) . . . . . . . . initialise kernel data structures */ static Int InitKernel ( StructInitInfo * module ) { /* Keep track of variables containing library functions called in this */ /* module. */
GVAR_OPER(ONE, 1, "op", &OneOp), GVAR_OPER(ONE_MUT, 1, "op", &OneMutOp), GVAR_OPER(INV, 1, "op", &InvOp), GVAR_OPER(INV_MUT, 1, "op", &InvMutOp), { 0, 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export */ static StructGVarFunc GVarFuncs [] = { GVAR_FUNC(COMM_DEFAULT, 2, "opL, opR"), GVAR_FUNC(POW_DEFAULT, 2, "opL, opR"), GVAR_FUNC(LQUO_DEFAULT, 2, "opL, opR"), GVAR_FUNC(QUO_DEFAULT, 2, "opL, opR"), GVAR_FUNC(DIFF_DEFAULT, 2, "opL, opR"), { 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *F InitKernel( <module> ) . . . . . . . . initialise kernel data structures */ static Int InitKernel ( StructInitInfo * module )
Obj FuncTestCommand(Obj self) { return INTOBJ_INT(42); } Obj FuncTestCommandWithParams(Obj self, Obj param, Obj param2) { /* simply return the first parameter */ return param; } // Table of functions to export static StructGVarFunc GVarFuncs [] = { GVAR_FUNC(TestCommand, 0, ""), GVAR_FUNC(TestCommandWithParams, 2, "param, param2"), { 0 } /* Finish with an empty entry */ }; /**************************************************************************** ** *F InitKernel( <module> ) . . . . . . . . initialise kernel data structures */ static Int InitKernel( StructInitInfo *module ) { /* init filters and functions */ InitHdlrFuncsFromTable( GVarFuncs ); /* return success */
{ "UNB_REC", 2, "obj, rnam", &UnbRecOper, UnbRecHandler, "src/records.c:UNB_REC" }, { 0, 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export */ static StructGVarFunc GVarFuncs [] = { GVAR_FUNC(RNamObj, 1, "obj"), GVAR_FUNC(NameRNam, 1, "rnam"), GVAR_FUNC(ALL_RNAMES, 0, ""), { 0, 0, 0, 0, 0 } }; /**************************************************************************** ** *F InitKernel( <module> ) . . . . . . . . initialise kernel data structures */ static Int InitKernel ( StructInitInfo * module ) { UInt type; /* loop variable */