/**************************************************************************** ** ** This file is part of GAP, a system for computational discrete algebra. ** ** Copyright of GAP belongs to its developers, whose names are too numerous ** to list here. Please refer to the COPYRIGHT file for details. ** ** SPDX-License-Identifier: GPL-2.0-or-later ** ** This file declares APIs for GAP modules, including builtin modules, ** or static and dynamic modules used by packages and end users to provide ** kernel extensions.
*/
// type of the module: MODULE_BUILTIN, MODULE_STATIC, MODULE_DYNAMIC
UInt type;
// name of the module: filename with ".c" or library filename constChar * name;
// revision_c is obsolete and only kept for backwards compatibility constChar * revision_c;
// revision_h is obsolete and only kept for backwards compatibility constChar * revision_h;
// version number for MODULE_BUILTIN
UInt version;
// CRC value for MODULE_STATIC or MODULE_DYNAMIC, for use with modules // generated by gac from GAP source code: this field then stores the CRC // of the GAP source file, and GAP verifies during loading that it still // matches; otherwise, it will fall back to using the original GAP code. Int crc;
// initialise kernel data structures Int (*initKernel)(StructInitInfo *);
// initialise library data structures Int (*initLibrary)(StructInitInfo *);
// sanity check Int (*checkInit)(StructInitInfo *);
// function to call before saving workspace Int (*preSave)(StructInitInfo *);
// function to call after saving workspace Int (*postSave)(StructInitInfo *);
// function to call after restoring workspace Int (*postRestore)(StructInitInfo *);
// number of bytes this module needs for its per-thread module state
UInt moduleStateSize;
// if this is not zero, then the module state offset is stored into // the address this points at Int * moduleStateOffsetPtr;
// initialize thread local module state Int (*initModuleState)(void);
// destroy thread local module state Int (*destroyModuleState)(void);
/**************************************************************************** ** ** Some helper functions and macros used for validation in GVAR_FUNC_2ARGS ** and its likes. ** ** The trick is that VALIDATE_FUNC_nARGS(func) produces code that the ** compiler can trivially prove to be equivalent to just inserting 'func'; ** and the "call" to VALIDATE_FUNC_HELPER_n can never ever be executed; ** but since it is still there in the input, the compiler has to check ** that its argument has the correct type.
*/ staticinline ObjFunc VALIDATE_FUNC_HELPER_0(ObjFunc_0ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_1(ObjFunc_1ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_2(ObjFunc_2ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_3(ObjFunc_3ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_4(ObjFunc_4ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_5(ObjFunc_5ARGS f)
{ return 0;
} staticinline ObjFunc VALIDATE_FUNC_HELPER_6(ObjFunc_6ARGS f)
{ return 0;
}
// GVAR_OPER is a helper macro for quickly creating table entries in // StructGVarOper arrays #define GVAR_OPER(name, nargs, args, operation) \
{ \ #name, nargs, args, operation, Func##name, __FILE__ ":"#name \
}
// The following helper macros are similar to GVAR_FUNC, but perform stricter // validation of the function passed in; in particular, it is checked that it // has the correct return and argument types, and the correct number of // arguments. #define GVAR_OPER_0ARGS(name, operation) \
{ \ #name, 0, "", operation, \
VALIDATE_FUNC_0ARGS(Func##name), __FILE__ ":"#name \
}
// GVAR_FUNC is a helper macro for quickly creating table entries in // StructGVarFunc arrays #define GVAR_FUNC(name, nargs, args) \
{ \ #name, nargs, args, (ObjFunc)(void *)Func##name, __FILE__ ":"#name \
}
// The following helper macros are similar to GVAR_FUNC, but perform stricter // validation of the function passed in; in particular, it is checked that it // has the correct return and argument types, and the correct number of // arguments. #define GVAR_FUNC_0ARGS(name) \
{ \ #name, 0, "", \
VALIDATE_FUNC_0ARGS(Func##name), __FILE__ ":"#name \
}
/**************************************************************************** ** *F RecordLoadedModule( <module> ) . . . . . . . . store module in <Modules> ** ** The filename argument is a C string. A copy of it is taken in some ** private space and added to the module info. ** ** This function triggers no garbage collection, so it OK to pass a pointer ** to the content of a GAP string object as filename.
*/ void RecordLoadedModule(StructInitInfo * module, Int isGapRootRelative, constChar * filename);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.