Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346/****************************************************************************1**2*W gap.h GAP source Martin Schönert3**4**5*Y Copyright (C) 1996, Lehrstuhl D für Mathematik, RWTH Aachen, Germany6*Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland7*Y Copyright (C) 2002 The GAP Group8**9** This file declares the various read-eval-print loops and related stuff.10*/1112#ifndef GAP_GAP_H13#define GAP_GAP_H141516/****************************************************************************17**1819*V Last . . . . . . . . . . . . . . . . . . . . . . global variable 'last'20**21** 'Last', 'Last2', and 'Last3' are the global variables 'last', 'last2',22** and 'last3', which are automatically assigned the result values in the23** main read-eval-print loop.24*/25extern UInt Last;262728/****************************************************************************29**30*V Last2 . . . . . . . . . . . . . . . . . . . . . . global variable 'last2'31*/32extern UInt Last2;333435/****************************************************************************36**37*V Last3 . . . . . . . . . . . . . . . . . . . . . . global variable 'last3'38*/39extern UInt Last3;404142/****************************************************************************43**44*V Time . . . . . . . . . . . . . . . . . . . . . . global variable 'time'45**46** 'Time' is the global variable 'time', which is automatically assigned the47** time the last command took.48*/49extern UInt Time;5051/****************************************************************************52**53*V AlarmJumpBuffer . . . . . .long jump buffer used for timeouts54**55** Needs to be visible to code in read.c that stores away execution state56*/575859extern syJmp_buf AlarmJumpBuffers[];60extern UInt NumAlarmJumpBuffers;616263/****************************************************************************64**6566*F ViewObjHandler . . . . . . . . . handler to view object and catch errors67*/68extern UInt ViewObjGVar;69extern UInt CustomViewGVar;7071extern void ViewObjHandler ( Obj obj );727374/****************************************************************************75**7677*F * * * * * * * * * * * * * * print and error * * * * * * * * * * * * * * *78*/798081/****************************************************************************82**83*F FuncPrint( <self>, <args> ) . . . . . . . . . . . . . . . . print <args>84*/85extern Obj FuncPrint (86Obj self,87Obj args );888990/****************************************************************************91**92*F ErrorQuit( <msg>, <arg1>, <arg2> ) . . . . . . . . . . . print and quit93*/94extern void ErrorQuit (95const Char * msg,96Int arg1,97Int arg2 );9899/****************************************************************************100**101*F ErrorMayQuit( <msg>, <arg1>, <arg2> ) . print, enter break loop and quit102** no option to return anything.103*/104extern void ErrorMayQuit (105const Char * msg,106Int arg1,107Int arg2 );108109110/****************************************************************************111**112*F ErrorQuitBound( <name> ) . . . . . . . . . . . . . . . unbound variable113*/114extern void ErrorQuitBound (115const Char * name );116117118/****************************************************************************119**120*F ErrorQuitFuncResult() . . . . . . . . . . . . . . . . must return a value121*/122extern void ErrorQuitFuncResult ( void );123124125/****************************************************************************126**127*F ErrorQuitIntSmall( <obj> ) . . . . . . . . . . . . . not a small integer128*/129extern void ErrorQuitIntSmall (130Obj obj );131132133/****************************************************************************134**135*F ErrorQuitIntSmallPos( <obj> ) . . . . . . . not a positive small integer136*/137extern void ErrorQuitIntSmallPos (138Obj obj );139140/****************************************************************************141**142*F ErrorQuitIntPos( <obj> ) . . . . . . . not a positive integer143*/144extern void ErrorQuitIntPos (145Obj obj );146147148/****************************************************************************149**150*F ErrorQuitBool( <obj> ) . . . . . . . . . . . . . . . . . . not a boolean151*/152extern void ErrorQuitBool (153Obj obj );154155156/****************************************************************************157**158*F ErrorQuitFunc( <obj> ) . . . . . . . . . . . . . . . . . not a function159*/160extern void ErrorQuitFunc (161Obj obj );162163164/****************************************************************************165**166*F ErrorQuitNrArgs( <narg>, <args> ) . . . . . . . wrong number of arguments167*/168extern void ErrorQuitNrArgs (169Int narg,170Obj args );171172/****************************************************************************173**174*F ErrorQuitRange3( <first>, <second>, <last> ) . . .divisibility rules175*/176extern void ErrorQuitRange3 (177Obj first,178Obj second,179Obj last);180181182/****************************************************************************183**184*F ErrorReturnObj( <msg>, <arg1>, <arg2>, <msg2> ) . . print and return obj185*/186extern Obj ErrorReturnObj (187const Char * msg,188Int arg1,189Int arg2,190const Char * msg2 );191192193/****************************************************************************194**195*F ErrorReturnVoid( <msg>, <arg1>, <arg2>, <msg2> ) . . . print and return196*/197extern void ErrorReturnVoid (198const Char * msg,199Int arg1,200Int arg2,201const Char * msg2 );202203extern Obj ErrorLVars;204extern Obj ErrorLVars0;205206207/****************************************************************************208**209*T ExecStatus . . . . type of status values returned by read, eval and exec210** subroutines, explaining why evaluation, or execution211** has terminated.212**213** Values are powers of two, although I do not currently know of any214** cirumstances where they can get combined215**216** STATUS_END 0 ran off the end of the code217** STATUS_RETURN_VAL 1 value returned218** STATUS_RETURN_VOID 2 void returned219** STATUS_TNM 4 try-next-method220** STATUS_QUIT 8 quit command221** STATUS_EOF 16 End of file222** STATUS_ERROR 32 error223** STATUS_QQUIT 64 QUIT command224*/225226typedef UInt ExecStatus;227228#define STATUS_END 0229#define STATUS_RETURN_VAL 1230#define STATUS_RETURN_VOID 2231#define STATUS_TNM 4232#define STATUS_QUIT 8233#define STATUS_EOF 16234#define STATUS_ERROR 32235#define STATUS_QQUIT 64236237238239extern UInt UserHasQuit;240extern UInt UserHasQUIT;241extern UInt SystemErrorCode;242243#if 0244/****************************************************************************245**246*F FuncError( <self>, <args> ) . . . . . . . . . . . . . . . signal an error247**248*/249extern Obj FuncError (250Obj self,251Obj args );252253#endif254255256/****************************************************************************257**258259*F * * * * * * * * * * * * * important filters * * * * * * * * * * * * * * *260*/261262/****************************************************************************263**264265*V FN_IS_MUTABLE . . . . . . . . . . . . . . . filter number for `IsMutable'266*/267#define FN_IS_MUTABLE 1268269270/****************************************************************************271**272*V FN_IS_EMPTY . . . . . . . . . . . . . . . . . filter number for `IsEmpty'273*/274#define FN_IS_EMPTY 2275276277/****************************************************************************278**279*V FN_IS_SSORT . . . . . . . . . . . . . . filter number for `IsSSortedList'280*/281#define FN_IS_SSORT 3282283284/****************************************************************************285**286*V FN_IS_NSORT . . . . . . . . . . . . . . filter number for `IsNSortedList'287*/288#define FN_IS_NSORT 4289290291/****************************************************************************292**293*V FN_IS_DENSE . . . . . . . . . . . . . . . filter number for `IsDenseList'294*/295#define FN_IS_DENSE 5296297298/****************************************************************************299**300*V FN_IS_NDENSE . . . . . . . . . . . . . filter number for `IsNDenseList'301*/302#define FN_IS_NDENSE 6303304305/****************************************************************************306**307*V FN_IS_HOMOG . . . . . . . . . . . . filter number for `IsHomogeneousList'308*/309#define FN_IS_HOMOG 7310311312/****************************************************************************313**314*V FN_IS_NHOMOG . . . . . . . . . filter number for `IsNonHomogeneousList'315*/316#define FN_IS_NHOMOG 8317318319/****************************************************************************320**321*V FN_IS_TABLE . . . . . . . . . . . . . . . . . filter number for `IsTable'322*/323#define FN_IS_TABLE 9324325/****************************************************************************326**327*V FN_IS_RECT . . . . . . . . . . . . filter number for `IsRectangularTable'328*/329#define FN_IS_RECT 10330#define LAST_FN FN_IS_RECT331332333/****************************************************************************334**335336*F * * * * * * * * * * * * * initialize package * * * * * * * * * * * * * * *337*/338339340/****************************************************************************341**342343*F FillInVersion( <module>, <rev_c>, <rev_h> ) . . . fill in version number344*/345extern void FillInVersion (346StructInitInfo * module );347348349/****************************************************************************350**351*F RequireModule( <calling>, <required>, <version> ) . . . . require module352*/353extern void RequireModule (354StructInitInfo * module,355const Char * required,356UInt version );357358359/****************************************************************************360**361*F InitBagNamesFromTable( <table> ) . . . . . . . . . initialise bag names362*/363extern void InitBagNamesFromTable (364StructBagNames * tab );365366367/****************************************************************************368**369*F InitClearFiltsTNumsFromTable( <tab> ) . . . initialise clear filts tnums370*/371extern void InitClearFiltsTNumsFromTable (372Int * tab );373374375/****************************************************************************376**377*F InitHasFiltListTNumsFromTable( <tab> ) . . initialise tester filts tnums378*/379extern void InitHasFiltListTNumsFromTable (380Int * tab );381382383/****************************************************************************384**385*F InitSetFiltListTNumsFromTable( <tab> ) . . initialise setter filts tnums386*/387extern void InitSetFiltListTNumsFromTable (388Int * tab );389390391/****************************************************************************392**393*F InitResetFiltListTNumsFromTable( <tab> ) initialise unsetter filts tnums394*/395extern void InitResetFiltListTNumsFromTable (396Int * tab );397398399/****************************************************************************400**401*F InitGVarFiltsFromTable( <tab> ) . . . . . . . . . . . . . . . new filters402*/403extern void InitGVarFiltsFromTable (404StructGVarFilt * tab );405406407/****************************************************************************408**409*F InitGVarAttrsFromTable( <tab> ) . . . . . . . . . . . . . new attributes410*/411extern void InitGVarAttrsFromTable (412StructGVarAttr * tab );413414415/****************************************************************************416**417*F InitGVarPropsFromTable( <tab> ) . . . . . . . . . . . . . new properties418*/419extern void InitGVarPropsFromTable (420StructGVarProp * tab );421422423/****************************************************************************424**425*F InitGVarOpersFromTable( <tab> ) . . . . . . . . . . . . . new operations426*/427extern void InitGVarOpersFromTable (428StructGVarOper * tab );429430431/****************************************************************************432**433*F InitGVarFuncsFromTable( <tab> ) . . . . . . . . . . . . . . new function434*/435extern void InitGVarFuncsFromTable (436StructGVarFunc * tab );437438439/****************************************************************************440**441*F InitHdlrFiltsFromTable( <tab> ) . . . . . . . . . . . . . . . new filters442*/443extern void InitHdlrFiltsFromTable (444StructGVarFilt * tab );445446447/****************************************************************************448**449*F InitHdlrAttrsFromTable( <tab> ) . . . . . . . . . . . . . new attributes450*/451extern void InitHdlrAttrsFromTable (452StructGVarAttr * tab );453454455/****************************************************************************456**457*F InitHdlrPropsFromTable( <tab> ) . . . . . . . . . . . . . new properties458*/459extern void InitHdlrPropsFromTable (460StructGVarProp * tab );461462463/****************************************************************************464**465*F InitHdlrOpersFromTable( <tab> ) . . . . . . . . . . . . . new operations466*/467extern void InitHdlrOpersFromTable (468StructGVarOper * tab );469470471/****************************************************************************472**473*F InitHdlrFuncsFromTable( <tab> ) . . . . . . . . . . . . . . new functions474*/475extern void InitHdlrFuncsFromTable (476StructGVarFunc * tab );477478479/****************************************************************************480**481*F ImportGVarFromLibrary( <name>, <address> ) . . . import global variable482*/483extern void ImportGVarFromLibrary(484const Char * name,485Obj * address );486487488/****************************************************************************489**490*F ImportFuncFromLibrary( <name>, <address> ) . . . import global function491*/492extern void ImportFuncFromLibrary(493const Char * name,494Obj * address );495496497/****************************************************************************498**499500*V Revisions . . . . . . . . . . . . . . . . . . record of revision numbers501*/502extern Obj Revisions;503504505extern Obj Error;506extern Obj ErrorInner;507508/****************************************************************************509**510511*F Modules . . . . . . . . . . . . . . . . . . . . . . . . . list of modules512*/513extern StructInitInfo * Modules [];514extern UInt NrModules;515extern UInt NrBuiltinModules;516517518519520/****************************************************************************521**522*F RecordLoadedModule( <module> ) . . . . . . . . store module in <Modules>523**524** The filename argument is a C string. A copy of it is taken in some525** private space and added to the module info.526*/527extern void RecordLoadedModule (528StructInitInfo * module,529Char * filename );530531532533534/****************************************************************************535**536537*F InitializeGap( <argc>, <argv> ) . . . . . . . . . . . . . . . . init GAP538*/539extern void InitializeGap (540int * pargc,541char * argv [] );542543544#endif // GAP_GAP_H545546/****************************************************************************547**548549*E gap.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here550*/551552553