Example #1
0
}

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 )
Example #2
0
  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.                                                             */
Example #3
0
File: ariths.c Project: embray/gap
    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 )
Example #4
0

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 */
Example #5
0
    { "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                   */