CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

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

Path: gap4r8 / src / gap.h
Views: 418346
1
/****************************************************************************
2
**
3
*W gap.h GAP source Martin Schönert
4
**
5
**
6
*Y Copyright (C) 1996, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
7
*Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
8
*Y Copyright (C) 2002 The GAP Group
9
**
10
** This file declares the various read-eval-print loops and related stuff.
11
*/
12
13
#ifndef GAP_GAP_H
14
#define GAP_GAP_H
15
16
17
/****************************************************************************
18
**
19
20
*V Last . . . . . . . . . . . . . . . . . . . . . . global variable 'last'
21
**
22
** 'Last', 'Last2', and 'Last3' are the global variables 'last', 'last2',
23
** and 'last3', which are automatically assigned the result values in the
24
** main read-eval-print loop.
25
*/
26
extern UInt Last;
27
28
29
/****************************************************************************
30
**
31
*V Last2 . . . . . . . . . . . . . . . . . . . . . . global variable 'last2'
32
*/
33
extern UInt Last2;
34
35
36
/****************************************************************************
37
**
38
*V Last3 . . . . . . . . . . . . . . . . . . . . . . global variable 'last3'
39
*/
40
extern UInt Last3;
41
42
43
/****************************************************************************
44
**
45
*V Time . . . . . . . . . . . . . . . . . . . . . . global variable 'time'
46
**
47
** 'Time' is the global variable 'time', which is automatically assigned the
48
** time the last command took.
49
*/
50
extern UInt Time;
51
52
/****************************************************************************
53
**
54
*V AlarmJumpBuffer . . . . . .long jump buffer used for timeouts
55
**
56
** Needs to be visible to code in read.c that stores away execution state
57
*/
58
59
60
extern syJmp_buf AlarmJumpBuffers[];
61
extern UInt NumAlarmJumpBuffers;
62
63
64
/****************************************************************************
65
**
66
67
*F ViewObjHandler . . . . . . . . . handler to view object and catch errors
68
*/
69
extern UInt ViewObjGVar;
70
extern UInt CustomViewGVar;
71
72
extern void ViewObjHandler ( Obj obj );
73
74
75
/****************************************************************************
76
**
77
78
*F * * * * * * * * * * * * * * print and error * * * * * * * * * * * * * * *
79
*/
80
81
82
/****************************************************************************
83
**
84
*F FuncPrint( <self>, <args> ) . . . . . . . . . . . . . . . . print <args>
85
*/
86
extern Obj FuncPrint (
87
Obj self,
88
Obj args );
89
90
91
/****************************************************************************
92
**
93
*F ErrorQuit( <msg>, <arg1>, <arg2> ) . . . . . . . . . . . print and quit
94
*/
95
extern void ErrorQuit (
96
const Char * msg,
97
Int arg1,
98
Int arg2 );
99
100
/****************************************************************************
101
**
102
*F ErrorMayQuit( <msg>, <arg1>, <arg2> ) . print, enter break loop and quit
103
** no option to return anything.
104
*/
105
extern void ErrorMayQuit (
106
const Char * msg,
107
Int arg1,
108
Int arg2 );
109
110
111
/****************************************************************************
112
**
113
*F ErrorQuitBound( <name> ) . . . . . . . . . . . . . . . unbound variable
114
*/
115
extern void ErrorQuitBound (
116
const Char * name );
117
118
119
/****************************************************************************
120
**
121
*F ErrorQuitFuncResult() . . . . . . . . . . . . . . . . must return a value
122
*/
123
extern void ErrorQuitFuncResult ( void );
124
125
126
/****************************************************************************
127
**
128
*F ErrorQuitIntSmall( <obj> ) . . . . . . . . . . . . . not a small integer
129
*/
130
extern void ErrorQuitIntSmall (
131
Obj obj );
132
133
134
/****************************************************************************
135
**
136
*F ErrorQuitIntSmallPos( <obj> ) . . . . . . . not a positive small integer
137
*/
138
extern void ErrorQuitIntSmallPos (
139
Obj obj );
140
141
/****************************************************************************
142
**
143
*F ErrorQuitIntPos( <obj> ) . . . . . . . not a positive integer
144
*/
145
extern void ErrorQuitIntPos (
146
Obj obj );
147
148
149
/****************************************************************************
150
**
151
*F ErrorQuitBool( <obj> ) . . . . . . . . . . . . . . . . . . not a boolean
152
*/
153
extern void ErrorQuitBool (
154
Obj obj );
155
156
157
/****************************************************************************
158
**
159
*F ErrorQuitFunc( <obj> ) . . . . . . . . . . . . . . . . . not a function
160
*/
161
extern void ErrorQuitFunc (
162
Obj obj );
163
164
165
/****************************************************************************
166
**
167
*F ErrorQuitNrArgs( <narg>, <args> ) . . . . . . . wrong number of arguments
168
*/
169
extern void ErrorQuitNrArgs (
170
Int narg,
171
Obj args );
172
173
/****************************************************************************
174
**
175
*F ErrorQuitRange3( <first>, <second>, <last> ) . . .divisibility rules
176
*/
177
extern void ErrorQuitRange3 (
178
Obj first,
179
Obj second,
180
Obj last);
181
182
183
/****************************************************************************
184
**
185
*F ErrorReturnObj( <msg>, <arg1>, <arg2>, <msg2> ) . . print and return obj
186
*/
187
extern Obj ErrorReturnObj (
188
const Char * msg,
189
Int arg1,
190
Int arg2,
191
const Char * msg2 );
192
193
194
/****************************************************************************
195
**
196
*F ErrorReturnVoid( <msg>, <arg1>, <arg2>, <msg2> ) . . . print and return
197
*/
198
extern void ErrorReturnVoid (
199
const Char * msg,
200
Int arg1,
201
Int arg2,
202
const Char * msg2 );
203
204
extern Obj ErrorLVars;
205
extern Obj ErrorLVars0;
206
207
208
/****************************************************************************
209
**
210
*T ExecStatus . . . . type of status values returned by read, eval and exec
211
** subroutines, explaining why evaluation, or execution
212
** has terminated.
213
**
214
** Values are powers of two, although I do not currently know of any
215
** cirumstances where they can get combined
216
**
217
** STATUS_END 0 ran off the end of the code
218
** STATUS_RETURN_VAL 1 value returned
219
** STATUS_RETURN_VOID 2 void returned
220
** STATUS_TNM 4 try-next-method
221
** STATUS_QUIT 8 quit command
222
** STATUS_EOF 16 End of file
223
** STATUS_ERROR 32 error
224
** STATUS_QQUIT 64 QUIT command
225
*/
226
227
typedef UInt ExecStatus;
228
229
#define STATUS_END 0
230
#define STATUS_RETURN_VAL 1
231
#define STATUS_RETURN_VOID 2
232
#define STATUS_TNM 4
233
#define STATUS_QUIT 8
234
#define STATUS_EOF 16
235
#define STATUS_ERROR 32
236
#define STATUS_QQUIT 64
237
238
239
240
extern UInt UserHasQuit;
241
extern UInt UserHasQUIT;
242
extern UInt SystemErrorCode;
243
244
#if 0
245
/****************************************************************************
246
**
247
*F FuncError( <self>, <args> ) . . . . . . . . . . . . . . . signal an error
248
**
249
*/
250
extern Obj FuncError (
251
Obj self,
252
Obj args );
253
254
#endif
255
256
257
/****************************************************************************
258
**
259
260
*F * * * * * * * * * * * * * important filters * * * * * * * * * * * * * * *
261
*/
262
263
/****************************************************************************
264
**
265
266
*V FN_IS_MUTABLE . . . . . . . . . . . . . . . filter number for `IsMutable'
267
*/
268
#define FN_IS_MUTABLE 1
269
270
271
/****************************************************************************
272
**
273
*V FN_IS_EMPTY . . . . . . . . . . . . . . . . . filter number for `IsEmpty'
274
*/
275
#define FN_IS_EMPTY 2
276
277
278
/****************************************************************************
279
**
280
*V FN_IS_SSORT . . . . . . . . . . . . . . filter number for `IsSSortedList'
281
*/
282
#define FN_IS_SSORT 3
283
284
285
/****************************************************************************
286
**
287
*V FN_IS_NSORT . . . . . . . . . . . . . . filter number for `IsNSortedList'
288
*/
289
#define FN_IS_NSORT 4
290
291
292
/****************************************************************************
293
**
294
*V FN_IS_DENSE . . . . . . . . . . . . . . . filter number for `IsDenseList'
295
*/
296
#define FN_IS_DENSE 5
297
298
299
/****************************************************************************
300
**
301
*V FN_IS_NDENSE . . . . . . . . . . . . . filter number for `IsNDenseList'
302
*/
303
#define FN_IS_NDENSE 6
304
305
306
/****************************************************************************
307
**
308
*V FN_IS_HOMOG . . . . . . . . . . . . filter number for `IsHomogeneousList'
309
*/
310
#define FN_IS_HOMOG 7
311
312
313
/****************************************************************************
314
**
315
*V FN_IS_NHOMOG . . . . . . . . . filter number for `IsNonHomogeneousList'
316
*/
317
#define FN_IS_NHOMOG 8
318
319
320
/****************************************************************************
321
**
322
*V FN_IS_TABLE . . . . . . . . . . . . . . . . . filter number for `IsTable'
323
*/
324
#define FN_IS_TABLE 9
325
326
/****************************************************************************
327
**
328
*V FN_IS_RECT . . . . . . . . . . . . filter number for `IsRectangularTable'
329
*/
330
#define FN_IS_RECT 10
331
#define LAST_FN FN_IS_RECT
332
333
334
/****************************************************************************
335
**
336
337
*F * * * * * * * * * * * * * initialize package * * * * * * * * * * * * * * *
338
*/
339
340
341
/****************************************************************************
342
**
343
344
*F FillInVersion( <module>, <rev_c>, <rev_h> ) . . . fill in version number
345
*/
346
extern void FillInVersion (
347
StructInitInfo * module );
348
349
350
/****************************************************************************
351
**
352
*F RequireModule( <calling>, <required>, <version> ) . . . . require module
353
*/
354
extern void RequireModule (
355
StructInitInfo * module,
356
const Char * required,
357
UInt version );
358
359
360
/****************************************************************************
361
**
362
*F InitBagNamesFromTable( <table> ) . . . . . . . . . initialise bag names
363
*/
364
extern void InitBagNamesFromTable (
365
StructBagNames * tab );
366
367
368
/****************************************************************************
369
**
370
*F InitClearFiltsTNumsFromTable( <tab> ) . . . initialise clear filts tnums
371
*/
372
extern void InitClearFiltsTNumsFromTable (
373
Int * tab );
374
375
376
/****************************************************************************
377
**
378
*F InitHasFiltListTNumsFromTable( <tab> ) . . initialise tester filts tnums
379
*/
380
extern void InitHasFiltListTNumsFromTable (
381
Int * tab );
382
383
384
/****************************************************************************
385
**
386
*F InitSetFiltListTNumsFromTable( <tab> ) . . initialise setter filts tnums
387
*/
388
extern void InitSetFiltListTNumsFromTable (
389
Int * tab );
390
391
392
/****************************************************************************
393
**
394
*F InitResetFiltListTNumsFromTable( <tab> ) initialise unsetter filts tnums
395
*/
396
extern void InitResetFiltListTNumsFromTable (
397
Int * tab );
398
399
400
/****************************************************************************
401
**
402
*F InitGVarFiltsFromTable( <tab> ) . . . . . . . . . . . . . . . new filters
403
*/
404
extern void InitGVarFiltsFromTable (
405
StructGVarFilt * tab );
406
407
408
/****************************************************************************
409
**
410
*F InitGVarAttrsFromTable( <tab> ) . . . . . . . . . . . . . new attributes
411
*/
412
extern void InitGVarAttrsFromTable (
413
StructGVarAttr * tab );
414
415
416
/****************************************************************************
417
**
418
*F InitGVarPropsFromTable( <tab> ) . . . . . . . . . . . . . new properties
419
*/
420
extern void InitGVarPropsFromTable (
421
StructGVarProp * tab );
422
423
424
/****************************************************************************
425
**
426
*F InitGVarOpersFromTable( <tab> ) . . . . . . . . . . . . . new operations
427
*/
428
extern void InitGVarOpersFromTable (
429
StructGVarOper * tab );
430
431
432
/****************************************************************************
433
**
434
*F InitGVarFuncsFromTable( <tab> ) . . . . . . . . . . . . . . new function
435
*/
436
extern void InitGVarFuncsFromTable (
437
StructGVarFunc * tab );
438
439
440
/****************************************************************************
441
**
442
*F InitHdlrFiltsFromTable( <tab> ) . . . . . . . . . . . . . . . new filters
443
*/
444
extern void InitHdlrFiltsFromTable (
445
StructGVarFilt * tab );
446
447
448
/****************************************************************************
449
**
450
*F InitHdlrAttrsFromTable( <tab> ) . . . . . . . . . . . . . new attributes
451
*/
452
extern void InitHdlrAttrsFromTable (
453
StructGVarAttr * tab );
454
455
456
/****************************************************************************
457
**
458
*F InitHdlrPropsFromTable( <tab> ) . . . . . . . . . . . . . new properties
459
*/
460
extern void InitHdlrPropsFromTable (
461
StructGVarProp * tab );
462
463
464
/****************************************************************************
465
**
466
*F InitHdlrOpersFromTable( <tab> ) . . . . . . . . . . . . . new operations
467
*/
468
extern void InitHdlrOpersFromTable (
469
StructGVarOper * tab );
470
471
472
/****************************************************************************
473
**
474
*F InitHdlrFuncsFromTable( <tab> ) . . . . . . . . . . . . . . new functions
475
*/
476
extern void InitHdlrFuncsFromTable (
477
StructGVarFunc * tab );
478
479
480
/****************************************************************************
481
**
482
*F ImportGVarFromLibrary( <name>, <address> ) . . . import global variable
483
*/
484
extern void ImportGVarFromLibrary(
485
const Char * name,
486
Obj * address );
487
488
489
/****************************************************************************
490
**
491
*F ImportFuncFromLibrary( <name>, <address> ) . . . import global function
492
*/
493
extern void ImportFuncFromLibrary(
494
const Char * name,
495
Obj * address );
496
497
498
/****************************************************************************
499
**
500
501
*V Revisions . . . . . . . . . . . . . . . . . . record of revision numbers
502
*/
503
extern Obj Revisions;
504
505
506
extern Obj Error;
507
extern Obj ErrorInner;
508
509
/****************************************************************************
510
**
511
512
*F Modules . . . . . . . . . . . . . . . . . . . . . . . . . list of modules
513
*/
514
extern StructInitInfo * Modules [];
515
extern UInt NrModules;
516
extern UInt NrBuiltinModules;
517
518
519
520
521
/****************************************************************************
522
**
523
*F RecordLoadedModule( <module> ) . . . . . . . . store module in <Modules>
524
**
525
** The filename argument is a C string. A copy of it is taken in some
526
** private space and added to the module info.
527
*/
528
extern void RecordLoadedModule (
529
StructInitInfo * module,
530
Char * filename );
531
532
533
534
535
/****************************************************************************
536
**
537
538
*F InitializeGap( <argc>, <argv> ) . . . . . . . . . . . . . . . . init GAP
539
*/
540
extern void InitializeGap (
541
int * pargc,
542
char * argv [] );
543
544
545
#endif // GAP_GAP_H
546
547
/****************************************************************************
548
**
549
550
*E gap.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
551
*/
552
553