Ravenveil commited on
Commit
2b49a4f
·
verified ·
1 Parent(s): c8b9d7e

backup 04_physworld 2026-11-08 10:11:26 (part 3)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +57 -0
  2. physworld_p1_20261018/envs/p1/include/python3.11/setobject.h +49 -0
  3. physworld_p1_20261018/envs/p1/include/python3.11/sliceobject.h +65 -0
  4. physworld_p1_20261018/envs/p1/include/python3.11/structmember.h +75 -0
  5. physworld_p1_20261018/envs/p1/include/python3.11/structseq.h +49 -0
  6. physworld_p1_20261018/envs/p1/include/python3.11/sysmodule.h +41 -0
  7. physworld_p1_20261018/envs/p1/include/python3.11/token.h +97 -0
  8. physworld_p1_20261018/envs/p1/include/python3.11/traceback.h +26 -0
  9. physworld_p1_20261018/envs/p1/include/python3.11/tracemalloc.h +38 -0
  10. physworld_p1_20261018/envs/p1/include/python3.11/tupleobject.h +46 -0
  11. physworld_p1_20261018/envs/p1/include/python3.11/typeslots.h +88 -0
  12. physworld_p1_20261018/envs/p1/include/python3.11/unicodeobject.h +1049 -0
  13. physworld_p1_20261018/envs/p1/include/python3.11/warnings.h +45 -0
  14. physworld_p1_20261018/envs/p1/include/python3.11/weakrefobject.h +42 -0
  15. physworld_p1_20261018/envs/p1/include/readline/chardefs.h +165 -0
  16. physworld_p1_20261018/envs/p1/include/readline/history.h +291 -0
  17. physworld_p1_20261018/envs/p1/include/readline/keymaps.h +100 -0
  18. physworld_p1_20261018/envs/p1/include/readline/readline.h +1012 -0
  19. physworld_p1_20261018/envs/p1/include/readline/rlconf.h +84 -0
  20. physworld_p1_20261018/envs/p1/include/readline/rlstdc.h +45 -0
  21. physworld_p1_20261018/envs/p1/include/readline/rltypedefs.h +96 -0
  22. physworld_p1_20261018/envs/p1/include/readline/tilde.h +68 -0
  23. physworld_p1_20261018/envs/p1/include/rpcsvc/yp.h +304 -0
  24. physworld_p1_20261018/envs/p1/include/rpcsvc/yp.x +307 -0
  25. physworld_p1_20261018/envs/p1/include/rpcsvc/yp_prot.h +486 -0
  26. physworld_p1_20261018/envs/p1/include/rpcsvc/ypclnt.h +91 -0
  27. physworld_p1_20261018/envs/p1/include/rpcsvc/yppasswd.h +49 -0
  28. physworld_p1_20261018/envs/p1/include/rpcsvc/yppasswd.x +61 -0
  29. physworld_p1_20261018/envs/p1/include/rpcsvc/ypupd.h +90 -0
  30. physworld_p1_20261018/envs/p1/include/sqlite3.h +0 -0
  31. physworld_p1_20261018/envs/p1/include/sqlite3ext.h +745 -0
  32. physworld_p1_20261018/envs/p1/include/tcl.h +2639 -0
  33. physworld_p1_20261018/envs/p1/include/tclDecls.h +0 -0
  34. physworld_p1_20261018/envs/p1/include/tclInt.h +0 -0
  35. physworld_p1_20261018/envs/p1/include/tclIntDecls.h +1433 -0
  36. physworld_p1_20261018/envs/p1/include/tclIntPlatDecls.h +600 -0
  37. physworld_p1_20261018/envs/p1/include/tclOO.h +147 -0
  38. physworld_p1_20261018/envs/p1/include/tclOODecls.h +256 -0
  39. physworld_p1_20261018/envs/p1/include/tclOOInt.h +607 -0
  40. physworld_p1_20261018/envs/p1/include/tclOOIntDecls.h +166 -0
  41. physworld_p1_20261018/envs/p1/include/tclPlatDecls.h +141 -0
  42. physworld_p1_20261018/envs/p1/include/tclPort.h +46 -0
  43. physworld_p1_20261018/envs/p1/include/tclThread.h +36 -0
  44. physworld_p1_20261018/envs/p1/include/tclTomMath.h +1131 -0
  45. physworld_p1_20261018/envs/p1/include/tclTomMathDecls.h +669 -0
  46. physworld_p1_20261018/envs/p1/include/tclUnixPort.h +742 -0
  47. physworld_p1_20261018/envs/p1/include/tdbc.h +80 -0
  48. physworld_p1_20261018/envs/p1/include/tdbcDecls.h +70 -0
  49. physworld_p1_20261018/envs/p1/include/tdbcInt.h +55 -0
  50. physworld_p1_20261018/envs/p1/include/term.h +893 -0
.gitattributes CHANGED
@@ -3349,3 +3349,60 @@ physworld_p1_20261018/envs/p1/bin/zstd filter=lfs diff=lfs merge=lfs -text
3349
  physworld_p1_20261018/envs/p1/bin/zstdcat filter=lfs diff=lfs merge=lfs -text
3350
  physworld_p1_20261018/envs/p1/bin/zstdmt filter=lfs diff=lfs merge=lfs -text
3351
  physworld_p1_20261018/envs/p1/compiler_compat/ld filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3349
  physworld_p1_20261018/envs/p1/bin/zstdcat filter=lfs diff=lfs merge=lfs -text
3350
  physworld_p1_20261018/envs/p1/bin/zstdmt filter=lfs diff=lfs merge=lfs -text
3351
  physworld_p1_20261018/envs/p1/compiler_compat/ld filter=lfs diff=lfs merge=lfs -text
3352
+ physworld_p1_20261018/envs/p1/lib/itcl4.2.3/libitcl4.2.3.so filter=lfs diff=lfs merge=lfs -text
3353
+ physworld_p1_20261018/envs/p1/lib/libatomic.so filter=lfs diff=lfs merge=lfs -text
3354
+ physworld_p1_20261018/envs/p1/lib/libatomic.so.1 filter=lfs diff=lfs merge=lfs -text
3355
+ physworld_p1_20261018/envs/p1/lib/libatomic.so.1.2.0 filter=lfs diff=lfs merge=lfs -text
3356
+ physworld_p1_20261018/envs/p1/lib/libbz2.a filter=lfs diff=lfs merge=lfs -text
3357
+ physworld_p1_20261018/envs/p1/lib/libbz2.so filter=lfs diff=lfs merge=lfs -text
3358
+ physworld_p1_20261018/envs/p1/lib/libbz2.so.1.0 filter=lfs diff=lfs merge=lfs -text
3359
+ physworld_p1_20261018/envs/p1/lib/libbz2.so.1.0.8 filter=lfs diff=lfs merge=lfs -text
3360
+ physworld_p1_20261018/envs/p1/lib/libcrypt.so filter=lfs diff=lfs merge=lfs -text
3361
+ physworld_p1_20261018/envs/p1/lib/libcrypt.so.2 filter=lfs diff=lfs merge=lfs -text
3362
+ physworld_p1_20261018/envs/p1/lib/libcrypt.so.2.0.0 filter=lfs diff=lfs merge=lfs -text
3363
+ physworld_p1_20261018/envs/p1/lib/libcrypto.so filter=lfs diff=lfs merge=lfs -text
3364
+ physworld_p1_20261018/envs/p1/lib/libcrypto.so.3 filter=lfs diff=lfs merge=lfs -text
3365
+ physworld_p1_20261018/envs/p1/lib/libexpat.so.1 filter=lfs diff=lfs merge=lfs -text
3366
+ physworld_p1_20261018/envs/p1/lib/libexpat.so.1.12.5 filter=lfs diff=lfs merge=lfs -text
3367
+ physworld_p1_20261018/envs/p1/lib/libffi.a filter=lfs diff=lfs merge=lfs -text
3368
+ physworld_p1_20261018/envs/p1/lib/libgcc_s.so.1 filter=lfs diff=lfs merge=lfs -text
3369
+ physworld_p1_20261018/envs/p1/lib/libgomp.so filter=lfs diff=lfs merge=lfs -text
3370
+ physworld_p1_20261018/envs/p1/lib/libgomp.so.1 filter=lfs diff=lfs merge=lfs -text
3371
+ physworld_p1_20261018/envs/p1/lib/libgomp.so.1.0.0 filter=lfs diff=lfs merge=lfs -text
3372
+ physworld_p1_20261018/envs/p1/lib/libitm.so filter=lfs diff=lfs merge=lfs -text
3373
+ physworld_p1_20261018/envs/p1/lib/libitm.so.1 filter=lfs diff=lfs merge=lfs -text
3374
+ physworld_p1_20261018/envs/p1/lib/libitm.so.1.0.0 filter=lfs diff=lfs merge=lfs -text
3375
+ physworld_p1_20261018/envs/p1/lib/liblzma.so.5 filter=lfs diff=lfs merge=lfs -text
3376
+ physworld_p1_20261018/envs/p1/lib/liblzma.so.5.8.3 filter=lfs diff=lfs merge=lfs -text
3377
+ physworld_p1_20261018/envs/p1/lib/libncurses++.a filter=lfs diff=lfs merge=lfs -text
3378
+ physworld_p1_20261018/envs/p1/lib/libncurses++w.a filter=lfs diff=lfs merge=lfs -text
3379
+ physworld_p1_20261018/envs/p1/lib/libncurses.so.6 filter=lfs diff=lfs merge=lfs -text
3380
+ physworld_p1_20261018/envs/p1/lib/libncurses.so.6.6 filter=lfs diff=lfs merge=lfs -text
3381
+ physworld_p1_20261018/envs/p1/lib/libncursesw.so.6 filter=lfs diff=lfs merge=lfs -text
3382
+ physworld_p1_20261018/envs/p1/lib/libncursesw.so.6.6 filter=lfs diff=lfs merge=lfs -text
3383
+ physworld_p1_20261018/envs/p1/lib/libpython3.11.so filter=lfs diff=lfs merge=lfs -text
3384
+ physworld_p1_20261018/envs/p1/lib/libpython3.11.so.1.0 filter=lfs diff=lfs merge=lfs -text
3385
+ physworld_p1_20261018/envs/p1/lib/libquadmath.so filter=lfs diff=lfs merge=lfs -text
3386
+ physworld_p1_20261018/envs/p1/lib/libquadmath.so.0 filter=lfs diff=lfs merge=lfs -text
3387
+ physworld_p1_20261018/envs/p1/lib/libquadmath.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
3388
+ physworld_p1_20261018/envs/p1/lib/libreadline.so filter=lfs diff=lfs merge=lfs -text
3389
+ physworld_p1_20261018/envs/p1/lib/libreadline.so.8 filter=lfs diff=lfs merge=lfs -text
3390
+ physworld_p1_20261018/envs/p1/lib/libreadline.so.8.3 filter=lfs diff=lfs merge=lfs -text
3391
+ physworld_p1_20261018/envs/p1/lib/libsqlite3.so filter=lfs diff=lfs merge=lfs -text
3392
+ physworld_p1_20261018/envs/p1/lib/libsqlite3.so.0 filter=lfs diff=lfs merge=lfs -text
3393
+ physworld_p1_20261018/envs/p1/lib/libsqlite3.so.3.54.1 filter=lfs diff=lfs merge=lfs -text
3394
+ physworld_p1_20261018/envs/p1/lib/libssl.so filter=lfs diff=lfs merge=lfs -text
3395
+ physworld_p1_20261018/envs/p1/lib/libssl.so.3 filter=lfs diff=lfs merge=lfs -text
3396
+ physworld_p1_20261018/envs/p1/lib/libtcl8.6.so filter=lfs diff=lfs merge=lfs -text
3397
+ physworld_p1_20261018/envs/p1/lib/libtinfo.so filter=lfs diff=lfs merge=lfs -text
3398
+ physworld_p1_20261018/envs/p1/lib/libtinfo.so.6 filter=lfs diff=lfs merge=lfs -text
3399
+ physworld_p1_20261018/envs/p1/lib/libtinfo.so.6.6 filter=lfs diff=lfs merge=lfs -text
3400
+ physworld_p1_20261018/envs/p1/lib/libtinfow.so filter=lfs diff=lfs merge=lfs -text
3401
+ physworld_p1_20261018/envs/p1/lib/libtinfow.so.6 filter=lfs diff=lfs merge=lfs -text
3402
+ physworld_p1_20261018/envs/p1/lib/libtinfow.so.6.6 filter=lfs diff=lfs merge=lfs -text
3403
+ physworld_p1_20261018/envs/p1/lib/libtk8.6.so filter=lfs diff=lfs merge=lfs -text
3404
+ physworld_p1_20261018/envs/p1/lib/libz.so.1 filter=lfs diff=lfs merge=lfs -text
3405
+ physworld_p1_20261018/envs/p1/lib/libz.so.1.3.2 filter=lfs diff=lfs merge=lfs -text
3406
+ physworld_p1_20261018/envs/p1/lib/libzstd.so filter=lfs diff=lfs merge=lfs -text
3407
+ physworld_p1_20261018/envs/p1/lib/libzstd.so.1 filter=lfs diff=lfs merge=lfs -text
3408
+ physworld_p1_20261018/envs/p1/lib/libzstd.so.1.5.7 filter=lfs diff=lfs merge=lfs -text
physworld_p1_20261018/envs/p1/include/python3.11/setobject.h ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Set object interface */
2
+
3
+ #ifndef Py_SETOBJECT_H
4
+ #define Py_SETOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ PyAPI_DATA(PyTypeObject) PySet_Type;
10
+ PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
11
+ PyAPI_DATA(PyTypeObject) PySetIter_Type;
12
+
13
+ PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
14
+ PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
15
+
16
+ PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
17
+ PyAPI_FUNC(int) PySet_Clear(PyObject *set);
18
+ PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
19
+ PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
20
+ PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
21
+ PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
22
+
23
+ #define PyFrozenSet_CheckExact(ob) Py_IS_TYPE(ob, &PyFrozenSet_Type)
24
+ #define PyFrozenSet_Check(ob) \
25
+ (Py_IS_TYPE(ob, &PyFrozenSet_Type) || \
26
+ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
27
+
28
+ #define PyAnySet_CheckExact(ob) \
29
+ (Py_IS_TYPE(ob, &PySet_Type) || Py_IS_TYPE(ob, &PyFrozenSet_Type))
30
+ #define PyAnySet_Check(ob) \
31
+ (Py_IS_TYPE(ob, &PySet_Type) || Py_IS_TYPE(ob, &PyFrozenSet_Type) || \
32
+ PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
33
+ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
34
+
35
+ #define PySet_CheckExact(op) Py_IS_TYPE(op, &PySet_Type)
36
+ #define PySet_Check(ob) \
37
+ (Py_IS_TYPE(ob, &PySet_Type) || \
38
+ PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
39
+
40
+ #ifndef Py_LIMITED_API
41
+ # define Py_CPYTHON_SETOBJECT_H
42
+ # include "cpython/setobject.h"
43
+ # undef Py_CPYTHON_SETOBJECT_H
44
+ #endif
45
+
46
+ #ifdef __cplusplus
47
+ }
48
+ #endif
49
+ #endif /* !Py_SETOBJECT_H */
physworld_p1_20261018/envs/p1/include/python3.11/sliceobject.h ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_SLICEOBJECT_H
2
+ #define Py_SLICEOBJECT_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ /* The unique ellipsis object "..." */
8
+
9
+ PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
10
+
11
+ #define Py_Ellipsis (&_Py_EllipsisObject)
12
+
13
+ /* Slice object interface */
14
+
15
+ /*
16
+
17
+ A slice object containing start, stop, and step data members (the
18
+ names are from range). After much talk with Guido, it was decided to
19
+ let these be any arbitrary python type. Py_None stands for omitted values.
20
+ */
21
+ #ifndef Py_LIMITED_API
22
+ typedef struct {
23
+ PyObject_HEAD
24
+ PyObject *start, *stop, *step; /* not NULL */
25
+ } PySliceObject;
26
+ #endif
27
+
28
+ PyAPI_DATA(PyTypeObject) PySlice_Type;
29
+ PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
30
+
31
+ #define PySlice_Check(op) Py_IS_TYPE(op, &PySlice_Type)
32
+
33
+ PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
34
+ PyObject* step);
35
+ #ifndef Py_LIMITED_API
36
+ PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
37
+ PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
38
+ PyObject **start_ptr, PyObject **stop_ptr,
39
+ PyObject **step_ptr);
40
+ #endif
41
+ PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
42
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
43
+ Py_DEPRECATED(3.7)
44
+ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
45
+ Py_ssize_t *start, Py_ssize_t *stop,
46
+ Py_ssize_t *step,
47
+ Py_ssize_t *slicelength);
48
+
49
+ #if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
50
+ #define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
51
+ PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
52
+ ((*(slicelen) = 0), -1) : \
53
+ ((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
54
+ 0))
55
+ PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
56
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
57
+ PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
58
+ Py_ssize_t *start, Py_ssize_t *stop,
59
+ Py_ssize_t step);
60
+ #endif
61
+
62
+ #ifdef __cplusplus
63
+ }
64
+ #endif
65
+ #endif /* !Py_SLICEOBJECT_H */
physworld_p1_20261018/envs/p1/include/python3.11/structmember.h ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_STRUCTMEMBER_H
2
+ #define Py_STRUCTMEMBER_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+
8
+ /* Interface to map C struct members to Python object attributes */
9
+
10
+ #include <stddef.h> /* For offsetof */
11
+
12
+ /* An array of PyMemberDef structures defines the name, type and offset
13
+ of selected members of a C structure. These can be read by
14
+ PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY
15
+ flag is set). The array must be terminated with an entry whose name
16
+ pointer is NULL. */
17
+
18
+ struct PyMemberDef {
19
+ const char *name;
20
+ int type;
21
+ Py_ssize_t offset;
22
+ int flags;
23
+ const char *doc;
24
+ };
25
+
26
+ /* Types */
27
+ #define T_SHORT 0
28
+ #define T_INT 1
29
+ #define T_LONG 2
30
+ #define T_FLOAT 3
31
+ #define T_DOUBLE 4
32
+ #define T_STRING 5
33
+ #define T_OBJECT 6
34
+ /* XXX the ordering here is weird for binary compatibility */
35
+ #define T_CHAR 7 /* 1-character string */
36
+ #define T_BYTE 8 /* 8-bit signed int */
37
+ /* unsigned variants: */
38
+ #define T_UBYTE 9
39
+ #define T_USHORT 10
40
+ #define T_UINT 11
41
+ #define T_ULONG 12
42
+
43
+ /* Added by Jack: strings contained in the structure */
44
+ #define T_STRING_INPLACE 13
45
+
46
+ /* Added by Lillo: bools contained in the structure (assumed char) */
47
+ #define T_BOOL 14
48
+
49
+ #define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError
50
+ when the value is NULL, instead of
51
+ converting to None. */
52
+ #define T_LONGLONG 17
53
+ #define T_ULONGLONG 18
54
+
55
+ #define T_PYSSIZET 19 /* Py_ssize_t */
56
+ #define T_NONE 20 /* Value is always None */
57
+
58
+
59
+ /* Flags */
60
+ #define READONLY 1
61
+ #define READ_RESTRICTED 2
62
+ #define PY_WRITE_RESTRICTED 4
63
+ #define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)
64
+
65
+ #define PY_AUDIT_READ READ_RESTRICTED
66
+
67
+ /* Current API, use this */
68
+ PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, PyMemberDef *);
69
+ PyAPI_FUNC(int) PyMember_SetOne(char *, PyMemberDef *, PyObject *);
70
+
71
+
72
+ #ifdef __cplusplus
73
+ }
74
+ #endif
75
+ #endif /* !Py_STRUCTMEMBER_H */
physworld_p1_20261018/envs/p1/include/python3.11/structseq.h ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Named tuple object interface */
3
+
4
+ #ifndef Py_STRUCTSEQ_H
5
+ #define Py_STRUCTSEQ_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ typedef struct PyStructSequence_Field {
11
+ const char *name;
12
+ const char *doc;
13
+ } PyStructSequence_Field;
14
+
15
+ typedef struct PyStructSequence_Desc {
16
+ const char *name;
17
+ const char *doc;
18
+ PyStructSequence_Field *fields;
19
+ int n_in_sequence;
20
+ } PyStructSequence_Desc;
21
+
22
+ PyAPI_DATA(const char * const) PyStructSequence_UnnamedField;
23
+
24
+ #ifndef Py_LIMITED_API
25
+ PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
26
+ PyStructSequence_Desc *desc);
27
+ PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
28
+ PyStructSequence_Desc *desc);
29
+ #endif
30
+ PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
31
+
32
+ PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
33
+
34
+ #ifndef Py_LIMITED_API
35
+ typedef PyTupleObject PyStructSequence;
36
+
37
+ /* Macro, *only* to be used to fill in brand new objects */
38
+ #define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
39
+
40
+ #define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
41
+ #endif
42
+
43
+ PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
44
+ PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
45
+
46
+ #ifdef __cplusplus
47
+ }
48
+ #endif
49
+ #endif /* !Py_STRUCTSEQ_H */
physworld_p1_20261018/envs/p1/include/python3.11/sysmodule.h ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* System module interface */
3
+
4
+ #ifndef Py_SYSMODULE_H
5
+ #define Py_SYSMODULE_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
11
+ PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
12
+
13
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
14
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
15
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
16
+
17
+ PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
18
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
19
+ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
20
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
21
+ PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
22
+ PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
23
+
24
+ PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
25
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
26
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *);
27
+ Py_DEPRECATED(3.11) PyAPI_FUNC(int) PySys_HasWarnOptions(void);
28
+
29
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
30
+ PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
31
+
32
+ #ifndef Py_LIMITED_API
33
+ # define Py_CPYTHON_SYSMODULE_H
34
+ # include "cpython/sysmodule.h"
35
+ # undef Py_CPYTHON_SYSMODULE_H
36
+ #endif
37
+
38
+ #ifdef __cplusplus
39
+ }
40
+ #endif
41
+ #endif /* !Py_SYSMODULE_H */
physworld_p1_20261018/envs/p1/include/python3.11/token.h ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Auto-generated by Tools/scripts/generate_token.py */
2
+
3
+ /* Token types */
4
+ #ifndef Py_LIMITED_API
5
+ #ifndef Py_TOKEN_H
6
+ #define Py_TOKEN_H
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
12
+
13
+ #define ENDMARKER 0
14
+ #define NAME 1
15
+ #define NUMBER 2
16
+ #define STRING 3
17
+ #define NEWLINE 4
18
+ #define INDENT 5
19
+ #define DEDENT 6
20
+ #define LPAR 7
21
+ #define RPAR 8
22
+ #define LSQB 9
23
+ #define RSQB 10
24
+ #define COLON 11
25
+ #define COMMA 12
26
+ #define SEMI 13
27
+ #define PLUS 14
28
+ #define MINUS 15
29
+ #define STAR 16
30
+ #define SLASH 17
31
+ #define VBAR 18
32
+ #define AMPER 19
33
+ #define LESS 20
34
+ #define GREATER 21
35
+ #define EQUAL 22
36
+ #define DOT 23
37
+ #define PERCENT 24
38
+ #define LBRACE 25
39
+ #define RBRACE 26
40
+ #define EQEQUAL 27
41
+ #define NOTEQUAL 28
42
+ #define LESSEQUAL 29
43
+ #define GREATEREQUAL 30
44
+ #define TILDE 31
45
+ #define CIRCUMFLEX 32
46
+ #define LEFTSHIFT 33
47
+ #define RIGHTSHIFT 34
48
+ #define DOUBLESTAR 35
49
+ #define PLUSEQUAL 36
50
+ #define MINEQUAL 37
51
+ #define STAREQUAL 38
52
+ #define SLASHEQUAL 39
53
+ #define PERCENTEQUAL 40
54
+ #define AMPEREQUAL 41
55
+ #define VBAREQUAL 42
56
+ #define CIRCUMFLEXEQUAL 43
57
+ #define LEFTSHIFTEQUAL 44
58
+ #define RIGHTSHIFTEQUAL 45
59
+ #define DOUBLESTAREQUAL 46
60
+ #define DOUBLESLASH 47
61
+ #define DOUBLESLASHEQUAL 48
62
+ #define AT 49
63
+ #define ATEQUAL 50
64
+ #define RARROW 51
65
+ #define ELLIPSIS 52
66
+ #define COLONEQUAL 53
67
+ #define OP 54
68
+ #define AWAIT 55
69
+ #define ASYNC 56
70
+ #define TYPE_IGNORE 57
71
+ #define TYPE_COMMENT 58
72
+ #define SOFT_KEYWORD 59
73
+ #define ERRORTOKEN 60
74
+ #define N_TOKENS 64
75
+ #define NT_OFFSET 256
76
+
77
+ /* Special definitions for cooperation with parser */
78
+
79
+ #define ISTERMINAL(x) ((x) < NT_OFFSET)
80
+ #define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
81
+ #define ISEOF(x) ((x) == ENDMARKER)
82
+ #define ISWHITESPACE(x) ((x) == ENDMARKER || \
83
+ (x) == NEWLINE || \
84
+ (x) == INDENT || \
85
+ (x) == DEDENT)
86
+
87
+
88
+ PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */
89
+ PyAPI_FUNC(int) PyToken_OneChar(int);
90
+ PyAPI_FUNC(int) PyToken_TwoChars(int, int);
91
+ PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
92
+
93
+ #ifdef __cplusplus
94
+ }
95
+ #endif
96
+ #endif /* !Py_TOKEN_H */
97
+ #endif /* Py_LIMITED_API */
physworld_p1_20261018/envs/p1/include/python3.11/traceback.h ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_TRACEBACK_H
2
+ #define Py_TRACEBACK_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ /* Traceback interface */
8
+
9
+ PyAPI_FUNC(int) PyTraceBack_Here(PyFrameObject *);
10
+ PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
11
+
12
+ /* Reveal traceback type so we can typecheck traceback objects */
13
+ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
14
+ #define PyTraceBack_Check(v) Py_IS_TYPE(v, &PyTraceBack_Type)
15
+
16
+
17
+ #ifndef Py_LIMITED_API
18
+ # define Py_CPYTHON_TRACEBACK_H
19
+ # include "cpython/traceback.h"
20
+ # undef Py_CPYTHON_TRACEBACK_H
21
+ #endif
22
+
23
+ #ifdef __cplusplus
24
+ }
25
+ #endif
26
+ #endif /* !Py_TRACEBACK_H */
physworld_p1_20261018/envs/p1/include/python3.11/tracemalloc.h ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_TRACEMALLOC_H
2
+ #define Py_TRACEMALLOC_H
3
+
4
+ #ifndef Py_LIMITED_API
5
+ /* Track an allocated memory block in the tracemalloc module.
6
+ Return 0 on success, return -1 on error (failed to allocate memory to store
7
+ the trace).
8
+
9
+ Return -2 if tracemalloc is disabled.
10
+
11
+ If memory block is already tracked, update the existing trace. */
12
+ PyAPI_FUNC(int) PyTraceMalloc_Track(
13
+ unsigned int domain,
14
+ uintptr_t ptr,
15
+ size_t size);
16
+
17
+ /* Untrack an allocated memory block in the tracemalloc module.
18
+ Do nothing if the block was not tracked.
19
+
20
+ Return -2 if tracemalloc is disabled, otherwise return 0. */
21
+ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
22
+ unsigned int domain,
23
+ uintptr_t ptr);
24
+
25
+ /* Get the traceback where a memory block was allocated.
26
+
27
+ Return a tuple of (filename: str, lineno: int) tuples.
28
+
29
+ Return None if the tracemalloc module is disabled or if the memory block
30
+ is not tracked by tracemalloc.
31
+
32
+ Raise an exception and return NULL on error. */
33
+ PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback(
34
+ unsigned int domain,
35
+ uintptr_t ptr);
36
+ #endif
37
+
38
+ #endif /* !Py_TRACEMALLOC_H */
physworld_p1_20261018/envs/p1/include/python3.11/tupleobject.h ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Tuple object interface */
2
+
3
+ #ifndef Py_TUPLEOBJECT_H
4
+ #define Py_TUPLEOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ /*
10
+ Another generally useful object type is a tuple of object pointers.
11
+ For Python, this is an immutable type. C code can change the tuple items
12
+ (but not their number), and even use tuples as general-purpose arrays of
13
+ object references, but in general only brand new tuples should be mutated,
14
+ not ones that might already have been exposed to Python code.
15
+
16
+ *** WARNING *** PyTuple_SetItem does not increment the new item's reference
17
+ count, but does decrement the reference count of the item it replaces,
18
+ if not nil. It does *decrement* the reference count if it is *not*
19
+ inserted in the tuple. Similarly, PyTuple_GetItem does not increment the
20
+ returned item's reference count.
21
+ */
22
+
23
+ PyAPI_DATA(PyTypeObject) PyTuple_Type;
24
+ PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
25
+
26
+ #define PyTuple_Check(op) \
27
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
28
+ #define PyTuple_CheckExact(op) Py_IS_TYPE(op, &PyTuple_Type)
29
+
30
+ PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size);
31
+ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
32
+ PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
33
+ PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
34
+ PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
35
+ PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
36
+
37
+ #ifndef Py_LIMITED_API
38
+ # define Py_CPYTHON_TUPLEOBJECT_H
39
+ # include "cpython/tupleobject.h"
40
+ # undef Py_CPYTHON_TUPLEOBJECT_H
41
+ #endif
42
+
43
+ #ifdef __cplusplus
44
+ }
45
+ #endif
46
+ #endif /* !Py_TUPLEOBJECT_H */
physworld_p1_20261018/envs/p1/include/python3.11/typeslots.h ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Do not renumber the file; these numbers are part of the stable ABI. */
2
+ #define Py_bf_getbuffer 1
3
+ #define Py_bf_releasebuffer 2
4
+ #define Py_mp_ass_subscript 3
5
+ #define Py_mp_length 4
6
+ #define Py_mp_subscript 5
7
+ #define Py_nb_absolute 6
8
+ #define Py_nb_add 7
9
+ #define Py_nb_and 8
10
+ #define Py_nb_bool 9
11
+ #define Py_nb_divmod 10
12
+ #define Py_nb_float 11
13
+ #define Py_nb_floor_divide 12
14
+ #define Py_nb_index 13
15
+ #define Py_nb_inplace_add 14
16
+ #define Py_nb_inplace_and 15
17
+ #define Py_nb_inplace_floor_divide 16
18
+ #define Py_nb_inplace_lshift 17
19
+ #define Py_nb_inplace_multiply 18
20
+ #define Py_nb_inplace_or 19
21
+ #define Py_nb_inplace_power 20
22
+ #define Py_nb_inplace_remainder 21
23
+ #define Py_nb_inplace_rshift 22
24
+ #define Py_nb_inplace_subtract 23
25
+ #define Py_nb_inplace_true_divide 24
26
+ #define Py_nb_inplace_xor 25
27
+ #define Py_nb_int 26
28
+ #define Py_nb_invert 27
29
+ #define Py_nb_lshift 28
30
+ #define Py_nb_multiply 29
31
+ #define Py_nb_negative 30
32
+ #define Py_nb_or 31
33
+ #define Py_nb_positive 32
34
+ #define Py_nb_power 33
35
+ #define Py_nb_remainder 34
36
+ #define Py_nb_rshift 35
37
+ #define Py_nb_subtract 36
38
+ #define Py_nb_true_divide 37
39
+ #define Py_nb_xor 38
40
+ #define Py_sq_ass_item 39
41
+ #define Py_sq_concat 40
42
+ #define Py_sq_contains 41
43
+ #define Py_sq_inplace_concat 42
44
+ #define Py_sq_inplace_repeat 43
45
+ #define Py_sq_item 44
46
+ #define Py_sq_length 45
47
+ #define Py_sq_repeat 46
48
+ #define Py_tp_alloc 47
49
+ #define Py_tp_base 48
50
+ #define Py_tp_bases 49
51
+ #define Py_tp_call 50
52
+ #define Py_tp_clear 51
53
+ #define Py_tp_dealloc 52
54
+ #define Py_tp_del 53
55
+ #define Py_tp_descr_get 54
56
+ #define Py_tp_descr_set 55
57
+ #define Py_tp_doc 56
58
+ #define Py_tp_getattr 57
59
+ #define Py_tp_getattro 58
60
+ #define Py_tp_hash 59
61
+ #define Py_tp_init 60
62
+ #define Py_tp_is_gc 61
63
+ #define Py_tp_iter 62
64
+ #define Py_tp_iternext 63
65
+ #define Py_tp_methods 64
66
+ #define Py_tp_new 65
67
+ #define Py_tp_repr 66
68
+ #define Py_tp_richcompare 67
69
+ #define Py_tp_setattr 68
70
+ #define Py_tp_setattro 69
71
+ #define Py_tp_str 70
72
+ #define Py_tp_traverse 71
73
+ #define Py_tp_members 72
74
+ #define Py_tp_getset 73
75
+ #define Py_tp_free 74
76
+ #define Py_nb_matrix_multiply 75
77
+ #define Py_nb_inplace_matrix_multiply 76
78
+ #define Py_am_await 77
79
+ #define Py_am_aiter 78
80
+ #define Py_am_anext 79
81
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
82
+ /* New in 3.5 */
83
+ #define Py_tp_finalize 80
84
+ #endif
85
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
86
+ /* New in 3.10 */
87
+ #define Py_am_send 81
88
+ #endif
physworld_p1_20261018/envs/p1/include/python3.11/unicodeobject.h ADDED
@@ -0,0 +1,1049 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_UNICODEOBJECT_H
2
+ #define Py_UNICODEOBJECT_H
3
+
4
+ #include <stdarg.h> // va_list
5
+
6
+ /*
7
+
8
+ Unicode implementation based on original code by Fredrik Lundh,
9
+ modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
10
+ Unicode Integration Proposal. (See
11
+ http://www.egenix.com/files/python/unicode-proposal.txt).
12
+
13
+ Copyright (c) Corporation for National Research Initiatives.
14
+
15
+
16
+ Original header:
17
+ --------------------------------------------------------------------
18
+
19
+ * Yet another Unicode string type for Python. This type supports the
20
+ * 16-bit Basic Multilingual Plane (BMP) only.
21
+ *
22
+ * Written by Fredrik Lundh, January 1999.
23
+ *
24
+ * Copyright (c) 1999 by Secret Labs AB.
25
+ * Copyright (c) 1999 by Fredrik Lundh.
26
+ *
27
+ * fredrik@pythonware.com
28
+ * http://www.pythonware.com
29
+ *
30
+ * --------------------------------------------------------------------
31
+ * This Unicode String Type is
32
+ *
33
+ * Copyright (c) 1999 by Secret Labs AB
34
+ * Copyright (c) 1999 by Fredrik Lundh
35
+ *
36
+ * By obtaining, using, and/or copying this software and/or its
37
+ * associated documentation, you agree that you have read, understood,
38
+ * and will comply with the following terms and conditions:
39
+ *
40
+ * Permission to use, copy, modify, and distribute this software and its
41
+ * associated documentation for any purpose and without fee is hereby
42
+ * granted, provided that the above copyright notice appears in all
43
+ * copies, and that both that copyright notice and this permission notice
44
+ * appear in supporting documentation, and that the name of Secret Labs
45
+ * AB or the author not be used in advertising or publicity pertaining to
46
+ * distribution of the software without specific, written prior
47
+ * permission.
48
+ *
49
+ * SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
50
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
51
+ * FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
52
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
53
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
54
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
55
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
56
+ * -------------------------------------------------------------------- */
57
+
58
+ #include <ctype.h>
59
+
60
+ /* === Internal API ======================================================= */
61
+
62
+ /* --- Internal Unicode Format -------------------------------------------- */
63
+
64
+ /* Python 3.x requires unicode */
65
+ #define Py_USING_UNICODE
66
+
67
+ #ifndef SIZEOF_WCHAR_T
68
+ #error Must define SIZEOF_WCHAR_T
69
+ #endif
70
+
71
+ #define Py_UNICODE_SIZE SIZEOF_WCHAR_T
72
+
73
+ /* If wchar_t can be used for UCS-4 storage, set Py_UNICODE_WIDE.
74
+ Otherwise, Unicode strings are stored as UCS-2 (with limited support
75
+ for UTF-16) */
76
+
77
+ #if Py_UNICODE_SIZE >= 4
78
+ #define Py_UNICODE_WIDE
79
+ #endif
80
+
81
+ /* Set these flags if the platform has "wchar.h" and the
82
+ wchar_t type is a 16-bit unsigned type */
83
+ /* #define HAVE_WCHAR_H */
84
+ /* #define HAVE_USABLE_WCHAR_T */
85
+
86
+ /* If the compiler provides a wchar_t type we try to support it
87
+ through the interface functions PyUnicode_FromWideChar(),
88
+ PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */
89
+
90
+ #ifdef HAVE_USABLE_WCHAR_T
91
+ # ifndef HAVE_WCHAR_H
92
+ # define HAVE_WCHAR_H
93
+ # endif
94
+ #endif
95
+
96
+ #ifdef HAVE_WCHAR_H
97
+ # include <wchar.h>
98
+ #endif
99
+
100
+ /* Py_UCS4 and Py_UCS2 are typedefs for the respective
101
+ unicode representations. */
102
+ typedef uint32_t Py_UCS4;
103
+ typedef uint16_t Py_UCS2;
104
+ typedef uint8_t Py_UCS1;
105
+
106
+ #ifdef __cplusplus
107
+ extern "C" {
108
+ #endif
109
+
110
+
111
+ PyAPI_DATA(PyTypeObject) PyUnicode_Type;
112
+ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
113
+
114
+ #define PyUnicode_Check(op) \
115
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
116
+ #define PyUnicode_CheckExact(op) Py_IS_TYPE(op, &PyUnicode_Type)
117
+
118
+ /* --- Constants ---------------------------------------------------------- */
119
+
120
+ /* This Unicode character will be used as replacement character during
121
+ decoding if the errors argument is set to "replace". Note: the
122
+ Unicode character U+FFFD is the official REPLACEMENT CHARACTER in
123
+ Unicode 3.0. */
124
+
125
+ #define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UCS4) 0xFFFD)
126
+
127
+ /* === Public API ========================================================= */
128
+
129
+ /* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
130
+ PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
131
+ const char *u, /* UTF-8 encoded string */
132
+ Py_ssize_t size /* size of buffer */
133
+ );
134
+
135
+ /* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
136
+ UTF-8 encoded bytes. The size is determined with strlen(). */
137
+ PyAPI_FUNC(PyObject*) PyUnicode_FromString(
138
+ const char *u /* UTF-8 encoded string */
139
+ );
140
+
141
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
142
+ PyAPI_FUNC(PyObject*) PyUnicode_Substring(
143
+ PyObject *str,
144
+ Py_ssize_t start,
145
+ Py_ssize_t end);
146
+ #endif
147
+
148
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
149
+ /* Copy the string into a UCS4 buffer including the null character if copy_null
150
+ is set. Return NULL and raise an exception on error. Raise a SystemError if
151
+ the buffer is smaller than the string. Return buffer on success.
152
+
153
+ buflen is the length of the buffer in (Py_UCS4) characters. */
154
+ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4(
155
+ PyObject *unicode,
156
+ Py_UCS4* buffer,
157
+ Py_ssize_t buflen,
158
+ int copy_null);
159
+
160
+ /* Copy the string into a UCS4 buffer. A new buffer is allocated using
161
+ * PyMem_Malloc; if this fails, NULL is returned with a memory error
162
+ exception set. */
163
+ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode);
164
+ #endif
165
+
166
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
167
+ /* Get the length of the Unicode object. */
168
+
169
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength(
170
+ PyObject *unicode
171
+ );
172
+ #endif
173
+
174
+ /* Get the number of Py_UNICODE units in the
175
+ string representation. */
176
+
177
+ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
178
+ PyObject *unicode /* Unicode object */
179
+ );
180
+
181
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
182
+ /* Read a character from the string. */
183
+
184
+ PyAPI_FUNC(Py_UCS4) PyUnicode_ReadChar(
185
+ PyObject *unicode,
186
+ Py_ssize_t index
187
+ );
188
+
189
+ /* Write a character to the string. The string must have been created through
190
+ PyUnicode_New, must not be shared, and must not have been hashed yet.
191
+
192
+ Return 0 on success, -1 on error. */
193
+
194
+ PyAPI_FUNC(int) PyUnicode_WriteChar(
195
+ PyObject *unicode,
196
+ Py_ssize_t index,
197
+ Py_UCS4 character
198
+ );
199
+ #endif
200
+
201
+ /* Resize a Unicode object. The length is the number of characters, except
202
+ if the kind of the string is PyUnicode_WCHAR_KIND: in this case, the length
203
+ is the number of Py_UNICODE characters.
204
+
205
+ *unicode is modified to point to the new (resized) object and 0
206
+ returned on success.
207
+
208
+ Try to resize the string in place (which is usually faster than allocating
209
+ a new string and copy characters), or create a new string.
210
+
211
+ Error handling is implemented as follows: an exception is set, -1
212
+ is returned and *unicode left untouched.
213
+
214
+ WARNING: The function doesn't check string content, the result may not be a
215
+ string in canonical representation. */
216
+
217
+ PyAPI_FUNC(int) PyUnicode_Resize(
218
+ PyObject **unicode, /* Pointer to the Unicode object */
219
+ Py_ssize_t length /* New length */
220
+ );
221
+
222
+ /* Decode obj to a Unicode object.
223
+
224
+ bytes, bytearray and other bytes-like objects are decoded according to the
225
+ given encoding and error handler. The encoding and error handler can be
226
+ NULL to have the interface use UTF-8 and "strict".
227
+
228
+ All other objects (including Unicode objects) raise an exception.
229
+
230
+ The API returns NULL in case of an error. The caller is responsible
231
+ for decref'ing the returned objects.
232
+
233
+ */
234
+
235
+ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
236
+ PyObject *obj, /* Object */
237
+ const char *encoding, /* encoding */
238
+ const char *errors /* error handling */
239
+ );
240
+
241
+ /* Copy an instance of a Unicode subtype to a new true Unicode object if
242
+ necessary. If obj is already a true Unicode object (not a subtype), return
243
+ the reference with *incremented* refcount.
244
+
245
+ The API returns NULL in case of an error. The caller is responsible
246
+ for decref'ing the returned objects.
247
+
248
+ */
249
+
250
+ PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
251
+ PyObject *obj /* Object */
252
+ );
253
+
254
+ PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
255
+ const char *format, /* ASCII-encoded string */
256
+ va_list vargs
257
+ );
258
+ PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(
259
+ const char *format, /* ASCII-encoded string */
260
+ ...
261
+ );
262
+
263
+ PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
264
+ PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
265
+ const char *u /* UTF-8 encoded string */
266
+ );
267
+
268
+ // PyUnicode_InternImmortal() is deprecated since Python 3.10
269
+ // and will be removed in Python 3.12. Use PyUnicode_InternInPlace() instead.
270
+ Py_DEPRECATED(3.10) PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
271
+
272
+ /* --- wchar_t support for platforms which support it --------------------- */
273
+
274
+ #ifdef HAVE_WCHAR_H
275
+
276
+ /* Create a Unicode Object from the wchar_t buffer w of the given
277
+ size.
278
+
279
+ The buffer is copied into the new object. */
280
+
281
+ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
282
+ const wchar_t *w, /* wchar_t buffer */
283
+ Py_ssize_t size /* size of buffer */
284
+ );
285
+
286
+ /* Copies the Unicode Object contents into the wchar_t buffer w. At
287
+ most size wchar_t characters are copied.
288
+
289
+ Note that the resulting wchar_t string may or may not be
290
+ 0-terminated. It is the responsibility of the caller to make sure
291
+ that the wchar_t string is 0-terminated in case this is required by
292
+ the application.
293
+
294
+ Returns the number of wchar_t characters copied (excluding a
295
+ possibly trailing 0-termination character) or -1 in case of an
296
+ error. */
297
+
298
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
299
+ PyObject *unicode, /* Unicode object */
300
+ wchar_t *w, /* wchar_t buffer */
301
+ Py_ssize_t size /* size of buffer */
302
+ );
303
+
304
+ /* Convert the Unicode object to a wide character string. The output string
305
+ always ends with a nul character. If size is not NULL, write the number of
306
+ wide characters (excluding the null character) into *size.
307
+
308
+ Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it)
309
+ on success. On error, returns NULL, *size is undefined and raises a
310
+ MemoryError. */
311
+
312
+ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
313
+ PyObject *unicode, /* Unicode object */
314
+ Py_ssize_t *size /* number of characters of the result */
315
+ );
316
+
317
+ #endif
318
+
319
+ /* --- Unicode ordinals --------------------------------------------------- */
320
+
321
+ /* Create a Unicode Object from the given Unicode code point ordinal.
322
+
323
+ The ordinal must be in range(0x110000). A ValueError is
324
+ raised in case it is not.
325
+
326
+ */
327
+
328
+ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
329
+
330
+ /* === Builtin Codecs =====================================================
331
+
332
+ Many of these APIs take two arguments encoding and errors. These
333
+ parameters encoding and errors have the same semantics as the ones
334
+ of the builtin str() API.
335
+
336
+ Setting encoding to NULL causes the default encoding (UTF-8) to be used.
337
+
338
+ Error handling is set by errors which may also be set to NULL
339
+ meaning to use the default handling defined for the codec. Default
340
+ error handling for all builtin codecs is "strict" (ValueErrors are
341
+ raised).
342
+
343
+ The codecs all use a similar interface. Only deviation from the
344
+ generic ones are documented.
345
+
346
+ */
347
+
348
+ /* --- Manage the default encoding ---------------------------------------- */
349
+
350
+ /* Returns "utf-8". */
351
+ PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
352
+
353
+ /* --- Generic Codecs ----------------------------------------------------- */
354
+
355
+ /* Create a Unicode object by decoding the encoded string s of the
356
+ given size. */
357
+
358
+ PyAPI_FUNC(PyObject*) PyUnicode_Decode(
359
+ const char *s, /* encoded string */
360
+ Py_ssize_t size, /* size of buffer */
361
+ const char *encoding, /* encoding */
362
+ const char *errors /* error handling */
363
+ );
364
+
365
+ /* Decode a Unicode object unicode and return the result as Python
366
+ object.
367
+
368
+ This API is DEPRECATED. The only supported standard encoding is rot13.
369
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
370
+ that decode from str. */
371
+
372
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject(
373
+ PyObject *unicode, /* Unicode object */
374
+ const char *encoding, /* encoding */
375
+ const char *errors /* error handling */
376
+ );
377
+
378
+ /* Decode a Unicode object unicode and return the result as Unicode
379
+ object.
380
+
381
+ This API is DEPRECATED. The only supported standard encoding is rot13.
382
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
383
+ that decode from str to str. */
384
+
385
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
386
+ PyObject *unicode, /* Unicode object */
387
+ const char *encoding, /* encoding */
388
+ const char *errors /* error handling */
389
+ );
390
+
391
+ /* Encodes a Unicode object and returns the result as Python
392
+ object.
393
+
394
+ This API is DEPRECATED. It is superseded by PyUnicode_AsEncodedString()
395
+ since all standard encodings (except rot13) encode str to bytes.
396
+ Use PyCodec_Encode() for encoding with rot13 and non-standard codecs
397
+ that encode form str to non-bytes. */
398
+
399
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
400
+ PyObject *unicode, /* Unicode object */
401
+ const char *encoding, /* encoding */
402
+ const char *errors /* error handling */
403
+ );
404
+
405
+ /* Encodes a Unicode object and returns the result as Python string
406
+ object. */
407
+
408
+ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
409
+ PyObject *unicode, /* Unicode object */
410
+ const char *encoding, /* encoding */
411
+ const char *errors /* error handling */
412
+ );
413
+
414
+ /* Encodes a Unicode object and returns the result as Unicode
415
+ object.
416
+
417
+ This API is DEPRECATED. The only supported standard encodings is rot13.
418
+ Use PyCodec_Encode() to encode with rot13 and non-standard codecs
419
+ that encode from str to str. */
420
+
421
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode(
422
+ PyObject *unicode, /* Unicode object */
423
+ const char *encoding, /* encoding */
424
+ const char *errors /* error handling */
425
+ );
426
+
427
+ /* Build an encoding map. */
428
+
429
+ PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap(
430
+ PyObject* string /* 256 character map */
431
+ );
432
+
433
+ /* --- UTF-7 Codecs ------------------------------------------------------- */
434
+
435
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7(
436
+ const char *string, /* UTF-7 encoded string */
437
+ Py_ssize_t length, /* size of string */
438
+ const char *errors /* error handling */
439
+ );
440
+
441
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
442
+ const char *string, /* UTF-7 encoded string */
443
+ Py_ssize_t length, /* size of string */
444
+ const char *errors, /* error handling */
445
+ Py_ssize_t *consumed /* bytes consumed */
446
+ );
447
+
448
+ /* --- UTF-8 Codecs ------------------------------------------------------- */
449
+
450
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8(
451
+ const char *string, /* UTF-8 encoded string */
452
+ Py_ssize_t length, /* size of string */
453
+ const char *errors /* error handling */
454
+ );
455
+
456
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful(
457
+ const char *string, /* UTF-8 encoded string */
458
+ Py_ssize_t length, /* size of string */
459
+ const char *errors, /* error handling */
460
+ Py_ssize_t *consumed /* bytes consumed */
461
+ );
462
+
463
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
464
+ PyObject *unicode /* Unicode object */
465
+ );
466
+
467
+ /* Returns a pointer to the default encoding (UTF-8) of the
468
+ Unicode object unicode and the size of the encoded representation
469
+ in bytes stored in *size.
470
+
471
+ In case of an error, no *size is set.
472
+
473
+ This function caches the UTF-8 encoded string in the unicodeobject
474
+ and subsequent calls will return the same string. The memory is released
475
+ when the unicodeobject is deallocated.
476
+ */
477
+
478
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
479
+ PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(
480
+ PyObject *unicode,
481
+ Py_ssize_t *size);
482
+ #endif
483
+
484
+ /* --- UTF-32 Codecs ------------------------------------------------------ */
485
+
486
+ /* Decodes length bytes from a UTF-32 encoded buffer string and returns
487
+ the corresponding Unicode object.
488
+
489
+ errors (if non-NULL) defines the error handling. It defaults
490
+ to "strict".
491
+
492
+ If byteorder is non-NULL, the decoder starts decoding using the
493
+ given byte order:
494
+
495
+ *byteorder == -1: little endian
496
+ *byteorder == 0: native order
497
+ *byteorder == 1: big endian
498
+
499
+ In native mode, the first four bytes of the stream are checked for a
500
+ BOM mark. If found, the BOM mark is analysed, the byte order
501
+ adjusted and the BOM skipped. In the other modes, no BOM mark
502
+ interpretation is done. After completion, *byteorder is set to the
503
+ current byte order at the end of input data.
504
+
505
+ If byteorder is NULL, the codec starts in native order mode.
506
+
507
+ */
508
+
509
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32(
510
+ const char *string, /* UTF-32 encoded string */
511
+ Py_ssize_t length, /* size of string */
512
+ const char *errors, /* error handling */
513
+ int *byteorder /* pointer to byteorder to use
514
+ 0=native;-1=LE,1=BE; updated on
515
+ exit */
516
+ );
517
+
518
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful(
519
+ const char *string, /* UTF-32 encoded string */
520
+ Py_ssize_t length, /* size of string */
521
+ const char *errors, /* error handling */
522
+ int *byteorder, /* pointer to byteorder to use
523
+ 0=native;-1=LE,1=BE; updated on
524
+ exit */
525
+ Py_ssize_t *consumed /* bytes consumed */
526
+ );
527
+
528
+ /* Returns a Python string using the UTF-32 encoding in native byte
529
+ order. The string always starts with a BOM mark. */
530
+
531
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
532
+ PyObject *unicode /* Unicode object */
533
+ );
534
+
535
+ /* Returns a Python string object holding the UTF-32 encoded value of
536
+ the Unicode data.
537
+
538
+ If byteorder is not 0, output is written according to the following
539
+ byte order:
540
+
541
+ byteorder == -1: little endian
542
+ byteorder == 0: native byte order (writes a BOM mark)
543
+ byteorder == 1: big endian
544
+
545
+ If byteorder is 0, the output string will always start with the
546
+ Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
547
+ prepended.
548
+
549
+ */
550
+
551
+ /* --- UTF-16 Codecs ------------------------------------------------------ */
552
+
553
+ /* Decodes length bytes from a UTF-16 encoded buffer string and returns
554
+ the corresponding Unicode object.
555
+
556
+ errors (if non-NULL) defines the error handling. It defaults
557
+ to "strict".
558
+
559
+ If byteorder is non-NULL, the decoder starts decoding using the
560
+ given byte order:
561
+
562
+ *byteorder == -1: little endian
563
+ *byteorder == 0: native order
564
+ *byteorder == 1: big endian
565
+
566
+ In native mode, the first two bytes of the stream are checked for a
567
+ BOM mark. If found, the BOM mark is analysed, the byte order
568
+ adjusted and the BOM skipped. In the other modes, no BOM mark
569
+ interpretation is done. After completion, *byteorder is set to the
570
+ current byte order at the end of input data.
571
+
572
+ If byteorder is NULL, the codec starts in native order mode.
573
+
574
+ */
575
+
576
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16(
577
+ const char *string, /* UTF-16 encoded string */
578
+ Py_ssize_t length, /* size of string */
579
+ const char *errors, /* error handling */
580
+ int *byteorder /* pointer to byteorder to use
581
+ 0=native;-1=LE,1=BE; updated on
582
+ exit */
583
+ );
584
+
585
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful(
586
+ const char *string, /* UTF-16 encoded string */
587
+ Py_ssize_t length, /* size of string */
588
+ const char *errors, /* error handling */
589
+ int *byteorder, /* pointer to byteorder to use
590
+ 0=native;-1=LE,1=BE; updated on
591
+ exit */
592
+ Py_ssize_t *consumed /* bytes consumed */
593
+ );
594
+
595
+ /* Returns a Python string using the UTF-16 encoding in native byte
596
+ order. The string always starts with a BOM mark. */
597
+
598
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
599
+ PyObject *unicode /* Unicode object */
600
+ );
601
+
602
+ /* --- Unicode-Escape Codecs ---------------------------------------------- */
603
+
604
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
605
+ const char *string, /* Unicode-Escape encoded string */
606
+ Py_ssize_t length, /* size of string */
607
+ const char *errors /* error handling */
608
+ );
609
+
610
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
611
+ PyObject *unicode /* Unicode object */
612
+ );
613
+
614
+ /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
615
+
616
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape(
617
+ const char *string, /* Raw-Unicode-Escape encoded string */
618
+ Py_ssize_t length, /* size of string */
619
+ const char *errors /* error handling */
620
+ );
621
+
622
+ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
623
+ PyObject *unicode /* Unicode object */
624
+ );
625
+
626
+ /* --- Latin-1 Codecs -----------------------------------------------------
627
+
628
+ Note: Latin-1 corresponds to the first 256 Unicode ordinals. */
629
+
630
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1(
631
+ const char *string, /* Latin-1 encoded string */
632
+ Py_ssize_t length, /* size of string */
633
+ const char *errors /* error handling */
634
+ );
635
+
636
+ PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
637
+ PyObject *unicode /* Unicode object */
638
+ );
639
+
640
+ /* --- ASCII Codecs -------------------------------------------------------
641
+
642
+ Only 7-bit ASCII data is excepted. All other codes generate errors.
643
+
644
+ */
645
+
646
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII(
647
+ const char *string, /* ASCII encoded string */
648
+ Py_ssize_t length, /* size of string */
649
+ const char *errors /* error handling */
650
+ );
651
+
652
+ PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
653
+ PyObject *unicode /* Unicode object */
654
+ );
655
+
656
+ /* --- Character Map Codecs -----------------------------------------------
657
+
658
+ This codec uses mappings to encode and decode characters.
659
+
660
+ Decoding mappings must map byte ordinals (integers in the range from 0 to
661
+ 255) to Unicode strings, integers (which are then interpreted as Unicode
662
+ ordinals) or None. Unmapped data bytes (ones which cause a LookupError)
663
+ as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined
664
+ mapping" and cause an error.
665
+
666
+ Encoding mappings must map Unicode ordinal integers to bytes objects,
667
+ integers in the range from 0 to 255 or None. Unmapped character
668
+ ordinals (ones which cause a LookupError) as well as mapped to
669
+ None are treated as "undefined mapping" and cause an error.
670
+
671
+ */
672
+
673
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap(
674
+ const char *string, /* Encoded string */
675
+ Py_ssize_t length, /* size of string */
676
+ PyObject *mapping, /* decoding mapping */
677
+ const char *errors /* error handling */
678
+ );
679
+
680
+ PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
681
+ PyObject *unicode, /* Unicode object */
682
+ PyObject *mapping /* encoding mapping */
683
+ );
684
+
685
+ /* --- MBCS codecs for Windows -------------------------------------------- */
686
+
687
+ #ifdef MS_WINDOWS
688
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
689
+ const char *string, /* MBCS encoded string */
690
+ Py_ssize_t length, /* size of string */
691
+ const char *errors /* error handling */
692
+ );
693
+
694
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
695
+ const char *string, /* MBCS encoded string */
696
+ Py_ssize_t length, /* size of string */
697
+ const char *errors, /* error handling */
698
+ Py_ssize_t *consumed /* bytes consumed */
699
+ );
700
+
701
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
702
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful(
703
+ int code_page, /* code page number */
704
+ const char *string, /* encoded string */
705
+ Py_ssize_t length, /* size of string */
706
+ const char *errors, /* error handling */
707
+ Py_ssize_t *consumed /* bytes consumed */
708
+ );
709
+ #endif
710
+
711
+ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
712
+ PyObject *unicode /* Unicode object */
713
+ );
714
+
715
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
716
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage(
717
+ int code_page, /* code page number */
718
+ PyObject *unicode, /* Unicode object */
719
+ const char *errors /* error handling */
720
+ );
721
+ #endif
722
+
723
+ #endif /* MS_WINDOWS */
724
+
725
+ /* --- Locale encoding --------------------------------------------------- */
726
+
727
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
728
+ /* Decode a string from the current locale encoding. The decoder is strict if
729
+ *surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape'
730
+ error handler (PEP 383) to escape undecodable bytes. If a byte sequence can
731
+ be decoded as a surrogate character and *surrogateescape* is not equal to
732
+ zero, the byte sequence is escaped using the 'surrogateescape' error handler
733
+ instead of being decoded. *str* must end with a null character but cannot
734
+ contain embedded null characters. */
735
+
736
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
737
+ const char *str,
738
+ Py_ssize_t len,
739
+ const char *errors);
740
+
741
+ /* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string
742
+ length using strlen(). */
743
+
744
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
745
+ const char *str,
746
+ const char *errors);
747
+
748
+ /* Encode a Unicode object to the current locale encoding. The encoder is
749
+ strict is *surrogateescape* is equal to zero, otherwise the
750
+ "surrogateescape" error handler is used. Return a bytes object. The string
751
+ cannot contain embedded null characters. */
752
+
753
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
754
+ PyObject *unicode,
755
+ const char *errors
756
+ );
757
+ #endif
758
+
759
+ /* --- File system encoding ---------------------------------------------- */
760
+
761
+ /* ParseTuple converter: encode str objects to bytes using
762
+ PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */
763
+
764
+ PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
765
+
766
+ /* ParseTuple converter: decode bytes objects to unicode using
767
+ PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */
768
+
769
+ PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
770
+
771
+ /* Decode a null-terminated string using Py_FileSystemDefaultEncoding
772
+ and the "surrogateescape" error handler.
773
+
774
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
775
+ encoding.
776
+
777
+ Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
778
+ */
779
+
780
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
781
+ const char *s /* encoded string */
782
+ );
783
+
784
+ /* Decode a string using Py_FileSystemDefaultEncoding
785
+ and the "surrogateescape" error handler.
786
+
787
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
788
+ encoding.
789
+ */
790
+
791
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
792
+ const char *s, /* encoded string */
793
+ Py_ssize_t size /* size */
794
+ );
795
+
796
+ /* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
797
+ "surrogateescape" error handler, and return bytes.
798
+
799
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
800
+ encoding.
801
+ */
802
+
803
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
804
+ PyObject *unicode
805
+ );
806
+
807
+ /* --- Methods & Slots ----------------------------------------------------
808
+
809
+ These are capable of handling Unicode objects and strings on input
810
+ (we refer to them as strings in the descriptions) and return
811
+ Unicode objects or integers as appropriate. */
812
+
813
+ /* Concat two strings giving a new Unicode string. */
814
+
815
+ PyAPI_FUNC(PyObject*) PyUnicode_Concat(
816
+ PyObject *left, /* Left string */
817
+ PyObject *right /* Right string */
818
+ );
819
+
820
+ /* Concat two strings and put the result in *pleft
821
+ (sets *pleft to NULL on error) */
822
+
823
+ PyAPI_FUNC(void) PyUnicode_Append(
824
+ PyObject **pleft, /* Pointer to left string */
825
+ PyObject *right /* Right string */
826
+ );
827
+
828
+ /* Concat two strings, put the result in *pleft and drop the right object
829
+ (sets *pleft to NULL on error) */
830
+
831
+ PyAPI_FUNC(void) PyUnicode_AppendAndDel(
832
+ PyObject **pleft, /* Pointer to left string */
833
+ PyObject *right /* Right string */
834
+ );
835
+
836
+ /* Split a string giving a list of Unicode strings.
837
+
838
+ If sep is NULL, splitting will be done at all whitespace
839
+ substrings. Otherwise, splits occur at the given separator.
840
+
841
+ At most maxsplit splits will be done. If negative, no limit is set.
842
+
843
+ Separators are not included in the resulting list.
844
+
845
+ */
846
+
847
+ PyAPI_FUNC(PyObject*) PyUnicode_Split(
848
+ PyObject *s, /* String to split */
849
+ PyObject *sep, /* String separator */
850
+ Py_ssize_t maxsplit /* Maxsplit count */
851
+ );
852
+
853
+ /* Dito, but split at line breaks.
854
+
855
+ CRLF is considered to be one line break. Line breaks are not
856
+ included in the resulting list. */
857
+
858
+ PyAPI_FUNC(PyObject*) PyUnicode_Splitlines(
859
+ PyObject *s, /* String to split */
860
+ int keepends /* If true, line end markers are included */
861
+ );
862
+
863
+ /* Partition a string using a given separator. */
864
+
865
+ PyAPI_FUNC(PyObject*) PyUnicode_Partition(
866
+ PyObject *s, /* String to partition */
867
+ PyObject *sep /* String separator */
868
+ );
869
+
870
+ /* Partition a string using a given separator, searching from the end of the
871
+ string. */
872
+
873
+ PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
874
+ PyObject *s, /* String to partition */
875
+ PyObject *sep /* String separator */
876
+ );
877
+
878
+ /* Split a string giving a list of Unicode strings.
879
+
880
+ If sep is NULL, splitting will be done at all whitespace
881
+ substrings. Otherwise, splits occur at the given separator.
882
+
883
+ At most maxsplit splits will be done. But unlike PyUnicode_Split
884
+ PyUnicode_RSplit splits from the end of the string. If negative,
885
+ no limit is set.
886
+
887
+ Separators are not included in the resulting list.
888
+
889
+ */
890
+
891
+ PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
892
+ PyObject *s, /* String to split */
893
+ PyObject *sep, /* String separator */
894
+ Py_ssize_t maxsplit /* Maxsplit count */
895
+ );
896
+
897
+ /* Translate a string by applying a character mapping table to it and
898
+ return the resulting Unicode object.
899
+
900
+ The mapping table must map Unicode ordinal integers to Unicode strings,
901
+ Unicode ordinal integers or None (causing deletion of the character).
902
+
903
+ Mapping tables may be dictionaries or sequences. Unmapped character
904
+ ordinals (ones which cause a LookupError) are left untouched and
905
+ are copied as-is.
906
+
907
+ */
908
+
909
+ PyAPI_FUNC(PyObject *) PyUnicode_Translate(
910
+ PyObject *str, /* String */
911
+ PyObject *table, /* Translate table */
912
+ const char *errors /* error handling */
913
+ );
914
+
915
+ /* Join a sequence of strings using the given separator and return
916
+ the resulting Unicode string. */
917
+
918
+ PyAPI_FUNC(PyObject*) PyUnicode_Join(
919
+ PyObject *separator, /* Separator string */
920
+ PyObject *seq /* Sequence object */
921
+ );
922
+
923
+ /* Return 1 if substr matches str[start:end] at the given tail end, 0
924
+ otherwise. */
925
+
926
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch(
927
+ PyObject *str, /* String */
928
+ PyObject *substr, /* Prefix or Suffix string */
929
+ Py_ssize_t start, /* Start index */
930
+ Py_ssize_t end, /* Stop index */
931
+ int direction /* Tail end: -1 prefix, +1 suffix */
932
+ );
933
+
934
+ /* Return the first position of substr in str[start:end] using the
935
+ given search direction or -1 if not found. -2 is returned in case
936
+ an error occurred and an exception is set. */
937
+
938
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Find(
939
+ PyObject *str, /* String */
940
+ PyObject *substr, /* Substring to find */
941
+ Py_ssize_t start, /* Start index */
942
+ Py_ssize_t end, /* Stop index */
943
+ int direction /* Find direction: +1 forward, -1 backward */
944
+ );
945
+
946
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
947
+ /* Like PyUnicode_Find, but search for single character only. */
948
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_FindChar(
949
+ PyObject *str,
950
+ Py_UCS4 ch,
951
+ Py_ssize_t start,
952
+ Py_ssize_t end,
953
+ int direction
954
+ );
955
+ #endif
956
+
957
+ /* Count the number of occurrences of substr in str[start:end]. */
958
+
959
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Count(
960
+ PyObject *str, /* String */
961
+ PyObject *substr, /* Substring to count */
962
+ Py_ssize_t start, /* Start index */
963
+ Py_ssize_t end /* Stop index */
964
+ );
965
+
966
+ /* Replace at most maxcount occurrences of substr in str with replstr
967
+ and return the resulting Unicode object. */
968
+
969
+ PyAPI_FUNC(PyObject *) PyUnicode_Replace(
970
+ PyObject *str, /* String */
971
+ PyObject *substr, /* Substring to find */
972
+ PyObject *replstr, /* Substring to replace */
973
+ Py_ssize_t maxcount /* Max. number of replacements to apply;
974
+ -1 = all */
975
+ );
976
+
977
+ /* Compare two strings and return -1, 0, 1 for less than, equal,
978
+ greater than resp.
979
+ Raise an exception and return -1 on error. */
980
+
981
+ PyAPI_FUNC(int) PyUnicode_Compare(
982
+ PyObject *left, /* Left string */
983
+ PyObject *right /* Right string */
984
+ );
985
+
986
+ /* Compare a Unicode object with C string and return -1, 0, 1 for less than,
987
+ equal, and greater than, respectively. It is best to pass only
988
+ ASCII-encoded strings, but the function interprets the input string as
989
+ ISO-8859-1 if it contains non-ASCII characters.
990
+ This function does not raise exceptions. */
991
+
992
+ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
993
+ PyObject *left,
994
+ const char *right /* ASCII-encoded string */
995
+ );
996
+
997
+ /* Rich compare two strings and return one of the following:
998
+
999
+ - NULL in case an exception was raised
1000
+ - Py_True or Py_False for successful comparisons
1001
+ - Py_NotImplemented in case the type combination is unknown
1002
+
1003
+ Possible values for op:
1004
+
1005
+ Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE
1006
+
1007
+ */
1008
+
1009
+ PyAPI_FUNC(PyObject *) PyUnicode_RichCompare(
1010
+ PyObject *left, /* Left string */
1011
+ PyObject *right, /* Right string */
1012
+ int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
1013
+ );
1014
+
1015
+ /* Apply an argument tuple or dictionary to a format string and return
1016
+ the resulting Unicode string. */
1017
+
1018
+ PyAPI_FUNC(PyObject *) PyUnicode_Format(
1019
+ PyObject *format, /* Format string */
1020
+ PyObject *args /* Argument tuple or dictionary */
1021
+ );
1022
+
1023
+ /* Checks whether element is contained in container and return 1/0
1024
+ accordingly.
1025
+
1026
+ element has to coerce to a one element Unicode string. -1 is
1027
+ returned in case of an error. */
1028
+
1029
+ PyAPI_FUNC(int) PyUnicode_Contains(
1030
+ PyObject *container, /* Container string */
1031
+ PyObject *element /* Element string */
1032
+ );
1033
+
1034
+ /* Checks whether argument is a valid identifier. */
1035
+
1036
+ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
1037
+
1038
+ /* === Characters Type APIs =============================================== */
1039
+
1040
+ #ifndef Py_LIMITED_API
1041
+ # define Py_CPYTHON_UNICODEOBJECT_H
1042
+ # include "cpython/unicodeobject.h"
1043
+ # undef Py_CPYTHON_UNICODEOBJECT_H
1044
+ #endif
1045
+
1046
+ #ifdef __cplusplus
1047
+ }
1048
+ #endif
1049
+ #endif /* !Py_UNICODEOBJECT_H */
physworld_p1_20261018/envs/p1/include/python3.11/warnings.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_WARNINGS_H
2
+ #define Py_WARNINGS_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ PyAPI_FUNC(int) PyErr_WarnEx(
8
+ PyObject *category,
9
+ const char *message, /* UTF-8 encoded string */
10
+ Py_ssize_t stack_level);
11
+
12
+ PyAPI_FUNC(int) PyErr_WarnFormat(
13
+ PyObject *category,
14
+ Py_ssize_t stack_level,
15
+ const char *format, /* ASCII-encoded string */
16
+ ...);
17
+
18
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
19
+ /* Emit a ResourceWarning warning */
20
+ PyAPI_FUNC(int) PyErr_ResourceWarning(
21
+ PyObject *source,
22
+ Py_ssize_t stack_level,
23
+ const char *format, /* ASCII-encoded string */
24
+ ...);
25
+ #endif
26
+
27
+ PyAPI_FUNC(int) PyErr_WarnExplicit(
28
+ PyObject *category,
29
+ const char *message, /* UTF-8 encoded string */
30
+ const char *filename, /* decoded from the filesystem encoding */
31
+ int lineno,
32
+ const char *module, /* UTF-8 encoded string */
33
+ PyObject *registry);
34
+
35
+ #ifndef Py_LIMITED_API
36
+ # define Py_CPYTHON_WARNINGS_H
37
+ # include "cpython/warnings.h"
38
+ # undef Py_CPYTHON_WARNINGS_H
39
+ #endif
40
+
41
+ #ifdef __cplusplus
42
+ }
43
+ #endif
44
+ #endif /* !Py_WARNINGS_H */
45
+
physworld_p1_20261018/envs/p1/include/python3.11/weakrefobject.h ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Weak references objects for Python. */
2
+
3
+ #ifndef Py_WEAKREFOBJECT_H
4
+ #define Py_WEAKREFOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ typedef struct _PyWeakReference PyWeakReference;
10
+
11
+ PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
12
+ PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
13
+ PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
14
+
15
+ #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
16
+ #define PyWeakref_CheckRefExact(op) \
17
+ Py_IS_TYPE(op, &_PyWeakref_RefType)
18
+ #define PyWeakref_CheckProxy(op) \
19
+ (Py_IS_TYPE(op, &_PyWeakref_ProxyType) || \
20
+ Py_IS_TYPE(op, &_PyWeakref_CallableProxyType))
21
+
22
+ #define PyWeakref_Check(op) \
23
+ (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
24
+
25
+
26
+ PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
27
+ PyObject *callback);
28
+ PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
29
+ PyObject *callback);
30
+ PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
31
+
32
+
33
+ #ifndef Py_LIMITED_API
34
+ # define Py_CPYTHON_WEAKREFOBJECT_H
35
+ # include "cpython/weakrefobject.h"
36
+ # undef Py_CPYTHON_WEAKREFOBJECT_H
37
+ #endif
38
+
39
+ #ifdef __cplusplus
40
+ }
41
+ #endif
42
+ #endif /* !Py_WEAKREFOBJECT_H */
physworld_p1_20261018/envs/p1/include/readline/chardefs.h ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* chardefs.h -- Character definitions for readline. */
2
+
3
+ /* Copyright (C) 1994-2021 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #ifndef _CHARDEFS_H_
23
+ #define _CHARDEFS_H_
24
+
25
+ #include <ctype.h>
26
+
27
+ #if defined (HAVE_CONFIG_H)
28
+ # if defined (HAVE_STRING_H)
29
+ # include <string.h>
30
+ # endif /* HAVE_STRING_H */
31
+ # if defined (HAVE_STRINGS_H)
32
+ # include <strings.h>
33
+ # endif /* HAVE_STRINGS_H */
34
+ #else
35
+ # include <string.h>
36
+ #endif /* !HAVE_CONFIG_H */
37
+
38
+ #ifndef whitespace
39
+ #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
40
+ #endif
41
+
42
+ #ifdef CTRL
43
+ # undef CTRL
44
+ #endif
45
+ #ifdef UNCTRL
46
+ # undef UNCTRL
47
+ #endif
48
+
49
+ /* Some character stuff. */
50
+ #define control_character_threshold 0x020 /* Smaller than this is control. */
51
+ #define control_character_mask 0x1f /* 0x20 - 1 */
52
+ #define meta_character_threshold 0x07f /* Larger than this is Meta. */
53
+ #define control_character_bit 0x40 /* 0x000000, must be off. */
54
+ #define meta_character_bit 0x080 /* x0000000, must be on. */
55
+ #define largest_char 255 /* Largest character value. */
56
+
57
+ #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
58
+ #define META_CHAR(c) ((unsigned char)(c) > meta_character_threshold && (unsigned char)(c) <= largest_char)
59
+
60
+ #define CTRL(c) ((c) & control_character_mask)
61
+ #define META(c) ((c) | meta_character_bit)
62
+
63
+ #define UNMETA(c) ((c) & (~meta_character_bit))
64
+ #define UNCTRL(c) _rl_to_upper(((c)|control_character_bit))
65
+
66
+ #ifndef UCHAR_MAX
67
+ # define UCHAR_MAX 255
68
+ #endif
69
+ #ifndef CHAR_MAX
70
+ # define CHAR_MAX 127
71
+ #endif
72
+
73
+ /* use this as a proxy for C89 */
74
+ #if defined (HAVE_STDLIB_H) && defined (HAVE_STRING_H)
75
+ # define IN_CTYPE_DOMAIN(c) 1
76
+ # define NON_NEGATIVE(c) 1
77
+ #else
78
+ # define IN_CTYPE_DOMAIN(c) ((c) >= 0 && (c) <= CHAR_MAX)
79
+ # define NON_NEGATIVE(c) ((unsigned char)(c) == (c))
80
+ #endif
81
+
82
+ #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
83
+ # define isxdigit(c) (isdigit((unsigned char)(c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
84
+ #endif
85
+
86
+ /* Some systems define these; we want our definitions. */
87
+ #undef ISPRINT
88
+
89
+ /* Beware: these only work with single-byte ASCII characters. */
90
+
91
+ #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum ((unsigned char)c))
92
+ #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha ((unsigned char)c))
93
+ #define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit ((unsigned char)c))
94
+ #define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower ((unsigned char)c))
95
+ #define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint ((unsigned char)c))
96
+ #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper ((unsigned char)c))
97
+ #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit ((unsigned char)c))
98
+
99
+ #define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
100
+ #define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
101
+ #define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
102
+
103
+ #define _rl_alphabetic_p(c) (NON_NEGATIVE(c) && ISALNUM(c))
104
+ #define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c))
105
+
106
+ #ifndef _rl_to_upper
107
+ # define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)(c)) : (c))
108
+ # define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)(c)) : (c))
109
+ #endif
110
+
111
+ #ifndef _rl_digit_value
112
+ # define _rl_digit_value(x) ((x) - '0')
113
+ #endif
114
+
115
+ #ifndef _rl_isident
116
+ # define _rl_isident(c) (ISALNUM(c) || (c) == '_')
117
+ #endif
118
+
119
+ #ifndef ISOCTAL
120
+ # define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
121
+ #endif
122
+ #define OCTVALUE(c) ((c) - '0')
123
+
124
+ #define HEXVALUE(c) \
125
+ (((c) >= 'a' && (c) <= 'f') \
126
+ ? (c)-'a'+10 \
127
+ : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
128
+
129
+ #ifndef NEWLINE
130
+ #define NEWLINE '\n'
131
+ #endif
132
+
133
+ #ifndef RETURN
134
+ #define RETURN CTRL('M')
135
+ #endif
136
+
137
+ #ifndef RUBOUT
138
+ #define RUBOUT 0x7f
139
+ #endif
140
+
141
+ #ifndef TAB
142
+ #define TAB '\t'
143
+ #endif
144
+
145
+ #ifdef ABORT_CHAR
146
+ #undef ABORT_CHAR
147
+ #endif
148
+ #define ABORT_CHAR CTRL('G')
149
+
150
+ #ifdef PAGE
151
+ #undef PAGE
152
+ #endif
153
+ #define PAGE CTRL('L')
154
+
155
+ #ifdef SPACE
156
+ #undef SPACE
157
+ #endif
158
+ #define SPACE ' ' /* XXX - was 0x20 */
159
+
160
+ #ifdef ESC
161
+ #undef ESC
162
+ #endif
163
+ #define ESC CTRL('[')
164
+
165
+ #endif /* _CHARDEFS_H_ */
physworld_p1_20261018/envs/p1/include/readline/history.h ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* history.h -- the names of functions that you can call in history. */
2
+
3
+ /* Copyright (C) 1989-2023 Free Software Foundation, Inc.
4
+
5
+ This file contains the GNU History Library (History), a set of
6
+ routines for managing the text of previously typed lines.
7
+
8
+ History is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ History is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with History. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #ifndef _HISTORY_H_
23
+ #define _HISTORY_H_
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #include <time.h> /* XXX - for history timestamp code */
30
+
31
+ #if defined READLINE_LIBRARY
32
+ # include "rlstdc.h"
33
+ # include "rltypedefs.h"
34
+ #else
35
+ # include <readline/rlstdc.h>
36
+ # include <readline/rltypedefs.h>
37
+ #endif
38
+
39
+ typedef void *histdata_t;
40
+
41
+ /* Let's not step on anyone else's define for now, since we don't use this yet. */
42
+ #ifndef HS_HISTORY_VERSION
43
+ # define HS_HISTORY_VERSION 0x0803 /* History 8.3 */
44
+ #endif
45
+
46
+ /* The structure used to store a history entry. */
47
+ typedef struct _hist_entry {
48
+ char *line;
49
+ char *timestamp; /* char * rather than time_t for read/write */
50
+ histdata_t data;
51
+ } HIST_ENTRY;
52
+
53
+ #ifndef HIST_ENTRY_DEFINED
54
+ # define HIST_ENTRY_DEFINED
55
+ #endif
56
+
57
+ /* Size of the history-library-managed space in history entry HS. */
58
+ #define HISTENT_BYTES(hs) (strlen ((hs)->line) + strlen ((hs)->timestamp))
59
+
60
+ /* A structure used to pass the current state of the history stuff around. */
61
+ typedef struct _hist_state {
62
+ HIST_ENTRY **entries; /* Pointer to the entries themselves. */
63
+ int offset; /* The location pointer within this array. */
64
+ int length; /* Number of elements within this array. */
65
+ int size; /* Number of slots allocated to this array. */
66
+ int flags;
67
+ } HISTORY_STATE;
68
+
69
+ /* Flag values for the `flags' member of HISTORY_STATE. */
70
+ #define HS_STIFLED 0x01
71
+
72
+ /* Initialization and state management. */
73
+
74
+ /* Begin a session in which the history functions might be used. This
75
+ just initializes the interactive variables. */
76
+ extern void using_history (void);
77
+
78
+ /* Return the current HISTORY_STATE of the history. */
79
+ extern HISTORY_STATE *history_get_history_state (void);
80
+
81
+ /* Set the state of the current history array to STATE. */
82
+ extern void history_set_history_state (HISTORY_STATE *);
83
+
84
+ /* Manage the history list. */
85
+
86
+ /* Place STRING at the end of the history list.
87
+ The associated data field (if any) is set to NULL. */
88
+ extern void add_history (const char *);
89
+
90
+ /* Change the timestamp associated with the most recent history entry to
91
+ STRING. */
92
+ extern void add_history_time (const char *);
93
+
94
+ /* Remove an entry from the history list. WHICH is the magic number that
95
+ tells us which element to delete. The elements are numbered from 0. */
96
+ extern HIST_ENTRY *remove_history (int);
97
+
98
+ /* Remove a set of entries from the history list: FIRST to LAST, inclusive */
99
+ extern HIST_ENTRY **remove_history_range (int, int);
100
+
101
+ /* Allocate a history entry consisting of STRING and TIMESTAMP and return
102
+ a pointer to it. */
103
+ extern HIST_ENTRY *alloc_history_entry (char *, char *);
104
+
105
+ /* Copy the history entry H, but not the (opaque) data pointer */
106
+ extern HIST_ENTRY *copy_history_entry (HIST_ENTRY *);
107
+
108
+ /* Free the history entry H and return any application-specific data
109
+ associated with it. */
110
+ extern histdata_t free_history_entry (HIST_ENTRY *);
111
+
112
+ /* Make the history entry at WHICH have LINE and DATA. This returns
113
+ the old entry so you can dispose of the data. In the case of an
114
+ invalid WHICH, a NULL pointer is returned. */
115
+ extern HIST_ENTRY *replace_history_entry (int, const char *, histdata_t);
116
+
117
+ /* Clear the history list and start over. */
118
+ extern void clear_history (void);
119
+
120
+ /* Stifle the history list, remembering only MAX number of entries. */
121
+ extern void stifle_history (int);
122
+
123
+ /* Stop stifling the history. This returns the previous amount the
124
+ history was stifled by. The value is positive if the history was
125
+ stifled, negative if it wasn't. */
126
+ extern int unstifle_history (void);
127
+
128
+ /* Return 1 if the history is stifled, 0 if it is not. */
129
+ extern int history_is_stifled (void);
130
+
131
+ /* Information about the history list. */
132
+
133
+ /* Return a NULL terminated array of HIST_ENTRY which is the current input
134
+ history. Element 0 of this list is the beginning of time. If there
135
+ is no history, return NULL. */
136
+ extern HIST_ENTRY **history_list (void);
137
+
138
+ /* Returns the number which says what history element we are now
139
+ looking at. */
140
+ extern int where_history (void);
141
+
142
+ /* Return the history entry at the current position, as determined by
143
+ history_offset. If there is no entry there, return a NULL pointer. */
144
+ extern HIST_ENTRY *current_history (void);
145
+
146
+ /* Return the history entry which is logically at OFFSET in the history
147
+ array. OFFSET is relative to history_base. */
148
+ extern HIST_ENTRY *history_get (int);
149
+
150
+ /* Return the timestamp associated with the HIST_ENTRY * passed as an
151
+ argument */
152
+ extern time_t history_get_time (HIST_ENTRY *);
153
+
154
+ /* Return the number of bytes that the primary history entries are using.
155
+ This just adds up the lengths of the_history->lines. */
156
+ extern int history_total_bytes (void);
157
+
158
+ /* Moving around the history list. */
159
+
160
+ /* Set the position in the history list to POS. */
161
+ extern int history_set_pos (int);
162
+
163
+ /* Back up history_offset to the previous history entry, and return
164
+ a pointer to that entry. If there is no previous entry, return
165
+ a NULL pointer. */
166
+ extern HIST_ENTRY *previous_history (void);
167
+
168
+ /* Move history_offset forward to the next item in the input_history,
169
+ and return the a pointer to that entry. If there is no next entry,
170
+ return a NULL pointer. */
171
+ extern HIST_ENTRY *next_history (void);
172
+
173
+ /* Searching the history list. */
174
+
175
+ /* Search the history for STRING, starting at history_offset.
176
+ If DIRECTION < 0, then the search is through previous entries,
177
+ else through subsequent. If the string is found, then
178
+ current_history () is the history entry, and the value of this function
179
+ is the offset in the line of that history entry that the string was
180
+ found in. Otherwise, nothing is changed, and a -1 is returned. */
181
+ extern int history_search (const char *, int);
182
+
183
+ /* Search the history for STRING, starting at history_offset.
184
+ The search is anchored: matching lines must begin with string.
185
+ DIRECTION is as in history_search(). */
186
+ extern int history_search_prefix (const char *, int);
187
+
188
+ /* Search for STRING in the history list, starting at POS, an
189
+ absolute index into the list. DIR, if negative, says to search
190
+ backwards from POS, else forwards.
191
+ Returns the absolute index of the history element where STRING
192
+ was found, or -1 otherwise. */
193
+ extern int history_search_pos (const char *, int, int);
194
+
195
+ /* Managing the history file. */
196
+
197
+ /* Add the contents of FILENAME to the history list, a line at a time.
198
+ If FILENAME is NULL, then read from ~/.history. Returns 0 if
199
+ successful, or errno if not. */
200
+ extern int read_history (const char *);
201
+
202
+ /* Read a range of lines from FILENAME, adding them to the history list.
203
+ Start reading at the FROM'th line and end at the TO'th. If FROM
204
+ is zero, start at the beginning. If TO is less than FROM, read
205
+ until the end of the file. If FILENAME is NULL, then read from
206
+ ~/.history. Returns 0 if successful, or errno if not. */
207
+ extern int read_history_range (const char *, int, int);
208
+
209
+ /* Write the current history to FILENAME. If FILENAME is NULL,
210
+ then write the history list to ~/.history. Values returned
211
+ are as in read_history (). */
212
+ extern int write_history (const char *);
213
+
214
+ /* Append NELEMENT entries to FILENAME. The entries appended are from
215
+ the end of the list minus NELEMENTs up to the end of the list. */
216
+ extern int append_history (int, const char *);
217
+
218
+ /* Truncate the history file, leaving only the last NLINES lines. */
219
+ extern int history_truncate_file (const char *, int);
220
+
221
+ /* History expansion. */
222
+
223
+ /* Expand the string STRING, placing the result into OUTPUT, a pointer
224
+ to a string. Returns:
225
+
226
+ 0) If no expansions took place (or, if the only change in
227
+ the text was the de-slashifying of the history expansion
228
+ character)
229
+ 1) If expansions did take place
230
+ -1) If there was an error in expansion.
231
+ 2) If the returned line should just be printed.
232
+
233
+ If an error occurred in expansion, then OUTPUT contains a descriptive
234
+ error message. */
235
+ extern int history_expand (const char *, char **);
236
+
237
+ /* Extract a string segment consisting of the FIRST through LAST
238
+ arguments present in STRING. Arguments are broken up as in
239
+ the shell. */
240
+ extern char *history_arg_extract (int, int, const char *);
241
+
242
+ /* Return the text of the history event beginning at the current
243
+ offset into STRING. Pass STRING with *INDEX equal to the
244
+ history_expansion_char that begins this specification.
245
+ DELIMITING_QUOTE is a character that is allowed to end the string
246
+ specification for what to search for in addition to the normal
247
+ characters `:', ` ', `\t', `\n', and sometimes `?'. */
248
+ extern char *get_history_event (const char *, int *, int);
249
+
250
+ /* Return an array of tokens, much as the shell might. The tokens are
251
+ parsed out of STRING. */
252
+ extern char **history_tokenize (const char *);
253
+
254
+ /* Exported history variables. */
255
+ extern int history_base;
256
+ extern int history_length;
257
+ extern int history_max_entries;
258
+ extern int history_offset;
259
+
260
+ extern int history_lines_read_from_file;
261
+ extern int history_lines_written_to_file;
262
+
263
+ extern char history_expansion_char;
264
+ extern char history_subst_char;
265
+ extern char *history_word_delimiters;
266
+ extern char history_comment_char;
267
+ extern char *history_no_expand_chars;
268
+ extern char *history_search_delimiter_chars;
269
+
270
+ extern int history_quotes_inhibit_expansion;
271
+ extern int history_quoting_state;
272
+
273
+ extern int history_write_timestamps;
274
+
275
+ /* These two are undocumented; the second is reserved for future use */
276
+ extern int history_multiline_entries;
277
+ extern int history_file_version;
278
+
279
+ /* Backwards compatibility */
280
+ extern int max_input_history;
281
+
282
+ /* If set, this function is called to decide whether or not a particular
283
+ history expansion should be treated as a special case for the calling
284
+ application and not expanded. */
285
+ extern rl_linebuf_func_t *history_inhibit_expansion_function;
286
+
287
+ #ifdef __cplusplus
288
+ }
289
+ #endif
290
+
291
+ #endif /* !_HISTORY_H_ */
physworld_p1_20261018/envs/p1/include/readline/keymaps.h ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* keymaps.h -- Manipulation of readline keymaps. */
2
+
3
+ /* Copyright (C) 1987, 1989, 1992-2021 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #ifndef _KEYMAPS_H_
23
+ #define _KEYMAPS_H_
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #if defined (READLINE_LIBRARY)
30
+ # include "rlstdc.h"
31
+ # include "chardefs.h"
32
+ # include "rltypedefs.h"
33
+ #else
34
+ # include <readline/rlstdc.h>
35
+ # include <readline/chardefs.h>
36
+ # include <readline/rltypedefs.h>
37
+ #endif
38
+
39
+ /* A keymap contains one entry for each key in the ASCII set.
40
+ Each entry consists of a type and a pointer.
41
+ FUNCTION is the address of a function to run, or the
42
+ address of a keymap to indirect through.
43
+ TYPE says which kind of thing FUNCTION is. */
44
+ typedef struct _keymap_entry {
45
+ char type;
46
+ rl_command_func_t *function;
47
+ } KEYMAP_ENTRY;
48
+
49
+ /* This must be large enough to hold bindings for all of the characters
50
+ in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x,
51
+ and so on) plus one for subsequence matching. */
52
+ #define KEYMAP_SIZE 257
53
+ #define ANYOTHERKEY KEYMAP_SIZE-1
54
+
55
+ typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
56
+ typedef KEYMAP_ENTRY *Keymap;
57
+
58
+ /* The values that TYPE can have in a keymap entry. */
59
+ #define ISFUNC 0
60
+ #define ISKMAP 1
61
+ #define ISMACR 2
62
+
63
+ extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
64
+ extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
65
+
66
+ /* Return a new, empty keymap.
67
+ Free it with free() when you are done. */
68
+ extern Keymap rl_make_bare_keymap (void);
69
+
70
+ /* Return a new keymap which is a copy of MAP. */
71
+ extern Keymap rl_copy_keymap (Keymap);
72
+
73
+ /* Return a new keymap with the printing characters bound to rl_insert,
74
+ the lowercase Meta characters bound to run their equivalents, and
75
+ the Meta digits bound to produce numeric arguments. */
76
+ extern Keymap rl_make_keymap (void);
77
+
78
+ /* Free the storage associated with a keymap. */
79
+ extern void rl_discard_keymap (Keymap);
80
+
81
+ /* These functions actually appear in bind.c */
82
+
83
+ /* Return the keymap corresponding to a given name. Names look like
84
+ `emacs' or `emacs-meta' or `vi-insert'. */
85
+ extern Keymap rl_get_keymap_by_name (const char *);
86
+
87
+ /* Return the current keymap. */
88
+ extern Keymap rl_get_keymap (void);
89
+
90
+ /* Set the current keymap to MAP. */
91
+ extern void rl_set_keymap (Keymap);
92
+
93
+ /* Set the name of MAP to NAME */
94
+ extern int rl_set_keymap_name (const char *, Keymap);
95
+
96
+ #ifdef __cplusplus
97
+ }
98
+ #endif
99
+
100
+ #endif /* _KEYMAPS_H_ */
physworld_p1_20261018/envs/p1/include/readline/readline.h ADDED
@@ -0,0 +1,1012 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Readline.h -- the names of functions callable from within readline. */
2
+
3
+ /* Copyright (C) 1987-2024 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #if !defined (_READLINE_H_)
23
+ #define _READLINE_H_
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #if defined (READLINE_LIBRARY)
30
+ # include "rlstdc.h"
31
+ # include "rltypedefs.h"
32
+ # include "keymaps.h"
33
+ # include "tilde.h"
34
+ #else
35
+ # include <readline/rlstdc.h>
36
+ # include <readline/rltypedefs.h>
37
+ # include <readline/keymaps.h>
38
+ # include <readline/tilde.h>
39
+ #endif
40
+
41
+ /* Hex-encoded Readline version number. */
42
+ #define RL_READLINE_VERSION 0x0803 /* Readline 8.3 */
43
+ #define RL_VERSION_MAJOR 8
44
+ #define RL_VERSION_MINOR 3
45
+
46
+ /* Readline data structures. */
47
+
48
+ /* Maintaining the state of undo. We remember individual deletes and inserts
49
+ on a chain of things to do. */
50
+
51
+ /* The actions that undo knows how to undo. Notice that UNDO_DELETE means
52
+ to insert some text, and UNDO_INSERT means to delete some text. I.e.,
53
+ the code tells undo what to undo, not how to undo it. */
54
+ enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
55
+
56
+ /* What an element of THE_UNDO_LIST looks like. */
57
+ typedef struct undo_list {
58
+ struct undo_list *next;
59
+ int start, end; /* Where the change took place. */
60
+ char *text; /* The text to insert, if undoing a delete. */
61
+ enum undo_code what; /* Delete, Insert, Begin, End. */
62
+ } UNDO_LIST;
63
+
64
+ /* The current undo list for RL_LINE_BUFFER. */
65
+ extern UNDO_LIST *rl_undo_list;
66
+
67
+ /* The data structure for mapping textual names to code addresses. */
68
+ typedef struct _funmap {
69
+ const char *name;
70
+ rl_command_func_t *function;
71
+ } FUNMAP;
72
+
73
+ extern FUNMAP **funmap;
74
+
75
+ /* **************************************************************** */
76
+ /* */
77
+ /* Functions available to bind to key sequences */
78
+ /* */
79
+ /* **************************************************************** */
80
+
81
+ /* Bindable commands for numeric arguments. */
82
+ extern int rl_digit_argument (int, int);
83
+ extern int rl_universal_argument (int, int);
84
+
85
+ /* Bindable commands for moving the cursor. */
86
+ extern int rl_forward_byte (int, int);
87
+ extern int rl_forward_char (int, int);
88
+ extern int rl_forward (int, int);
89
+ extern int rl_backward_byte (int, int);
90
+ extern int rl_backward_char (int, int);
91
+ extern int rl_backward (int, int);
92
+ extern int rl_beg_of_line (int, int);
93
+ extern int rl_end_of_line (int, int);
94
+ extern int rl_forward_word (int, int);
95
+ extern int rl_backward_word (int, int);
96
+ extern int rl_refresh_line (int, int);
97
+ extern int rl_clear_screen (int, int);
98
+ extern int rl_clear_display (int, int);
99
+ extern int rl_skip_csi_sequence (int, int);
100
+ extern int rl_arrow_keys (int, int);
101
+
102
+ extern int rl_previous_screen_line (int, int);
103
+ extern int rl_next_screen_line (int, int);
104
+
105
+ /* Bindable commands for inserting and deleting text. */
106
+ extern int rl_insert (int, int);
107
+ extern int rl_quoted_insert (int, int);
108
+ extern int rl_tab_insert (int, int);
109
+ extern int rl_newline (int, int);
110
+ extern int rl_do_lowercase_version (int, int);
111
+ extern int rl_rubout (int, int);
112
+ extern int rl_delete (int, int);
113
+ extern int rl_rubout_or_delete (int, int);
114
+ extern int rl_delete_horizontal_space (int, int);
115
+ extern int rl_delete_or_show_completions (int, int);
116
+ extern int rl_insert_comment (int, int);
117
+
118
+ /* Bindable commands for changing case. */
119
+ extern int rl_upcase_word (int, int);
120
+ extern int rl_downcase_word (int, int);
121
+ extern int rl_capitalize_word (int, int);
122
+
123
+ /* Bindable commands for transposing characters and words. */
124
+ extern int rl_transpose_words (int, int);
125
+ extern int rl_transpose_chars (int, int);
126
+
127
+ /* Bindable commands for searching within a line. */
128
+ extern int rl_char_search (int, int);
129
+ extern int rl_backward_char_search (int, int);
130
+
131
+ /* Bindable commands for readline's interface to the command history. */
132
+ extern int rl_beginning_of_history (int, int);
133
+ extern int rl_end_of_history (int, int);
134
+ extern int rl_get_next_history (int, int);
135
+ extern int rl_get_previous_history (int, int);
136
+ extern int rl_operate_and_get_next (int, int);
137
+ extern int rl_fetch_history (int, int);
138
+
139
+ /* Bindable commands for managing the mark and region. */
140
+ extern int rl_set_mark (int, int);
141
+ extern int rl_exchange_point_and_mark (int, int);
142
+
143
+ /* Bindable commands to set the editing mode (emacs or vi). */
144
+ extern int rl_vi_editing_mode (int, int);
145
+ extern int rl_emacs_editing_mode (int, int);
146
+
147
+ /* Bindable commands to change the insert mode (insert or overwrite) */
148
+ extern int rl_overwrite_mode (int, int);
149
+
150
+ /* Bindable commands for managing key bindings. */
151
+ extern int rl_re_read_init_file (int, int);
152
+ extern int rl_dump_functions (int, int);
153
+ extern int rl_dump_macros (int, int);
154
+ extern int rl_dump_variables (int, int);
155
+
156
+ /* Bindable commands for word completion. */
157
+ extern int rl_complete (int, int);
158
+ extern int rl_possible_completions (int, int);
159
+ extern int rl_insert_completions (int, int);
160
+ extern int rl_old_menu_complete (int, int);
161
+ extern int rl_menu_complete (int, int);
162
+ extern int rl_backward_menu_complete (int, int);
163
+ extern int rl_export_completions (int, int);
164
+
165
+ /* Bindable commands for killing and yanking text, and managing the kill ring. */
166
+ extern int rl_kill_word (int, int);
167
+ extern int rl_backward_kill_word (int, int);
168
+ extern int rl_kill_line (int, int);
169
+ extern int rl_backward_kill_line (int, int);
170
+ extern int rl_kill_full_line (int, int);
171
+ extern int rl_unix_word_rubout (int, int);
172
+ extern int rl_unix_filename_rubout (int, int);
173
+ extern int rl_unix_line_discard (int, int);
174
+ extern int rl_copy_region_to_kill (int, int);
175
+ extern int rl_kill_region (int, int);
176
+ extern int rl_copy_forward_word (int, int);
177
+ extern int rl_copy_backward_word (int, int);
178
+ extern int rl_yank (int, int);
179
+ extern int rl_yank_pop (int, int);
180
+ extern int rl_yank_nth_arg (int, int);
181
+ extern int rl_yank_last_arg (int, int);
182
+ extern int rl_bracketed_paste_begin (int, int);
183
+ /* Not available unless _WIN32 is defined. */
184
+ #if defined (_WIN32)
185
+ extern int rl_paste_from_clipboard (int, int);
186
+ #endif
187
+
188
+ /* Bindable commands for incremental searching. */
189
+ extern int rl_reverse_search_history (int, int);
190
+ extern int rl_forward_search_history (int, int);
191
+
192
+ /* Bindable keyboard macro commands. */
193
+ extern int rl_start_kbd_macro (int, int);
194
+ extern int rl_end_kbd_macro (int, int);
195
+ extern int rl_call_last_kbd_macro (int, int);
196
+ extern int rl_print_last_kbd_macro (int, int);
197
+
198
+ /* Bindable undo commands. */
199
+ extern int rl_revert_line (int, int);
200
+ extern int rl_undo_command (int, int);
201
+
202
+ /* Bindable tilde expansion commands. */
203
+ extern int rl_tilde_expand (int, int);
204
+
205
+ /* Bindable terminal control commands. */
206
+ extern int rl_restart_output (int, int);
207
+ extern int rl_stop_output (int, int);
208
+
209
+ /* Miscellaneous bindable commands. */
210
+ extern int rl_abort (int, int);
211
+ extern int rl_tty_status (int, int);
212
+
213
+ extern int rl_execute_named_command (int, int);
214
+
215
+ /* Bindable commands for incremental and non-incremental history searching. */
216
+ extern int rl_history_search_forward (int, int);
217
+ extern int rl_history_search_backward (int, int);
218
+ extern int rl_history_substr_search_forward (int, int);
219
+ extern int rl_history_substr_search_backward (int, int);
220
+ extern int rl_noninc_forward_search (int, int);
221
+ extern int rl_noninc_reverse_search (int, int);
222
+ extern int rl_noninc_forward_search_again (int, int);
223
+ extern int rl_noninc_reverse_search_again (int, int);
224
+
225
+ /* Bindable command used when inserting a matching close character. */
226
+ extern int rl_insert_close (int, int);
227
+
228
+ /* Not available unless READLINE_CALLBACKS is defined. */
229
+ extern void rl_callback_handler_install (const char *, rl_vcpfunc_t *);
230
+ extern void rl_callback_read_char (void);
231
+ extern void rl_callback_handler_remove (void);
232
+ extern void rl_callback_sigcleanup (void);
233
+
234
+ /* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
235
+ /* VI-mode bindable commands. */
236
+ extern int rl_vi_redo (int, int);
237
+ extern int rl_vi_undo (int, int);
238
+ extern int rl_vi_yank_arg (int, int);
239
+ extern int rl_vi_fetch_history (int, int);
240
+ extern int rl_vi_search_again (int, int);
241
+ extern int rl_vi_search (int, int);
242
+ extern int rl_vi_complete (int, int);
243
+ extern int rl_vi_tilde_expand (int, int);
244
+ extern int rl_vi_prev_word (int, int);
245
+ extern int rl_vi_next_word (int, int);
246
+ extern int rl_vi_end_word (int, int);
247
+ extern int rl_vi_insert_beg (int, int);
248
+ extern int rl_vi_append_mode (int, int);
249
+ extern int rl_vi_append_eol (int, int);
250
+ extern int rl_vi_eof_maybe (int, int);
251
+ extern int rl_vi_insertion_mode (int, int);
252
+ extern int rl_vi_insert_mode (int, int);
253
+ extern int rl_vi_movement_mode (int, int);
254
+ extern int rl_vi_arg_digit (int, int);
255
+ extern int rl_vi_change_case (int, int);
256
+ extern int rl_vi_put (int, int);
257
+ extern int rl_vi_column (int, int);
258
+ extern int rl_vi_delete_to (int, int);
259
+ extern int rl_vi_change_to (int, int);
260
+ extern int rl_vi_yank_to (int, int);
261
+ extern int rl_vi_yank_pop (int, int);
262
+ extern int rl_vi_rubout (int, int);
263
+ extern int rl_vi_delete (int, int);
264
+ extern int rl_vi_back_to_indent (int, int);
265
+ extern int rl_vi_unix_word_rubout (int, int);
266
+ extern int rl_vi_first_print (int, int);
267
+ extern int rl_vi_char_search (int, int);
268
+ extern int rl_vi_match (int, int);
269
+ extern int rl_vi_change_char (int, int);
270
+ extern int rl_vi_subst (int, int);
271
+ extern int rl_vi_overstrike (int, int);
272
+ extern int rl_vi_overstrike_delete (int, int);
273
+ extern int rl_vi_replace (int, int);
274
+ extern int rl_vi_set_mark (int, int);
275
+ extern int rl_vi_goto_mark (int, int);
276
+
277
+ /* VI-mode utility functions. */
278
+ extern int rl_vi_check (void);
279
+ extern int rl_vi_domove (int, int *);
280
+ extern int rl_vi_bracktype (int);
281
+
282
+ extern void rl_vi_start_inserting (int, int, int);
283
+
284
+ /* VI-mode pseudo-bindable commands, used as utility functions. */
285
+ extern int rl_vi_fWord (int, int);
286
+ extern int rl_vi_bWord (int, int);
287
+ extern int rl_vi_eWord (int, int);
288
+ extern int rl_vi_fword (int, int);
289
+ extern int rl_vi_bword (int, int);
290
+ extern int rl_vi_eword (int, int);
291
+
292
+ /* **************************************************************** */
293
+ /* */
294
+ /* Well Published Functions */
295
+ /* */
296
+ /* **************************************************************** */
297
+
298
+ /* Readline functions. */
299
+ /* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */
300
+ extern char *readline (const char *);
301
+
302
+ extern int rl_set_prompt (const char *);
303
+ extern int rl_expand_prompt (char *);
304
+
305
+ extern int rl_initialize (void);
306
+
307
+ /* Undocumented; unused by readline */
308
+ extern int rl_discard_argument (void);
309
+
310
+ /* Utility functions to bind keys to readline commands. */
311
+ extern int rl_add_defun (const char *, rl_command_func_t *, int);
312
+ extern int rl_bind_key (int, rl_command_func_t *);
313
+ extern int rl_bind_key_in_map (int, rl_command_func_t *, Keymap);
314
+ extern int rl_unbind_key (int);
315
+ extern int rl_unbind_key_in_map (int, Keymap);
316
+ extern int rl_bind_key_if_unbound (int, rl_command_func_t *);
317
+ extern int rl_bind_key_if_unbound_in_map (int, rl_command_func_t *, Keymap);
318
+ extern int rl_unbind_function_in_map (rl_command_func_t *, Keymap);
319
+ extern int rl_unbind_command_in_map (const char *, Keymap);
320
+ extern int rl_bind_keyseq (const char *, rl_command_func_t *);
321
+ extern int rl_bind_keyseq_in_map (const char *, rl_command_func_t *, Keymap);
322
+ extern int rl_bind_keyseq_if_unbound (const char *, rl_command_func_t *);
323
+ extern int rl_bind_keyseq_if_unbound_in_map (const char *, rl_command_func_t *, Keymap);
324
+ extern int rl_generic_bind (int, const char *, char *, Keymap);
325
+
326
+ extern char *rl_variable_value (const char *);
327
+ extern int rl_variable_bind (const char *, const char *);
328
+
329
+ /* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
330
+ extern int rl_set_key (const char *, rl_command_func_t *, Keymap);
331
+
332
+ /* Backwards compatibility, use rl_generic_bind instead. */
333
+ extern int rl_macro_bind (const char *, const char *, Keymap);
334
+
335
+ /* Undocumented in the texinfo manual; not really useful to programs. */
336
+ extern int rl_translate_keyseq (const char *, char *, int *);
337
+ extern char *rl_untranslate_keyseq (int);
338
+
339
+ extern rl_command_func_t *rl_named_function (const char *);
340
+ extern rl_command_func_t *rl_function_of_keyseq (const char *, Keymap, int *);
341
+ extern rl_command_func_t *rl_function_of_keyseq_len (const char *, size_t, Keymap, int *);
342
+ extern int rl_trim_arg_from_keyseq (const char *, size_t, Keymap);
343
+
344
+ extern void rl_list_funmap_names (void);
345
+ extern char **rl_invoking_keyseqs_in_map (rl_command_func_t *, Keymap);
346
+ extern char **rl_invoking_keyseqs (rl_command_func_t *);
347
+
348
+ extern void rl_print_keybinding (const char *, Keymap, int);
349
+
350
+ extern void rl_function_dumper (int);
351
+ extern void rl_macro_dumper (int);
352
+ extern void rl_variable_dumper (int);
353
+
354
+ extern int rl_read_init_file (const char *);
355
+ extern int rl_parse_and_bind (char *);
356
+
357
+ /* Functions for manipulating keymaps. */
358
+ extern Keymap rl_make_bare_keymap (void);
359
+ extern int rl_empty_keymap (Keymap);
360
+ extern Keymap rl_copy_keymap (Keymap);
361
+ extern Keymap rl_make_keymap (void);
362
+ extern void rl_discard_keymap (Keymap);
363
+ extern void rl_free_keymap (Keymap);
364
+
365
+ extern Keymap rl_get_keymap_by_name (const char *);
366
+ extern char *rl_get_keymap_name (Keymap);
367
+ extern void rl_set_keymap (Keymap);
368
+ extern Keymap rl_get_keymap (void);
369
+
370
+ extern int rl_set_keymap_name (const char *, Keymap);
371
+
372
+ /* Undocumented; used internally only. */
373
+ extern void rl_set_keymap_from_edit_mode (void);
374
+ extern char *rl_get_keymap_name_from_edit_mode (void);
375
+
376
+ /* Functions for manipulating the funmap, which maps command names to functions. */
377
+ extern int rl_add_funmap_entry (const char *, rl_command_func_t *);
378
+ extern const char **rl_funmap_names (void);
379
+ /* Undocumented, only used internally -- there is only one funmap, and this
380
+ function may be called only once. */
381
+ extern void rl_initialize_funmap (void);
382
+
383
+ /* Utility functions for managing keyboard macros. */
384
+ extern void rl_push_macro_input (char *);
385
+
386
+ /* Functions for undoing, from undo.c */
387
+ extern void rl_add_undo (enum undo_code, int, int, char *);
388
+ extern void rl_free_undo_list (void);
389
+ extern int rl_do_undo (void);
390
+ extern int rl_begin_undo_group (void);
391
+ extern int rl_end_undo_group (void);
392
+ extern int rl_modifying (int, int);
393
+
394
+ /* Functions for redisplay. */
395
+ extern void rl_redisplay (void);
396
+ extern int rl_on_new_line (void);
397
+ extern int rl_on_new_line_with_prompt (void);
398
+ extern int rl_forced_update_display (void);
399
+ extern int rl_clear_visible_line (void);
400
+ extern int rl_clear_message (void);
401
+ extern int rl_reset_line_state (void);
402
+ extern int rl_crlf (void);
403
+
404
+ /* Functions to manage the mark and region, especially the notion of an
405
+ active mark and an active region. */
406
+ extern void rl_keep_mark_active (void);
407
+
408
+ extern void rl_activate_mark (void);
409
+ extern void rl_deactivate_mark (void);
410
+ extern int rl_mark_active_p (void);
411
+
412
+ extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
413
+
414
+ extern int rl_show_char (int);
415
+
416
+ /* Undocumented in texinfo manual. */
417
+ extern int rl_character_len (int, int);
418
+ extern void rl_redraw_prompt_last_line (void);
419
+
420
+ /* Save and restore internal prompt redisplay information. */
421
+ extern void rl_save_prompt (void);
422
+ extern void rl_restore_prompt (void);
423
+
424
+ /* Modifying text. */
425
+ extern void rl_replace_line (const char *, int);
426
+ extern int rl_insert_text (const char *);
427
+ extern int rl_delete_text (int, int);
428
+ extern int rl_kill_text (int, int);
429
+ extern char *rl_copy_text (int, int);
430
+
431
+ /* Terminal and tty mode management. */
432
+ extern void rl_prep_terminal (int);
433
+ extern void rl_deprep_terminal (void);
434
+ extern void rl_tty_set_default_bindings (Keymap);
435
+ extern void rl_tty_unset_default_bindings (Keymap);
436
+
437
+ extern int rl_tty_set_echoing (int);
438
+ extern int rl_reset_terminal (const char *);
439
+ extern void rl_resize_terminal (void);
440
+ extern void rl_set_screen_size (int, int);
441
+ extern void rl_get_screen_size (int *, int *);
442
+ extern void rl_reset_screen_size (void);
443
+
444
+ extern char *rl_get_termcap (const char *);
445
+ extern void rl_reparse_colors (void);
446
+
447
+ /* Functions for character input. */
448
+ extern int rl_stuff_char (int);
449
+ extern int rl_execute_next (int);
450
+ extern int rl_clear_pending_input (void);
451
+ extern int rl_read_key (void);
452
+ extern int rl_getc (FILE *);
453
+ extern int rl_set_keyboard_input_timeout (int);
454
+
455
+ /* Functions to set and reset timeouts. */
456
+ extern int rl_set_timeout (unsigned int, unsigned int);
457
+ extern int rl_timeout_remaining (unsigned int *, unsigned int *);
458
+
459
+ #undef rl_clear_timeout
460
+ #define rl_clear_timeout() rl_set_timeout (0, 0)
461
+
462
+ /* `Public' utility functions . */
463
+ extern void rl_extend_line_buffer (int);
464
+ extern int rl_ding (void);
465
+ extern int rl_alphabetic (int);
466
+ extern void rl_free (void *);
467
+
468
+ /* Readline signal handling, from signals.c */
469
+ extern int rl_set_signals (void);
470
+ extern int rl_clear_signals (void);
471
+ extern void rl_cleanup_after_signal (void);
472
+ extern void rl_reset_after_signal (void);
473
+ extern void rl_free_line_state (void);
474
+
475
+ extern int rl_pending_signal (void);
476
+ extern void rl_check_signals (void);
477
+
478
+ extern void rl_echo_signal_char (int);
479
+
480
+ extern int rl_set_paren_blink_timeout (int);
481
+
482
+ /* History management functions. */
483
+
484
+ extern void rl_clear_history (void);
485
+
486
+ /* Undocumented. */
487
+ extern int rl_maybe_save_line (void);
488
+ extern int rl_maybe_unsave_line (void);
489
+ extern int rl_maybe_replace_line (void);
490
+
491
+ /* Completion functions. */
492
+ extern int rl_complete_internal (int);
493
+ extern void rl_display_match_list (char **, int, int);
494
+
495
+ extern char **rl_completion_matches (const char *, rl_compentry_func_t *);
496
+ extern char *rl_username_completion_function (const char *, int);
497
+ extern char *rl_filename_completion_function (const char *, int);
498
+
499
+ extern int rl_completion_mode (rl_command_func_t *);
500
+
501
+ #if 0
502
+ /* Backwards compatibility (compat.c). These will go away sometime. */
503
+ extern void free_undo_list (void);
504
+ extern int maybe_save_line (void);
505
+ extern int maybe_unsave_line (void);
506
+ extern int maybe_replace_line (void);
507
+
508
+ extern int ding (void);
509
+ extern int alphabetic (int);
510
+ extern int crlf (void);
511
+
512
+ extern char **completion_matches (char *, rl_compentry_func_t *);
513
+ extern char *username_completion_function (const char *, int);
514
+ extern char *filename_completion_function (const char *, int);
515
+ #endif
516
+
517
+ /* **************************************************************** */
518
+ /* */
519
+ /* Well Published Variables */
520
+ /* */
521
+ /* **************************************************************** */
522
+
523
+ /* The version of this incarnation of the readline library. */
524
+ extern const char *rl_library_version; /* e.g., "4.2" */
525
+ extern int rl_readline_version; /* e.g., 0x0402 */
526
+
527
+ /* True if this is real GNU readline. */
528
+ extern int rl_gnu_readline_p;
529
+
530
+ /* Flags word encapsulating the current readline state. */
531
+ extern unsigned long rl_readline_state;
532
+
533
+ /* Says which editing mode readline is currently using. 1 means emacs mode;
534
+ 0 means vi mode. */
535
+ extern int rl_editing_mode;
536
+
537
+ /* Insert or overwrite mode for emacs mode. 1 means insert mode; 0 means
538
+ overwrite mode. Reset to insert mode on each input line. */
539
+ extern int rl_insert_mode;
540
+
541
+ /* The name of the calling program. You should initialize this to
542
+ whatever was in argv[0]. It is used when parsing conditionals. */
543
+ extern const char *rl_readline_name;
544
+
545
+ /* The prompt readline uses. This is set from the argument to
546
+ readline (), and should not be assigned to directly. */
547
+ extern char *rl_prompt;
548
+
549
+ /* The prompt string that is actually displayed by rl_redisplay. Public so
550
+ applications can more easily supply their own redisplay functions. */
551
+ extern char *rl_display_prompt;
552
+
553
+ /* The line buffer that is in use. */
554
+ extern char *rl_line_buffer;
555
+
556
+ /* The location of point, and end. */
557
+ extern int rl_point;
558
+ extern int rl_end;
559
+
560
+ /* The mark, or saved cursor position. */
561
+ extern int rl_mark;
562
+
563
+ /* Flag to indicate that readline has finished with the current input
564
+ line and should return it. */
565
+ extern int rl_done;
566
+
567
+ /* Flag to indicate that readline has read an EOF character or read has
568
+ returned 0 or error, and is returning a NULL line as a result. */
569
+ extern int rl_eof_found;
570
+
571
+ /* If set to a character value, that will be the next keystroke read. */
572
+ extern int rl_pending_input;
573
+
574
+ /* Non-zero if we called this function from _rl_dispatch(). It's present
575
+ so functions can find out whether they were called from a key binding
576
+ or directly from an application. */
577
+ extern int rl_dispatching;
578
+
579
+ /* Non-zero if the user typed a numeric argument before executing the
580
+ current function. */
581
+ extern int rl_explicit_arg;
582
+
583
+ /* The current value of the numeric argument specified by the user. */
584
+ extern int rl_numeric_arg;
585
+
586
+ /* The address of the last command function Readline executed. */
587
+ extern rl_command_func_t *rl_last_func;
588
+
589
+ /* The name of the terminal to use. */
590
+ extern const char *rl_terminal_name;
591
+
592
+ /* The input and output streams. */
593
+ extern FILE *rl_instream;
594
+ extern FILE *rl_outstream;
595
+
596
+ /* If non-zero, Readline gives values of LINES and COLUMNS from the environment
597
+ greater precedence than values fetched from the kernel when computing the
598
+ screen dimensions. */
599
+ extern int rl_prefer_env_winsize;
600
+
601
+ /* If non-zero, then this is the address of a function to call just
602
+ before readline_internal () prints the first prompt. */
603
+ extern rl_hook_func_t *rl_startup_hook;
604
+
605
+ /* If non-zero, this is the address of a function to call just before
606
+ readline_internal_setup () returns and readline_internal starts
607
+ reading input characters. */
608
+ extern rl_hook_func_t *rl_pre_input_hook;
609
+
610
+ /* The address of a function to call periodically while Readline is
611
+ awaiting character input, or NULL, for no event handling. */
612
+ extern rl_hook_func_t *rl_event_hook;
613
+
614
+ /* The address of a function to call if a read is interrupted by a signal. */
615
+ extern rl_hook_func_t *rl_signal_event_hook;
616
+
617
+ extern rl_hook_func_t *rl_timeout_event_hook;
618
+
619
+ /* The address of a function to call if Readline needs to know whether or not
620
+ there is data available from the current input source. */
621
+ extern rl_hook_func_t *rl_input_available_hook;
622
+
623
+ /* The address of the function to call to fetch a character from the current
624
+ Readline input stream */
625
+ extern rl_getc_func_t *rl_getc_function;
626
+
627
+ extern rl_voidfunc_t *rl_redisplay_function;
628
+
629
+ extern rl_vintfunc_t *rl_prep_term_function;
630
+ extern rl_voidfunc_t *rl_deprep_term_function;
631
+
632
+ extern rl_macro_print_func_t *rl_macro_display_hook;
633
+
634
+ /* Dispatch variables. */
635
+ extern Keymap rl_executing_keymap;
636
+ extern Keymap rl_binding_keymap;
637
+
638
+ extern int rl_executing_key;
639
+ extern char *rl_executing_keyseq;
640
+ extern int rl_key_sequence_length;
641
+
642
+ /* Display variables. */
643
+ /* If non-zero, readline will erase the entire line, including any prompt,
644
+ if the only thing typed on an otherwise-blank line is something bound to
645
+ rl_newline. */
646
+ extern int rl_erase_empty_line;
647
+
648
+ /* If non-zero, the application has already printed the prompt (rl_prompt)
649
+ before calling readline, so readline should not output it the first time
650
+ redisplay is done. */
651
+ extern int rl_already_prompted;
652
+
653
+ /* A non-zero value means to read only this many characters rather than
654
+ up to a character bound to accept-line. */
655
+ extern int rl_num_chars_to_read;
656
+
657
+ /* The text of a currently-executing keyboard macro. */
658
+ extern char *rl_executing_macro;
659
+
660
+ /* Variables to control readline signal handling. */
661
+ /* If non-zero, readline will install its own signal handlers for
662
+ SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
663
+ extern int rl_catch_signals;
664
+
665
+ /* If non-zero, readline will install a signal handler for SIGWINCH
666
+ that also attempts to call any calling application's SIGWINCH signal
667
+ handler. Note that the terminal is not cleaned up before the
668
+ application's signal handler is called; use rl_cleanup_after_signal()
669
+ to do that. */
670
+ extern int rl_catch_sigwinch;
671
+
672
+ /* If non-zero, the readline SIGWINCH handler will modify LINES and
673
+ COLUMNS in the environment. */
674
+ extern int rl_change_environment;
675
+
676
+ /* Completion variables. */
677
+ /* Pointer to the generator function for completion_matches ().
678
+ NULL means to use rl_filename_completion_function (), the default
679
+ filename completer. */
680
+ extern rl_compentry_func_t *rl_completion_entry_function;
681
+
682
+ /* Optional generator for menu completion. Default is
683
+ rl_completion_entry_function (rl_filename_completion_function). */
684
+ extern rl_compentry_func_t *rl_menu_completion_entry_function;
685
+
686
+ /* If rl_ignore_some_completions_function is non-NULL it is the address
687
+ of a function to call after all of the possible matches have been
688
+ generated, but before the actual completion is done to the input line.
689
+ The function is called with one argument; a NULL terminated array
690
+ of (char *). If your function removes any of the elements, they
691
+ must be free()'ed. */
692
+ extern rl_compignore_func_t *rl_ignore_some_completions_function;
693
+
694
+ /* Pointer to alternative function to create matches.
695
+ Function is called with TEXT, START, and END.
696
+ START and END are indices in RL_LINE_BUFFER saying what the boundaries
697
+ of TEXT are.
698
+ If this function exists and returns NULL then call the value of
699
+ rl_completion_entry_function to try to match, otherwise use the
700
+ array of strings returned. */
701
+ extern rl_completion_func_t *rl_attempted_completion_function;
702
+
703
+ /* The basic list of characters that signal a break between words for the
704
+ completer routine. The initial contents of this variable is what
705
+ breaks words in the shell, i.e. "n\"\\'`@$>". */
706
+ extern const char *rl_basic_word_break_characters;
707
+
708
+ /* The list of characters that signal a break between words for
709
+ rl_complete_internal. The default list is the contents of
710
+ rl_basic_word_break_characters. */
711
+ extern const char *rl_completer_word_break_characters;
712
+
713
+ /* Hook function to allow an application to set the completion word
714
+ break characters before readline breaks up the line. Allows
715
+ position-dependent word break characters. */
716
+ extern rl_cpvfunc_t *rl_completion_word_break_hook;
717
+
718
+ /* List of characters which can be used to quote a substring of the line.
719
+ Completion occurs on the entire substring, and within the substring
720
+ rl_completer_word_break_characters are treated as any other character,
721
+ unless they also appear within this list. */
722
+ extern const char *rl_completer_quote_characters;
723
+
724
+ /* List of quote characters which cause a word break. */
725
+ extern const char *rl_basic_quote_characters;
726
+
727
+ /* List of characters that need to be quoted in filenames by the completer. */
728
+ extern const char *rl_filename_quote_characters;
729
+
730
+ /* List of characters that are word break characters, but should be left
731
+ in TEXT when it is passed to the completion function. The shell uses
732
+ this to help determine what kind of completing to do. */
733
+ extern const char *rl_special_prefixes;
734
+
735
+ /* If non-zero, then this is the address of a function to call when
736
+ completing on a directory name. The function is called with
737
+ the address of a string (the current directory name) as an arg. It
738
+ changes what is displayed when the possible completions are printed
739
+ or inserted. The directory completion hook should perform
740
+ any necessary dequoting. This function should return 1 if it modifies
741
+ the directory name pointer passed as an argument. If the directory
742
+ completion hook returns 0, it should not modify the directory name
743
+ pointer passed as an argument. */
744
+ extern rl_icppfunc_t *rl_directory_completion_hook;
745
+
746
+ /* If non-zero, this is the address of a function to call when completing
747
+ a directory name. This function takes the address of the directory name
748
+ to be modified as an argument. Unlike rl_directory_completion_hook, it
749
+ only modifies the directory name used in opendir(2), not what is displayed
750
+ when the possible completions are printed or inserted. If set, it takes
751
+ precedence over rl_directory_completion_hook. The directory rewrite
752
+ hook should perform any necessary dequoting. This function has the same
753
+ return value properties as the directory_completion_hook.
754
+
755
+ I'm not happy with how this works yet, so it's undocumented. I'm trying
756
+ it in bash to see how well it goes. */
757
+ extern rl_icppfunc_t *rl_directory_rewrite_hook;
758
+
759
+ /* If non-zero, this is the address of a function for the completer to call
760
+ before deciding which character to append to a completed name. It should
761
+ modify the directory name passed as an argument if appropriate, and return
762
+ non-zero if it modifies the name. This should not worry about dequoting
763
+ the filename; that has already happened by the time it gets here. */
764
+ extern rl_icppfunc_t *rl_filename_stat_hook;
765
+
766
+ /* If non-zero, this is the address of a function to call when reading
767
+ directory entries from the filesystem for completion and comparing
768
+ them to the partial word to be completed. The function should
769
+ either return its first argument (if no conversion takes place) or
770
+ newly-allocated memory. This can, for instance, convert filenames
771
+ between character sets for comparison against what's typed at the
772
+ keyboard. The returned value is what is added to the list of
773
+ matches. The second argument is the length of the filename to be
774
+ converted. */
775
+ extern rl_dequote_func_t *rl_filename_rewrite_hook;
776
+
777
+ /* If non-zero, this is the address of a function to call before
778
+ comparing the filename portion of a word to be completed with directory
779
+ entries from the filesystem. This takes the address of the partial word
780
+ to be completed, after any rl_filename_dequoting_function has been applied.
781
+ The function should either return its first argument (if no conversion
782
+ takes place) or newly-allocated memory. This can, for instance, convert
783
+ the filename portion of the completion word to a character set suitable
784
+ for comparison against directory entries read from the filesystem (after
785
+ their potential modification by rl_filename_rewrite_hook).
786
+ The returned value is what is added to the list of matches.
787
+ The second argument is the length of the filename to be converted. */
788
+ extern rl_dequote_func_t *rl_completion_rewrite_hook;
789
+
790
+ /* Backwards compatibility with previous versions of readline. */
791
+ #define rl_symbolic_link_hook rl_directory_completion_hook
792
+
793
+ /* If non-zero, then this is the address of a function to call when
794
+ completing a word would normally display the list of possible matches.
795
+ This function is called instead of actually doing the display.
796
+ It takes three arguments: (char **matches, int num_matches, int max_length)
797
+ where MATCHES is the array of strings that matched, NUM_MATCHES is the
798
+ number of strings in that array, and MAX_LENGTH is the length of the
799
+ longest string in that array. */
800
+ extern rl_compdisp_func_t *rl_completion_display_matches_hook;
801
+
802
+ /* Non-zero means that the results of the matches are to be treated
803
+ as filenames. This is ALWAYS zero on entry, and can only be changed
804
+ within a completion entry finder function. */
805
+ extern int rl_filename_completion_desired;
806
+
807
+ /* Non-zero means that the results of the matches are to be quoted using
808
+ double quotes (or an application-specific quoting mechanism) if the
809
+ filename contains any characters in rl_word_break_chars. This is
810
+ ALWAYS non-zero on entry, and can only be changed within a completion
811
+ entry finder function. */
812
+ extern int rl_filename_quoting_desired;
813
+
814
+ /* Non-zero means we should apply filename-type quoting to all completions
815
+ even if we are not otherwise treating the matches as filenames. This is
816
+ ALWAYS zero on entry, and can only be changed within a completion entry
817
+ finder function. */
818
+ extern int rl_full_quoting_desired;
819
+
820
+ /* Set to a function to quote a filename in an application-specific fashion.
821
+ Called with the text to quote, the type of match found (single or multiple)
822
+ and a pointer to the quoting character to be used, which the function can
823
+ reset if desired. */
824
+ extern rl_quote_func_t *rl_filename_quoting_function;
825
+
826
+ /* Function to call to remove quoting characters from a filename. Called
827
+ before completion is attempted, so the embedded quotes do not interfere
828
+ with matching names in the file system. */
829
+ extern rl_dequote_func_t *rl_filename_dequoting_function;
830
+
831
+ /* Function to call to decide whether or not a word break character is
832
+ quoted. If a character is quoted, it does not break words for the
833
+ completer. */
834
+ extern rl_linebuf_func_t *rl_char_is_quoted_p;
835
+
836
+ /* Non-zero means to suppress normal filename completion after the
837
+ user-specified completion function has been called. */
838
+ extern int rl_attempted_completion_over;
839
+
840
+ /* Set to a character describing the type of completion being attempted by
841
+ rl_complete_internal; available for use by application completion
842
+ functions. */
843
+ extern int rl_completion_type;
844
+
845
+ /* Set to the last key used to invoke one of the completion functions */
846
+ extern int rl_completion_invoking_key;
847
+
848
+ /* Up to this many items will be displayed in response to a
849
+ possible-completions call. After that, we ask the user if she
850
+ is sure she wants to see them all. The default value is 100. */
851
+ extern int rl_completion_query_items;
852
+
853
+ /* Character appended to completed words when at the end of the line. The
854
+ default is a space. Nothing is added if this is '\0'. */
855
+ extern int rl_completion_append_character;
856
+
857
+ /* If set to non-zero by an application completion function,
858
+ rl_completion_append_character will not be appended. */
859
+ extern int rl_completion_suppress_append;
860
+
861
+ /* Set to any quote character readline thinks it finds before any application
862
+ completion function is called. */
863
+ extern int rl_completion_quote_character;
864
+
865
+ /* Set to a non-zero value if readline found quoting anywhere in the word to
866
+ be completed; set before any application completion function is called. */
867
+ extern int rl_completion_found_quote;
868
+
869
+ /* If non-zero, the completion functions don't append any closing quote.
870
+ This is set to 0 by rl_complete_internal and may be changed by an
871
+ application-specific completion function. */
872
+ extern int rl_completion_suppress_quote;
873
+
874
+ /* If non-zero, readline will sort the completion matches. On by default. */
875
+ extern int rl_sort_completion_matches;
876
+
877
+ /* If non-zero, a slash will be appended to completed filenames that are
878
+ symbolic links to directory names, subject to the value of the
879
+ mark-directories variable (which is user-settable). This exists so
880
+ that application completion functions can override the user's preference
881
+ (set via the mark-symlinked-directories variable) if appropriate.
882
+ It's set to the value of _rl_complete_mark_symlink_dirs in
883
+ rl_complete_internal before any application-specific completion
884
+ function is called, so without that function doing anything, the user's
885
+ preferences are honored. */
886
+ extern int rl_completion_mark_symlink_dirs;
887
+
888
+ /* If non-zero, then disallow duplicates in the matches. */
889
+ extern int rl_ignore_completion_duplicates;
890
+
891
+ /* If this is non-zero, completion is (temporarily) inhibited, and the
892
+ completion character will be inserted as any other. */
893
+ extern int rl_inhibit_completion;
894
+
895
+ /* Applications can set this to non-zero to have readline's signal handlers
896
+ installed during the entire duration of reading a complete line, as in
897
+ readline-6.2. This should be used with care, because it can result in
898
+ readline receiving signals and not handling them until it's called again
899
+ via rl_callback_read_char, thereby stealing them from the application.
900
+ By default, signal handlers are only active while readline is active. */
901
+ extern int rl_persistent_signal_handlers;
902
+
903
+ /* Input error; can be returned by (*rl_getc_function) if readline is reading
904
+ a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */
905
+ #define READERR (-2)
906
+
907
+ /* Definitions available for use by readline clients. */
908
+ #define RL_PROMPT_START_IGNORE '\001'
909
+ #define RL_PROMPT_END_IGNORE '\002'
910
+
911
+ /* Possible values for do_replace argument to rl_filename_quoting_function,
912
+ called by rl_complete_internal. */
913
+ #define NO_MATCH 0
914
+ #define SINGLE_MATCH 1
915
+ #define MULT_MATCH 2
916
+
917
+ /* Possible state values for rl_readline_state */
918
+ #define RL_STATE_NONE 0x0000000 /* no state; before first call */
919
+
920
+ #define RL_STATE_INITIALIZING 0x00000001 /* initializing */
921
+ #define RL_STATE_INITIALIZED 0x00000002 /* initialization done */
922
+ #define RL_STATE_TERMPREPPED 0x00000004 /* terminal is prepped */
923
+ #define RL_STATE_READCMD 0x00000008 /* reading a command key */
924
+ #define RL_STATE_METANEXT 0x00000010 /* reading input after ESC */
925
+ #define RL_STATE_DISPATCHING 0x00000020 /* dispatching to a command */
926
+ #define RL_STATE_MOREINPUT 0x00000040 /* reading more input in a command function */
927
+ #define RL_STATE_ISEARCH 0x00000080 /* doing incremental search */
928
+ #define RL_STATE_NSEARCH 0x00000100 /* doing non-inc search */
929
+ #define RL_STATE_SEARCH 0x00000200 /* doing a history search */
930
+ #define RL_STATE_NUMERICARG 0x00000400 /* reading numeric argument */
931
+ #define RL_STATE_MACROINPUT 0x00000800 /* getting input from a macro */
932
+ #define RL_STATE_MACRODEF 0x00001000 /* defining keyboard macro */
933
+ #define RL_STATE_OVERWRITE 0x00002000 /* overwrite mode */
934
+ #define RL_STATE_COMPLETING 0x00004000 /* doing completion */
935
+ #define RL_STATE_SIGHANDLER 0x00008000 /* in readline sighandler */
936
+ #define RL_STATE_UNDOING 0x00010000 /* doing an undo */
937
+ #define RL_STATE_INPUTPENDING 0x00020000 /* rl_execute_next called */
938
+ #define RL_STATE_TTYCSAVED 0x00040000 /* tty special chars saved */
939
+ #define RL_STATE_CALLBACK 0x00080000 /* using the callback interface */
940
+ #define RL_STATE_VIMOTION 0x00100000 /* reading vi motion arg */
941
+ #define RL_STATE_MULTIKEY 0x00200000 /* reading multiple-key command */
942
+ #define RL_STATE_VICMDONCE 0x00400000 /* entered vi command mode at least once */
943
+ #define RL_STATE_CHARSEARCH 0x00800000 /* vi mode char search */
944
+ #define RL_STATE_REDISPLAYING 0x01000000 /* updating terminal display */
945
+
946
+ #define RL_STATE_DONE 0x02000000 /* done; accepted line */
947
+ #define RL_STATE_TIMEOUT 0x04000000 /* done; timed out */
948
+ #define RL_STATE_EOF 0x08000000 /* done; got eof on read */
949
+
950
+ /* Rearrange these for next major version */
951
+ #define RL_STATE_READSTR 0x10000000 /* reading a string for M-x */
952
+
953
+ #define RL_SETSTATE(x) (rl_readline_state |= (x))
954
+ #define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
955
+ #define RL_ISSTATE(x) (rl_readline_state & (x))
956
+
957
+ struct readline_state {
958
+ /* line state */
959
+ int point;
960
+ int end;
961
+ int mark;
962
+ int buflen;
963
+ char *buffer;
964
+ UNDO_LIST *ul;
965
+ char *prompt;
966
+
967
+ /* global state */
968
+ int rlstate; /* XXX -- needs to be unsigned long */
969
+ int done;
970
+ Keymap kmap;
971
+
972
+ /* input state */
973
+ rl_command_func_t *lastfunc;
974
+ int insmode;
975
+ int edmode;
976
+ char *kseq;
977
+ int kseqlen;
978
+
979
+ int pendingin;
980
+ FILE *inf;
981
+ FILE *outf;
982
+ char *macro;
983
+
984
+ /* signal state */
985
+ int catchsigs;
986
+ int catchsigwinch;
987
+
988
+ /* search state */
989
+
990
+ /* completion state */
991
+ rl_compentry_func_t *entryfunc;
992
+ rl_compentry_func_t *menuentryfunc;
993
+ rl_compignore_func_t *ignorefunc;
994
+ rl_completion_func_t *attemptfunc;
995
+ const char *wordbreakchars;
996
+
997
+ /* options state */
998
+
999
+ /* hook state */
1000
+
1001
+ /* reserved for future expansion, so the struct size doesn't change */
1002
+ char reserved[64];
1003
+ };
1004
+
1005
+ extern int rl_save_state (struct readline_state *);
1006
+ extern int rl_restore_state (struct readline_state *);
1007
+
1008
+ #ifdef __cplusplus
1009
+ }
1010
+ #endif
1011
+
1012
+ #endif /* _READLINE_H_ */
physworld_p1_20261018/envs/p1/include/readline/rlconf.h ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* rlconf.h -- readline configuration definitions */
2
+
3
+ /* Copyright (C) 1992-2015 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #if !defined (_RLCONF_H_)
23
+ #define _RLCONF_H_
24
+
25
+ /* Define this if you want the vi-mode editing available. */
26
+ #define VI_MODE
27
+
28
+ /* Define this to get an indication of file type when listing completions. */
29
+ #define VISIBLE_STATS
30
+
31
+ /* Define this to get support for colors when listing completions and in
32
+ other places. */
33
+ #define COLOR_SUPPORT
34
+
35
+ /* This definition is needed by readline.c, rltty.c, and signals.c. */
36
+ /* If on, then readline handles signals in a way that doesn't suck. */
37
+ #define HANDLE_SIGNALS
38
+
39
+ /* Ugly but working hack for binding prefix meta. */
40
+ #define PREFIX_META_HACK
41
+
42
+ /* The next-to-last-ditch effort file name for a user-specific init file. */
43
+ #define DEFAULT_INPUTRC "~/.inputrc"
44
+
45
+ /* The ultimate last-ditch filename for an init file -- system-wide. */
46
+ #define SYS_INPUTRC "/etc/inputrc"
47
+
48
+ /* If defined, expand tabs to spaces. */
49
+ #define DISPLAY_TABS
50
+
51
+ /* If defined, use the terminal escape sequence to move the cursor forward
52
+ over a character when updating the line rather than rewriting it. */
53
+ /* #define HACK_TERMCAP_MOTION */
54
+
55
+ /* The string inserted by the `insert comment' command. */
56
+ #define RL_COMMENT_BEGIN_DEFAULT "#"
57
+
58
+ /* Define this if you want code that allows readline to be used in an
59
+ X `callback' style. */
60
+ #define READLINE_CALLBACKS
61
+
62
+ /* Define this if you want the cursor to indicate insert or overwrite mode. */
63
+ /* #define CURSOR_MODE */
64
+
65
+ /* Define this if you want to enable code that talks to the Linux kernel
66
+ tty auditing system. */
67
+ /* #define ENABLE_TTY_AUDIT_SUPPORT */
68
+
69
+ /* Defaults for the various editing mode indicators, inserted at the beginning
70
+ of the last (maybe only) line of the prompt if show-mode-in-prompt is on */
71
+ #define RL_EMACS_MODESTR_DEFAULT "@"
72
+ #define RL_EMACS_MODESTR_DEFLEN 1
73
+
74
+ #define RL_VI_INS_MODESTR_DEFAULT "(ins)"
75
+ #define RL_VI_INS_MODESTR_DEFLEN 5
76
+ #define RL_VI_CMD_MODESTR_DEFAULT "(cmd)"
77
+ #define RL_VI_CMD_MODESTR_DEFLEN 5
78
+
79
+ /* Do you want readline to assume it's running in an ANSI-compatible terminal
80
+ by default? If set to 0, readline tries to check and verify whether or not
81
+ it is. */
82
+ #define RL_ANSI_TERM_DEFAULT 1 /* for now */
83
+
84
+ #endif /* _RLCONF_H_ */
physworld_p1_20261018/envs/p1/include/readline/rlstdc.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */
2
+
3
+ /* Copyright (C) 1993-2009,2023 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #if !defined (_RL_STDC_H_)
23
+ #define _RL_STDC_H_
24
+
25
+ /* Adapted from BSD /usr/include/sys/cdefs.h. */
26
+
27
+ /* A function can be defined using prototypes and compile on both ANSI C
28
+ and traditional C compilers with something like this:
29
+ extern char *func PARAMS((char *, char *, int)); */
30
+
31
+ #if !defined (PARAMS)
32
+ # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
33
+ # define PARAMS(protos) protos
34
+ # else
35
+ # define PARAMS(protos) ()
36
+ # endif
37
+ #endif
38
+
39
+ #ifndef __attribute__
40
+ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
41
+ # define __attribute__(x)
42
+ # endif
43
+ #endif
44
+
45
+ #endif /* !_RL_STDC_H_ */
physworld_p1_20261018/envs/p1/include/readline/rltypedefs.h ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* rltypedefs.h -- Type declarations for readline functions. */
2
+
3
+ /* Copyright (C) 2000-2023 Free Software Foundation, Inc.
4
+
5
+ This file is part of the GNU Readline Library (Readline), a library
6
+ for reading lines of text with interactive input and history editing.
7
+
8
+ Readline is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ Readline is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #ifndef _RL_TYPEDEFS_H_
23
+ #define _RL_TYPEDEFS_H_
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ /* Old-style, attempt to mark as deprecated in some way people will notice. */
30
+
31
+ #if !defined (_FUNCTION_DEF) && defined (WANT_OBSOLETE_TYPEDEFS)
32
+ # define _FUNCTION_DEF
33
+
34
+ typedef int Function () __attribute__((deprecated));
35
+ typedef void VFunction () __attribute__((deprecated));
36
+ typedef char *CPFunction () __attribute__((deprecated));
37
+ typedef char **CPPFunction () __attribute__((deprecated));
38
+
39
+ #endif /* _FUNCTION_DEF && WANT_OBSOLETE_TYPEDEFS */
40
+
41
+ /* New style. */
42
+
43
+ #if !defined (_RL_FUNCTION_TYPEDEF)
44
+ # define _RL_FUNCTION_TYPEDEF
45
+
46
+ /* Bindable functions */
47
+ typedef int rl_command_func_t (int, int);
48
+
49
+ /* Typedefs for the completion system */
50
+ typedef char *rl_compentry_func_t (const char *, int);
51
+ typedef char **rl_completion_func_t (const char *, int, int);
52
+
53
+ typedef char *rl_quote_func_t (char *, int, char *);
54
+ typedef char *rl_dequote_func_t (char *, int);
55
+
56
+ typedef int rl_compignore_func_t (char **);
57
+
58
+ typedef void rl_compdisp_func_t (char **, int, int);
59
+
60
+ /* Functions for displaying key bindings. Currently only one. */
61
+ typedef void rl_macro_print_func_t (const char *, const char *, int, const char *);
62
+
63
+ /* Type for input and pre-read hook functions like rl_event_hook */
64
+ typedef int rl_hook_func_t (void);
65
+
66
+ /* Input function type */
67
+ typedef int rl_getc_func_t (FILE *);
68
+
69
+ /* Generic function that takes a character buffer (which could be the readline
70
+ line buffer) and an index into it (which could be rl_point) and returns
71
+ an int. */
72
+ typedef int rl_linebuf_func_t (char *, int);
73
+
74
+ /* `Generic' function pointer typedefs */
75
+ typedef int rl_intfunc_t (int);
76
+ #define rl_ivoidfunc_t rl_hook_func_t
77
+ typedef int rl_icpfunc_t (char *);
78
+ typedef int rl_icppfunc_t (char **);
79
+
80
+ typedef void rl_voidfunc_t (void);
81
+ typedef void rl_vintfunc_t (int);
82
+ typedef void rl_vcpfunc_t (char *);
83
+ typedef void rl_vcppfunc_t (char **);
84
+
85
+ typedef char *rl_cpvfunc_t (void);
86
+ typedef char *rl_cpifunc_t (int);
87
+ typedef char *rl_cpcpfunc_t (char *);
88
+ typedef char *rl_cpcppfunc_t (char **);
89
+
90
+ #endif /* _RL_FUNCTION_TYPEDEF */
91
+
92
+ #ifdef __cplusplus
93
+ }
94
+ #endif
95
+
96
+ #endif /* _RL_TYPEDEFS_H_ */
physworld_p1_20261018/envs/p1/include/readline/tilde.h ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* tilde.h: Externally available variables and function in libtilde.a. */
2
+
3
+ /* Copyright (C) 1992-2009,2021 Free Software Foundation, Inc.
4
+
5
+ This file contains the Readline Library (Readline), a set of
6
+ routines for providing Emacs style line input to programs that ask
7
+ for it.
8
+
9
+ Readline is free software: you can redistribute it and/or modify
10
+ it under the terms of the GNU General Public License as published by
11
+ the Free Software Foundation, either version 3 of the License, or
12
+ (at your option) any later version.
13
+
14
+ Readline is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ GNU General Public License for more details.
18
+
19
+ You should have received a copy of the GNU General Public License
20
+ along with Readline. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+
23
+ #if !defined (_TILDE_H_)
24
+ # define _TILDE_H_
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+ typedef char *tilde_hook_func_t (char *);
31
+
32
+ /* If non-null, this contains the address of a function that the application
33
+ wants called before trying the standard tilde expansions. The function
34
+ is called with the text sans tilde, and returns a malloc()'ed string
35
+ which is the expansion, or a NULL pointer if the expansion fails. */
36
+ extern tilde_hook_func_t *tilde_expansion_preexpansion_hook;
37
+
38
+ /* If non-null, this contains the address of a function to call if the
39
+ standard meaning for expanding a tilde fails. The function is called
40
+ with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
41
+ which is the expansion, or a NULL pointer if there is no expansion. */
42
+ extern tilde_hook_func_t *tilde_expansion_failure_hook;
43
+
44
+ /* When non-null, this is a NULL terminated array of strings which
45
+ are duplicates for a tilde prefix. Bash uses this to expand
46
+ `=~' and `:~'. */
47
+ extern char **tilde_additional_prefixes;
48
+
49
+ /* When non-null, this is a NULL terminated array of strings which match
50
+ the end of a username, instead of just "/". Bash sets this to
51
+ `:' and `=~'. */
52
+ extern char **tilde_additional_suffixes;
53
+
54
+ /* Return a new string which is the result of tilde expanding STRING. */
55
+ extern char *tilde_expand (const char *);
56
+
57
+ /* Do the work of tilde expansion on FILENAME. FILENAME starts with a
58
+ tilde. If there is no expansion, call tilde_expansion_failure_hook. */
59
+ extern char *tilde_expand_word (const char *);
60
+
61
+ /* Find the portion of the string beginning with ~ that should be expanded. */
62
+ extern char *tilde_find_word (const char *, int, int *);
63
+
64
+ #ifdef __cplusplus
65
+ }
66
+ #endif
67
+
68
+ #endif /* _TILDE_H_ */
physworld_p1_20261018/envs/p1/include/rpcsvc/yp.h ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Please do not edit this file.
3
+ * It was generated using rpcgen.
4
+ */
5
+
6
+ #ifndef __RPCSVC_YP_H__
7
+ #define __RPCSVC_YP_H__
8
+
9
+ #include <rpc/rpc.h>
10
+
11
+ #define YPMAXRECORD 1024
12
+ #define YPMAXDOMAIN 256
13
+ #define YPMAXMAP 64
14
+ #define YPMAXPEER 64
15
+
16
+ enum ypstat {
17
+ YP_TRUE = 1,
18
+ YP_NOMORE = 2,
19
+ YP_FALSE = 0,
20
+ YP_NOMAP = -1,
21
+ YP_NODOM = -2,
22
+ YP_NOKEY = -3,
23
+ YP_BADOP = -4,
24
+ YP_BADDB = -5,
25
+ YP_YPERR = -6,
26
+ YP_BADARGS = -7,
27
+ YP_VERS = -8,
28
+ };
29
+ typedef enum ypstat ypstat;
30
+
31
+ enum ypxfrstat {
32
+ YPXFR_SUCC = 1,
33
+ YPXFR_AGE = 2,
34
+ YPXFR_NOMAP = -1,
35
+ YPXFR_NODOM = -2,
36
+ YPXFR_RSRC = -3,
37
+ YPXFR_RPC = -4,
38
+ YPXFR_MADDR = -5,
39
+ YPXFR_YPERR = -6,
40
+ YPXFR_BADARGS = -7,
41
+ YPXFR_DBM = -8,
42
+ YPXFR_FILE = -9,
43
+ YPXFR_SKEW = -10,
44
+ YPXFR_CLEAR = -11,
45
+ YPXFR_FORCE = -12,
46
+ YPXFR_XFRERR = -13,
47
+ YPXFR_REFUSED = -14,
48
+ };
49
+ typedef enum ypxfrstat ypxfrstat;
50
+
51
+ typedef char *domainname;
52
+ typedef char *mapname;
53
+ typedef char *peername;
54
+
55
+ typedef struct {
56
+ u_int keydat_len;
57
+ char *keydat_val;
58
+ } keydat;
59
+
60
+ typedef struct {
61
+ u_int valdat_len;
62
+ char *valdat_val;
63
+ } valdat;
64
+
65
+ struct ypmap_parms {
66
+ domainname domain;
67
+ mapname map;
68
+ u_int ordernum;
69
+ peername peer;
70
+ };
71
+ typedef struct ypmap_parms ypmap_parms;
72
+
73
+ struct ypreq_key {
74
+ domainname domain;
75
+ mapname map;
76
+ keydat key;
77
+ };
78
+ typedef struct ypreq_key ypreq_key;
79
+
80
+ struct ypreq_nokey {
81
+ domainname domain;
82
+ mapname map;
83
+ };
84
+ typedef struct ypreq_nokey ypreq_nokey;
85
+
86
+ struct ypreq_xfr {
87
+ ypmap_parms map_parms;
88
+ u_int transid;
89
+ u_int prog;
90
+ u_int port;
91
+ };
92
+ typedef struct ypreq_xfr ypreq_xfr;
93
+
94
+ struct ypresp_val {
95
+ ypstat stat;
96
+ valdat val;
97
+ };
98
+ typedef struct ypresp_val ypresp_val;
99
+
100
+ struct ypresp_key_val {
101
+ ypstat stat;
102
+ valdat val;
103
+ keydat key;
104
+ };
105
+ typedef struct ypresp_key_val ypresp_key_val;
106
+
107
+ struct ypresp_master {
108
+ ypstat stat;
109
+ peername peer;
110
+ };
111
+ typedef struct ypresp_master ypresp_master;
112
+
113
+ struct ypresp_order {
114
+ ypstat stat;
115
+ u_int ordernum;
116
+ };
117
+ typedef struct ypresp_order ypresp_order;
118
+
119
+ struct ypresp_all {
120
+ bool_t more;
121
+ union {
122
+ ypresp_key_val val;
123
+ } ypresp_all_u;
124
+ };
125
+ typedef struct ypresp_all ypresp_all;
126
+
127
+ struct ypresp_xfr {
128
+ u_int transid;
129
+ ypxfrstat xfrstat;
130
+ };
131
+ typedef struct ypresp_xfr ypresp_xfr;
132
+
133
+ struct ypmaplist {
134
+ mapname map;
135
+ struct ypmaplist *next;
136
+ };
137
+ typedef struct ypmaplist ypmaplist;
138
+
139
+ struct ypresp_maplist {
140
+ ypstat stat;
141
+ ypmaplist *maps;
142
+ };
143
+ typedef struct ypresp_maplist ypresp_maplist;
144
+
145
+ enum yppush_status {
146
+ YPPUSH_SUCC = 1,
147
+ YPPUSH_AGE = 2,
148
+ YPPUSH_NOMAP = -1,
149
+ YPPUSH_NODOM = -2,
150
+ YPPUSH_RSRC = -3,
151
+ YPPUSH_RPC = -4,
152
+ YPPUSH_MADDR = -5,
153
+ YPPUSH_YPERR = -6,
154
+ YPPUSH_BADARGS = -7,
155
+ YPPUSH_DBM = -8,
156
+ YPPUSH_FILE = -9,
157
+ YPPUSH_SKEW = -10,
158
+ YPPUSH_CLEAR = -11,
159
+ YPPUSH_FORCE = -12,
160
+ YPPUSH_XFRERR = -13,
161
+ YPPUSH_REFUSED = -14,
162
+ };
163
+ typedef enum yppush_status yppush_status;
164
+
165
+ struct yppushresp_xfr {
166
+ u_int transid;
167
+ yppush_status status;
168
+ };
169
+ typedef struct yppushresp_xfr yppushresp_xfr;
170
+
171
+ enum ypbind_resptype {
172
+ YPBIND_SUCC_VAL = 1,
173
+ YPBIND_FAIL_VAL = 2,
174
+ };
175
+ typedef enum ypbind_resptype ypbind_resptype;
176
+
177
+ struct ypbind_binding {
178
+ char ypbind_binding_addr[4];
179
+ char ypbind_binding_port[2];
180
+ };
181
+ typedef struct ypbind_binding ypbind_binding;
182
+
183
+ struct ypbind_resp {
184
+ ypbind_resptype ypbind_status;
185
+ union {
186
+ u_int ypbind_error;
187
+ ypbind_binding ypbind_bindinfo;
188
+ } ypbind_resp_u;
189
+ };
190
+ typedef struct ypbind_resp ypbind_resp;
191
+
192
+ #define YPBIND_ERR_ERR 1
193
+ #define YPBIND_ERR_NOSERV 2
194
+ #define YPBIND_ERR_RESC 3
195
+
196
+ struct ypbind_setdom {
197
+ domainname ypsetdom_domain;
198
+ ypbind_binding ypsetdom_binding;
199
+ u_int ypsetdom_vers;
200
+ };
201
+ typedef struct ypbind_setdom ypbind_setdom;
202
+
203
+ #define YPPROG 100004
204
+ #define YPVERS 2
205
+
206
+ #ifdef __cplusplus
207
+ extern "C" {
208
+ #endif
209
+
210
+ #define YPPROC_NULL 0
211
+ extern void * ypproc_null_2(void *, CLIENT *);
212
+ extern void * ypproc_null_2_svc(void *, struct svc_req *);
213
+ #define YPPROC_DOMAIN 1
214
+ extern bool_t * ypproc_domain_2(domainname *, CLIENT *);
215
+ extern bool_t * ypproc_domain_2_svc(domainname *, struct svc_req *);
216
+ #define YPPROC_DOMAIN_NONACK 2
217
+ extern bool_t * ypproc_domain_nonack_2(domainname *, CLIENT *);
218
+ extern bool_t * ypproc_domain_nonack_2_svc(domainname *, struct svc_req *);
219
+ #define YPPROC_MATCH 3
220
+ extern ypresp_val * ypproc_match_2(ypreq_key *, CLIENT *);
221
+ extern ypresp_val * ypproc_match_2_svc(ypreq_key *, struct svc_req *);
222
+ #define YPPROC_FIRST 4
223
+ extern ypresp_key_val * ypproc_first_2(ypreq_key *, CLIENT *);
224
+ extern ypresp_key_val * ypproc_first_2_svc(ypreq_key *, struct svc_req *);
225
+ #define YPPROC_NEXT 5
226
+ extern ypresp_key_val * ypproc_next_2(ypreq_key *, CLIENT *);
227
+ extern ypresp_key_val * ypproc_next_2_svc(ypreq_key *, struct svc_req *);
228
+ #define YPPROC_XFR 6
229
+ extern ypresp_xfr * ypproc_xfr_2(ypreq_xfr *, CLIENT *);
230
+ extern ypresp_xfr * ypproc_xfr_2_svc(ypreq_xfr *, struct svc_req *);
231
+ #define YPPROC_CLEAR 7
232
+ extern void * ypproc_clear_2(void *, CLIENT *);
233
+ extern void * ypproc_clear_2_svc(void *, struct svc_req *);
234
+ #define YPPROC_ALL 8
235
+ extern ypresp_all * ypproc_all_2(ypreq_nokey *, CLIENT *);
236
+ extern ypresp_all * ypproc_all_2_svc(ypreq_nokey *, struct svc_req *);
237
+ #define YPPROC_MASTER 9
238
+ extern ypresp_master * ypproc_master_2(ypreq_nokey *, CLIENT *);
239
+ extern ypresp_master * ypproc_master_2_svc(ypreq_nokey *, struct svc_req *);
240
+ #define YPPROC_ORDER 10
241
+ extern ypresp_order * ypproc_order_2(ypreq_nokey *, CLIENT *);
242
+ extern ypresp_order * ypproc_order_2_svc(ypreq_nokey *, struct svc_req *);
243
+ #define YPPROC_MAPLIST 11
244
+ extern ypresp_maplist * ypproc_maplist_2(domainname *, CLIENT *);
245
+ extern ypresp_maplist * ypproc_maplist_2_svc(domainname *, struct svc_req *);
246
+ extern int ypprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
247
+
248
+ #define YPPUSH_XFRRESPPROG 0x40000000
249
+ #define YPPUSH_XFRRESPVERS 1
250
+
251
+ #define YPPUSHPROC_NULL 0
252
+ extern void * yppushproc_null_1(void *, CLIENT *);
253
+ extern void * yppushproc_null_1_svc(void *, struct svc_req *);
254
+ #define YPPUSHPROC_XFRRESP 1
255
+ extern void * yppushproc_xfrresp_1(yppushresp_xfr *, CLIENT *);
256
+ extern void * yppushproc_xfrresp_1_svc(yppushresp_xfr *, struct svc_req *);
257
+ extern int yppush_xfrrespprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
258
+
259
+ #define YPBINDPROG 100007
260
+ #define YPBINDVERS 2
261
+
262
+ #define YPBINDPROC_NULL 0
263
+ extern void * ypbindproc_null_2(void *, CLIENT *);
264
+ extern void * ypbindproc_null_2_svc(void *, struct svc_req *);
265
+ #define YPBINDPROC_DOMAIN 1
266
+ extern ypbind_resp * ypbindproc_domain_2(domainname *, CLIENT *);
267
+ extern ypbind_resp * ypbindproc_domain_2_svc(domainname *, struct svc_req *);
268
+ #define YPBINDPROC_SETDOM 2
269
+ extern void * ypbindproc_setdom_2(ypbind_setdom *, CLIENT *);
270
+ extern void * ypbindproc_setdom_2_svc(ypbind_setdom *, struct svc_req *);
271
+ extern int ypbindprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
272
+
273
+ /* the xdr functions */
274
+ extern bool_t xdr_ypstat (XDR *, ypstat*);
275
+ extern bool_t xdr_ypxfrstat (XDR *, ypxfrstat*);
276
+ extern bool_t xdr_domainname (XDR *, domainname*);
277
+ extern bool_t xdr_mapname (XDR *, mapname*);
278
+ extern bool_t xdr_peername (XDR *, peername*);
279
+ extern bool_t xdr_keydat (XDR *, keydat*);
280
+ extern bool_t xdr_valdat (XDR *, valdat*);
281
+ extern bool_t xdr_ypmap_parms (XDR *, ypmap_parms*);
282
+ extern bool_t xdr_ypreq_key (XDR *, ypreq_key*);
283
+ extern bool_t xdr_ypreq_nokey (XDR *, ypreq_nokey*);
284
+ extern bool_t xdr_ypreq_xfr (XDR *, ypreq_xfr*);
285
+ extern bool_t xdr_ypresp_val (XDR *, ypresp_val*);
286
+ extern bool_t xdr_ypresp_key_val (XDR *, ypresp_key_val*);
287
+ extern bool_t xdr_ypresp_master (XDR *, ypresp_master*);
288
+ extern bool_t xdr_ypresp_order (XDR *, ypresp_order*);
289
+ extern bool_t xdr_ypresp_all (XDR *, ypresp_all*);
290
+ extern bool_t xdr_ypresp_xfr (XDR *, ypresp_xfr*);
291
+ extern bool_t xdr_ypmaplist (XDR *, ypmaplist*);
292
+ extern bool_t xdr_ypresp_maplist (XDR *, ypresp_maplist*);
293
+ extern bool_t xdr_yppush_status (XDR *, yppush_status*);
294
+ extern bool_t xdr_yppushresp_xfr (XDR *, yppushresp_xfr*);
295
+ extern bool_t xdr_ypbind_resptype (XDR *, ypbind_resptype*);
296
+ extern bool_t xdr_ypbind_binding (XDR *, ypbind_binding*);
297
+ extern bool_t xdr_ypbind_resp (XDR *, ypbind_resp*);
298
+ extern bool_t xdr_ypbind_setdom (XDR *, ypbind_setdom*);
299
+
300
+ #ifdef __cplusplus
301
+ }
302
+ #endif
303
+
304
+ #endif /* !__RPCSVC_YP_H__ */
physworld_p1_20261018/envs/p1/include/rpcsvc/yp.x ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */
2
+
3
+ /*
4
+ * Copyright (c) 2010 Oracle America, Inc.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions are
8
+ * met:
9
+ *
10
+ * * Redistributions of source code must retain the above copyright
11
+ * notice, this list of conditions and the following disclaimer.
12
+ * * Redistributions in binary form must reproduce the above
13
+ * copyright notice, this list of conditions and the following
14
+ * disclaimer in the documentation and/or other materials
15
+ * provided with the distribution.
16
+ * * Neither the name of the "Oracle America, Inc." nor the names of its
17
+ * contributors may be used to endorse or promote products derived
18
+ * from this software without specific prior written permission.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ /*
35
+ * Protocol description file for the Yellow Pages Service
36
+ */
37
+
38
+ const YPMAXRECORD = 1024;
39
+ const YPMAXDOMAIN = 256;
40
+ const YPMAXMAP = 64;
41
+ const YPMAXPEER = 64;
42
+
43
+
44
+ enum ypstat {
45
+ YP_TRUE = 1,
46
+ YP_NOMORE = 2,
47
+ YP_FALSE = 0,
48
+ YP_NOMAP = -1,
49
+ YP_NODOM = -2,
50
+ YP_NOKEY = -3,
51
+ YP_BADOP = -4,
52
+ YP_BADDB = -5,
53
+ YP_YPERR = -6,
54
+ YP_BADARGS = -7,
55
+ YP_VERS = -8
56
+ };
57
+
58
+
59
+ enum ypxfrstat {
60
+ YPXFR_SUCC = 1,
61
+ YPXFR_AGE = 2,
62
+ YPXFR_NOMAP = -1,
63
+ YPXFR_NODOM = -2,
64
+ YPXFR_RSRC = -3,
65
+ YPXFR_RPC = -4,
66
+ YPXFR_MADDR = -5,
67
+ YPXFR_YPERR = -6,
68
+ YPXFR_BADARGS = -7,
69
+ YPXFR_DBM = -8,
70
+ YPXFR_FILE = -9,
71
+ YPXFR_SKEW = -10,
72
+ YPXFR_CLEAR = -11,
73
+ YPXFR_FORCE = -12,
74
+ YPXFR_XFRERR = -13,
75
+ YPXFR_REFUSED = -14
76
+ };
77
+
78
+
79
+ typedef string domainname<YPMAXDOMAIN>;
80
+ typedef string mapname<YPMAXMAP>;
81
+ typedef string peername<YPMAXPEER>;
82
+ typedef opaque keydat<YPMAXRECORD>;
83
+ typedef opaque valdat<YPMAXRECORD>;
84
+
85
+
86
+ struct ypmap_parms {
87
+ domainname domain;
88
+ mapname map;
89
+ unsigned int ordernum;
90
+ peername peer;
91
+ };
92
+
93
+ struct ypreq_key {
94
+ domainname domain;
95
+ mapname map;
96
+ keydat key;
97
+ };
98
+
99
+ struct ypreq_nokey {
100
+ domainname domain;
101
+ mapname map;
102
+ };
103
+
104
+ struct ypreq_xfr {
105
+ ypmap_parms map_parms;
106
+ unsigned int transid;
107
+ unsigned int prog;
108
+ unsigned int port;
109
+ };
110
+
111
+
112
+ struct ypresp_val {
113
+ ypstat stat;
114
+ valdat val;
115
+ };
116
+
117
+ struct ypresp_key_val {
118
+ ypstat stat;
119
+ #ifdef STUPID_SUN_BUG
120
+ /* This is the form as distributed by Sun. But even the Sun NIS
121
+ servers expect the values in the other order. So their
122
+ implementation somehow must change the order internally. We
123
+ don't want to follow this bad example since the user should be
124
+ able to use rpcgen on this file. */
125
+ keydat key;
126
+ valdat val;
127
+ #else
128
+ valdat val;
129
+ keydat key;
130
+ #endif
131
+ };
132
+
133
+
134
+ struct ypresp_master {
135
+ ypstat stat;
136
+ peername peer;
137
+ };
138
+
139
+ struct ypresp_order {
140
+ ypstat stat;
141
+ unsigned int ordernum;
142
+ };
143
+
144
+ union ypresp_all switch (bool more) {
145
+ case TRUE:
146
+ ypresp_key_val val;
147
+ case FALSE:
148
+ void;
149
+ };
150
+
151
+ struct ypresp_xfr {
152
+ unsigned int transid;
153
+ ypxfrstat xfrstat;
154
+ };
155
+
156
+ struct ypmaplist {
157
+ mapname map;
158
+ ypmaplist *next;
159
+ };
160
+
161
+ struct ypresp_maplist {
162
+ ypstat stat;
163
+ ypmaplist *maps;
164
+ };
165
+
166
+ enum yppush_status {
167
+ YPPUSH_SUCC = 1, /* Success */
168
+ YPPUSH_AGE = 2, /* Master's version not newer */
169
+ YPPUSH_NOMAP = -1, /* Can't find server for map */
170
+ YPPUSH_NODOM = -2, /* Domain not supported */
171
+ YPPUSH_RSRC = -3, /* Local resource alloc failure */
172
+ YPPUSH_RPC = -4, /* RPC failure talking to server */
173
+ YPPUSH_MADDR = -5, /* Can't get master address */
174
+ YPPUSH_YPERR = -6, /* YP server/map db error */
175
+ YPPUSH_BADARGS = -7, /* Request arguments bad */
176
+ YPPUSH_DBM = -8, /* Local dbm operation failed */
177
+ YPPUSH_FILE = -9, /* Local file I/O operation failed */
178
+ YPPUSH_SKEW = -10, /* Map version skew during transfer */
179
+ YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
180
+ YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */
181
+ YPPUSH_XFRERR = -13, /* ypxfr error */
182
+ YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */
183
+ };
184
+
185
+ struct yppushresp_xfr {
186
+ unsigned transid;
187
+ yppush_status status;
188
+ };
189
+
190
+ /*
191
+ * Response structure and overall result status codes. Success and failure
192
+ * represent two separate response message types.
193
+ */
194
+
195
+ enum ypbind_resptype {
196
+ YPBIND_SUCC_VAL = 1,
197
+ YPBIND_FAIL_VAL = 2
198
+ };
199
+
200
+ struct ypbind_binding {
201
+ opaque ypbind_binding_addr[4]; /* In network order */
202
+ opaque ypbind_binding_port[2]; /* In network order */
203
+ };
204
+
205
+ union ypbind_resp switch (ypbind_resptype ypbind_status) {
206
+ case YPBIND_FAIL_VAL:
207
+ unsigned ypbind_error;
208
+ case YPBIND_SUCC_VAL:
209
+ ypbind_binding ypbind_bindinfo;
210
+ };
211
+
212
+ /* Detailed failure reason codes for response field ypbind_error*/
213
+
214
+ const YPBIND_ERR_ERR = 1; /* Internal error */
215
+ const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
216
+ const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
217
+
218
+
219
+ /*
220
+ * Request data structure for ypbind "Set domain" procedure.
221
+ */
222
+ struct ypbind_setdom {
223
+ domainname ypsetdom_domain;
224
+ ypbind_binding ypsetdom_binding;
225
+ unsigned ypsetdom_vers;
226
+ };
227
+
228
+
229
+ /*
230
+ * YP access protocol
231
+ */
232
+ program YPPROG {
233
+ version YPVERS {
234
+ void
235
+ YPPROC_NULL(void) = 0;
236
+
237
+ bool
238
+ YPPROC_DOMAIN(domainname) = 1;
239
+
240
+ bool
241
+ YPPROC_DOMAIN_NONACK(domainname) = 2;
242
+
243
+ ypresp_val
244
+ YPPROC_MATCH(ypreq_key) = 3;
245
+
246
+ ypresp_key_val
247
+ YPPROC_FIRST(ypreq_key) = 4;
248
+
249
+ ypresp_key_val
250
+ YPPROC_NEXT(ypreq_key) = 5;
251
+
252
+ ypresp_xfr
253
+ YPPROC_XFR(ypreq_xfr) = 6;
254
+
255
+ void
256
+ YPPROC_CLEAR(void) = 7;
257
+
258
+ ypresp_all
259
+ YPPROC_ALL(ypreq_nokey) = 8;
260
+
261
+ ypresp_master
262
+ YPPROC_MASTER(ypreq_nokey) = 9;
263
+
264
+ ypresp_order
265
+ YPPROC_ORDER(ypreq_nokey) = 10;
266
+
267
+ ypresp_maplist
268
+ YPPROC_MAPLIST(domainname) = 11;
269
+ } = 2;
270
+ } = 100004;
271
+
272
+
273
+ /*
274
+ * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
275
+ */
276
+ program YPPUSH_XFRRESPPROG {
277
+ version YPPUSH_XFRRESPVERS {
278
+ void
279
+ YPPUSHPROC_NULL(void) = 0;
280
+
281
+ #ifdef STUPID_SUN_BUG
282
+ /* This is the form as distributed by Sun.
283
+ But this is not what the programs use. */
284
+ yppushresp_xfr
285
+ YPPUSHPROC_XFRRESP(void) = 1;
286
+ #else
287
+ void
288
+ YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
289
+ #endif
290
+ } = 1;
291
+ } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
292
+
293
+ /*
294
+ * YP binding protocol
295
+ */
296
+ program YPBINDPROG {
297
+ version YPBINDVERS {
298
+ void
299
+ YPBINDPROC_NULL(void) = 0;
300
+
301
+ ypbind_resp
302
+ YPBINDPROC_DOMAIN(domainname) = 1;
303
+
304
+ void
305
+ YPBINDPROC_SETDOM(ypbind_setdom) = 2;
306
+ } = 2;
307
+ } = 100007;
physworld_p1_20261018/envs/p1/include/rpcsvc/yp_prot.h ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file contains symbols and structures defining the rpc protocol
3
+ * between the NIS clients and the NIS servers. The servers
4
+ * are the NIS database servers, and the NIS binders.
5
+ */
6
+
7
+ #ifndef _RPCSVC_YP_PROT_H
8
+ #define _RPCSVC_YP_PROT_H
9
+
10
+ #include <rpc/rpc.h>
11
+ #include <rpcsvc/ypclnt.h>
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+
18
+ /*
19
+ * The following procedures are supported by the protocol:
20
+ *
21
+ * YPPROC_NULL() returns () takes nothing, returns nothing. This indicates
22
+ * that the NIS server is alive.
23
+ *
24
+ * YPPROC_DOMAIN (char *) returns (bool_t) TRUE. Indicates that the
25
+ * responding NIS server does serve the named domain; FALSE indicates no
26
+ * support.
27
+ *
28
+ * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the NIS server does serve
29
+ * the named domain, otherwise does not return. Used in the broadcast case.
30
+ *
31
+ * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val). Returns the
32
+ * right-hand value for a passed left-hand key, within a named map and
33
+ * domain.
34
+ *
35
+ * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
36
+ * Returns the first key-value pair from a named domain and map.
37
+ *
38
+ * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val). Returns
39
+ * the key-value pair following a passed key-value pair within a named
40
+ * domain and map.
41
+ *
42
+ * YPPROC_XFR (struct ypreq_xfr) returns nothing. Indicates to a server that
43
+ * a map should be updated.
44
+ *
45
+ * YPPROC_NEWXFR (struct ypreq_newxfr) returns nothing. Indicates to a server
46
+ * that a map should be updated. Uses protocol independent request struct.
47
+ *
48
+ * YPPROC_CLEAR takes nothing, returns nothing. Instructs a NIS server to
49
+ * close the current map, so that old versions of the disk file don't get
50
+ * held open.
51
+ *
52
+ * YPPROC_ALL (struct ypreq_nokey), returns
53
+ * union switch (bool_t more) {
54
+ * TRUE: (struct ypresp_key_val);
55
+ * FALSE: (struct) {};
56
+ * }
57
+ *
58
+ * YPPROC_MASTER (struct ypreq_nokey), returns (ypresp_master)
59
+ *
60
+ * YPPROC_ORDER (struct ypreq_nokey), returns (ypresp_order)
61
+ *
62
+ * YPPROC_MAPLIST (char *), returns (struct ypmaplist *)
63
+ */
64
+
65
+ /* Program and version symbols, magic numbers */
66
+
67
+ #define YPPROG 100004
68
+ #define YPVERS 2
69
+ #define YPVERS_ORIG 1
70
+ #define YPMAXRECORD 1024
71
+ #define YPMAXDOMAIN 256
72
+ #define YPMAXMAP 64
73
+ #define YPMAXPEER 256
74
+
75
+ /* byte size of a large NIS packet */
76
+ #define YPMSGSZ 1600
77
+
78
+ typedef struct keydat {
79
+ u_int keydat_len;
80
+ char *keydat_val;
81
+ } keydat_t;
82
+
83
+ typedef struct valdat {
84
+ u_int valdat_len;
85
+ char *valdat_val;
86
+ } valdat_t;
87
+
88
+ struct ypmap_parms {
89
+ char *domain; /* Null string means not available */
90
+ char *map; /* Null string means not available */
91
+ unsigned int ordernum; /* 0 means not available */
92
+ char *owner; /* Null string means not available */
93
+ };
94
+ typedef struct ypmap_parms ypmap_parms;
95
+
96
+ /*
97
+ * Request parameter structures
98
+ */
99
+
100
+ struct ypreq_key {
101
+ char *domain;
102
+ char *map;
103
+ keydat_t keydat;
104
+ };
105
+ typedef struct ypreq_key ypreq_key;
106
+
107
+ struct ypreq_nokey {
108
+ char *domain;
109
+ char *map;
110
+ };
111
+ typedef struct ypreq_nokey ypreq_nokey;
112
+
113
+ struct ypreq_xfr {
114
+ struct ypmap_parms map_parms;
115
+ u_int transid;
116
+ u_int proto;
117
+ u_int port;
118
+ };
119
+ typedef struct ypreq_xfr ypreq_xfr;
120
+
121
+ struct ypreq_newxfr {
122
+ struct ypmap_parms map_parms;
123
+ u_int transid;
124
+ u_int proto;
125
+ char *name;
126
+ };
127
+ typedef struct ypreq_newxfr ypreq_newxfr;
128
+
129
+ #define ypxfr_domain map_parms.domain
130
+ #define ypxfr_map map_parms.map
131
+ #define ypxfr_ordernum map_parms.ordernum
132
+ #define ypxfr_owner map_parms.owner
133
+
134
+ /* Return status values */
135
+
136
+ enum ypstat {
137
+ YP_TRUE = 1, /* General purpose success code */
138
+ #define YP_TRUE YP_TRUE
139
+ YP_NOMORE = 2, /* No more entries in map */
140
+ #define YP_NOMORE YP_NOMORE
141
+ YP_FALSE = 0, /* General purpose failure code */
142
+ #define YP_FALSE YP_FALSE
143
+ YP_NOMAP = -1, /* No such map in domain */
144
+ #define YP_NOMAP YP_NOMAP
145
+ YP_NODOM = -2, /* Domain not supported */
146
+ #define YP_NODOM YP_NODOM
147
+ YP_NOKEY = -3, /* No such key in map */
148
+ #define YP_NOKEY YP_NOKEY
149
+ YP_BADOP = -4, /* Invalid operation */
150
+ #define YP_BADOP YP_BADOP
151
+ YP_BADDB = -5, /* Server data base is bad */
152
+ #define YP_BADDB YP_BADDB
153
+ YP_YPERR = -6, /* NIS server error */
154
+ #define YP_YPERR YP_YPERR
155
+ YP_BADARGS = -7, /* Request arguments bad */
156
+ #define YP_BADARGS YP_BADARGS
157
+ YP_VERS = -8 /* NIS server version mismatch - server can't supply
158
+ requested service. */
159
+ #define YP_VERS YP_VERS
160
+ };
161
+ typedef enum ypstat ypstat;
162
+
163
+
164
+ enum ypxfrstat {
165
+ YPXFR_SUCC = 1,
166
+ YPXFR_AGE = 2,
167
+ YPXFR_NOMAP = -1,
168
+ YPXFR_NODOM = -2,
169
+ YPXFR_RSRC = -3,
170
+ YPXFR_RPC = -4,
171
+ YPXFR_MADDR = -5,
172
+ YPXFR_YPERR = -6,
173
+ YPXFR_BADARGS = -7,
174
+ YPXFR_DBM = -8,
175
+ YPXFR_FILE = -9,
176
+ YPXFR_SKEW = -10,
177
+ YPXFR_CLEAR = -11,
178
+ YPXFR_FORCE = -12,
179
+ YPXFR_XFRERR = -13,
180
+ YPXFR_REFUSED = -14
181
+ };
182
+ typedef enum ypxfrstat ypxfrstat;
183
+
184
+ /*
185
+ * Response parameter structures
186
+ */
187
+
188
+ struct ypresp_val {
189
+ ypstat status;
190
+ valdat_t valdat;
191
+ };
192
+ typedef struct ypresp_val ypresp_val;
193
+
194
+ struct ypresp_key_val {
195
+ ypstat status;
196
+ valdat_t valdat;
197
+ keydat_t keydat;
198
+ };
199
+ typedef struct ypresp_key_val ypresp_key_val;
200
+
201
+ struct ypresp_master {
202
+ ypstat status;
203
+ char *master;
204
+ };
205
+ typedef struct ypresp_master ypresp_master;
206
+
207
+ struct ypresp_order {
208
+ ypstat status;
209
+ unsigned int ordernum;
210
+ };
211
+ typedef struct ypresp_order ypresp_order;
212
+
213
+ struct ypresp_xfr {
214
+ u_int transid;
215
+ ypxfrstat xfrstat;
216
+ };
217
+ typedef struct ypresp_xfr ypresp_xfr;
218
+
219
+ struct ypmaplist {
220
+ char *map;
221
+ #define ypml_name map
222
+ struct ypmaplist *next;
223
+ #define ypml_next next
224
+ };
225
+ typedef struct ypmaplist ypmaplist;
226
+
227
+ struct ypresp_maplist {
228
+ ypstat status;
229
+ struct ypmaplist *list;
230
+ };
231
+ typedef struct ypresp_maplist ypresp_maplist;
232
+
233
+
234
+ /*
235
+ * Procedure symbols. YPPROC_NULL, YPPROC_DOMAIN, and YPPROC_DOMAIN_NONACK
236
+ * must keep the same values (0, 1, and 2) that they had in the first version
237
+ * of the protocol.
238
+ */
239
+
240
+ #define YPPROC_NULL 0
241
+ #define YPPROC_DOMAIN 1
242
+ #define YPPROC_DOMAIN_NONACK 2
243
+ #define YPPROC_MATCH 3
244
+ #define YPPROC_FIRST 4
245
+ #define YPPROC_NEXT 5
246
+ #define YPPROC_XFR 6
247
+ #define YPPROC_CLEAR 7
248
+ #define YPPROC_ALL 8
249
+ #define YPPROC_MASTER 9
250
+ #define YPPROC_ORDER 10
251
+ #define YPPROC_MAPLIST 11
252
+ #define YPPROC_NEWXFR 12
253
+
254
+ /*
255
+ * Protocol between clients and NIS binder servers
256
+ */
257
+
258
+ /*
259
+ * The following procedures are supported by the protocol:
260
+ *
261
+ * YPBINDPROC_NULL() returns ()
262
+ * takes nothing, returns nothing
263
+ *
264
+ * YPBINDPROC_DOMAIN takes (char *) returns (struct ypbind2_resp)
265
+ *
266
+ * YPBINDPROC_SETDOM takes (struct ypbind2_setdom) returns nothing
267
+ */
268
+
269
+ /* Program and version symbols, magic numbers */
270
+
271
+ #define YPBINDPROG 100007
272
+ #define YPBINDVERS 3
273
+ #define YPBINDVERS_2 2
274
+ #define YPBINDVERS_1 1
275
+
276
+ /* Procedure symbols */
277
+
278
+ #define YPBINDPROC_NULL 0
279
+ #define YPBINDPROC_DOMAIN 1
280
+ #define YPBINDPROC_SETDOM 2
281
+
282
+ /*
283
+ * Request and response structures and overall result status codes.
284
+ * Success and failure represent two separate response message types.
285
+ */
286
+
287
+ enum ypbind_resptype {YPBIND_SUCC_VAL = 1, YPBIND_FAIL_VAL = 2};
288
+ typedef enum ypbind_resptype ypbind_resptype;
289
+
290
+ struct ypbind2_binding {
291
+ struct in_addr ypbind_binding_addr; /* In network order */
292
+ unsigned short int ypbind_binding_port; /* In network order */
293
+ };
294
+ typedef struct ypbind2_binding ypbind2_binding;
295
+
296
+ struct ypbind2_resp {
297
+ enum ypbind_resptype ypbind_status;
298
+ union {
299
+ u_int ypbind_error;
300
+ struct ypbind2_binding ypbind_bindinfo;
301
+ } ypbind_respbody;
302
+ };
303
+ typedef struct ypbind2_resp ypbind2_resp;
304
+ #define ypbind2_error ypbind_respbody.ypbind_error
305
+ #define ypbind2_bindinfo ypbind_respbody.ypbind_bindinfo
306
+ #define ypbind2_addr ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr
307
+ #define ypbind2_port ypbind_respbody.ypbind_bindinfo.ypbind_binding_port
308
+
309
+ struct ypbind_oldsetdom {
310
+ char ypoldsetdom_domain[YPMAXDOMAIN];
311
+ ypbind2_binding ypoldsetdom_binding;
312
+ };
313
+ typedef struct ypbind_oldsetdom ypbind_oldsetdom;
314
+ #define ypoldsetdom_addr ypoldsetdom_binding.ypbind_binding_addr
315
+ #define ypoldsetdom_port ypoldsetdom_binding.ypbind_binding_port
316
+
317
+ struct ypbind2_setdom {
318
+ char *ypsetdom_domain;
319
+ struct ypbind2_binding ypsetdom_binding;
320
+ u_int ypsetdom_vers;
321
+ };
322
+ typedef struct ypbind2_setdom ypbind2_setdom;
323
+ #define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
324
+ #define ypsetdom_port ypsetdom_binding.ypbind_binding_port
325
+
326
+ struct ypbind3_binding {
327
+ struct netconfig *ypbind_nconf;
328
+ struct netbuf *ypbind_svcaddr;
329
+ char *ypbind_servername;
330
+ /* that's the highest version number that the used
331
+ ypserv supports, normally YPVERS */
332
+ rpcvers_t ypbind_hi_vers;
333
+ /* the lowest version number that the used
334
+ ypserv supports, on Solaris 0 or YPVERS, too */
335
+ rpcvers_t ypbind_lo_vers;
336
+ };
337
+ typedef struct ypbind3_binding ypbind3_binding;
338
+
339
+ struct ypbind3_resp {
340
+ enum ypbind_resptype ypbind_status;
341
+ union {
342
+ u_long ypbind_error;
343
+ struct ypbind3_binding *ypbind_bindinfo;
344
+ } ypbind_respbody;
345
+ };
346
+ typedef struct ypbind3_resp ypbind3_resp;
347
+ #define ypbind3_error ypbind_respbody.ypbind_error
348
+ #define ypbind3_bindinfo ypbind_respbody.ypbind_bindinfo
349
+ #define ypbind3_nconf ypbind_respbody.ypbind_bindinfo->ypbind_nconf
350
+ #define ypbind3_svcaddr ypbind_respbody.ypbind_bindinfo->ypbind_svcaddr
351
+ #define ypbind3_servername ypbind_respbody.ypbind_bindinfo->ypbind_servername
352
+ #define ypbind3_hi_vers ypbind_respbody.ypbind_bindinfo->ypbind_hi_vers
353
+ #define ypbind3_lo_vers ypbind_respbody.ypbind_bindinfo->ypbind_lo_vers
354
+
355
+ struct ypbind3_setdom {
356
+ char *ypsetdom_domain;
357
+ struct ypbind3_binding *ypsetdom_bindinfo;
358
+ };
359
+ typedef struct ypbind3_setdom ypbind3_setdom;
360
+ #define ypsetdom3_nconf ypsetdom_bindinfo->ypbind_nconf
361
+ #define ypsetdom3_svcaddr ypsetdom_bindinfo->ypbind_svcaddr
362
+ #define ypsetdom3_servername ypsetdom_bindinfo->ypbind_servername
363
+ #define ypsetdom3_hi_vers ypsetdom_bindinfo->ypbind_hi_vers
364
+ #define ypsetdom3_lo_vers ypsetdom_bindinfo->ypbind_lo_vers
365
+
366
+
367
+ /* Detailed failure reason codes for response field ypbind_error*/
368
+
369
+ #define YPBIND_ERR_ERR 1 /* Internal error */
370
+ #define YPBIND_ERR_NOSERV 2 /* No bound server for passed domain */
371
+ #define YPBIND_ERR_RESC 3 /* System resource allocation failure */
372
+ #define YPBIND_ERR_NODOMAIN 4 /* Domain doesn't exist */
373
+
374
+ /*
375
+ * Protocol between clients (ypxfr, only) and yppush
376
+ * yppush speaks a protocol in the transient range, which
377
+ * is supplied to ypxfr as a command-line parameter when it
378
+ * is activated by ypserv.
379
+ */
380
+ #define YPPUSHVERS 1
381
+ #define YPPUSHVERS_ORIG 1
382
+
383
+ /* Procedure symbols */
384
+
385
+ #define YPPUSHPROC_NULL 0
386
+ #define YPPUSHPROC_XFRRESP 1
387
+
388
+ /* Status values for yppushresp_xfr.status */
389
+
390
+ enum yppush_status {
391
+ YPPUSH_SUCC = 1, /* Success */
392
+ #define YPPUSH_SUCC YPPUSH_SUCC
393
+ YPPUSH_AGE = 2, /* Master's version not newer */
394
+ #define YPPUSH_AGE YPPUSH_AGE
395
+ YPPUSH_NOMAP = -1, /* Can't find server for map */
396
+ #define YPPUSH_NOMAP YPPUSH_NOMAP
397
+ YPPUSH_NODOM = -2, /* Domain not supported */
398
+ #define YPPUSH_NODOM YPPUSH_NODOM
399
+ YPPUSH_RSRC = -3, /* Local resouce alloc failure */
400
+ #define YPPUSH_RSRC YPPUSH_RSRC
401
+ YPPUSH_RPC = -4, /* RPC failure talking to server */
402
+ #define YPPUSH_RPC YPPUSH_RPC
403
+ YPPUSH_MADDR = -5, /* Can't get master address */
404
+ #define YPPUSH_MADDR YPPUSH_MADDR
405
+ YPPUSH_YPERR = -6, /* NIS server/map db error */
406
+ #define YPPUSH_YPERR YPPUSH_YPERR
407
+ YPPUSH_BADARGS = -7, /* Request arguments bad */
408
+ #define YPPUSH_BADARGS YPPUSH_BADARGS
409
+ YPPUSH_DBM = -8, /* Local dbm operation failed */
410
+ #define YPPUSH_DBM YPPUSH_DBM
411
+ YPPUSH_FILE = -9, /* Local file I/O operation failed */
412
+ #define YPPUSH_FILE YPPUSH_FILE
413
+ YPPUSH_SKEW = -10, /* Map version skew during transfer */
414
+ #define YPPUSH_SKEW YPPUSH_SKEW
415
+ YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
416
+ #define YPPUSH_CLEAR YPPUSH_CLEAR
417
+ YPPUSH_FORCE = -12, /* No local order number in map - use -f flag*/
418
+ #define YPPUSH_FORCE YPPUSH_FORCE
419
+ YPPUSH_XFRERR = -13, /* ypxfr error */
420
+ #define YPPUSH_XFRERR YPPUSH_XFRERR
421
+ YPPUSH_REFUSED = -14, /* Transfer request refused by ypserv */
422
+ #define YPPUSH_REFUSED YPPUSH_REFUSED
423
+ YPPUSH_NOALIAS = -15 /* Alias not found for map or domain */
424
+ #define YPPUSH_NOALIAS YPPUSH_NOALIAS
425
+ };
426
+ typedef enum yppush_status yppush_status;
427
+
428
+ struct yppushresp_xfr {
429
+ u_int transid;
430
+ yppush_status status;
431
+ };
432
+ typedef struct yppushresp_xfr yppushresp_xfr;
433
+
434
+ struct ypresp_all {
435
+ bool_t more;
436
+ union {
437
+ struct ypresp_key_val val;
438
+ } ypresp_all_u;
439
+ };
440
+ typedef struct ypresp_all ypresp_all;
441
+
442
+ extern bool_t xdr_domainname (XDR *__xdrs, char ** __objp);
443
+ extern bool_t xdr_keydat (XDR *__xdrs, keydat_t *__objp);
444
+ extern bool_t xdr_valdat (XDR *__xdrs, valdat_t *__objp);
445
+ extern bool_t xdr_ypall (XDR *__xdrs, struct ypall_callback * __objp);
446
+ extern bool_t xdr_ypbind2_binding (XDR *__xdrs, struct ypbind2_binding * __objp);
447
+ extern bool_t xdr_ypbind2_resp (XDR *__xdrs, struct ypbind2_resp * __objp);
448
+ extern bool_t xdr_ypbind2_setdom (XDR *__xdrs, struct ypbind2_setdom * __objp);
449
+ extern bool_t xdr_ypbind3_binding (XDR *__xdrs, struct ypbind3_binding * __objp);
450
+ extern bool_t xdr_ypbind3_resp (XDR *__xdrs, struct ypbind3_resp * __objp);
451
+ extern bool_t xdr_ypbind3_setdom (XDR *__xdrs, struct ypbind3_setdom * __objp);
452
+ extern bool_t xdr_ypbind_oldsetdom (XDR *__xdrs, struct ypbind_oldsetdom * __objp);
453
+ extern bool_t xdr_ypbind_resptype (XDR *__xdrs, enum ypbind_resptype * __objp);
454
+ extern bool_t xdr_ypmap_parms (XDR *__xdrs, struct ypmap_parms * __objp);
455
+ extern bool_t xdr_ypmaplist (XDR *__xdrs, struct ypmaplist *__objp);
456
+ extern bool_t xdr_yppushresp_xfr (XDR *__xdrs, struct yppushresp_xfr * __objp);
457
+ extern bool_t xdr_ypreq_key (XDR *__xdrs, struct ypreq_key * __objp);
458
+ extern bool_t xdr_ypreq_newxfr (XDR *__xdrs, struct ypreq_newxfr * __objp);
459
+ extern bool_t xdr_ypreq_nokey (XDR *__xdrs, struct ypreq_nokey * __objp);
460
+ extern bool_t xdr_ypreq_xfr (XDR *__xdrs, struct ypreq_xfr * __objp);
461
+ extern bool_t xdr_ypresp_all (XDR *__xdrs, struct ypresp_all * __objp);
462
+ extern bool_t xdr_ypresp_key_val (XDR *__xdrs, struct ypresp_key_val * __objp);
463
+ extern bool_t xdr_ypresp_maplist (XDR *__xdrs, struct ypresp_maplist * __objp);
464
+ extern bool_t xdr_ypresp_master (XDR *__xdrs, struct ypresp_master * __objp);
465
+ extern bool_t xdr_ypresp_order (XDR *__xdrs, struct ypresp_order * __objp);
466
+ extern bool_t xdr_ypresp_val (XDR *__xdrs, struct ypresp_val * __objp);
467
+ extern bool_t xdr_ypresp_xfr (XDR *__xdrs, struct ypresp_xfr *__objp);
468
+ extern bool_t xdr_ypstat (XDR *__xdrs, enum ypstat * __objp);
469
+ extern bool_t xdr_ypxfrstat (XDR *__xdrs, enum ypxfrstat *__objp);
470
+
471
+ /* Not really for this, but missing better place: */
472
+ extern const char *taddr2host (const struct netconfig *__nconf,
473
+ const struct netbuf *__nbuf,
474
+ char *__host, size_t __hostlen);
475
+ extern const char *taddr2ipstr (const struct netconfig *__nconf,
476
+ const struct netbuf *__nbuf,
477
+ char *__buf, size_t __buflen);
478
+ extern unsigned short taddr2port (const struct netconfig *__nconf,
479
+ const struct netbuf *__nbuf);
480
+
481
+ #ifdef __cplusplus
482
+ }
483
+ #endif
484
+
485
+
486
+ #endif /* _RPCSVC_YP_PROT_H */
physworld_p1_20261018/envs/p1/include/rpcsvc/ypclnt.h ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright (C) 1996-2014 Free Software Foundation, Inc.
2
+ This file is part of the GNU C Library.
3
+ Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
4
+
5
+ The GNU C Library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License as published by the Free Software Foundation; either
8
+ version 2.1 of the License, or (at your option) any later version.
9
+
10
+ The GNU C Library is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public
16
+ License along with the GNU C Library; if not, see
17
+ <http://www.gnu.org/licenses/>. */
18
+
19
+
20
+ #ifndef __RPCSVC_YPCLNT_H__
21
+ #define __RPCSVC_YPCLNT_H__
22
+
23
+ /* Some defines */
24
+ #define YPERR_SUCCESS 0 /* There is no error */
25
+ #define YPERR_BADARGS 1 /* Args to function are bad */
26
+ #define YPERR_RPC 2 /* RPC failure */
27
+ #define YPERR_DOMAIN 3 /* Can't bind to a server with this domain */
28
+ #define YPERR_MAP 4 /* No such map in server's domain */
29
+ #define YPERR_KEY 5 /* No such key in map */
30
+ #define YPERR_YPERR 6 /* Internal yp server or client error */
31
+ #define YPERR_RESRC 7 /* Local resource allocation failure */
32
+ #define YPERR_NOMORE 8 /* No more records in map database */
33
+ #define YPERR_PMAP 9 /* Can't communicate with portmapper */
34
+ #define YPERR_YPBIND 10 /* Can't communicate with ypbind */
35
+ #define YPERR_YPSERV 11 /* Can't communicate with ypserv */
36
+ #define YPERR_NODOM 12 /* Local domain name not set */
37
+ #define YPERR_BADDB 13 /* yp data base is bad */
38
+ #define YPERR_VERS 14 /* YP version mismatch */
39
+ #define YPERR_ACCESS 15 /* Access violation */
40
+ #define YPERR_BUSY 16 /* Database is busy */
41
+
42
+ /* Types of update operations */
43
+ #define YPOP_CHANGE 1 /* Change, do not add */
44
+ #define YPOP_INSERT 2 /* Add, do not change */
45
+ #define YPOP_DELETE 3 /* Delete this entry */
46
+ #define YPOP_STORE 4 /* Add, or change */
47
+
48
+ #ifdef __cplusplus
49
+ extern "C" {
50
+ #endif
51
+
52
+ /* struct ypall_callback * is the arg which must be passed to yp_all. */
53
+ struct ypall_callback
54
+ {
55
+ int (*foreach) (int __status, char *__key, int __keylen,
56
+ char *__val, int __vallen, char *__data);
57
+ char *data;
58
+ };
59
+
60
+ /* External NIS client function references. */
61
+ extern int yp_bind (const char *);
62
+ extern void yp_unbind (const char *);
63
+ extern int yp_get_default_domain (char **);
64
+ extern int yp_match (const char *, const char *, const char *,
65
+ const int, char **, int *);
66
+ extern int yp_first (const char *, const char *, char **,
67
+ int *, char **, int *);
68
+ extern int yp_next (const char *, const char *, const char *,
69
+ const int, char **, int *, char **, int *);
70
+ extern int yp_master (const char *, const char *, char **);
71
+ extern int yp_order (const char *, const char *, unsigned int *);
72
+ extern int yp_all (const char *, const char *,
73
+ const struct ypall_callback *);
74
+ extern const char *yperr_string (const int);
75
+ extern const char *ypbinderr_string (const int);
76
+ extern int ypprot_err (const int);
77
+ extern int yp_update (char *, char *, unsigned int, char *,
78
+ int, char *, int);
79
+
80
+ #if 0
81
+ extern int yp_maplist (const char *, struct ypmaplist **);
82
+ #endif
83
+
84
+ /* This functions exists only under BSD and Linux systems. */
85
+ extern int __yp_check (char **);
86
+
87
+ #ifdef __cplusplus
88
+ }
89
+ #endif
90
+
91
+ #endif /* __RPCSVC_YPCLNT_H__ */
physworld_p1_20261018/envs/p1/include/rpcsvc/yppasswd.h ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Please do not edit this file.
3
+ * It was generated using rpcgen.
4
+ */
5
+
6
+ #ifndef _YPPASSWD_H_RPCGEN
7
+ #define _YPPASSWD_H_RPCGEN
8
+
9
+ #include <rpc/rpc.h>
10
+
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif
15
+
16
+ struct passwd {
17
+ char *pw_name;
18
+ char *pw_passwd;
19
+ int pw_uid;
20
+ int pw_gid;
21
+ char *pw_gecos;
22
+ char *pw_dir;
23
+ char *pw_shell;
24
+ };
25
+ typedef struct passwd passwd;
26
+
27
+ struct yppasswd {
28
+ char *oldpass;
29
+ struct passwd newpw;
30
+ };
31
+ typedef struct yppasswd yppasswd;
32
+
33
+ #define YPPASSWDPROG 100009
34
+ #define YPPASSWDVERS 1
35
+ #define YPPASSWDPROC_UPDATE 1
36
+
37
+ extern int * yppasswdproc_update_1(yppasswd *, CLIENT *);
38
+ extern int * yppasswdproc_update_1_svc(yppasswd *, struct svc_req *);
39
+ extern int yppasswdprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
40
+
41
+ /* the xdr functions */
42
+ extern bool_t xdr_passwd (XDR *, struct passwd*);
43
+ extern bool_t xdr_yppasswd (XDR *, yppasswd*);
44
+
45
+ #ifdef __cplusplus
46
+ }
47
+ #endif
48
+
49
+ #endif /* !_YPPASSWD_H_RPCGEN */
physworld_p1_20261018/envs/p1/include/rpcsvc/yppasswd.x ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @(#)yppasswd.x 2.1 88/08/01 4.0 RPCSRC */
2
+
3
+ /*
4
+ * Copyright (c) 2010, Oracle America, Inc.
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are
7
+ * met:
8
+ *
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above
12
+ * copyright notice, this list of conditions and the following
13
+ * disclaimer in the documentation and/or other materials
14
+ * provided with the distribution.
15
+ * * Neither the name of the "Oracle America, Inc." nor the names of its
16
+ * contributors may be used to endorse or promote products derived
17
+ * from this software without specific prior written permission.
18
+ *
19
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+
33
+ /*
34
+ * YP password update protocol
35
+ * Requires unix authentication
36
+ */
37
+ program YPPASSWDPROG {
38
+ version YPPASSWDVERS {
39
+ /*
40
+ * Update my passwd entry
41
+ */
42
+ int
43
+ YPPASSWDPROC_UPDATE(yppasswd) = 1;
44
+ } = 1;
45
+ } = 100009;
46
+
47
+
48
+ struct passwd {
49
+ string pw_name<>; /* username */
50
+ string pw_passwd<>; /* encrypted password */
51
+ int pw_uid; /* user id */
52
+ int pw_gid; /* group id */
53
+ string pw_gecos<>; /* in real life name */
54
+ string pw_dir<>; /* home directory */
55
+ string pw_shell<>; /* default shell */
56
+ };
57
+
58
+ struct yppasswd {
59
+ string oldpass<>; /* unencrypted old password */
60
+ passwd newpw; /* new passwd entry */
61
+ };
physworld_p1_20261018/envs/p1/include/rpcsvc/ypupd.h ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c) 2010, Oracle America, Inc.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions are
6
+ * met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright
9
+ * notice, this list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above
11
+ * copyright notice, this list of conditions and the following
12
+ * disclaimer in the documentation and/or other materials
13
+ * provided with the distribution.
14
+ * * Neither the name of the "Oracle America, Inc." nor the names of its
15
+ * contributors may be used to endorse or promote products derived
16
+ * from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ */
31
+ /* from @(#)ypupdate_prot.x 1.3 91/03/11 TIRPC 1.0 */
32
+
33
+ #ifndef __RPCSVC_YPUPD_H__
34
+ #define __RPCSVC_YPUPD_H__
35
+
36
+ #include <rpc/rpc.h>
37
+
38
+ #define MAXMAPNAMELEN 255
39
+ #define MAXYPDATALEN 1023
40
+ #define MAXERRMSGLEN 255
41
+
42
+ #ifdef __cplusplus
43
+ extern "C" {
44
+ #endif
45
+
46
+ typedef struct {
47
+ u_int yp_buf_len;
48
+ char *yp_buf_val;
49
+ } yp_buf;
50
+
51
+ extern bool_t xdr_yp_buf (XDR *, yp_buf*);
52
+
53
+ struct ypupdate_args {
54
+ char *mapname;
55
+ yp_buf key;
56
+ yp_buf datum;
57
+ };
58
+ typedef struct ypupdate_args ypupdate_args;
59
+
60
+ extern bool_t xdr_ypupdate_args (XDR *, ypupdate_args*);
61
+
62
+ struct ypdelete_args {
63
+ char *mapname;
64
+ yp_buf key;
65
+ };
66
+ typedef struct ypdelete_args ypdelete_args;
67
+
68
+ extern bool_t xdr_ypdelete_args (XDR *, ypdelete_args*);
69
+
70
+ #define YPU_PROG 100028
71
+ #define YPU_VERS 1
72
+
73
+ #define YPU_CHANGE 1
74
+ extern u_int * ypu_change_1 (ypupdate_args *, CLIENT *);
75
+ extern u_int * ypu_change_1_svc (ypupdate_args *, struct svc_req *);
76
+ #define YPU_INSERT 2
77
+ extern u_int * ypu_insert_1 (ypupdate_args *, CLIENT *);
78
+ extern u_int * ypu_insert_1_svc (ypupdate_args *, struct svc_req *);
79
+ #define YPU_DELETE 3
80
+ extern u_int * ypu_delete_1 (ypdelete_args *, CLIENT *);
81
+ extern u_int * ypu_delete_1_svc (ypdelete_args *, struct svc_req *);
82
+ #define YPU_STORE 4
83
+ extern u_int * ypu_store_1 (ypupdate_args *, CLIENT *);
84
+ extern u_int * ypu_store_1_svc (ypupdate_args *, struct svc_req *);
85
+
86
+ #ifdef __cplusplus
87
+ }
88
+ #endif
89
+
90
+ #endif /* !__RPCSVC_YPUPD_H__ */
physworld_p1_20261018/envs/p1/include/sqlite3.h ADDED
The diff for this file is too large to render. See raw diff
 
physworld_p1_20261018/envs/p1/include/sqlite3ext.h ADDED
@@ -0,0 +1,745 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** 2006 June 7
3
+ **
4
+ ** The author disclaims copyright to this source code. In place of
5
+ ** a legal notice, here is a blessing:
6
+ **
7
+ ** May you do good and not evil.
8
+ ** May you find forgiveness for yourself and forgive others.
9
+ ** May you share freely, never taking more than you give.
10
+ **
11
+ *************************************************************************
12
+ ** This header file defines the SQLite interface for use by
13
+ ** shared libraries that want to be imported as extensions into
14
+ ** an SQLite instance. Shared libraries that intend to be loaded
15
+ ** as extensions by SQLite should #include this file instead of
16
+ ** sqlite3.h.
17
+ */
18
+ #ifndef SQLITE3EXT_H
19
+ #define SQLITE3EXT_H
20
+ #include "sqlite3.h"
21
+
22
+ /*
23
+ ** The following structure holds pointers to all of the SQLite API
24
+ ** routines.
25
+ **
26
+ ** WARNING: In order to maintain backwards compatibility, add new
27
+ ** interfaces to the end of this structure only. If you insert new
28
+ ** interfaces in the middle of this structure, then older different
29
+ ** versions of SQLite will not be able to load each other's shared
30
+ ** libraries!
31
+ */
32
+ struct sqlite3_api_routines {
33
+ void * (*aggregate_context)(sqlite3_context*,int nBytes);
34
+ int (*aggregate_count)(sqlite3_context*);
35
+ int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
36
+ int (*bind_double)(sqlite3_stmt*,int,double);
37
+ int (*bind_int)(sqlite3_stmt*,int,int);
38
+ int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
39
+ int (*bind_null)(sqlite3_stmt*,int);
40
+ int (*bind_parameter_count)(sqlite3_stmt*);
41
+ int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
42
+ const char * (*bind_parameter_name)(sqlite3_stmt*,int);
43
+ int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
44
+ int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
45
+ int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
46
+ int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
47
+ int (*busy_timeout)(sqlite3*,int ms);
48
+ int (*changes)(sqlite3*);
49
+ int (*close)(sqlite3*);
50
+ int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
51
+ int eTextRep,const char*));
52
+ int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
53
+ int eTextRep,const void*));
54
+ const void * (*column_blob)(sqlite3_stmt*,int iCol);
55
+ int (*column_bytes)(sqlite3_stmt*,int iCol);
56
+ int (*column_bytes16)(sqlite3_stmt*,int iCol);
57
+ int (*column_count)(sqlite3_stmt*pStmt);
58
+ const char * (*column_database_name)(sqlite3_stmt*,int);
59
+ const void * (*column_database_name16)(sqlite3_stmt*,int);
60
+ const char * (*column_decltype)(sqlite3_stmt*,int i);
61
+ const void * (*column_decltype16)(sqlite3_stmt*,int);
62
+ double (*column_double)(sqlite3_stmt*,int iCol);
63
+ int (*column_int)(sqlite3_stmt*,int iCol);
64
+ sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
65
+ const char * (*column_name)(sqlite3_stmt*,int);
66
+ const void * (*column_name16)(sqlite3_stmt*,int);
67
+ const char * (*column_origin_name)(sqlite3_stmt*,int);
68
+ const void * (*column_origin_name16)(sqlite3_stmt*,int);
69
+ const char * (*column_table_name)(sqlite3_stmt*,int);
70
+ const void * (*column_table_name16)(sqlite3_stmt*,int);
71
+ const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
72
+ const void * (*column_text16)(sqlite3_stmt*,int iCol);
73
+ int (*column_type)(sqlite3_stmt*,int iCol);
74
+ sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
75
+ void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
76
+ int (*complete)(const char*sql);
77
+ int (*complete16)(const void*sql);
78
+ int (*create_collation)(sqlite3*,const char*,int,void*,
79
+ int(*)(void*,int,const void*,int,const void*));
80
+ int (*create_collation16)(sqlite3*,const void*,int,void*,
81
+ int(*)(void*,int,const void*,int,const void*));
82
+ int (*create_function)(sqlite3*,const char*,int,int,void*,
83
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
84
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
85
+ void (*xFinal)(sqlite3_context*));
86
+ int (*create_function16)(sqlite3*,const void*,int,int,void*,
87
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
88
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
89
+ void (*xFinal)(sqlite3_context*));
90
+ int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
91
+ int (*data_count)(sqlite3_stmt*pStmt);
92
+ sqlite3 * (*db_handle)(sqlite3_stmt*);
93
+ int (*declare_vtab)(sqlite3*,const char*);
94
+ int (*enable_shared_cache)(int);
95
+ int (*errcode)(sqlite3*db);
96
+ const char * (*errmsg)(sqlite3*);
97
+ const void * (*errmsg16)(sqlite3*);
98
+ int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
99
+ int (*expired)(sqlite3_stmt*);
100
+ int (*finalize)(sqlite3_stmt*pStmt);
101
+ void (*free)(void*);
102
+ void (*free_table)(char**result);
103
+ int (*get_autocommit)(sqlite3*);
104
+ void * (*get_auxdata)(sqlite3_context*,int);
105
+ int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
106
+ int (*global_recover)(void);
107
+ void (*interruptx)(sqlite3*);
108
+ sqlite_int64 (*last_insert_rowid)(sqlite3*);
109
+ const char * (*libversion)(void);
110
+ int (*libversion_number)(void);
111
+ void *(*malloc)(int);
112
+ char *(SQLITE_CDECL*mprintf)(const char*,...);
113
+ int (*open)(const char*,sqlite3**);
114
+ int (*open16)(const void*,sqlite3**);
115
+ int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
116
+ int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
117
+ void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
118
+ void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
119
+ void *(*realloc)(void*,int);
120
+ int (*reset)(sqlite3_stmt*pStmt);
121
+ void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
122
+ void (*result_double)(sqlite3_context*,double);
123
+ void (*result_error)(sqlite3_context*,const char*,int);
124
+ void (*result_error16)(sqlite3_context*,const void*,int);
125
+ void (*result_int)(sqlite3_context*,int);
126
+ void (*result_int64)(sqlite3_context*,sqlite_int64);
127
+ void (*result_null)(sqlite3_context*);
128
+ void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
129
+ void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
130
+ void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
131
+ void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
132
+ void (*result_value)(sqlite3_context*,sqlite3_value*);
133
+ void *(*rollback_hook)(sqlite3*,void(*)(void*),void*);
134
+ int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
135
+ const char*,const char*),void*);
136
+ void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
137
+ char *(SQLITE_CDECL*xsnprintf)(int,char*,const char*,...);
138
+ int (*step)(sqlite3_stmt*);
139
+ int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
140
+ char const**,char const**,int*,int*,int*);
141
+ void (*thread_cleanup)(void);
142
+ int (*total_changes)(sqlite3*);
143
+ void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
144
+ int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
145
+ void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
146
+ sqlite_int64),void*);
147
+ void * (*user_data)(sqlite3_context*);
148
+ const void * (*value_blob)(sqlite3_value*);
149
+ int (*value_bytes)(sqlite3_value*);
150
+ int (*value_bytes16)(sqlite3_value*);
151
+ double (*value_double)(sqlite3_value*);
152
+ int (*value_int)(sqlite3_value*);
153
+ sqlite_int64 (*value_int64)(sqlite3_value*);
154
+ int (*value_numeric_type)(sqlite3_value*);
155
+ const unsigned char * (*value_text)(sqlite3_value*);
156
+ const void * (*value_text16)(sqlite3_value*);
157
+ const void * (*value_text16be)(sqlite3_value*);
158
+ const void * (*value_text16le)(sqlite3_value*);
159
+ int (*value_type)(sqlite3_value*);
160
+ char *(*vmprintf)(const char*,va_list);
161
+ /* Added ??? */
162
+ int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
163
+ /* Added by 3.3.13 */
164
+ int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
165
+ int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
166
+ int (*clear_bindings)(sqlite3_stmt*);
167
+ /* Added by 3.4.1 */
168
+ int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
169
+ void (*xDestroy)(void *));
170
+ /* Added by 3.5.0 */
171
+ int (*bind_zeroblob)(sqlite3_stmt*,int,int);
172
+ int (*blob_bytes)(sqlite3_blob*);
173
+ int (*blob_close)(sqlite3_blob*);
174
+ int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
175
+ int,sqlite3_blob**);
176
+ int (*blob_read)(sqlite3_blob*,void*,int,int);
177
+ int (*blob_write)(sqlite3_blob*,const void*,int,int);
178
+ int (*create_collation_v2)(sqlite3*,const char*,int,void*,
179
+ int(*)(void*,int,const void*,int,const void*),
180
+ void(*)(void*));
181
+ int (*file_control)(sqlite3*,const char*,int,void*);
182
+ sqlite3_int64 (*memory_highwater)(int);
183
+ sqlite3_int64 (*memory_used)(void);
184
+ sqlite3_mutex *(*mutex_alloc)(int);
185
+ void (*mutex_enter)(sqlite3_mutex*);
186
+ void (*mutex_free)(sqlite3_mutex*);
187
+ void (*mutex_leave)(sqlite3_mutex*);
188
+ int (*mutex_try)(sqlite3_mutex*);
189
+ int (*open_v2)(const char*,sqlite3**,int,const char*);
190
+ int (*release_memory)(int);
191
+ void (*result_error_nomem)(sqlite3_context*);
192
+ void (*result_error_toobig)(sqlite3_context*);
193
+ int (*sleep)(int);
194
+ void (*soft_heap_limit)(int);
195
+ sqlite3_vfs *(*vfs_find)(const char*);
196
+ int (*vfs_register)(sqlite3_vfs*,int);
197
+ int (*vfs_unregister)(sqlite3_vfs*);
198
+ int (*xthreadsafe)(void);
199
+ void (*result_zeroblob)(sqlite3_context*,int);
200
+ void (*result_error_code)(sqlite3_context*,int);
201
+ int (SQLITE_CDECL*test_control)(int, ...);
202
+ void (*randomness)(int,void*);
203
+ sqlite3 *(*context_db_handle)(sqlite3_context*);
204
+ int (*extended_result_codes)(sqlite3*,int);
205
+ int (*limit)(sqlite3*,int,int);
206
+ sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
207
+ const char *(*sql)(sqlite3_stmt*);
208
+ int (*status)(int,int*,int*,int);
209
+ int (*backup_finish)(sqlite3_backup*);
210
+ sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
211
+ int (*backup_pagecount)(sqlite3_backup*);
212
+ int (*backup_remaining)(sqlite3_backup*);
213
+ int (*backup_step)(sqlite3_backup*,int);
214
+ const char *(*compileoption_get)(int);
215
+ int (*compileoption_used)(const char*);
216
+ int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
217
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
218
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
219
+ void (*xFinal)(sqlite3_context*),
220
+ void(*xDestroy)(void*));
221
+ int (SQLITE_CDECL*db_config)(sqlite3*,int,...);
222
+ sqlite3_mutex *(*db_mutex)(sqlite3*);
223
+ int (*db_status)(sqlite3*,int,int*,int*,int);
224
+ int (*extended_errcode)(sqlite3*);
225
+ void (SQLITE_CDECL*log)(int,const char*,...);
226
+ sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
227
+ const char *(*sourceid)(void);
228
+ int (*stmt_status)(sqlite3_stmt*,int,int);
229
+ int (*strnicmp)(const char*,const char*,int);
230
+ int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
231
+ int (*wal_autocheckpoint)(sqlite3*,int);
232
+ int (*wal_checkpoint)(sqlite3*,const char*);
233
+ void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
234
+ int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
235
+ int (SQLITE_CDECL*vtab_config)(sqlite3*,int op,...);
236
+ int (*vtab_on_conflict)(sqlite3*);
237
+ /* Version 3.7.16 and later */
238
+ int (*close_v2)(sqlite3*);
239
+ const char *(*db_filename)(sqlite3*,const char*);
240
+ int (*db_readonly)(sqlite3*,const char*);
241
+ int (*db_release_memory)(sqlite3*);
242
+ const char *(*errstr)(int);
243
+ int (*stmt_busy)(sqlite3_stmt*);
244
+ int (*stmt_readonly)(sqlite3_stmt*);
245
+ int (*stricmp)(const char*,const char*);
246
+ int (*uri_boolean)(const char*,const char*,int);
247
+ sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
248
+ const char *(*uri_parameter)(const char*,const char*);
249
+ char *(*xvsnprintf)(int,char*,const char*,va_list);
250
+ int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
251
+ /* Version 3.8.7 and later */
252
+ int (*auto_extension)(void(*)(void));
253
+ int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
254
+ void(*)(void*));
255
+ int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
256
+ void(*)(void*),unsigned char);
257
+ int (*cancel_auto_extension)(void(*)(void));
258
+ int (*load_extension)(sqlite3*,const char*,const char*,char**);
259
+ void *(*malloc64)(sqlite3_uint64);
260
+ sqlite3_uint64 (*msize)(void*);
261
+ void *(*realloc64)(void*,sqlite3_uint64);
262
+ void (*reset_auto_extension)(void);
263
+ void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64,
264
+ void(*)(void*));
265
+ void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
266
+ void(*)(void*), unsigned char);
267
+ int (*strglob)(const char*,const char*);
268
+ /* Version 3.8.11 and later */
269
+ sqlite3_value *(*value_dup)(const sqlite3_value*);
270
+ void (*value_free)(sqlite3_value*);
271
+ int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
272
+ int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
273
+ /* Version 3.9.0 and later */
274
+ unsigned int (*value_subtype)(sqlite3_value*);
275
+ void (*result_subtype)(sqlite3_context*,unsigned int);
276
+ /* Version 3.10.0 and later */
277
+ int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int);
278
+ int (*strlike)(const char*,const char*,unsigned int);
279
+ int (*db_cacheflush)(sqlite3*);
280
+ /* Version 3.12.0 and later */
281
+ int (*system_errno)(sqlite3*);
282
+ /* Version 3.14.0 and later */
283
+ int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
284
+ char *(*expanded_sql)(sqlite3_stmt*);
285
+ /* Version 3.18.0 and later */
286
+ void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64);
287
+ /* Version 3.20.0 and later */
288
+ int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
289
+ sqlite3_stmt**,const char**);
290
+ int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
291
+ sqlite3_stmt**,const void**);
292
+ int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
293
+ void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
294
+ void *(*value_pointer)(sqlite3_value*,const char*);
295
+ int (*vtab_nochange)(sqlite3_context*);
296
+ int (*value_nochange)(sqlite3_value*);
297
+ const char *(*vtab_collation)(sqlite3_index_info*,int);
298
+ /* Version 3.24.0 and later */
299
+ int (*keyword_count)(void);
300
+ int (*keyword_name)(int,const char**,int*);
301
+ int (*keyword_check)(const char*,int);
302
+ sqlite3_str *(*str_new)(sqlite3*);
303
+ char *(*str_finish)(sqlite3_str*);
304
+ void (SQLITE_CDECL*str_appendf)(sqlite3_str*, const char *zFormat, ...);
305
+ void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
306
+ void (*str_append)(sqlite3_str*, const char *zIn, int N);
307
+ void (*str_appendall)(sqlite3_str*, const char *zIn);
308
+ void (*str_appendchar)(sqlite3_str*, int N, char C);
309
+ void (*str_reset)(sqlite3_str*);
310
+ int (*str_errcode)(sqlite3_str*);
311
+ int (*str_length)(sqlite3_str*);
312
+ char *(*str_value)(sqlite3_str*);
313
+ /* Version 3.25.0 and later */
314
+ int (*create_window_function)(sqlite3*,const char*,int,int,void*,
315
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
316
+ void (*xFinal)(sqlite3_context*),
317
+ void (*xValue)(sqlite3_context*),
318
+ void (*xInv)(sqlite3_context*,int,sqlite3_value**),
319
+ void(*xDestroy)(void*));
320
+ /* Version 3.26.0 and later */
321
+ const char *(*normalized_sql)(sqlite3_stmt*);
322
+ /* Version 3.28.0 and later */
323
+ int (*stmt_isexplain)(sqlite3_stmt*);
324
+ int (*value_frombind)(sqlite3_value*);
325
+ /* Version 3.30.0 and later */
326
+ int (*drop_modules)(sqlite3*,const char**);
327
+ /* Version 3.31.0 and later */
328
+ sqlite3_int64 (*hard_heap_limit64)(sqlite3_int64);
329
+ const char *(*uri_key)(const char*,int);
330
+ const char *(*filename_database)(const char*);
331
+ const char *(*filename_journal)(const char*);
332
+ const char *(*filename_wal)(const char*);
333
+ /* Version 3.32.0 and later */
334
+ const char *(*create_filename)(const char*,const char*,const char*,
335
+ int,const char**);
336
+ void (*free_filename)(const char*);
337
+ sqlite3_file *(*database_file_object)(const char*);
338
+ /* Version 3.34.0 and later */
339
+ int (*txn_state)(sqlite3*,const char*);
340
+ /* Version 3.36.1 and later */
341
+ sqlite3_int64 (*changes64)(sqlite3*);
342
+ sqlite3_int64 (*total_changes64)(sqlite3*);
343
+ /* Version 3.37.0 and later */
344
+ int (*autovacuum_pages)(sqlite3*,
345
+ unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
346
+ void*, void(*)(void*));
347
+ /* Version 3.38.0 and later */
348
+ int (*error_offset)(sqlite3*);
349
+ int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**);
350
+ int (*vtab_distinct)(sqlite3_index_info*);
351
+ int (*vtab_in)(sqlite3_index_info*,int,int);
352
+ int (*vtab_in_first)(sqlite3_value*,sqlite3_value**);
353
+ int (*vtab_in_next)(sqlite3_value*,sqlite3_value**);
354
+ /* Version 3.39.0 and later */
355
+ int (*deserialize)(sqlite3*,const char*,unsigned char*,
356
+ sqlite3_int64,sqlite3_int64,unsigned);
357
+ unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
358
+ unsigned int);
359
+ const char *(*db_name)(sqlite3*,int);
360
+ /* Version 3.40.0 and later */
361
+ int (*value_encoding)(sqlite3_value*);
362
+ /* Version 3.41.0 and later */
363
+ int (*is_interrupted)(sqlite3*);
364
+ /* Version 3.43.0 and later */
365
+ int (*stmt_explain)(sqlite3_stmt*,int);
366
+ /* Version 3.44.0 and later */
367
+ void *(*get_clientdata)(sqlite3*,const char*);
368
+ int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
369
+ /* Version 3.50.0 and later */
370
+ int (*setlk_timeout)(sqlite3*,int,int);
371
+ /* Version 3.51.0 and later */
372
+ int (*set_errmsg)(sqlite3*,int,const char*);
373
+ int (*db_status64)(sqlite3*,int,sqlite3_int64*,sqlite3_int64*,int);
374
+ /* Version 3.52.0 and later */
375
+ void (*str_truncate)(sqlite3_str*,int);
376
+ void (*str_free)(sqlite3_str*);
377
+ int (*carray_bind)(sqlite3_stmt*,int,void*,int,int,void(*)(void*));
378
+ int (*carray_bind_v2)(sqlite3_stmt*,int,void*,int,int,void(*)(void*),void*);
379
+ /* Version 3.54.0 and later */
380
+ sqlite3_int64 (*incomplete)(const char*);
381
+ void (*result_str)(sqlite3_context*,sqlite3_str*,int);
382
+ };
383
+
384
+ /*
385
+ ** This is the function signature used for all extension entry points. It
386
+ ** is also defined in the file "loadext.c".
387
+ */
388
+ typedef int (*sqlite3_loadext_entry)(
389
+ sqlite3 *db, /* Handle to the database. */
390
+ char **pzErrMsg, /* Used to set error string on failure. */
391
+ const sqlite3_api_routines *pThunk /* Extension API function pointers. */
392
+ );
393
+
394
+ /*
395
+ ** The following macros redefine the API routines so that they are
396
+ ** redirected through the global sqlite3_api structure.
397
+ **
398
+ ** This header file is also used by the loadext.c source file
399
+ ** (part of the main SQLite library - not an extension) so that
400
+ ** it can get access to the sqlite3_api_routines structure
401
+ ** definition. But the main library does not want to redefine
402
+ ** the API. So the redefinition macros are only valid if the
403
+ ** SQLITE_CORE macros is undefined.
404
+ */
405
+ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
406
+ #define sqlite3_aggregate_context sqlite3_api->aggregate_context
407
+ #ifndef SQLITE_OMIT_DEPRECATED
408
+ #define sqlite3_aggregate_count sqlite3_api->aggregate_count
409
+ #endif
410
+ #define sqlite3_bind_blob sqlite3_api->bind_blob
411
+ #define sqlite3_bind_double sqlite3_api->bind_double
412
+ #define sqlite3_bind_int sqlite3_api->bind_int
413
+ #define sqlite3_bind_int64 sqlite3_api->bind_int64
414
+ #define sqlite3_bind_null sqlite3_api->bind_null
415
+ #define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
416
+ #define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
417
+ #define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
418
+ #define sqlite3_bind_text sqlite3_api->bind_text
419
+ #define sqlite3_bind_text16 sqlite3_api->bind_text16
420
+ #define sqlite3_bind_value sqlite3_api->bind_value
421
+ #define sqlite3_busy_handler sqlite3_api->busy_handler
422
+ #define sqlite3_busy_timeout sqlite3_api->busy_timeout
423
+ #define sqlite3_changes sqlite3_api->changes
424
+ #define sqlite3_close sqlite3_api->close
425
+ #define sqlite3_collation_needed sqlite3_api->collation_needed
426
+ #define sqlite3_collation_needed16 sqlite3_api->collation_needed16
427
+ #define sqlite3_column_blob sqlite3_api->column_blob
428
+ #define sqlite3_column_bytes sqlite3_api->column_bytes
429
+ #define sqlite3_column_bytes16 sqlite3_api->column_bytes16
430
+ #define sqlite3_column_count sqlite3_api->column_count
431
+ #define sqlite3_column_database_name sqlite3_api->column_database_name
432
+ #define sqlite3_column_database_name16 sqlite3_api->column_database_name16
433
+ #define sqlite3_column_decltype sqlite3_api->column_decltype
434
+ #define sqlite3_column_decltype16 sqlite3_api->column_decltype16
435
+ #define sqlite3_column_double sqlite3_api->column_double
436
+ #define sqlite3_column_int sqlite3_api->column_int
437
+ #define sqlite3_column_int64 sqlite3_api->column_int64
438
+ #define sqlite3_column_name sqlite3_api->column_name
439
+ #define sqlite3_column_name16 sqlite3_api->column_name16
440
+ #define sqlite3_column_origin_name sqlite3_api->column_origin_name
441
+ #define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
442
+ #define sqlite3_column_table_name sqlite3_api->column_table_name
443
+ #define sqlite3_column_table_name16 sqlite3_api->column_table_name16
444
+ #define sqlite3_column_text sqlite3_api->column_text
445
+ #define sqlite3_column_text16 sqlite3_api->column_text16
446
+ #define sqlite3_column_type sqlite3_api->column_type
447
+ #define sqlite3_column_value sqlite3_api->column_value
448
+ #define sqlite3_commit_hook sqlite3_api->commit_hook
449
+ #define sqlite3_complete sqlite3_api->complete
450
+ #define sqlite3_complete16 sqlite3_api->complete16
451
+ #define sqlite3_create_collation sqlite3_api->create_collation
452
+ #define sqlite3_create_collation16 sqlite3_api->create_collation16
453
+ #define sqlite3_create_function sqlite3_api->create_function
454
+ #define sqlite3_create_function16 sqlite3_api->create_function16
455
+ #define sqlite3_create_module sqlite3_api->create_module
456
+ #define sqlite3_create_module_v2 sqlite3_api->create_module_v2
457
+ #define sqlite3_data_count sqlite3_api->data_count
458
+ #define sqlite3_db_handle sqlite3_api->db_handle
459
+ #define sqlite3_declare_vtab sqlite3_api->declare_vtab
460
+ #define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
461
+ #define sqlite3_errcode sqlite3_api->errcode
462
+ #define sqlite3_errmsg sqlite3_api->errmsg
463
+ #define sqlite3_errmsg16 sqlite3_api->errmsg16
464
+ #define sqlite3_exec sqlite3_api->exec
465
+ #ifndef SQLITE_OMIT_DEPRECATED
466
+ #define sqlite3_expired sqlite3_api->expired
467
+ #endif
468
+ #define sqlite3_finalize sqlite3_api->finalize
469
+ #define sqlite3_free sqlite3_api->free
470
+ #define sqlite3_free_table sqlite3_api->free_table
471
+ #define sqlite3_get_autocommit sqlite3_api->get_autocommit
472
+ #define sqlite3_get_auxdata sqlite3_api->get_auxdata
473
+ #define sqlite3_get_table sqlite3_api->get_table
474
+ #ifndef SQLITE_OMIT_DEPRECATED
475
+ #define sqlite3_global_recover sqlite3_api->global_recover
476
+ #endif
477
+ #define sqlite3_interrupt sqlite3_api->interruptx
478
+ #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
479
+ #define sqlite3_libversion sqlite3_api->libversion
480
+ #define sqlite3_libversion_number sqlite3_api->libversion_number
481
+ #define sqlite3_malloc sqlite3_api->malloc
482
+ #define sqlite3_mprintf sqlite3_api->mprintf
483
+ #define sqlite3_open sqlite3_api->open
484
+ #define sqlite3_open16 sqlite3_api->open16
485
+ #define sqlite3_prepare sqlite3_api->prepare
486
+ #define sqlite3_prepare16 sqlite3_api->prepare16
487
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
488
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
489
+ #define sqlite3_profile sqlite3_api->profile
490
+ #define sqlite3_progress_handler sqlite3_api->progress_handler
491
+ #define sqlite3_realloc sqlite3_api->realloc
492
+ #define sqlite3_reset sqlite3_api->reset
493
+ #define sqlite3_result_blob sqlite3_api->result_blob
494
+ #define sqlite3_result_double sqlite3_api->result_double
495
+ #define sqlite3_result_error sqlite3_api->result_error
496
+ #define sqlite3_result_error16 sqlite3_api->result_error16
497
+ #define sqlite3_result_int sqlite3_api->result_int
498
+ #define sqlite3_result_int64 sqlite3_api->result_int64
499
+ #define sqlite3_result_null sqlite3_api->result_null
500
+ #define sqlite3_result_text sqlite3_api->result_text
501
+ #define sqlite3_result_text16 sqlite3_api->result_text16
502
+ #define sqlite3_result_text16be sqlite3_api->result_text16be
503
+ #define sqlite3_result_text16le sqlite3_api->result_text16le
504
+ #define sqlite3_result_value sqlite3_api->result_value
505
+ #define sqlite3_rollback_hook sqlite3_api->rollback_hook
506
+ #define sqlite3_set_authorizer sqlite3_api->set_authorizer
507
+ #define sqlite3_set_auxdata sqlite3_api->set_auxdata
508
+ #define sqlite3_snprintf sqlite3_api->xsnprintf
509
+ #define sqlite3_step sqlite3_api->step
510
+ #define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
511
+ #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
512
+ #define sqlite3_total_changes sqlite3_api->total_changes
513
+ #define sqlite3_trace sqlite3_api->trace
514
+ #ifndef SQLITE_OMIT_DEPRECATED
515
+ #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
516
+ #endif
517
+ #define sqlite3_update_hook sqlite3_api->update_hook
518
+ #define sqlite3_user_data sqlite3_api->user_data
519
+ #define sqlite3_value_blob sqlite3_api->value_blob
520
+ #define sqlite3_value_bytes sqlite3_api->value_bytes
521
+ #define sqlite3_value_bytes16 sqlite3_api->value_bytes16
522
+ #define sqlite3_value_double sqlite3_api->value_double
523
+ #define sqlite3_value_int sqlite3_api->value_int
524
+ #define sqlite3_value_int64 sqlite3_api->value_int64
525
+ #define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
526
+ #define sqlite3_value_text sqlite3_api->value_text
527
+ #define sqlite3_value_text16 sqlite3_api->value_text16
528
+ #define sqlite3_value_text16be sqlite3_api->value_text16be
529
+ #define sqlite3_value_text16le sqlite3_api->value_text16le
530
+ #define sqlite3_value_type sqlite3_api->value_type
531
+ #define sqlite3_vmprintf sqlite3_api->vmprintf
532
+ #define sqlite3_vsnprintf sqlite3_api->xvsnprintf
533
+ #define sqlite3_overload_function sqlite3_api->overload_function
534
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
535
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
536
+ #define sqlite3_clear_bindings sqlite3_api->clear_bindings
537
+ #define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
538
+ #define sqlite3_blob_bytes sqlite3_api->blob_bytes
539
+ #define sqlite3_blob_close sqlite3_api->blob_close
540
+ #define sqlite3_blob_open sqlite3_api->blob_open
541
+ #define sqlite3_blob_read sqlite3_api->blob_read
542
+ #define sqlite3_blob_write sqlite3_api->blob_write
543
+ #define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
544
+ #define sqlite3_file_control sqlite3_api->file_control
545
+ #define sqlite3_memory_highwater sqlite3_api->memory_highwater
546
+ #define sqlite3_memory_used sqlite3_api->memory_used
547
+ #define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
548
+ #define sqlite3_mutex_enter sqlite3_api->mutex_enter
549
+ #define sqlite3_mutex_free sqlite3_api->mutex_free
550
+ #define sqlite3_mutex_leave sqlite3_api->mutex_leave
551
+ #define sqlite3_mutex_try sqlite3_api->mutex_try
552
+ #define sqlite3_open_v2 sqlite3_api->open_v2
553
+ #define sqlite3_release_memory sqlite3_api->release_memory
554
+ #define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
555
+ #define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
556
+ #define sqlite3_sleep sqlite3_api->sleep
557
+ #define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
558
+ #define sqlite3_vfs_find sqlite3_api->vfs_find
559
+ #define sqlite3_vfs_register sqlite3_api->vfs_register
560
+ #define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
561
+ #define sqlite3_threadsafe sqlite3_api->xthreadsafe
562
+ #define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
563
+ #define sqlite3_result_error_code sqlite3_api->result_error_code
564
+ #define sqlite3_test_control sqlite3_api->test_control
565
+ #define sqlite3_randomness sqlite3_api->randomness
566
+ #define sqlite3_context_db_handle sqlite3_api->context_db_handle
567
+ #define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
568
+ #define sqlite3_limit sqlite3_api->limit
569
+ #define sqlite3_next_stmt sqlite3_api->next_stmt
570
+ #define sqlite3_sql sqlite3_api->sql
571
+ #define sqlite3_status sqlite3_api->status
572
+ #define sqlite3_backup_finish sqlite3_api->backup_finish
573
+ #define sqlite3_backup_init sqlite3_api->backup_init
574
+ #define sqlite3_backup_pagecount sqlite3_api->backup_pagecount
575
+ #define sqlite3_backup_remaining sqlite3_api->backup_remaining
576
+ #define sqlite3_backup_step sqlite3_api->backup_step
577
+ #define sqlite3_compileoption_get sqlite3_api->compileoption_get
578
+ #define sqlite3_compileoption_used sqlite3_api->compileoption_used
579
+ #define sqlite3_create_function_v2 sqlite3_api->create_function_v2
580
+ #define sqlite3_db_config sqlite3_api->db_config
581
+ #define sqlite3_db_mutex sqlite3_api->db_mutex
582
+ #define sqlite3_db_status sqlite3_api->db_status
583
+ #define sqlite3_extended_errcode sqlite3_api->extended_errcode
584
+ #define sqlite3_log sqlite3_api->log
585
+ #define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64
586
+ #define sqlite3_sourceid sqlite3_api->sourceid
587
+ #define sqlite3_stmt_status sqlite3_api->stmt_status
588
+ #define sqlite3_strnicmp sqlite3_api->strnicmp
589
+ #define sqlite3_unlock_notify sqlite3_api->unlock_notify
590
+ #define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint
591
+ #define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint
592
+ #define sqlite3_wal_hook sqlite3_api->wal_hook
593
+ #define sqlite3_blob_reopen sqlite3_api->blob_reopen
594
+ #define sqlite3_vtab_config sqlite3_api->vtab_config
595
+ #define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict
596
+ /* Version 3.7.16 and later */
597
+ #define sqlite3_close_v2 sqlite3_api->close_v2
598
+ #define sqlite3_db_filename sqlite3_api->db_filename
599
+ #define sqlite3_db_readonly sqlite3_api->db_readonly
600
+ #define sqlite3_db_release_memory sqlite3_api->db_release_memory
601
+ #define sqlite3_errstr sqlite3_api->errstr
602
+ #define sqlite3_stmt_busy sqlite3_api->stmt_busy
603
+ #define sqlite3_stmt_readonly sqlite3_api->stmt_readonly
604
+ #define sqlite3_stricmp sqlite3_api->stricmp
605
+ #define sqlite3_uri_boolean sqlite3_api->uri_boolean
606
+ #define sqlite3_uri_int64 sqlite3_api->uri_int64
607
+ #define sqlite3_uri_parameter sqlite3_api->uri_parameter
608
+ #define sqlite3_uri_vsnprintf sqlite3_api->xvsnprintf
609
+ #define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
610
+ /* Version 3.8.7 and later */
611
+ #define sqlite3_auto_extension sqlite3_api->auto_extension
612
+ #define sqlite3_bind_blob64 sqlite3_api->bind_blob64
613
+ #define sqlite3_bind_text64 sqlite3_api->bind_text64
614
+ #define sqlite3_cancel_auto_extension sqlite3_api->cancel_auto_extension
615
+ #define sqlite3_load_extension sqlite3_api->load_extension
616
+ #define sqlite3_malloc64 sqlite3_api->malloc64
617
+ #define sqlite3_msize sqlite3_api->msize
618
+ #define sqlite3_realloc64 sqlite3_api->realloc64
619
+ #define sqlite3_reset_auto_extension sqlite3_api->reset_auto_extension
620
+ #define sqlite3_result_blob64 sqlite3_api->result_blob64
621
+ #define sqlite3_result_text64 sqlite3_api->result_text64
622
+ #define sqlite3_strglob sqlite3_api->strglob
623
+ /* Version 3.8.11 and later */
624
+ #define sqlite3_value_dup sqlite3_api->value_dup
625
+ #define sqlite3_value_free sqlite3_api->value_free
626
+ #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64
627
+ #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64
628
+ /* Version 3.9.0 and later */
629
+ #define sqlite3_value_subtype sqlite3_api->value_subtype
630
+ #define sqlite3_result_subtype sqlite3_api->result_subtype
631
+ /* Version 3.10.0 and later */
632
+ #define sqlite3_status64 sqlite3_api->status64
633
+ #define sqlite3_strlike sqlite3_api->strlike
634
+ #define sqlite3_db_cacheflush sqlite3_api->db_cacheflush
635
+ /* Version 3.12.0 and later */
636
+ #define sqlite3_system_errno sqlite3_api->system_errno
637
+ /* Version 3.14.0 and later */
638
+ #define sqlite3_trace_v2 sqlite3_api->trace_v2
639
+ #define sqlite3_expanded_sql sqlite3_api->expanded_sql
640
+ /* Version 3.18.0 and later */
641
+ #define sqlite3_set_last_insert_rowid sqlite3_api->set_last_insert_rowid
642
+ /* Version 3.20.0 and later */
643
+ #define sqlite3_prepare_v3 sqlite3_api->prepare_v3
644
+ #define sqlite3_prepare16_v3 sqlite3_api->prepare16_v3
645
+ #define sqlite3_bind_pointer sqlite3_api->bind_pointer
646
+ #define sqlite3_result_pointer sqlite3_api->result_pointer
647
+ #define sqlite3_value_pointer sqlite3_api->value_pointer
648
+ /* Version 3.22.0 and later */
649
+ #define sqlite3_vtab_nochange sqlite3_api->vtab_nochange
650
+ #define sqlite3_value_nochange sqlite3_api->value_nochange
651
+ #define sqlite3_vtab_collation sqlite3_api->vtab_collation
652
+ /* Version 3.24.0 and later */
653
+ #define sqlite3_keyword_count sqlite3_api->keyword_count
654
+ #define sqlite3_keyword_name sqlite3_api->keyword_name
655
+ #define sqlite3_keyword_check sqlite3_api->keyword_check
656
+ #define sqlite3_str_new sqlite3_api->str_new
657
+ #define sqlite3_str_finish sqlite3_api->str_finish
658
+ #define sqlite3_str_appendf sqlite3_api->str_appendf
659
+ #define sqlite3_str_vappendf sqlite3_api->str_vappendf
660
+ #define sqlite3_str_append sqlite3_api->str_append
661
+ #define sqlite3_str_appendall sqlite3_api->str_appendall
662
+ #define sqlite3_str_appendchar sqlite3_api->str_appendchar
663
+ #define sqlite3_str_reset sqlite3_api->str_reset
664
+ #define sqlite3_str_errcode sqlite3_api->str_errcode
665
+ #define sqlite3_str_length sqlite3_api->str_length
666
+ #define sqlite3_str_value sqlite3_api->str_value
667
+ /* Version 3.25.0 and later */
668
+ #define sqlite3_create_window_function sqlite3_api->create_window_function
669
+ /* Version 3.26.0 and later */
670
+ #define sqlite3_normalized_sql sqlite3_api->normalized_sql
671
+ /* Version 3.28.0 and later */
672
+ #define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain
673
+ #define sqlite3_value_frombind sqlite3_api->value_frombind
674
+ /* Version 3.30.0 and later */
675
+ #define sqlite3_drop_modules sqlite3_api->drop_modules
676
+ /* Version 3.31.0 and later */
677
+ #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64
678
+ #define sqlite3_uri_key sqlite3_api->uri_key
679
+ #define sqlite3_filename_database sqlite3_api->filename_database
680
+ #define sqlite3_filename_journal sqlite3_api->filename_journal
681
+ #define sqlite3_filename_wal sqlite3_api->filename_wal
682
+ /* Version 3.32.0 and later */
683
+ #define sqlite3_create_filename sqlite3_api->create_filename
684
+ #define sqlite3_free_filename sqlite3_api->free_filename
685
+ #define sqlite3_database_file_object sqlite3_api->database_file_object
686
+ /* Version 3.34.0 and later */
687
+ #define sqlite3_txn_state sqlite3_api->txn_state
688
+ /* Version 3.36.1 and later */
689
+ #define sqlite3_changes64 sqlite3_api->changes64
690
+ #define sqlite3_total_changes64 sqlite3_api->total_changes64
691
+ /* Version 3.37.0 and later */
692
+ #define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages
693
+ /* Version 3.38.0 and later */
694
+ #define sqlite3_error_offset sqlite3_api->error_offset
695
+ #define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value
696
+ #define sqlite3_vtab_distinct sqlite3_api->vtab_distinct
697
+ #define sqlite3_vtab_in sqlite3_api->vtab_in
698
+ #define sqlite3_vtab_in_first sqlite3_api->vtab_in_first
699
+ #define sqlite3_vtab_in_next sqlite3_api->vtab_in_next
700
+ /* Version 3.39.0 and later */
701
+ #ifndef SQLITE_OMIT_DESERIALIZE
702
+ #define sqlite3_deserialize sqlite3_api->deserialize
703
+ #define sqlite3_serialize sqlite3_api->serialize
704
+ #endif
705
+ #define sqlite3_db_name sqlite3_api->db_name
706
+ /* Version 3.40.0 and later */
707
+ #define sqlite3_value_encoding sqlite3_api->value_encoding
708
+ /* Version 3.41.0 and later */
709
+ #define sqlite3_is_interrupted sqlite3_api->is_interrupted
710
+ /* Version 3.43.0 and later */
711
+ #define sqlite3_stmt_explain sqlite3_api->stmt_explain
712
+ /* Version 3.44.0 and later */
713
+ #define sqlite3_get_clientdata sqlite3_api->get_clientdata
714
+ #define sqlite3_set_clientdata sqlite3_api->set_clientdata
715
+ /* Version 3.50.0 and later */
716
+ #define sqlite3_setlk_timeout sqlite3_api->setlk_timeout
717
+ /* Version 3.51.0 and later */
718
+ #define sqlite3_set_errmsg sqlite3_api->set_errmsg
719
+ #define sqlite3_db_status64 sqlite3_api->db_status64
720
+ /* Version 3.52.0 and later */
721
+ #define sqlite3_str_truncate sqlite3_api->str_truncate
722
+ #define sqlite3_str_free sqlite3_api->str_free
723
+ #define sqlite3_carray_bind sqlite3_api->carray_bind
724
+ #define sqlite3_carray_bind_v2 sqlite3_api->carray_bind_v2
725
+ /* Version 3.54.0 and later */
726
+ #define sqlite3_incomplete sqlite3_api->incomplete
727
+ #define sqlite3_result_str sqlite3_api->result_str
728
+ #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
729
+
730
+ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
731
+ /* This case when the file really is being compiled as a loadable
732
+ ** extension */
733
+ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
734
+ # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
735
+ # define SQLITE_EXTENSION_INIT3 \
736
+ extern const sqlite3_api_routines *sqlite3_api;
737
+ #else
738
+ /* This case when the file is being statically linked into the
739
+ ** application */
740
+ # define SQLITE_EXTENSION_INIT1 /*no-op*/
741
+ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
742
+ # define SQLITE_EXTENSION_INIT3 /*no-op*/
743
+ #endif
744
+
745
+ #endif /* SQLITE3EXT_H */
physworld_p1_20261018/envs/p1/include/tcl.h ADDED
@@ -0,0 +1,2639 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tcl.h --
3
+ *
4
+ * This header file describes the externally-visible facilities of the
5
+ * Tcl interpreter.
6
+ *
7
+ * Copyright (c) 1987-1994 The Regents of the University of California.
8
+ * Copyright (c) 1993-1996 Lucent Technologies.
9
+ * Copyright (c) 1994-1998 Sun Microsystems, Inc.
10
+ * Copyright (c) 1998-2000 by Scriptics Corporation.
11
+ * Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
12
+ *
13
+ * See the file "license.terms" for information on usage and redistribution of
14
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
+ */
16
+
17
+ #ifndef _TCL
18
+ #define _TCL
19
+
20
+ /*
21
+ * For C++ compilers, use extern "C"
22
+ */
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ /*
29
+ * The following defines are used to indicate the various release levels.
30
+ */
31
+
32
+ #define TCL_ALPHA_RELEASE 0
33
+ #define TCL_BETA_RELEASE 1
34
+ #define TCL_FINAL_RELEASE 2
35
+
36
+ /*
37
+ * When version numbers change here, must also go into the following files and
38
+ * update the version numbers:
39
+ *
40
+ * library/init.tcl (1 LOC patch)
41
+ * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
42
+ * win/configure.in (as above)
43
+ * win/tcl.m4 (not patchlevel)
44
+ * README (sections 0 and 2, with and without separator)
45
+ * macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
46
+ * win/README (not patchlevel) (sections 0 and 2)
47
+ * unix/tcl.spec (1 LOC patch)
48
+ * tools/tcl.hpj.in (not patchlevel, for windows installer)
49
+ */
50
+
51
+ #define TCL_MAJOR_VERSION 8
52
+ #define TCL_MINOR_VERSION 6
53
+ #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
54
+ #define TCL_RELEASE_SERIAL 13
55
+
56
+ #define TCL_VERSION "8.6"
57
+ #define TCL_PATCH_LEVEL "8.6.13"
58
+
59
+ /*
60
+ *----------------------------------------------------------------------------
61
+ * The following definitions set up the proper options for Windows compilers.
62
+ * We use this method because there is no autoconf equivalent.
63
+ */
64
+
65
+ #ifdef _WIN32
66
+ # ifndef __WIN32__
67
+ # define __WIN32__
68
+ # endif
69
+ # ifndef WIN32
70
+ # define WIN32
71
+ # endif
72
+ #endif
73
+
74
+ /*
75
+ * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
76
+ * quotation marks), JOIN joins two arguments.
77
+ */
78
+
79
+ #ifndef STRINGIFY
80
+ # define STRINGIFY(x) STRINGIFY1(x)
81
+ # define STRINGIFY1(x) #x
82
+ #endif
83
+ #ifndef JOIN
84
+ # define JOIN(a,b) JOIN1(a,b)
85
+ # define JOIN1(a,b) a##b
86
+ #endif
87
+
88
+ /*
89
+ * A special definition used to allow this header file to be included from
90
+ * windows resource files so that they can obtain version information.
91
+ * RC_INVOKED is defined by default by the windows RC tool.
92
+ *
93
+ * Resource compilers don't like all the C stuff, like typedefs and function
94
+ * declarations, that occur below, so block them out.
95
+ */
96
+
97
+ #ifndef RC_INVOKED
98
+
99
+ /*
100
+ * Special macro to define mutexes, that doesn't do anything if we are not
101
+ * using threads.
102
+ */
103
+
104
+ #ifdef TCL_THREADS
105
+ #define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
106
+ #else
107
+ #define TCL_DECLARE_MUTEX(name)
108
+ #endif
109
+
110
+ /*
111
+ * Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and
112
+ * SEEK_END, all #define'd by stdio.h .
113
+ *
114
+ * Also, many extensions need stdio.h, and they've grown accustomed to tcl.h
115
+ * providing it for them rather than #include-ing it themselves as they
116
+ * should, so also for their sake, we keep the #include to be consistent with
117
+ * prior Tcl releases.
118
+ */
119
+
120
+ #include <stdio.h>
121
+
122
+ /*
123
+ *----------------------------------------------------------------------------
124
+ * Support for functions with a variable number of arguments.
125
+ *
126
+ * The following TCL_VARARGS* macros are to support old extensions
127
+ * written for older versions of Tcl where the macros permitted
128
+ * support for the varargs.h system as well as stdarg.h .
129
+ *
130
+ * New code should just directly be written to use stdarg.h conventions.
131
+ */
132
+
133
+ #include <stdarg.h>
134
+ #if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
135
+ # define TCL_VARARGS(type, name) (type name, ...)
136
+ # define TCL_VARARGS_DEF(type, name) (type name, ...)
137
+ # define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
138
+ #endif /* !TCL_NO_DEPRECATED */
139
+ #if defined(__GNUC__) && (__GNUC__ > 2)
140
+ # if defined(_WIN32) && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO
141
+ # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__MINGW_PRINTF_FORMAT, a, b)))
142
+ # else
143
+ # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
144
+ # endif
145
+ # define TCL_NORETURN __attribute__ ((noreturn))
146
+ # if defined(BUILD_tcl) || defined(BUILD_tk)
147
+ # define TCL_NORETURN1 __attribute__ ((noreturn))
148
+ # else
149
+ # define TCL_NORETURN1 /* nothing */
150
+ # endif
151
+ #else
152
+ # define TCL_FORMAT_PRINTF(a,b)
153
+ # if defined(_MSC_VER) && (_MSC_VER >= 1310)
154
+ # define TCL_NORETURN _declspec(noreturn)
155
+ # else
156
+ # define TCL_NORETURN /* nothing */
157
+ # endif
158
+ # define TCL_NORETURN1 /* nothing */
159
+ #endif
160
+
161
+ /*
162
+ * Allow a part of Tcl's API to be explicitly marked as deprecated.
163
+ *
164
+ * Used to make TIP 330/336 generate moans even if people use the
165
+ * compatibility macros. Change your code, guys! We won't support you forever.
166
+ */
167
+
168
+ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
169
+ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
170
+ # define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__ (msg)))
171
+ # else
172
+ # define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__))
173
+ # endif
174
+ #else
175
+ # define TCL_DEPRECATED_API(msg) /* nothing portable */
176
+ #endif
177
+
178
+ /*
179
+ *----------------------------------------------------------------------------
180
+ * Macros used to declare a function to be exported by a DLL. Used by Windows,
181
+ * maps to no-op declarations on non-Windows systems. The default build on
182
+ * windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
183
+ * nonempty. To build a static library, the macro STATIC_BUILD should be
184
+ * defined.
185
+ *
186
+ * Note: when building static but linking dynamically to MSVCRT we must still
187
+ * correctly decorate the C library imported function. Use CRTIMPORT
188
+ * for this purpose. _DLL is defined by the compiler when linking to
189
+ * MSVCRT.
190
+ */
191
+
192
+ #if (defined(_WIN32) && (defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0550)) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
193
+ # define HAVE_DECLSPEC 1
194
+ # ifdef STATIC_BUILD
195
+ # define DLLIMPORT
196
+ # define DLLEXPORT
197
+ # ifdef _DLL
198
+ # define CRTIMPORT __declspec(dllimport)
199
+ # else
200
+ # define CRTIMPORT
201
+ # endif
202
+ # else
203
+ # define DLLIMPORT __declspec(dllimport)
204
+ # define DLLEXPORT __declspec(dllexport)
205
+ # define CRTIMPORT __declspec(dllimport)
206
+ # endif
207
+ #else
208
+ # define DLLIMPORT
209
+ # if defined(__GNUC__) && __GNUC__ > 3
210
+ # define DLLEXPORT __attribute__ ((visibility("default")))
211
+ # else
212
+ # define DLLEXPORT
213
+ # endif
214
+ # define CRTIMPORT
215
+ #endif
216
+
217
+ /*
218
+ * These macros are used to control whether functions are being declared for
219
+ * import or export. If a function is being declared while it is being built
220
+ * to be included in a shared library, then it should have the DLLEXPORT
221
+ * storage class. If is being declared for use by a module that is going to
222
+ * link against the shared library, then it should have the DLLIMPORT storage
223
+ * class. If the symbol is being declared for a static build or for use from a
224
+ * stub library, then the storage class should be empty.
225
+ *
226
+ * The convention is that a macro called BUILD_xxxx, where xxxx is the name of
227
+ * a library we are building, is set on the compile line for sources that are
228
+ * to be placed in the library. When this macro is set, the storage class will
229
+ * be set to DLLEXPORT. At the end of the header file, the storage class will
230
+ * be reset to DLLIMPORT.
231
+ */
232
+
233
+ #undef TCL_STORAGE_CLASS
234
+ #ifdef BUILD_tcl
235
+ # define TCL_STORAGE_CLASS DLLEXPORT
236
+ #else
237
+ # ifdef USE_TCL_STUBS
238
+ # define TCL_STORAGE_CLASS
239
+ # else
240
+ # define TCL_STORAGE_CLASS DLLIMPORT
241
+ # endif
242
+ #endif
243
+
244
+ /*
245
+ * The following _ANSI_ARGS_ macro is to support old extensions
246
+ * written for older versions of Tcl where it permitted support
247
+ * for compilers written in the pre-prototype era of C.
248
+ *
249
+ * New code should use prototypes.
250
+ */
251
+
252
+ #ifndef TCL_NO_DEPRECATED
253
+ # undef _ANSI_ARGS_
254
+ # define _ANSI_ARGS_(x) x
255
+ #endif
256
+
257
+ /*
258
+ * Definitions that allow this header file to be used either with or without
259
+ * ANSI C features.
260
+ */
261
+
262
+ #ifndef INLINE
263
+ # define INLINE
264
+ #endif
265
+
266
+ #ifdef NO_CONST
267
+ # ifndef const
268
+ # define const
269
+ # endif
270
+ #endif
271
+ #ifndef CONST
272
+ # define CONST const
273
+ #endif
274
+
275
+ #ifdef USE_NON_CONST
276
+ # ifdef USE_COMPAT_CONST
277
+ # error define at most one of USE_NON_CONST and USE_COMPAT_CONST
278
+ # endif
279
+ # define CONST84
280
+ # define CONST84_RETURN
281
+ #else
282
+ # ifdef USE_COMPAT_CONST
283
+ # define CONST84
284
+ # define CONST84_RETURN const
285
+ # else
286
+ # define CONST84 const
287
+ # define CONST84_RETURN const
288
+ # endif
289
+ #endif
290
+
291
+ #ifndef CONST86
292
+ # define CONST86 CONST84
293
+ #endif
294
+
295
+ /*
296
+ * Make sure EXTERN isn't defined elsewhere.
297
+ */
298
+
299
+ #ifdef EXTERN
300
+ # undef EXTERN
301
+ #endif /* EXTERN */
302
+
303
+ #ifdef __cplusplus
304
+ # define EXTERN extern "C" TCL_STORAGE_CLASS
305
+ #else
306
+ # define EXTERN extern TCL_STORAGE_CLASS
307
+ #endif
308
+
309
+ /*
310
+ *----------------------------------------------------------------------------
311
+ * The following code is copied from winnt.h. If we don't replicate it here,
312
+ * then <windows.h> can't be included after tcl.h, since tcl.h also defines
313
+ * VOID. This block is skipped under Cygwin and Mingw.
314
+ */
315
+
316
+ #if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
317
+ #ifndef VOID
318
+ #define VOID void
319
+ typedef char CHAR;
320
+ typedef short SHORT;
321
+ typedef long LONG;
322
+ #endif
323
+ #endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
324
+
325
+ /*
326
+ * Macro to use instead of "void" for arguments that must have type "void *"
327
+ * in ANSI C; maps them to type "char *" in non-ANSI systems.
328
+ */
329
+
330
+ #ifndef __VXWORKS__
331
+ # ifndef NO_VOID
332
+ # define VOID void
333
+ # else
334
+ # define VOID char
335
+ # endif
336
+ #endif
337
+
338
+ /*
339
+ * Miscellaneous declarations.
340
+ */
341
+
342
+ #ifndef _CLIENTDATA
343
+ # ifndef NO_VOID
344
+ typedef void *ClientData;
345
+ # else
346
+ typedef int *ClientData;
347
+ # endif
348
+ # define _CLIENTDATA
349
+ #endif
350
+
351
+ /*
352
+ * Darwin specific configure overrides (to support fat compiles, where
353
+ * configure runs only once for multiple architectures):
354
+ */
355
+
356
+ #ifdef __APPLE__
357
+ # ifdef __LP64__
358
+ # undef TCL_WIDE_INT_TYPE
359
+ # define TCL_WIDE_INT_IS_LONG 1
360
+ # define TCL_CFG_DO64BIT 1
361
+ # else /* !__LP64__ */
362
+ # define TCL_WIDE_INT_TYPE long long
363
+ # undef TCL_WIDE_INT_IS_LONG
364
+ # undef TCL_CFG_DO64BIT
365
+ # endif /* __LP64__ */
366
+ # undef HAVE_STRUCT_STAT64
367
+ #endif /* __APPLE__ */
368
+
369
+ /* Cross-compiling 32-bit on a 64-bit platform? Then our
370
+ * configure script does the wrong thing. Correct that here.
371
+ */
372
+ #if defined(__GNUC__) && !defined(_WIN32) && !defined(__LP64__)
373
+ # undef TCL_WIDE_INT_IS_LONG
374
+ # undef TCL_WIDE_INT_TYPE
375
+ # define TCL_WIDE_INT_TYPE long long
376
+ #endif
377
+
378
+ /*
379
+ * Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
380
+ * Tcl_WideUInt to be the unsigned variant of that type (assuming that where
381
+ * we have one, we can have the other.)
382
+ *
383
+ * Also defines the following macros:
384
+ * TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
385
+ * LP64 system such as modern Solaris or Linux ... not including Win64)
386
+ * Tcl_WideAsLong - forgetful converter from wideInt to long.
387
+ * Tcl_LongAsWide - sign-extending converter from long to wideInt.
388
+ * Tcl_WideAsDouble - converter from wideInt to double.
389
+ * Tcl_DoubleAsWide - converter from double to wideInt.
390
+ *
391
+ * The following invariant should hold for any long value 'longVal':
392
+ * longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
393
+ *
394
+ * Note on converting between Tcl_WideInt and strings. This implementation (in
395
+ * tclObj.c) depends on the function
396
+ * sprintf(...,"%" TCL_LL_MODIFIER "d",...).
397
+ */
398
+
399
+ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
400
+ # ifdef _WIN32
401
+ # define TCL_WIDE_INT_TYPE __int64
402
+ # ifdef __BORLANDC__
403
+ # define TCL_LL_MODIFIER "L"
404
+ # elif defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
405
+ # define TCL_LL_MODIFIER "I64"
406
+ # else
407
+ # define TCL_LL_MODIFIER "ll"
408
+ # endif
409
+ # elif defined(__GNUC__)
410
+ # define TCL_WIDE_INT_TYPE long long
411
+ # define TCL_LL_MODIFIER "ll"
412
+ # else /* ! _WIN32 && ! __GNUC__ */
413
+ /*
414
+ * Don't know what platform it is and configure hasn't discovered what is
415
+ * going on for us. Try to guess...
416
+ */
417
+ # include <limits.h>
418
+ # if (INT_MAX < LONG_MAX)
419
+ # define TCL_WIDE_INT_IS_LONG 1
420
+ # else
421
+ # define TCL_WIDE_INT_TYPE long long
422
+ # endif
423
+ # endif /* _WIN32 */
424
+ #endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
425
+ #ifdef TCL_WIDE_INT_IS_LONG
426
+ # undef TCL_WIDE_INT_TYPE
427
+ # define TCL_WIDE_INT_TYPE long
428
+ #endif /* TCL_WIDE_INT_IS_LONG */
429
+
430
+ typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
431
+ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
432
+
433
+ #ifdef TCL_WIDE_INT_IS_LONG
434
+ # define Tcl_WideAsLong(val) ((long)(val))
435
+ # define Tcl_LongAsWide(val) ((long)(val))
436
+ # define Tcl_WideAsDouble(val) ((double)((long)(val)))
437
+ # define Tcl_DoubleAsWide(val) ((long)((double)(val)))
438
+ # ifndef TCL_LL_MODIFIER
439
+ # define TCL_LL_MODIFIER "l"
440
+ # endif /* !TCL_LL_MODIFIER */
441
+ #else /* TCL_WIDE_INT_IS_LONG */
442
+ /*
443
+ * The next short section of defines are only done when not running on Windows
444
+ * or some other strange platform.
445
+ */
446
+ # ifndef TCL_LL_MODIFIER
447
+ # define TCL_LL_MODIFIER "ll"
448
+ # endif /* !TCL_LL_MODIFIER */
449
+ # define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
450
+ # define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
451
+ # define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
452
+ # define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
453
+ #endif /* TCL_WIDE_INT_IS_LONG */
454
+
455
+ #ifdef _WIN32
456
+ # ifdef __BORLANDC__
457
+ typedef struct stati64 Tcl_StatBuf;
458
+ # elif defined(_WIN64) || defined(_USE_64BIT_TIME_T)
459
+ typedef struct __stat64 Tcl_StatBuf;
460
+ # elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
461
+ typedef struct _stati64 Tcl_StatBuf;
462
+ # else
463
+ typedef struct _stat32i64 Tcl_StatBuf;
464
+ # endif /* _MSC_VER < 1400 */
465
+ #elif defined(__CYGWIN__)
466
+ typedef struct {
467
+ dev_t st_dev;
468
+ unsigned short st_ino;
469
+ unsigned short st_mode;
470
+ short st_nlink;
471
+ short st_uid;
472
+ short st_gid;
473
+ /* Here is a 2-byte gap */
474
+ dev_t st_rdev;
475
+ /* Here is a 4-byte gap */
476
+ long long st_size;
477
+ struct {long tv_sec;} st_atim;
478
+ struct {long tv_sec;} st_mtim;
479
+ struct {long tv_sec;} st_ctim;
480
+ /* Here is a 4-byte gap */
481
+ } Tcl_StatBuf;
482
+ #elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
483
+ typedef struct stat64 Tcl_StatBuf;
484
+ #else
485
+ typedef struct stat Tcl_StatBuf;
486
+ #endif
487
+
488
+ /*
489
+ *----------------------------------------------------------------------------
490
+ * Data structures defined opaquely in this module. The definitions below just
491
+ * provide dummy types. A few fields are made visible in Tcl_Interp
492
+ * structures, namely those used for returning a string result from commands.
493
+ * Direct access to the result field is discouraged in Tcl 8.0. The
494
+ * interpreter result is either an object or a string, and the two values are
495
+ * kept consistent unless some C code sets interp->result directly.
496
+ * Programmers should use either the function Tcl_GetObjResult() or
497
+ * Tcl_GetStringResult() to read the interpreter's result. See the SetResult
498
+ * man page for details.
499
+ *
500
+ * Note: any change to the Tcl_Interp definition below must be mirrored in the
501
+ * "real" definition in tclInt.h.
502
+ *
503
+ * Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
504
+ * Instead, they set a Tcl_Obj member in the "real" structure that can be
505
+ * accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
506
+ */
507
+
508
+ typedef struct Tcl_Interp
509
+ #if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
510
+ {
511
+ /* TIP #330: Strongly discourage extensions from using the string
512
+ * result. */
513
+ #ifdef USE_INTERP_RESULT
514
+ char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
515
+ /* If the last command returned a string
516
+ * result, this points to it. */
517
+ void (*freeProc) (char *blockPtr)
518
+ TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
519
+ /* Zero means the string result is statically
520
+ * allocated. TCL_DYNAMIC means it was
521
+ * allocated with ckalloc and should be freed
522
+ * with ckfree. Other values give the address
523
+ * of function to invoke to free the result.
524
+ * Tcl_Eval must free it before executing next
525
+ * command. */
526
+ #else
527
+ char *resultDontUse; /* Don't use in extensions! */
528
+ void (*freeProcDontUse) (char *); /* Don't use in extensions! */
529
+ #endif
530
+ #ifdef USE_INTERP_ERRORLINE
531
+ int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine");
532
+ /* When TCL_ERROR is returned, this gives the
533
+ * line number within the command where the
534
+ * error occurred (1 if first line). */
535
+ #else
536
+ int errorLineDontUse; /* Don't use in extensions! */
537
+ #endif
538
+ }
539
+ #endif /* !TCL_NO_DEPRECATED */
540
+ Tcl_Interp;
541
+
542
+ typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
543
+ typedef struct Tcl_Channel_ *Tcl_Channel;
544
+ typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
545
+ typedef struct Tcl_Command_ *Tcl_Command;
546
+ typedef struct Tcl_Condition_ *Tcl_Condition;
547
+ typedef struct Tcl_Dict_ *Tcl_Dict;
548
+ typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
549
+ typedef struct Tcl_Encoding_ *Tcl_Encoding;
550
+ typedef struct Tcl_Event Tcl_Event;
551
+ typedef struct Tcl_InterpState_ *Tcl_InterpState;
552
+ typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
553
+ typedef struct Tcl_Mutex_ *Tcl_Mutex;
554
+ typedef struct Tcl_Pid_ *Tcl_Pid;
555
+ typedef struct Tcl_RegExp_ *Tcl_RegExp;
556
+ typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
557
+ typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
558
+ typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
559
+ typedef struct Tcl_Trace_ *Tcl_Trace;
560
+ typedef struct Tcl_Var_ *Tcl_Var;
561
+ typedef struct Tcl_ZLibStream_ *Tcl_ZlibStream;
562
+
563
+ /*
564
+ *----------------------------------------------------------------------------
565
+ * Definition of the interface to functions implementing threads. A function
566
+ * following this definition is given to each call of 'Tcl_CreateThread' and
567
+ * will be called as the main fuction of the new thread created by that call.
568
+ */
569
+
570
+ #if defined _WIN32
571
+ typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData);
572
+ #else
573
+ typedef void (Tcl_ThreadCreateProc) (ClientData clientData);
574
+ #endif
575
+
576
+ /*
577
+ * Threading function return types used for abstracting away platform
578
+ * differences when writing a Tcl_ThreadCreateProc. See the NewThread function
579
+ * in generic/tclThreadTest.c for it's usage.
580
+ */
581
+
582
+ #if defined _WIN32
583
+ # define Tcl_ThreadCreateType unsigned __stdcall
584
+ # define TCL_THREAD_CREATE_RETURN return 0
585
+ #else
586
+ # define Tcl_ThreadCreateType void
587
+ # define TCL_THREAD_CREATE_RETURN
588
+ #endif
589
+
590
+ /*
591
+ * Definition of values for default stacksize and the possible flags to be
592
+ * given to Tcl_CreateThread.
593
+ */
594
+
595
+ #define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
596
+ #define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default
597
+ * behaviour. */
598
+ #define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable. */
599
+
600
+ /*
601
+ * Flag values passed to Tcl_StringCaseMatch.
602
+ */
603
+
604
+ #define TCL_MATCH_NOCASE (1<<0)
605
+
606
+ /*
607
+ * Flag values passed to Tcl_GetRegExpFromObj.
608
+ */
609
+
610
+ #define TCL_REG_BASIC 000000 /* BREs (convenience). */
611
+ #define TCL_REG_EXTENDED 000001 /* EREs. */
612
+ #define TCL_REG_ADVF 000002 /* Advanced features in EREs. */
613
+ #define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs). */
614
+ #define TCL_REG_QUOTE 000004 /* No special characters, none. */
615
+ #define TCL_REG_NOCASE 000010 /* Ignore case. */
616
+ #define TCL_REG_NOSUB 000020 /* Don't care about subexpressions. */
617
+ #define TCL_REG_EXPANDED 000040 /* Expanded format, white space &
618
+ * comments. */
619
+ #define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
620
+ #define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before. */
621
+ #define TCL_REG_NEWLINE 000300 /* Newlines are line terminators. */
622
+ #define TCL_REG_CANMATCH 001000 /* Report details on partial/limited
623
+ * matches. */
624
+
625
+ /*
626
+ * Flags values passed to Tcl_RegExpExecObj.
627
+ */
628
+
629
+ #define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
630
+ #define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
631
+
632
+ /*
633
+ * Structures filled in by Tcl_RegExpInfo. Note that all offset values are
634
+ * relative to the start of the match string, not the beginning of the entire
635
+ * string.
636
+ */
637
+
638
+ typedef struct Tcl_RegExpIndices {
639
+ long start; /* Character offset of first character in
640
+ * match. */
641
+ long end; /* Character offset of first character after
642
+ * the match. */
643
+ } Tcl_RegExpIndices;
644
+
645
+ typedef struct Tcl_RegExpInfo {
646
+ int nsubs; /* Number of subexpressions in the compiled
647
+ * expression. */
648
+ Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
649
+ long extendStart; /* The offset at which a subsequent match
650
+ * might begin. */
651
+ long reserved; /* Reserved for later use. */
652
+ } Tcl_RegExpInfo;
653
+
654
+ /*
655
+ * Picky compilers complain if this typdef doesn't appear before the struct's
656
+ * reference in tclDecls.h.
657
+ */
658
+
659
+ typedef Tcl_StatBuf *Tcl_Stat_;
660
+ typedef struct stat *Tcl_OldStat_;
661
+
662
+ /*
663
+ *----------------------------------------------------------------------------
664
+ * When a TCL command returns, the interpreter contains a result from the
665
+ * command. Programmers are strongly encouraged to use one of the functions
666
+ * Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
667
+ * result. See the SetResult man page for details. Besides this result, the
668
+ * command function returns an integer code, which is one of the following:
669
+ *
670
+ * TCL_OK Command completed normally; the interpreter's result
671
+ * contains the command's result.
672
+ * TCL_ERROR The command couldn't be completed successfully; the
673
+ * interpreter's result describes what went wrong.
674
+ * TCL_RETURN The command requests that the current function return;
675
+ * the interpreter's result contains the function's
676
+ * return value.
677
+ * TCL_BREAK The command requests that the innermost loop be
678
+ * exited; the interpreter's result is meaningless.
679
+ * TCL_CONTINUE Go on to the next iteration of the current loop; the
680
+ * interpreter's result is meaningless.
681
+ */
682
+
683
+ #define TCL_OK 0
684
+ #define TCL_ERROR 1
685
+ #define TCL_RETURN 2
686
+ #define TCL_BREAK 3
687
+ #define TCL_CONTINUE 4
688
+
689
+ #define TCL_RESULT_SIZE 200
690
+
691
+ /*
692
+ *----------------------------------------------------------------------------
693
+ * Flags to control what substitutions are performed by Tcl_SubstObj():
694
+ */
695
+
696
+ #define TCL_SUBST_COMMANDS 001
697
+ #define TCL_SUBST_VARIABLES 002
698
+ #define TCL_SUBST_BACKSLASHES 004
699
+ #define TCL_SUBST_ALL 007
700
+
701
+ /*
702
+ * Argument descriptors for math function callbacks in expressions:
703
+ */
704
+
705
+ typedef enum {
706
+ TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
707
+ } Tcl_ValueType;
708
+
709
+ typedef struct Tcl_Value {
710
+ Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
711
+ * or both. */
712
+ long intValue; /* Integer value. */
713
+ double doubleValue; /* Double-precision floating value. */
714
+ Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
715
+ } Tcl_Value;
716
+
717
+ /*
718
+ * Forward declaration of Tcl_Obj to prevent an error when the forward
719
+ * reference to Tcl_Obj is encountered in the function types declared below.
720
+ */
721
+
722
+ struct Tcl_Obj;
723
+
724
+ /*
725
+ *----------------------------------------------------------------------------
726
+ * Function types defined by Tcl:
727
+ */
728
+
729
+ typedef int (Tcl_AppInitProc) (Tcl_Interp *interp);
730
+ typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp,
731
+ int code);
732
+ typedef void (Tcl_ChannelProc) (ClientData clientData, int mask);
733
+ typedef void (Tcl_CloseProc) (ClientData data);
734
+ typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
735
+ typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
736
+ int argc, CONST84 char *argv[]);
737
+ typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp,
738
+ int level, char *command, Tcl_CmdProc *proc,
739
+ ClientData cmdClientData, int argc, CONST84 char *argv[]);
740
+ typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp,
741
+ int level, const char *command, Tcl_Command commandInfo, int objc,
742
+ struct Tcl_Obj *const *objv);
743
+ typedef void (Tcl_CmdObjTraceDeleteProc) (ClientData clientData);
744
+ typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
745
+ struct Tcl_Obj *dupPtr);
746
+ typedef int (Tcl_EncodingConvertProc) (ClientData clientData, const char *src,
747
+ int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst,
748
+ int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr);
749
+ typedef void (Tcl_EncodingFreeProc) (ClientData clientData);
750
+ typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags);
751
+ typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags);
752
+ typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData);
753
+ typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags);
754
+ typedef void (Tcl_ExitProc) (ClientData clientData);
755
+ typedef void (Tcl_FileProc) (ClientData clientData, int mask);
756
+ typedef void (Tcl_FileFreeProc) (ClientData clientData);
757
+ typedef void (Tcl_FreeInternalRepProc) (struct Tcl_Obj *objPtr);
758
+ typedef void (Tcl_FreeProc) (char *blockPtr);
759
+ typedef void (Tcl_IdleProc) (ClientData clientData);
760
+ typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
761
+ Tcl_Interp *interp);
762
+ typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
763
+ Tcl_Value *args, Tcl_Value *resultPtr);
764
+ typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
765
+ typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
766
+ int objc, struct Tcl_Obj *const *objv);
767
+ typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp);
768
+ typedef int (Tcl_PackageUnloadProc) (Tcl_Interp *interp, int flags);
769
+ typedef void (Tcl_PanicProc) (const char *format, ...);
770
+ typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan,
771
+ char *address, int port);
772
+ typedef void (Tcl_TimerProc) (ClientData clientData);
773
+ typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr);
774
+ typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr);
775
+ typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp,
776
+ CONST84 char *part1, CONST84 char *part2, int flags);
777
+ typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp,
778
+ const char *oldName, const char *newName, int flags);
779
+ typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc,
780
+ ClientData clientData);
781
+ typedef void (Tcl_DeleteFileHandlerProc) (int fd);
782
+ typedef void (Tcl_AlertNotifierProc) (ClientData clientData);
783
+ typedef void (Tcl_ServiceModeHookProc) (int mode);
784
+ typedef ClientData (Tcl_InitNotifierProc) (void);
785
+ typedef void (Tcl_FinalizeNotifierProc) (ClientData clientData);
786
+ typedef void (Tcl_MainLoopProc) (void);
787
+
788
+ /*
789
+ *----------------------------------------------------------------------------
790
+ * The following structure represents a type of object, which is a particular
791
+ * internal representation for an object plus a set of functions that provide
792
+ * standard operations on objects of that type.
793
+ */
794
+
795
+ typedef struct Tcl_ObjType {
796
+ const char *name; /* Name of the type, e.g. "int". */
797
+ Tcl_FreeInternalRepProc *freeIntRepProc;
798
+ /* Called to free any storage for the type's
799
+ * internal rep. NULL if the internal rep does
800
+ * not need freeing. */
801
+ Tcl_DupInternalRepProc *dupIntRepProc;
802
+ /* Called to create a new object as a copy of
803
+ * an existing object. */
804
+ Tcl_UpdateStringProc *updateStringProc;
805
+ /* Called to update the string rep from the
806
+ * type's internal representation. */
807
+ Tcl_SetFromAnyProc *setFromAnyProc;
808
+ /* Called to convert the object's internal rep
809
+ * to this type. Frees the internal rep of the
810
+ * old type. Returns TCL_ERROR on failure. */
811
+ } Tcl_ObjType;
812
+
813
+ /*
814
+ * One of the following structures exists for each object in the Tcl system.
815
+ * An object stores a value as either a string, some internal representation,
816
+ * or both.
817
+ */
818
+
819
+ typedef struct Tcl_Obj {
820
+ int refCount; /* When 0 the object will be freed. */
821
+ char *bytes; /* This points to the first byte of the
822
+ * object's string representation. The array
823
+ * must be followed by a null byte (i.e., at
824
+ * offset length) but may also contain
825
+ * embedded null characters. The array's
826
+ * storage is allocated by ckalloc. NULL means
827
+ * the string rep is invalid and must be
828
+ * regenerated from the internal rep. Clients
829
+ * should use Tcl_GetStringFromObj or
830
+ * Tcl_GetString to get a pointer to the byte
831
+ * array as a readonly value. */
832
+ int length; /* The number of bytes at *bytes, not
833
+ * including the terminating null. */
834
+ const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
835
+ * corresponds to the type of the object's
836
+ * internal rep. NULL indicates the object has
837
+ * no internal rep (has no type). */
838
+ union { /* The internal representation: */
839
+ long longValue; /* - an long integer value. */
840
+ double doubleValue; /* - a double-precision floating value. */
841
+ void *otherValuePtr; /* - another, type-specific value,
842
+ not used internally any more. */
843
+ Tcl_WideInt wideValue; /* - a long long value. */
844
+ struct { /* - internal rep as two pointers.
845
+ * the main use of which is a bignum's
846
+ * tightly packed fields, where the alloc,
847
+ * used and signum flags are packed into
848
+ * ptr2 with everything else hung off ptr1. */
849
+ void *ptr1;
850
+ void *ptr2;
851
+ } twoPtrValue;
852
+ struct { /* - internal rep as a pointer and a long,
853
+ not used internally any more. */
854
+ void *ptr;
855
+ unsigned long value;
856
+ } ptrAndLongRep;
857
+ } internalRep;
858
+ } Tcl_Obj;
859
+
860
+ /*
861
+ * Macros to increment and decrement a Tcl_Obj's reference count, and to test
862
+ * whether an object is shared (i.e. has reference count > 1). Note: clients
863
+ * should use Tcl_DecrRefCount() when they are finished using an object, and
864
+ * should never call TclFreeObj() directly. TclFreeObj() is only defined and
865
+ * made public in tcl.h to support Tcl_DecrRefCount's macro definition.
866
+ */
867
+
868
+ void Tcl_IncrRefCount(Tcl_Obj *objPtr);
869
+ void Tcl_DecrRefCount(Tcl_Obj *objPtr);
870
+ int Tcl_IsShared(Tcl_Obj *objPtr);
871
+
872
+ /*
873
+ *----------------------------------------------------------------------------
874
+ * The following structure contains the state needed by Tcl_SaveResult. No-one
875
+ * outside of Tcl should access any of these fields. This structure is
876
+ * typically allocated on the stack.
877
+ */
878
+
879
+ typedef struct Tcl_SavedResult {
880
+ char *result;
881
+ Tcl_FreeProc *freeProc;
882
+ Tcl_Obj *objResultPtr;
883
+ char *appendResult;
884
+ int appendAvl;
885
+ int appendUsed;
886
+ char resultSpace[TCL_RESULT_SIZE+1];
887
+ } Tcl_SavedResult;
888
+
889
+ /*
890
+ *----------------------------------------------------------------------------
891
+ * The following definitions support Tcl's namespace facility. Note: the first
892
+ * five fields must match exactly the fields in a Namespace structure (see
893
+ * tclInt.h).
894
+ */
895
+
896
+ typedef struct Tcl_Namespace {
897
+ char *name; /* The namespace's name within its parent
898
+ * namespace. This contains no ::'s. The name
899
+ * of the global namespace is "" although "::"
900
+ * is an synonym. */
901
+ char *fullName; /* The namespace's fully qualified name. This
902
+ * starts with ::. */
903
+ ClientData clientData; /* Arbitrary value associated with this
904
+ * namespace. */
905
+ Tcl_NamespaceDeleteProc *deleteProc;
906
+ /* Function invoked when deleting the
907
+ * namespace to, e.g., free clientData. */
908
+ struct Tcl_Namespace *parentPtr;
909
+ /* Points to the namespace that contains this
910
+ * one. NULL if this is the global
911
+ * namespace. */
912
+ } Tcl_Namespace;
913
+
914
+ /*
915
+ *----------------------------------------------------------------------------
916
+ * The following structure represents a call frame, or activation record. A
917
+ * call frame defines a naming context for a procedure call: its local scope
918
+ * (for local variables) and its namespace scope (used for non-local
919
+ * variables; often the global :: namespace). A call frame can also define the
920
+ * naming context for a namespace eval or namespace inscope command: the
921
+ * namespace in which the command's code should execute. The Tcl_CallFrame
922
+ * structures exist only while procedures or namespace eval/inscope's are
923
+ * being executed, and provide a Tcl call stack.
924
+ *
925
+ * A call frame is initialized and pushed using Tcl_PushCallFrame and popped
926
+ * using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
927
+ * Tcl_PushCallFrame caller, and callers typically allocate them on the C call
928
+ * stack for efficiency. For this reason, Tcl_CallFrame is defined as a
929
+ * structure and not as an opaque token. However, most Tcl_CallFrame fields
930
+ * are hidden since applications should not access them directly; others are
931
+ * declared as "dummyX".
932
+ *
933
+ * WARNING!! The structure definition must be kept consistent with the
934
+ * CallFrame structure in tclInt.h. If you change one, change the other.
935
+ */
936
+
937
+ typedef struct Tcl_CallFrame {
938
+ Tcl_Namespace *nsPtr;
939
+ int dummy1;
940
+ int dummy2;
941
+ void *dummy3;
942
+ void *dummy4;
943
+ void *dummy5;
944
+ int dummy6;
945
+ void *dummy7;
946
+ void *dummy8;
947
+ int dummy9;
948
+ void *dummy10;
949
+ void *dummy11;
950
+ void *dummy12;
951
+ void *dummy13;
952
+ } Tcl_CallFrame;
953
+
954
+ /*
955
+ *----------------------------------------------------------------------------
956
+ * Information about commands that is returned by Tcl_GetCommandInfo and
957
+ * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
958
+ * function while proc is a traditional Tcl argc/argv string-based function.
959
+ * Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
960
+ * proc are non-NULL and can be called to execute the command. However, it may
961
+ * be faster to call one instead of the other. The member isNativeObjectProc
962
+ * is set to 1 if an object-based function was registered by
963
+ * Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
964
+ * Tcl_CreateCommand. The other function is typically set to a compatibility
965
+ * wrapper that does string-to-object or object-to-string argument conversions
966
+ * then calls the other function.
967
+ */
968
+
969
+ typedef struct Tcl_CmdInfo {
970
+ int isNativeObjectProc; /* 1 if objProc was registered by a call to
971
+ * Tcl_CreateObjCommand; 0 otherwise.
972
+ * Tcl_SetCmdInfo does not modify this
973
+ * field. */
974
+ Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
975
+ ClientData objClientData; /* ClientData for object proc. */
976
+ Tcl_CmdProc *proc; /* Command's string-based function. */
977
+ ClientData clientData; /* ClientData for string proc. */
978
+ Tcl_CmdDeleteProc *deleteProc;
979
+ /* Function to call when command is
980
+ * deleted. */
981
+ ClientData deleteData; /* Value to pass to deleteProc (usually the
982
+ * same as clientData). */
983
+ Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this
984
+ * command. Note that Tcl_SetCmdInfo will not
985
+ * change a command's namespace; use
986
+ * TclRenameCommand or Tcl_Eval (of 'rename')
987
+ * to do that. */
988
+ } Tcl_CmdInfo;
989
+
990
+ /*
991
+ *----------------------------------------------------------------------------
992
+ * The structure defined below is used to hold dynamic strings. The only
993
+ * fields that clients should use are string and length, accessible via the
994
+ * macros Tcl_DStringValue and Tcl_DStringLength.
995
+ */
996
+
997
+ #define TCL_DSTRING_STATIC_SIZE 200
998
+ typedef struct Tcl_DString {
999
+ char *string; /* Points to beginning of string: either
1000
+ * staticSpace below or a malloced array. */
1001
+ int length; /* Number of non-NULL characters in the
1002
+ * string. */
1003
+ int spaceAvl; /* Total number of bytes available for the
1004
+ * string and its terminating NULL char. */
1005
+ char staticSpace[TCL_DSTRING_STATIC_SIZE];
1006
+ /* Space to use in common case where string is
1007
+ * small. */
1008
+ } Tcl_DString;
1009
+
1010
+ #define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
1011
+ #define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
1012
+ #define Tcl_DStringTrunc Tcl_DStringSetLength
1013
+
1014
+ /*
1015
+ * Definitions for the maximum number of digits of precision that may be
1016
+ * specified in the "tcl_precision" variable, and the number of bytes of
1017
+ * buffer space required by Tcl_PrintDouble.
1018
+ */
1019
+
1020
+ #define TCL_MAX_PREC 17
1021
+ #define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
1022
+
1023
+ /*
1024
+ * Definition for a number of bytes of buffer space sufficient to hold the
1025
+ * string representation of an integer in base 10 (assuming the existence of
1026
+ * 64-bit integers).
1027
+ */
1028
+
1029
+ #define TCL_INTEGER_SPACE 24
1030
+
1031
+ /*
1032
+ * Flag values passed to Tcl_ConvertElement.
1033
+ * TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
1034
+ * use backslash quoting instead.
1035
+ * TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
1036
+ * is safe to leave the hash unquoted when the element is not the first
1037
+ * element of a list, and this flag can be used by the caller to indicate
1038
+ * that condition.
1039
+ */
1040
+
1041
+ #define TCL_DONT_USE_BRACES 1
1042
+ #define TCL_DONT_QUOTE_HASH 8
1043
+
1044
+ /*
1045
+ * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
1046
+ * abbreviated strings.
1047
+ */
1048
+
1049
+ #define TCL_EXACT 1
1050
+
1051
+ /*
1052
+ *----------------------------------------------------------------------------
1053
+ * Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
1054
+ * WARNING: these bit choices must not conflict with the bit choices for
1055
+ * evalFlag bits in tclInt.h!
1056
+ *
1057
+ * Meanings:
1058
+ * TCL_NO_EVAL: Just record this command
1059
+ * TCL_EVAL_GLOBAL: Execute script in global namespace
1060
+ * TCL_EVAL_DIRECT: Do not compile this script
1061
+ * TCL_EVAL_INVOKE: Magical Tcl_EvalObjv mode for aliases/ensembles
1062
+ * o Run in iPtr->lookupNsPtr or global namespace
1063
+ * o Cut out of error traces
1064
+ * o Don't reset the flags controlling ensemble
1065
+ * error message rewriting.
1066
+ * TCL_CANCEL_UNWIND: Magical Tcl_CancelEval mode that causes the
1067
+ * stack for the script in progress to be
1068
+ * completely unwound.
1069
+ * TCL_EVAL_NOERR: Do no exception reporting at all, just return
1070
+ * as the caller will report.
1071
+ */
1072
+
1073
+ #define TCL_NO_EVAL 0x010000
1074
+ #define TCL_EVAL_GLOBAL 0x020000
1075
+ #define TCL_EVAL_DIRECT 0x040000
1076
+ #define TCL_EVAL_INVOKE 0x080000
1077
+ #define TCL_CANCEL_UNWIND 0x100000
1078
+ #define TCL_EVAL_NOERR 0x200000
1079
+
1080
+ /*
1081
+ * Special freeProc values that may be passed to Tcl_SetResult (see the man
1082
+ * page for details):
1083
+ */
1084
+
1085
+ #define TCL_VOLATILE ((Tcl_FreeProc *) 1)
1086
+ #define TCL_STATIC ((Tcl_FreeProc *) 0)
1087
+ #define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
1088
+
1089
+ /*
1090
+ * Flag values passed to variable-related functions.
1091
+ * WARNING: these bit choices must not conflict with the bit choice for
1092
+ * TCL_CANCEL_UNWIND, above.
1093
+ */
1094
+
1095
+ #define TCL_GLOBAL_ONLY 1
1096
+ #define TCL_NAMESPACE_ONLY 2
1097
+ #define TCL_APPEND_VALUE 4
1098
+ #define TCL_LIST_ELEMENT 8
1099
+ #define TCL_TRACE_READS 0x10
1100
+ #define TCL_TRACE_WRITES 0x20
1101
+ #define TCL_TRACE_UNSETS 0x40
1102
+ #define TCL_TRACE_DESTROYED 0x80
1103
+ #define TCL_INTERP_DESTROYED 0x100
1104
+ #define TCL_LEAVE_ERR_MSG 0x200
1105
+ #define TCL_TRACE_ARRAY 0x800
1106
+ #ifndef TCL_REMOVE_OBSOLETE_TRACES
1107
+ /* Required to support old variable/vdelete/vinfo traces. */
1108
+ #define TCL_TRACE_OLD_STYLE 0x1000
1109
+ #endif
1110
+ /* Indicate the semantics of the result of a trace. */
1111
+ #define TCL_TRACE_RESULT_DYNAMIC 0x8000
1112
+ #define TCL_TRACE_RESULT_OBJECT 0x10000
1113
+
1114
+ /*
1115
+ * Flag values for ensemble commands.
1116
+ */
1117
+
1118
+ #define TCL_ENSEMBLE_PREFIX 0x02/* Flag value to say whether to allow
1119
+ * unambiguous prefixes of commands or to
1120
+ * require exact matches for command names. */
1121
+
1122
+ /*
1123
+ * Flag values passed to command-related functions.
1124
+ */
1125
+
1126
+ #define TCL_TRACE_RENAME 0x2000
1127
+ #define TCL_TRACE_DELETE 0x4000
1128
+
1129
+ #define TCL_ALLOW_INLINE_COMPILATION 0x20000
1130
+
1131
+ /*
1132
+ * The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
1133
+ * always parsed whenever the part2 is NULL. (This is to avoid a common error
1134
+ * when converting code to use the new object based APIs and forgetting to
1135
+ * give the flag)
1136
+ */
1137
+
1138
+ #if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
1139
+ # define TCL_PARSE_PART1 0x400
1140
+ #endif /* !TCL_NO_DEPRECATED */
1141
+
1142
+ /*
1143
+ * Types for linked variables:
1144
+ */
1145
+
1146
+ #define TCL_LINK_INT 1
1147
+ #define TCL_LINK_DOUBLE 2
1148
+ #define TCL_LINK_BOOLEAN 3
1149
+ #define TCL_LINK_STRING 4
1150
+ #define TCL_LINK_WIDE_INT 5
1151
+ #define TCL_LINK_CHAR 6
1152
+ #define TCL_LINK_UCHAR 7
1153
+ #define TCL_LINK_SHORT 8
1154
+ #define TCL_LINK_USHORT 9
1155
+ #define TCL_LINK_UINT 10
1156
+ #define TCL_LINK_LONG 11
1157
+ #define TCL_LINK_ULONG 12
1158
+ #define TCL_LINK_FLOAT 13
1159
+ #define TCL_LINK_WIDE_UINT 14
1160
+ #define TCL_LINK_READ_ONLY 0x80
1161
+
1162
+ /*
1163
+ *----------------------------------------------------------------------------
1164
+ * Forward declarations of Tcl_HashTable and related types.
1165
+ */
1166
+
1167
+ typedef struct Tcl_HashKeyType Tcl_HashKeyType;
1168
+ typedef struct Tcl_HashTable Tcl_HashTable;
1169
+ typedef struct Tcl_HashEntry Tcl_HashEntry;
1170
+
1171
+ typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
1172
+ typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
1173
+ typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
1174
+ void *keyPtr);
1175
+ typedef void (Tcl_FreeHashEntryProc) (Tcl_HashEntry *hPtr);
1176
+
1177
+ /*
1178
+ * This flag controls whether the hash table stores the hash of a key, or
1179
+ * recalculates it. There should be no reason for turning this flag off as it
1180
+ * is completely binary and source compatible unless you directly access the
1181
+ * bucketPtr member of the Tcl_HashTableEntry structure. This member has been
1182
+ * removed and the space used to store the hash value.
1183
+ */
1184
+
1185
+ #ifndef TCL_HASH_KEY_STORE_HASH
1186
+ # define TCL_HASH_KEY_STORE_HASH 1
1187
+ #endif
1188
+
1189
+ /*
1190
+ * Structure definition for an entry in a hash table. No-one outside Tcl
1191
+ * should access any of these fields directly; use the macros defined below.
1192
+ */
1193
+
1194
+ struct Tcl_HashEntry {
1195
+ Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
1196
+ * or NULL for end of chain. */
1197
+ Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
1198
+ #if TCL_HASH_KEY_STORE_HASH
1199
+ void *hash; /* Hash value, stored as pointer to ensure
1200
+ * that the offsets of the fields in this
1201
+ * structure are not changed. */
1202
+ #else
1203
+ Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to first
1204
+ * entry in this entry's chain: used for
1205
+ * deleting the entry. */
1206
+ #endif
1207
+ ClientData clientData; /* Application stores something here with
1208
+ * Tcl_SetHashValue. */
1209
+ union { /* Key has one of these forms: */
1210
+ char *oneWordValue; /* One-word value for key. */
1211
+ Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
1212
+ int words[1]; /* Multiple integer words for key. The actual
1213
+ * size will be as large as necessary for this
1214
+ * table's keys. */
1215
+ char string[1]; /* String for key. The actual size will be as
1216
+ * large as needed to hold the key. */
1217
+ } key; /* MUST BE LAST FIELD IN RECORD!! */
1218
+ };
1219
+
1220
+ /*
1221
+ * Flags used in Tcl_HashKeyType.
1222
+ *
1223
+ * TCL_HASH_KEY_RANDOMIZE_HASH -
1224
+ * There are some things, pointers for example
1225
+ * which don't hash well because they do not use
1226
+ * the lower bits. If this flag is set then the
1227
+ * hash table will attempt to rectify this by
1228
+ * randomising the bits and then using the upper
1229
+ * N bits as the index into the table.
1230
+ * TCL_HASH_KEY_SYSTEM_HASH - If this flag is set then all memory internally
1231
+ * allocated for the hash table that is not for an
1232
+ * entry will use the system heap.
1233
+ */
1234
+
1235
+ #define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
1236
+ #define TCL_HASH_KEY_SYSTEM_HASH 0x2
1237
+
1238
+ /*
1239
+ * Structure definition for the methods associated with a hash table key type.
1240
+ */
1241
+
1242
+ #define TCL_HASH_KEY_TYPE_VERSION 1
1243
+ struct Tcl_HashKeyType {
1244
+ int version; /* Version of the table. If this structure is
1245
+ * extended in future then the version can be
1246
+ * used to distinguish between different
1247
+ * structures. */
1248
+ int flags; /* Flags, see above for details. */
1249
+ Tcl_HashKeyProc *hashKeyProc;
1250
+ /* Calculates a hash value for the key. If
1251
+ * this is NULL then the pointer itself is
1252
+ * used as a hash value. */
1253
+ Tcl_CompareHashKeysProc *compareKeysProc;
1254
+ /* Compares two keys and returns zero if they
1255
+ * do not match, and non-zero if they do. If
1256
+ * this is NULL then the pointers are
1257
+ * compared. */
1258
+ Tcl_AllocHashEntryProc *allocEntryProc;
1259
+ /* Called to allocate memory for a new entry,
1260
+ * i.e. if the key is a string then this could
1261
+ * allocate a single block which contains
1262
+ * enough space for both the entry and the
1263
+ * string. Only the key field of the allocated
1264
+ * Tcl_HashEntry structure needs to be filled
1265
+ * in. If something else needs to be done to
1266
+ * the key, i.e. incrementing a reference
1267
+ * count then that should be done by this
1268
+ * function. If this is NULL then Tcl_Alloc is
1269
+ * used to allocate enough space for a
1270
+ * Tcl_HashEntry and the key pointer is
1271
+ * assigned to key.oneWordValue. */
1272
+ Tcl_FreeHashEntryProc *freeEntryProc;
1273
+ /* Called to free memory associated with an
1274
+ * entry. If something else needs to be done
1275
+ * to the key, i.e. decrementing a reference
1276
+ * count then that should be done by this
1277
+ * function. If this is NULL then Tcl_Free is
1278
+ * used to free the Tcl_HashEntry. */
1279
+ };
1280
+
1281
+ /*
1282
+ * Structure definition for a hash table. Must be in tcl.h so clients can
1283
+ * allocate space for these structures, but clients should never access any
1284
+ * fields in this structure.
1285
+ */
1286
+
1287
+ #define TCL_SMALL_HASH_TABLE 4
1288
+ struct Tcl_HashTable {
1289
+ Tcl_HashEntry **buckets; /* Pointer to bucket array. Each element
1290
+ * points to first entry in bucket's hash
1291
+ * chain, or NULL. */
1292
+ Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
1293
+ /* Bucket array used for small tables (to
1294
+ * avoid mallocs and frees). */
1295
+ int numBuckets; /* Total number of buckets allocated at
1296
+ * **bucketPtr. */
1297
+ int numEntries; /* Total number of entries present in
1298
+ * table. */
1299
+ int rebuildSize; /* Enlarge table when numEntries gets to be
1300
+ * this large. */
1301
+ int downShift; /* Shift count used in hashing function.
1302
+ * Designed to use high-order bits of
1303
+ * randomized keys. */
1304
+ int mask; /* Mask value used in hashing function. */
1305
+ int keyType; /* Type of keys used in this table. It's
1306
+ * either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
1307
+ * TCL_ONE_WORD_KEYS, or an integer giving the
1308
+ * number of ints that is the size of the
1309
+ * key. */
1310
+ Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const char *key);
1311
+ Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const char *key,
1312
+ int *newPtr);
1313
+ const Tcl_HashKeyType *typePtr;
1314
+ /* Type of the keys used in the
1315
+ * Tcl_HashTable. */
1316
+ };
1317
+
1318
+ /*
1319
+ * Structure definition for information used to keep track of searches through
1320
+ * hash tables:
1321
+ */
1322
+
1323
+ typedef struct Tcl_HashSearch {
1324
+ Tcl_HashTable *tablePtr; /* Table being searched. */
1325
+ int nextIndex; /* Index of next bucket to be enumerated after
1326
+ * present one. */
1327
+ Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
1328
+ * bucket. */
1329
+ } Tcl_HashSearch;
1330
+
1331
+ /*
1332
+ * Acceptable key types for hash tables:
1333
+ *
1334
+ * TCL_STRING_KEYS: The keys are strings, they are copied into the
1335
+ * entry.
1336
+ * TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored
1337
+ * in the entry.
1338
+ * TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied
1339
+ * into the entry.
1340
+ * TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the
1341
+ * pointer is stored in the entry.
1342
+ *
1343
+ * While maintaining binary compatibility the above have to be distinct values
1344
+ * as they are used to differentiate between old versions of the hash table
1345
+ * which don't have a typePtr and new ones which do. Once binary compatibility
1346
+ * is discarded in favour of making more wide spread changes TCL_STRING_KEYS
1347
+ * can be the same as TCL_CUSTOM_TYPE_KEYS, and TCL_ONE_WORD_KEYS can be the
1348
+ * same as TCL_CUSTOM_PTR_KEYS because they simply determine how the key is
1349
+ * accessed from the entry and not the behaviour.
1350
+ */
1351
+
1352
+ #define TCL_STRING_KEYS (0)
1353
+ #define TCL_ONE_WORD_KEYS (1)
1354
+ #define TCL_CUSTOM_TYPE_KEYS (-2)
1355
+ #define TCL_CUSTOM_PTR_KEYS (-1)
1356
+
1357
+ /*
1358
+ * Structure definition for information used to keep track of searches through
1359
+ * dictionaries. These fields should not be accessed by code outside
1360
+ * tclDictObj.c
1361
+ */
1362
+
1363
+ typedef struct {
1364
+ void *next; /* Search position for underlying hash
1365
+ * table. */
1366
+ int epoch; /* Epoch marker for dictionary being searched,
1367
+ * or -1 if search has terminated. */
1368
+ Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
1369
+ } Tcl_DictSearch;
1370
+
1371
+ /*
1372
+ *----------------------------------------------------------------------------
1373
+ * Flag values to pass to Tcl_DoOneEvent to disable searches for some kinds of
1374
+ * events:
1375
+ */
1376
+
1377
+ #define TCL_DONT_WAIT (1<<1)
1378
+ #define TCL_WINDOW_EVENTS (1<<2)
1379
+ #define TCL_FILE_EVENTS (1<<3)
1380
+ #define TCL_TIMER_EVENTS (1<<4)
1381
+ #define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
1382
+ #define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
1383
+
1384
+ /*
1385
+ * The following structure defines a generic event for the Tcl event system.
1386
+ * These are the things that are queued in calls to Tcl_QueueEvent and
1387
+ * serviced later by Tcl_DoOneEvent. There can be many different kinds of
1388
+ * events with different fields, corresponding to window events, timer events,
1389
+ * etc. The structure for a particular event consists of a Tcl_Event header
1390
+ * followed by additional information specific to that event.
1391
+ */
1392
+
1393
+ struct Tcl_Event {
1394
+ Tcl_EventProc *proc; /* Function to call to service this event. */
1395
+ struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
1396
+ };
1397
+
1398
+ /*
1399
+ * Positions to pass to Tcl_QueueEvent:
1400
+ */
1401
+
1402
+ typedef enum {
1403
+ TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
1404
+ } Tcl_QueuePosition;
1405
+
1406
+ /*
1407
+ * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
1408
+ * event routines.
1409
+ */
1410
+
1411
+ #define TCL_SERVICE_NONE 0
1412
+ #define TCL_SERVICE_ALL 1
1413
+
1414
+ /*
1415
+ * The following structure keeps is used to hold a time value, either as an
1416
+ * absolute time (the number of seconds from the epoch) or as an elapsed time.
1417
+ * On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
1418
+ */
1419
+
1420
+ typedef struct Tcl_Time {
1421
+ long sec; /* Seconds. */
1422
+ long usec; /* Microseconds. */
1423
+ } Tcl_Time;
1424
+
1425
+ typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
1426
+ typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
1427
+
1428
+ /*
1429
+ * TIP #233 (Virtualized Time)
1430
+ */
1431
+
1432
+ typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, ClientData clientData);
1433
+ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
1434
+
1435
+ /*
1436
+ *----------------------------------------------------------------------------
1437
+ * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler to
1438
+ * indicate what sorts of events are of interest:
1439
+ */
1440
+
1441
+ #define TCL_READABLE (1<<1)
1442
+ #define TCL_WRITABLE (1<<2)
1443
+ #define TCL_EXCEPTION (1<<3)
1444
+
1445
+ /*
1446
+ * Flag values to pass to Tcl_OpenCommandChannel to indicate the disposition
1447
+ * of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, are also used in
1448
+ * Tcl_GetStdChannel.
1449
+ */
1450
+
1451
+ #define TCL_STDIN (1<<1)
1452
+ #define TCL_STDOUT (1<<2)
1453
+ #define TCL_STDERR (1<<3)
1454
+ #define TCL_ENFORCE_MODE (1<<4)
1455
+
1456
+ /*
1457
+ * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
1458
+ * should be closed.
1459
+ */
1460
+
1461
+ #define TCL_CLOSE_READ (1<<1)
1462
+ #define TCL_CLOSE_WRITE (1<<2)
1463
+
1464
+ /*
1465
+ * Value to use as the closeProc for a channel that supports the close2Proc
1466
+ * interface.
1467
+ */
1468
+
1469
+ #define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *) 1)
1470
+
1471
+ /*
1472
+ * Channel version tag. This was introduced in 8.3.2/8.4.
1473
+ */
1474
+
1475
+ #define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1)
1476
+ #define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2)
1477
+ #define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3)
1478
+ #define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4)
1479
+ #define TCL_CHANNEL_VERSION_5 ((Tcl_ChannelTypeVersion) 0x5)
1480
+
1481
+ /*
1482
+ * TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc.
1483
+ */
1484
+
1485
+ #define TCL_CHANNEL_THREAD_INSERT (0)
1486
+ #define TCL_CHANNEL_THREAD_REMOVE (1)
1487
+
1488
+ /*
1489
+ * Typedefs for the various operations in a channel type:
1490
+ */
1491
+
1492
+ typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode);
1493
+ typedef int (Tcl_DriverCloseProc) (ClientData instanceData,
1494
+ Tcl_Interp *interp);
1495
+ typedef int (Tcl_DriverClose2Proc) (ClientData instanceData,
1496
+ Tcl_Interp *interp, int flags);
1497
+ typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf,
1498
+ int toRead, int *errorCodePtr);
1499
+ typedef int (Tcl_DriverOutputProc) (ClientData instanceData,
1500
+ CONST84 char *buf, int toWrite, int *errorCodePtr);
1501
+ typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset,
1502
+ int mode, int *errorCodePtr);
1503
+ typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData,
1504
+ Tcl_Interp *interp, const char *optionName,
1505
+ const char *value);
1506
+ typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData,
1507
+ Tcl_Interp *interp, CONST84 char *optionName,
1508
+ Tcl_DString *dsPtr);
1509
+ typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask);
1510
+ typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData,
1511
+ int direction, ClientData *handlePtr);
1512
+ typedef int (Tcl_DriverFlushProc) (ClientData instanceData);
1513
+ typedef int (Tcl_DriverHandlerProc) (ClientData instanceData,
1514
+ int interestMask);
1515
+ typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData,
1516
+ Tcl_WideInt offset, int mode, int *errorCodePtr);
1517
+ /*
1518
+ * TIP #218, Channel Thread Actions
1519
+ */
1520
+ typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData,
1521
+ int action);
1522
+ /*
1523
+ * TIP #208, File Truncation (etc.)
1524
+ */
1525
+ typedef int (Tcl_DriverTruncateProc) (ClientData instanceData,
1526
+ Tcl_WideInt length);
1527
+
1528
+ /*
1529
+ * struct Tcl_ChannelType:
1530
+ *
1531
+ * One such structure exists for each type (kind) of channel. It collects
1532
+ * together in one place all the functions that are part of the specific
1533
+ * channel type.
1534
+ *
1535
+ * It is recommend that the Tcl_Channel* functions are used to access elements
1536
+ * of this structure, instead of direct accessing.
1537
+ */
1538
+
1539
+ typedef struct Tcl_ChannelType {
1540
+ const char *typeName; /* The name of the channel type in Tcl
1541
+ * commands. This storage is owned by channel
1542
+ * type. */
1543
+ Tcl_ChannelTypeVersion version;
1544
+ /* Version of the channel type. */
1545
+ Tcl_DriverCloseProc *closeProc;
1546
+ /* Function to call to close the channel, or
1547
+ * TCL_CLOSE2PROC if the close2Proc should be
1548
+ * used instead. */
1549
+ Tcl_DriverInputProc *inputProc;
1550
+ /* Function to call for input on channel. */
1551
+ Tcl_DriverOutputProc *outputProc;
1552
+ /* Function to call for output on channel. */
1553
+ Tcl_DriverSeekProc *seekProc;
1554
+ /* Function to call to seek on the channel.
1555
+ * May be NULL. */
1556
+ Tcl_DriverSetOptionProc *setOptionProc;
1557
+ /* Set an option on a channel. */
1558
+ Tcl_DriverGetOptionProc *getOptionProc;
1559
+ /* Get an option from a channel. */
1560
+ Tcl_DriverWatchProc *watchProc;
1561
+ /* Set up the notifier to watch for events on
1562
+ * this channel. */
1563
+ Tcl_DriverGetHandleProc *getHandleProc;
1564
+ /* Get an OS handle from the channel or NULL
1565
+ * if not supported. */
1566
+ Tcl_DriverClose2Proc *close2Proc;
1567
+ /* Function to call to close the channel if
1568
+ * the device supports closing the read &
1569
+ * write sides independently. */
1570
+ Tcl_DriverBlockModeProc *blockModeProc;
1571
+ /* Set blocking mode for the raw channel. May
1572
+ * be NULL. */
1573
+ /*
1574
+ * Only valid in TCL_CHANNEL_VERSION_2 channels or later.
1575
+ */
1576
+ Tcl_DriverFlushProc *flushProc;
1577
+ /* Function to call to flush a channel. May be
1578
+ * NULL. */
1579
+ Tcl_DriverHandlerProc *handlerProc;
1580
+ /* Function to call to handle a channel event.
1581
+ * This will be passed up the stacked channel
1582
+ * chain. */
1583
+ /*
1584
+ * Only valid in TCL_CHANNEL_VERSION_3 channels or later.
1585
+ */
1586
+ Tcl_DriverWideSeekProc *wideSeekProc;
1587
+ /* Function to call to seek on the channel
1588
+ * which can handle 64-bit offsets. May be
1589
+ * NULL, and must be NULL if seekProc is
1590
+ * NULL. */
1591
+ /*
1592
+ * Only valid in TCL_CHANNEL_VERSION_4 channels or later.
1593
+ * TIP #218, Channel Thread Actions.
1594
+ */
1595
+ Tcl_DriverThreadActionProc *threadActionProc;
1596
+ /* Function to call to notify the driver of
1597
+ * thread specific activity for a channel. May
1598
+ * be NULL. */
1599
+ /*
1600
+ * Only valid in TCL_CHANNEL_VERSION_5 channels or later.
1601
+ * TIP #208, File Truncation.
1602
+ */
1603
+ Tcl_DriverTruncateProc *truncateProc;
1604
+ /* Function to call to truncate the underlying
1605
+ * file to a particular length. May be NULL if
1606
+ * the channel does not support truncation. */
1607
+ } Tcl_ChannelType;
1608
+
1609
+ /*
1610
+ * The following flags determine whether the blockModeProc above should set
1611
+ * the channel into blocking or nonblocking mode. They are passed as arguments
1612
+ * to the blockModeProc function in the above structure.
1613
+ */
1614
+
1615
+ #define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
1616
+ #define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
1617
+ * mode. */
1618
+
1619
+ /*
1620
+ *----------------------------------------------------------------------------
1621
+ * Enum for different types of file paths.
1622
+ */
1623
+
1624
+ typedef enum Tcl_PathType {
1625
+ TCL_PATH_ABSOLUTE,
1626
+ TCL_PATH_RELATIVE,
1627
+ TCL_PATH_VOLUME_RELATIVE
1628
+ } Tcl_PathType;
1629
+
1630
+ /*
1631
+ * The following structure is used to pass glob type data amongst the various
1632
+ * glob routines and Tcl_FSMatchInDirectory.
1633
+ */
1634
+
1635
+ typedef struct Tcl_GlobTypeData {
1636
+ int type; /* Corresponds to bcdpfls as in 'find -t'. */
1637
+ int perm; /* Corresponds to file permissions. */
1638
+ Tcl_Obj *macType; /* Acceptable Mac type. */
1639
+ Tcl_Obj *macCreator; /* Acceptable Mac creator. */
1640
+ } Tcl_GlobTypeData;
1641
+
1642
+ /*
1643
+ * Type and permission definitions for glob command.
1644
+ */
1645
+
1646
+ #define TCL_GLOB_TYPE_BLOCK (1<<0)
1647
+ #define TCL_GLOB_TYPE_CHAR (1<<1)
1648
+ #define TCL_GLOB_TYPE_DIR (1<<2)
1649
+ #define TCL_GLOB_TYPE_PIPE (1<<3)
1650
+ #define TCL_GLOB_TYPE_FILE (1<<4)
1651
+ #define TCL_GLOB_TYPE_LINK (1<<5)
1652
+ #define TCL_GLOB_TYPE_SOCK (1<<6)
1653
+ #define TCL_GLOB_TYPE_MOUNT (1<<7)
1654
+
1655
+ #define TCL_GLOB_PERM_RONLY (1<<0)
1656
+ #define TCL_GLOB_PERM_HIDDEN (1<<1)
1657
+ #define TCL_GLOB_PERM_R (1<<2)
1658
+ #define TCL_GLOB_PERM_W (1<<3)
1659
+ #define TCL_GLOB_PERM_X (1<<4)
1660
+
1661
+ /*
1662
+ * Flags for the unload callback function.
1663
+ */
1664
+
1665
+ #define TCL_UNLOAD_DETACH_FROM_INTERPRETER (1<<0)
1666
+ #define TCL_UNLOAD_DETACH_FROM_PROCESS (1<<1)
1667
+
1668
+ /*
1669
+ * Typedefs for the various filesystem operations:
1670
+ */
1671
+
1672
+ typedef int (Tcl_FSStatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
1673
+ typedef int (Tcl_FSAccessProc) (Tcl_Obj *pathPtr, int mode);
1674
+ typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) (Tcl_Interp *interp,
1675
+ Tcl_Obj *pathPtr, int mode, int permissions);
1676
+ typedef int (Tcl_FSMatchInDirectoryProc) (Tcl_Interp *interp, Tcl_Obj *result,
1677
+ Tcl_Obj *pathPtr, const char *pattern, Tcl_GlobTypeData *types);
1678
+ typedef Tcl_Obj * (Tcl_FSGetCwdProc) (Tcl_Interp *interp);
1679
+ typedef int (Tcl_FSChdirProc) (Tcl_Obj *pathPtr);
1680
+ typedef int (Tcl_FSLstatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
1681
+ typedef int (Tcl_FSCreateDirectoryProc) (Tcl_Obj *pathPtr);
1682
+ typedef int (Tcl_FSDeleteFileProc) (Tcl_Obj *pathPtr);
1683
+ typedef int (Tcl_FSCopyDirectoryProc) (Tcl_Obj *srcPathPtr,
1684
+ Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr);
1685
+ typedef int (Tcl_FSCopyFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
1686
+ typedef int (Tcl_FSRemoveDirectoryProc) (Tcl_Obj *pathPtr, int recursive,
1687
+ Tcl_Obj **errorPtr);
1688
+ typedef int (Tcl_FSRenameFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
1689
+ typedef void (Tcl_FSUnloadFileProc) (Tcl_LoadHandle loadHandle);
1690
+ typedef Tcl_Obj * (Tcl_FSListVolumesProc) (void);
1691
+ /* We have to declare the utime structure here. */
1692
+ struct utimbuf;
1693
+ typedef int (Tcl_FSUtimeProc) (Tcl_Obj *pathPtr, struct utimbuf *tval);
1694
+ typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
1695
+ int nextCheckpoint);
1696
+ typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
1697
+ Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
1698
+ typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
1699
+ Tcl_Obj **objPtrRef);
1700
+ typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
1701
+ Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
1702
+ typedef Tcl_Obj * (Tcl_FSLinkProc) (Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
1703
+ int linkType);
1704
+ typedef int (Tcl_FSLoadFileProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
1705
+ Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr);
1706
+ typedef int (Tcl_FSPathInFilesystemProc) (Tcl_Obj *pathPtr,
1707
+ ClientData *clientDataPtr);
1708
+ typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) (Tcl_Obj *pathPtr);
1709
+ typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) (Tcl_Obj *pathPtr);
1710
+ typedef void (Tcl_FSFreeInternalRepProc) (ClientData clientData);
1711
+ typedef ClientData (Tcl_FSDupInternalRepProc) (ClientData clientData);
1712
+ typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (ClientData clientData);
1713
+ typedef ClientData (Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
1714
+
1715
+ typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
1716
+
1717
+ /*
1718
+ *----------------------------------------------------------------------------
1719
+ * Data structures related to hooking into the filesystem
1720
+ */
1721
+
1722
+ /*
1723
+ * Filesystem version tag. This was introduced in 8.4.
1724
+ */
1725
+
1726
+ #define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1)
1727
+
1728
+ /*
1729
+ * struct Tcl_Filesystem:
1730
+ *
1731
+ * One such structure exists for each type (kind) of filesystem. It collects
1732
+ * together the functions that form the interface for a particulr the
1733
+ * filesystem. Tcl always accesses the filesystem through one of these
1734
+ * structures.
1735
+ *
1736
+ * Not all entries need be non-NULL; any which are NULL are simply ignored.
1737
+ * However, a complete filesystem should provide all of these functions. The
1738
+ * explanations in the structure show the importance of each function.
1739
+ */
1740
+
1741
+ typedef struct Tcl_Filesystem {
1742
+ const char *typeName; /* The name of the filesystem. */
1743
+ int structureLength; /* Length of this structure, so future binary
1744
+ * compatibility can be assured. */
1745
+ Tcl_FSVersion version; /* Version of the filesystem type. */
1746
+ Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
1747
+ /* Determines whether the pathname is in this
1748
+ * filesystem. This is the most important
1749
+ * filesystem function. */
1750
+ Tcl_FSDupInternalRepProc *dupInternalRepProc;
1751
+ /* Duplicates the internal handle of the node.
1752
+ * If it is NULL, the filesystem is less
1753
+ * performant. */
1754
+ Tcl_FSFreeInternalRepProc *freeInternalRepProc;
1755
+ /* Frees the internal handle of the node. NULL
1756
+ * only if there is no need to free resources
1757
+ * used for the internal handle. */
1758
+ Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
1759
+ /* Converts the internal handle to a normalized
1760
+ * path. NULL if the filesystem creates nodes
1761
+ * having no pathname. */
1762
+ Tcl_FSCreateInternalRepProc *createInternalRepProc;
1763
+ /* Creates an internal handle for a pathname.
1764
+ * May be NULL if pathnames have no internal
1765
+ * handle or if pathInFilesystemProc always
1766
+ * immediately creates an internal
1767
+ * representation for pathnames in the
1768
+ * filesystem. */
1769
+ Tcl_FSNormalizePathProc *normalizePathProc;
1770
+ /* Normalizes a path. Should be implemented if
1771
+ * the filesystems supports multiple paths to
1772
+ * the same node. */
1773
+ Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
1774
+ /* Determines the type of a path in this
1775
+ * filesystem. May be NULL. */
1776
+ Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
1777
+ /* Produces the separator character(s) for this
1778
+ * filesystem. Must not be NULL. */
1779
+ Tcl_FSStatProc *statProc; /* Called by 'Tcl_FSStat()'. Provided by any
1780
+ * reasonable filesystem. */
1781
+ Tcl_FSAccessProc *accessProc;
1782
+ /* Called by 'Tcl_FSAccess()'. Implemented by
1783
+ * any reasonable filesystem. */
1784
+ Tcl_FSOpenFileChannelProc *openFileChannelProc;
1785
+ /* Called by 'Tcl_FSOpenFileChannel()'.
1786
+ * Provided by any reasonable filesystem. */
1787
+ Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
1788
+ /* Called by 'Tcl_FSMatchInDirectory()'. NULL
1789
+ * if the filesystem does not support glob or
1790
+ * recursive copy. */
1791
+ Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
1792
+ * mtime' to set (not read) times, 'file
1793
+ * atime', and the open-r/open-w/fcopy variant
1794
+ * of 'file copy'. */
1795
+ Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
1796
+ * creating links is not supported. */
1797
+ Tcl_FSListVolumesProc *listVolumesProc;
1798
+ /* Lists filesystem volumes added by this
1799
+ * filesystem. NULL if the filesystem does not
1800
+ * use volumes. */
1801
+ Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
1802
+ /* List all valid attributes strings. NULL if
1803
+ * the filesystem does not support the 'file
1804
+ * attributes' command. Can be used to attach
1805
+ * arbitrary additional data to files in a
1806
+ * filesystem. */
1807
+ Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
1808
+ /* Called by 'Tcl_FSFileAttrsGet()' and by
1809
+ * 'file attributes'. */
1810
+ Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
1811
+ /* Called by 'Tcl_FSFileAttrsSet()' and by
1812
+ * 'file attributes'. */
1813
+ Tcl_FSCreateDirectoryProc *createDirectoryProc;
1814
+ /* Called by 'Tcl_FSCreateDirectory()'. May be
1815
+ * NULL if the filesystem is read-only. */
1816
+ Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
1817
+ /* Called by 'Tcl_FSRemoveDirectory()'. May be
1818
+ * NULL if the filesystem is read-only. */
1819
+ Tcl_FSDeleteFileProc *deleteFileProc;
1820
+ /* Called by 'Tcl_FSDeleteFile()' May be NULL
1821
+ * if the filesystem is is read-only. */
1822
+ Tcl_FSCopyFileProc *copyFileProc;
1823
+ /* Called by 'Tcl_FSCopyFile()'. If NULL, for
1824
+ * a copy operation at the script level (not
1825
+ * C) Tcl uses open-r, open-w and fcopy. */
1826
+ Tcl_FSRenameFileProc *renameFileProc;
1827
+ /* Called by 'Tcl_FSRenameFile()'. If NULL, for
1828
+ * a rename operation at the script level (not
1829
+ * C) Tcl performs a copy operation followed
1830
+ * by a delete operation. */
1831
+ Tcl_FSCopyDirectoryProc *copyDirectoryProc;
1832
+ /* Called by 'Tcl_FSCopyDirectory()'. If NULL,
1833
+ * for a copy operation at the script level
1834
+ * (not C) Tcl recursively creates directories
1835
+ * and copies files. */
1836
+ Tcl_FSLstatProc *lstatProc; /* Called by 'Tcl_FSLstat()'. If NULL, Tcl
1837
+ * attempts to use 'statProc' instead. */
1838
+ Tcl_FSLoadFileProc *loadFileProc;
1839
+ /* Called by 'Tcl_FSLoadFile()'. If NULL, Tcl
1840
+ * performs a copy to a temporary file in the
1841
+ * native filesystem and then calls
1842
+ * Tcl_FSLoadFile() on that temporary copy. */
1843
+ Tcl_FSGetCwdProc *getCwdProc;
1844
+ /* Called by 'Tcl_FSGetCwd()'. Normally NULL.
1845
+ * Usually only called once: If 'getcwd' is
1846
+ * called before 'chdir' is ever called. */
1847
+ Tcl_FSChdirProc *chdirProc; /* Called by 'Tcl_FSChdir()'. For a virtual
1848
+ * filesystem, chdirProc just returns zero
1849
+ * (success) if the pathname is a valid
1850
+ * directory, and some other value otherwise.
1851
+ * For A real filesystem, chdirProc performs
1852
+ * the correct action, e.g. calls the system
1853
+ * 'chdir' function. If not implemented, then
1854
+ * 'cd' and 'pwd' fail for a pathname in this
1855
+ * filesystem. On success Tcl stores the
1856
+ * pathname for use by GetCwd. If NULL, Tcl
1857
+ * performs records the pathname as the new
1858
+ * current directory if it passes a series of
1859
+ * directory access checks. */
1860
+ } Tcl_Filesystem;
1861
+
1862
+ /*
1863
+ * The following definitions are used as values for the 'linkAction' flag to
1864
+ * Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
1865
+ * be given. For link creation, the linkProc should create a link which
1866
+ * matches any of the types given.
1867
+ *
1868
+ * TCL_CREATE_SYMBOLIC_LINK - Create a symbolic or soft link.
1869
+ * TCL_CREATE_HARD_LINK - Create a hard link.
1870
+ */
1871
+
1872
+ #define TCL_CREATE_SYMBOLIC_LINK 0x01
1873
+ #define TCL_CREATE_HARD_LINK 0x02
1874
+
1875
+ /*
1876
+ *----------------------------------------------------------------------------
1877
+ * The following structure represents the Notifier functions that you can
1878
+ * override with the Tcl_SetNotifier call.
1879
+ */
1880
+
1881
+ typedef struct Tcl_NotifierProcs {
1882
+ Tcl_SetTimerProc *setTimerProc;
1883
+ Tcl_WaitForEventProc *waitForEventProc;
1884
+ Tcl_CreateFileHandlerProc *createFileHandlerProc;
1885
+ Tcl_DeleteFileHandlerProc *deleteFileHandlerProc;
1886
+ Tcl_InitNotifierProc *initNotifierProc;
1887
+ Tcl_FinalizeNotifierProc *finalizeNotifierProc;
1888
+ Tcl_AlertNotifierProc *alertNotifierProc;
1889
+ Tcl_ServiceModeHookProc *serviceModeHookProc;
1890
+ } Tcl_NotifierProcs;
1891
+
1892
+ /*
1893
+ *----------------------------------------------------------------------------
1894
+ * The following data structures and declarations are for the new Tcl parser.
1895
+ *
1896
+ * For each word of a command, and for each piece of a word such as a variable
1897
+ * reference, one of the following structures is created to describe the
1898
+ * token.
1899
+ */
1900
+
1901
+ typedef struct Tcl_Token {
1902
+ int type; /* Type of token, such as TCL_TOKEN_WORD; see
1903
+ * below for valid types. */
1904
+ const char *start; /* First character in token. */
1905
+ int size; /* Number of bytes in token. */
1906
+ int numComponents; /* If this token is composed of other tokens,
1907
+ * this field tells how many of them there are
1908
+ * (including components of components, etc.).
1909
+ * The component tokens immediately follow
1910
+ * this one. */
1911
+ } Tcl_Token;
1912
+
1913
+ /*
1914
+ * Type values defined for Tcl_Token structures. These values are defined as
1915
+ * mask bits so that it's easy to check for collections of types.
1916
+ *
1917
+ * TCL_TOKEN_WORD - The token describes one word of a command,
1918
+ * from the first non-blank character of the word
1919
+ * (which may be " or {) up to but not including
1920
+ * the space, semicolon, or bracket that
1921
+ * terminates the word. NumComponents counts the
1922
+ * total number of sub-tokens that make up the
1923
+ * word. This includes, for example, sub-tokens
1924
+ * of TCL_TOKEN_VARIABLE tokens.
1925
+ * TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD except
1926
+ * that the word is guaranteed to consist of a
1927
+ * single TCL_TOKEN_TEXT sub-token.
1928
+ * TCL_TOKEN_TEXT - The token describes a range of literal text
1929
+ * that is part of a word. NumComponents is
1930
+ * always 0.
1931
+ * TCL_TOKEN_BS - The token describes a backslash sequence that
1932
+ * must be collapsed. NumComponents is always 0.
1933
+ * TCL_TOKEN_COMMAND - The token describes a command whose result
1934
+ * must be substituted into the word. The token
1935
+ * includes the enclosing brackets. NumComponents
1936
+ * is always 0.
1937
+ * TCL_TOKEN_VARIABLE - The token describes a variable substitution,
1938
+ * including the dollar sign, variable name, and
1939
+ * array index (if there is one) up through the
1940
+ * right parentheses. NumComponents tells how
1941
+ * many additional tokens follow to represent the
1942
+ * variable name. The first token will be a
1943
+ * TCL_TOKEN_TEXT token that describes the
1944
+ * variable name. If the variable is an array
1945
+ * reference then there will be one or more
1946
+ * additional tokens, of type TCL_TOKEN_TEXT,
1947
+ * TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
1948
+ * TCL_TOKEN_VARIABLE, that describe the array
1949
+ * index; numComponents counts the total number
1950
+ * of nested tokens that make up the variable
1951
+ * reference, including sub-tokens of
1952
+ * TCL_TOKEN_VARIABLE tokens.
1953
+ * TCL_TOKEN_SUB_EXPR - The token describes one subexpression of an
1954
+ * expression, from the first non-blank character
1955
+ * of the subexpression up to but not including
1956
+ * the space, brace, or bracket that terminates
1957
+ * the subexpression. NumComponents counts the
1958
+ * total number of following subtokens that make
1959
+ * up the subexpression; this includes all
1960
+ * subtokens for any nested TCL_TOKEN_SUB_EXPR
1961
+ * tokens. For example, a numeric value used as a
1962
+ * primitive operand is described by a
1963
+ * TCL_TOKEN_SUB_EXPR token followed by a
1964
+ * TCL_TOKEN_TEXT token. A binary subexpression
1965
+ * is described by a TCL_TOKEN_SUB_EXPR token
1966
+ * followed by the TCL_TOKEN_OPERATOR token for
1967
+ * the operator, then TCL_TOKEN_SUB_EXPR tokens
1968
+ * for the left then the right operands.
1969
+ * TCL_TOKEN_OPERATOR - The token describes one expression operator.
1970
+ * An operator might be the name of a math
1971
+ * function such as "abs". A TCL_TOKEN_OPERATOR
1972
+ * token is always preceded by one
1973
+ * TCL_TOKEN_SUB_EXPR token for the operator's
1974
+ * subexpression, and is followed by zero or more
1975
+ * TCL_TOKEN_SUB_EXPR tokens for the operator's
1976
+ * operands. NumComponents is always 0.
1977
+ * TCL_TOKEN_EXPAND_WORD - This token is just like TCL_TOKEN_WORD except
1978
+ * that it marks a word that began with the
1979
+ * literal character prefix "{*}". This word is
1980
+ * marked to be expanded - that is, broken into
1981
+ * words after substitution is complete.
1982
+ */
1983
+
1984
+ #define TCL_TOKEN_WORD 1
1985
+ #define TCL_TOKEN_SIMPLE_WORD 2
1986
+ #define TCL_TOKEN_TEXT 4
1987
+ #define TCL_TOKEN_BS 8
1988
+ #define TCL_TOKEN_COMMAND 16
1989
+ #define TCL_TOKEN_VARIABLE 32
1990
+ #define TCL_TOKEN_SUB_EXPR 64
1991
+ #define TCL_TOKEN_OPERATOR 128
1992
+ #define TCL_TOKEN_EXPAND_WORD 256
1993
+
1994
+ /*
1995
+ * Parsing error types. On any parsing error, one of these values will be
1996
+ * stored in the error field of the Tcl_Parse structure defined below.
1997
+ */
1998
+
1999
+ #define TCL_PARSE_SUCCESS 0
2000
+ #define TCL_PARSE_QUOTE_EXTRA 1
2001
+ #define TCL_PARSE_BRACE_EXTRA 2
2002
+ #define TCL_PARSE_MISSING_BRACE 3
2003
+ #define TCL_PARSE_MISSING_BRACKET 4
2004
+ #define TCL_PARSE_MISSING_PAREN 5
2005
+ #define TCL_PARSE_MISSING_QUOTE 6
2006
+ #define TCL_PARSE_MISSING_VAR_BRACE 7
2007
+ #define TCL_PARSE_SYNTAX 8
2008
+ #define TCL_PARSE_BAD_NUMBER 9
2009
+
2010
+ /*
2011
+ * A structure of the following type is filled in by Tcl_ParseCommand. It
2012
+ * describes a single command parsed from an input string.
2013
+ */
2014
+
2015
+ #define NUM_STATIC_TOKENS 20
2016
+
2017
+ typedef struct Tcl_Parse {
2018
+ const char *commentStart; /* Pointer to # that begins the first of one
2019
+ * or more comments preceding the command. */
2020
+ int commentSize; /* Number of bytes in comments (up through
2021
+ * newline character that terminates the last
2022
+ * comment). If there were no comments, this
2023
+ * field is 0. */
2024
+ const char *commandStart; /* First character in first word of
2025
+ * command. */
2026
+ int commandSize; /* Number of bytes in command, including first
2027
+ * character of first word, up through the
2028
+ * terminating newline, close bracket, or
2029
+ * semicolon. */
2030
+ int numWords; /* Total number of words in command. May be
2031
+ * 0. */
2032
+ Tcl_Token *tokenPtr; /* Pointer to first token representing the
2033
+ * words of the command. Initially points to
2034
+ * staticTokens, but may change to point to
2035
+ * malloc-ed space if command exceeds space in
2036
+ * staticTokens. */
2037
+ int numTokens; /* Total number of tokens in command. */
2038
+ int tokensAvailable; /* Total number of tokens available at
2039
+ * *tokenPtr. */
2040
+ int errorType; /* One of the parsing error types defined
2041
+ * above. */
2042
+
2043
+ /*
2044
+ * The fields below are intended only for the private use of the parser.
2045
+ * They should not be used by functions that invoke Tcl_ParseCommand.
2046
+ */
2047
+
2048
+ const char *string; /* The original command string passed to
2049
+ * Tcl_ParseCommand. */
2050
+ const char *end; /* Points to the character just after the last
2051
+ * one in the command string. */
2052
+ Tcl_Interp *interp; /* Interpreter to use for error reporting, or
2053
+ * NULL. */
2054
+ const char *term; /* Points to character in string that
2055
+ * terminated most recent token. Filled in by
2056
+ * ParseTokens. If an error occurs, points to
2057
+ * beginning of region where the error
2058
+ * occurred (e.g. the open brace if the close
2059
+ * brace is missing). */
2060
+ int incomplete; /* This field is set to 1 by Tcl_ParseCommand
2061
+ * if the command appears to be incomplete.
2062
+ * This information is used by
2063
+ * Tcl_CommandComplete. */
2064
+ Tcl_Token staticTokens[NUM_STATIC_TOKENS];
2065
+ /* Initial space for tokens for command. This
2066
+ * space should be large enough to accommodate
2067
+ * most commands; dynamic space is allocated
2068
+ * for very large commands that don't fit
2069
+ * here. */
2070
+ } Tcl_Parse;
2071
+
2072
+ /*
2073
+ *----------------------------------------------------------------------------
2074
+ * The following structure represents a user-defined encoding. It collects
2075
+ * together all the functions that are used by the specific encoding.
2076
+ */
2077
+
2078
+ typedef struct Tcl_EncodingType {
2079
+ const char *encodingName; /* The name of the encoding, e.g. "euc-jp".
2080
+ * This name is the unique key for this
2081
+ * encoding type. */
2082
+ Tcl_EncodingConvertProc *toUtfProc;
2083
+ /* Function to convert from external encoding
2084
+ * into UTF-8. */
2085
+ Tcl_EncodingConvertProc *fromUtfProc;
2086
+ /* Function to convert from UTF-8 into
2087
+ * external encoding. */
2088
+ Tcl_EncodingFreeProc *freeProc;
2089
+ /* If non-NULL, function to call when this
2090
+ * encoding is deleted. */
2091
+ ClientData clientData; /* Arbitrary value associated with encoding
2092
+ * type. Passed to conversion functions. */
2093
+ int nullSize; /* Number of zero bytes that signify
2094
+ * end-of-string in this encoding. This number
2095
+ * is used to determine the source string
2096
+ * length when the srcLen argument is
2097
+ * negative. Must be 1 or 2. */
2098
+ } Tcl_EncodingType;
2099
+
2100
+ /*
2101
+ * The following definitions are used as values for the conversion control
2102
+ * flags argument when converting text from one character set to another:
2103
+ *
2104
+ * TCL_ENCODING_START - Signifies that the source buffer is the first
2105
+ * block in a (potentially multi-block) input
2106
+ * stream. Tells the conversion function to reset
2107
+ * to an initial state and perform any
2108
+ * initialization that needs to occur before the
2109
+ * first byte is converted. If the source buffer
2110
+ * contains the entire input stream to be
2111
+ * converted, this flag should be set.
2112
+ * TCL_ENCODING_END - Signifies that the source buffer is the last
2113
+ * block in a (potentially multi-block) input
2114
+ * stream. Tells the conversion routine to
2115
+ * perform any finalization that needs to occur
2116
+ * after the last byte is converted and then to
2117
+ * reset to an initial state. If the source
2118
+ * buffer contains the entire input stream to be
2119
+ * converted, this flag should be set.
2120
+ * TCL_ENCODING_STOPONERROR - If set, the converter returns immediately upon
2121
+ * encountering an invalid byte sequence or a
2122
+ * source character that has no mapping in the
2123
+ * target encoding. If clear, the converter
2124
+ * substitues the problematic character(s) with
2125
+ * one or more "close" characters in the
2126
+ * destination buffer and then continues to
2127
+ * convert the source.
2128
+ * TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf does not append a
2129
+ * terminating NUL byte. Since it does not need
2130
+ * an extra byte for a terminating NUL, it fills
2131
+ * all dstLen bytes with encoded UTF-8 content if
2132
+ * needed. If clear, a byte is reserved in the
2133
+ * dst space for NUL termination, and a
2134
+ * terminating NUL is appended.
2135
+ * TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
2136
+ * Tcl_ExternalToUtf takes the initial value of
2137
+ * *dstCharsPtr as a limit of the maximum number
2138
+ * of chars to produce in the encoded UTF-8
2139
+ * content. Otherwise, the number of chars
2140
+ * produced is controlled only by other limiting
2141
+ * factors.
2142
+ */
2143
+
2144
+ #define TCL_ENCODING_START 0x01
2145
+ #define TCL_ENCODING_END 0x02
2146
+ #define TCL_ENCODING_STOPONERROR 0x04
2147
+ #define TCL_ENCODING_NO_TERMINATE 0x08
2148
+ #define TCL_ENCODING_CHAR_LIMIT 0x10
2149
+
2150
+ /*
2151
+ * The following definitions are the error codes returned by the conversion
2152
+ * routines:
2153
+ *
2154
+ * TCL_OK - All characters were converted.
2155
+ * TCL_CONVERT_NOSPACE - The output buffer would not have been large
2156
+ * enough for all of the converted data; as many
2157
+ * characters as could fit were converted though.
2158
+ * TCL_CONVERT_MULTIBYTE - The last few bytes in the source string were
2159
+ * the beginning of a multibyte sequence, but
2160
+ * more bytes were needed to complete this
2161
+ * sequence. A subsequent call to the conversion
2162
+ * routine should pass the beginning of this
2163
+ * unconverted sequence plus additional bytes
2164
+ * from the source stream to properly convert the
2165
+ * formerly split-up multibyte sequence.
2166
+ * TCL_CONVERT_SYNTAX - The source stream contained an invalid
2167
+ * character sequence. This may occur if the
2168
+ * input stream has been damaged or if the input
2169
+ * encoding method was misidentified. This error
2170
+ * is reported only if TCL_ENCODING_STOPONERROR
2171
+ * was specified.
2172
+ * TCL_CONVERT_UNKNOWN - The source string contained a character that
2173
+ * could not be represented in the target
2174
+ * encoding. This error is reported only if
2175
+ * TCL_ENCODING_STOPONERROR was specified.
2176
+ */
2177
+
2178
+ #define TCL_CONVERT_MULTIBYTE (-1)
2179
+ #define TCL_CONVERT_SYNTAX (-2)
2180
+ #define TCL_CONVERT_UNKNOWN (-3)
2181
+ #define TCL_CONVERT_NOSPACE (-4)
2182
+
2183
+ /*
2184
+ * The maximum number of bytes that are necessary to represent a single
2185
+ * Unicode character in UTF-8. The valid values should be 3, 4 or 6
2186
+ * (or perhaps 1 if we want to support a non-unicode enabled core). If 3 or
2187
+ * 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
2188
+ * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
2189
+ * is the default and recommended mode. UCS-4 is experimental and not
2190
+ * recommended. It works for the core, but most extensions expect UCS-2.
2191
+ */
2192
+
2193
+ #ifndef TCL_UTF_MAX
2194
+ #define TCL_UTF_MAX 3
2195
+ #endif
2196
+
2197
+ /*
2198
+ * This represents a Unicode character. Any changes to this should also be
2199
+ * reflected in regcustom.h.
2200
+ */
2201
+
2202
+ #if TCL_UTF_MAX > 4
2203
+ /*
2204
+ * unsigned int isn't 100% accurate as it should be a strict 4-byte value.
2205
+ * The size of this value must be reflected correctly in regcustom.h.
2206
+ * XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
2207
+ * XXX: string rep that Tcl_UniChar represents. Changing the size
2208
+ * XXX: of Tcl_UniChar is /not/ supported.
2209
+ */
2210
+ typedef unsigned int Tcl_UniChar;
2211
+ #else
2212
+ typedef unsigned short Tcl_UniChar;
2213
+ #endif
2214
+
2215
+ /*
2216
+ *----------------------------------------------------------------------------
2217
+ * TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
2218
+ * provide the system with the embedded configuration data.
2219
+ */
2220
+
2221
+ typedef struct Tcl_Config {
2222
+ const char *key; /* Configuration key to register. ASCII
2223
+ * encoded, thus UTF-8. */
2224
+ const char *value; /* The value associated with the key. System
2225
+ * encoding. */
2226
+ } Tcl_Config;
2227
+
2228
+ /*
2229
+ *----------------------------------------------------------------------------
2230
+ * Flags for TIP#143 limits, detailing which limits are active in an
2231
+ * interpreter. Used for Tcl_{Add,Remove}LimitHandler type argument.
2232
+ */
2233
+
2234
+ #define TCL_LIMIT_COMMANDS 0x01
2235
+ #define TCL_LIMIT_TIME 0x02
2236
+
2237
+ /*
2238
+ * Structure containing information about a limit handler to be called when a
2239
+ * command- or time-limit is exceeded by an interpreter.
2240
+ */
2241
+
2242
+ typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
2243
+ typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
2244
+
2245
+ /*
2246
+ *----------------------------------------------------------------------------
2247
+ * Override definitions for libtommath.
2248
+ */
2249
+
2250
+ typedef struct mp_int mp_int;
2251
+ #define MP_INT_DECLARED
2252
+ typedef unsigned int mp_digit;
2253
+ #define MP_DIGIT_DECLARED
2254
+
2255
+ /*
2256
+ *----------------------------------------------------------------------------
2257
+ * Definitions needed for Tcl_ParseArgvObj routines.
2258
+ * Based on tkArgv.c.
2259
+ * Modifications from the original are copyright (c) Sam Bromley 2006
2260
+ */
2261
+
2262
+ typedef struct {
2263
+ int type; /* Indicates the option type; see below. */
2264
+ const char *keyStr; /* The key string that flags the option in the
2265
+ * argv array. */
2266
+ void *srcPtr; /* Value to be used in setting dst; usage
2267
+ * depends on type.*/
2268
+ void *dstPtr; /* Address of value to be modified; usage
2269
+ * depends on type.*/
2270
+ const char *helpStr; /* Documentation message describing this
2271
+ * option. */
2272
+ ClientData clientData; /* Word to pass to function callbacks. */
2273
+ } Tcl_ArgvInfo;
2274
+
2275
+ /*
2276
+ * Legal values for the type field of a Tcl_ArgInfo: see the user
2277
+ * documentation for details.
2278
+ */
2279
+
2280
+ #define TCL_ARGV_CONSTANT 15
2281
+ #define TCL_ARGV_INT 16
2282
+ #define TCL_ARGV_STRING 17
2283
+ #define TCL_ARGV_REST 18
2284
+ #define TCL_ARGV_FLOAT 19
2285
+ #define TCL_ARGV_FUNC 20
2286
+ #define TCL_ARGV_GENFUNC 21
2287
+ #define TCL_ARGV_HELP 22
2288
+ #define TCL_ARGV_END 23
2289
+
2290
+ /*
2291
+ * Types of callback functions for the TCL_ARGV_FUNC and TCL_ARGV_GENFUNC
2292
+ * argument types:
2293
+ */
2294
+
2295
+ typedef int (Tcl_ArgvFuncProc)(ClientData clientData, Tcl_Obj *objPtr,
2296
+ void *dstPtr);
2297
+ typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
2298
+ int objc, Tcl_Obj *const *objv, void *dstPtr);
2299
+
2300
+ /*
2301
+ * Shorthand for commonly used argTable entries.
2302
+ */
2303
+
2304
+ #define TCL_ARGV_AUTO_HELP \
2305
+ {TCL_ARGV_HELP, "-help", NULL, NULL, \
2306
+ "Print summary of command-line options and abort", NULL}
2307
+ #define TCL_ARGV_AUTO_REST \
2308
+ {TCL_ARGV_REST, "--", NULL, NULL, \
2309
+ "Marks the end of the options", NULL}
2310
+ #define TCL_ARGV_TABLE_END \
2311
+ {TCL_ARGV_END, NULL, NULL, NULL, NULL, NULL}
2312
+
2313
+ /*
2314
+ *----------------------------------------------------------------------------
2315
+ * Definitions needed for Tcl_Zlib routines. [TIP #234]
2316
+ *
2317
+ * Constants for the format flags describing what sort of data format is
2318
+ * desired/expected for the Tcl_ZlibDeflate, Tcl_ZlibInflate and
2319
+ * Tcl_ZlibStreamInit functions.
2320
+ */
2321
+
2322
+ #define TCL_ZLIB_FORMAT_RAW 1
2323
+ #define TCL_ZLIB_FORMAT_ZLIB 2
2324
+ #define TCL_ZLIB_FORMAT_GZIP 4
2325
+ #define TCL_ZLIB_FORMAT_AUTO 8
2326
+
2327
+ /*
2328
+ * Constants that describe whether the stream is to operate in compressing or
2329
+ * decompressing mode.
2330
+ */
2331
+
2332
+ #define TCL_ZLIB_STREAM_DEFLATE 16
2333
+ #define TCL_ZLIB_STREAM_INFLATE 32
2334
+
2335
+ /*
2336
+ * Constants giving compression levels. Use of TCL_ZLIB_COMPRESS_DEFAULT is
2337
+ * recommended.
2338
+ */
2339
+
2340
+ #define TCL_ZLIB_COMPRESS_NONE 0
2341
+ #define TCL_ZLIB_COMPRESS_FAST 1
2342
+ #define TCL_ZLIB_COMPRESS_BEST 9
2343
+ #define TCL_ZLIB_COMPRESS_DEFAULT (-1)
2344
+
2345
+ /*
2346
+ * Constants for types of flushing, used with Tcl_ZlibFlush.
2347
+ */
2348
+
2349
+ #define TCL_ZLIB_NO_FLUSH 0
2350
+ #define TCL_ZLIB_FLUSH 2
2351
+ #define TCL_ZLIB_FULLFLUSH 3
2352
+ #define TCL_ZLIB_FINALIZE 4
2353
+
2354
+ /*
2355
+ *----------------------------------------------------------------------------
2356
+ * Definitions needed for the Tcl_LoadFile function. [TIP #416]
2357
+ */
2358
+
2359
+ #define TCL_LOAD_GLOBAL 1
2360
+ #define TCL_LOAD_LAZY 2
2361
+
2362
+ /*
2363
+ *----------------------------------------------------------------------------
2364
+ * Single public declaration for NRE.
2365
+ */
2366
+
2367
+ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
2368
+ int result);
2369
+
2370
+ /*
2371
+ *----------------------------------------------------------------------------
2372
+ * The following constant is used to test for older versions of Tcl in the
2373
+ * stubs tables.
2374
+ */
2375
+
2376
+ #define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
2377
+
2378
+ /*
2379
+ * The following function is required to be defined in all stubs aware
2380
+ * extensions. The function is actually implemented in the stub library, not
2381
+ * the main Tcl library, although there is a trivial implementation in the
2382
+ * main library in case an extension is statically linked into an application.
2383
+ */
2384
+
2385
+ const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
2386
+ int exact);
2387
+ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
2388
+ const char *version, int epoch, int revision);
2389
+
2390
+ /*
2391
+ * When not using stubs, make it a macro.
2392
+ */
2393
+
2394
+ #ifndef USE_TCL_STUBS
2395
+ #define Tcl_InitStubs(interp, version, exact) \
2396
+ Tcl_PkgInitStubsCheck(interp, version, exact)
2397
+ #endif
2398
+
2399
+ /*
2400
+ * Public functions that are not accessible via the stubs table.
2401
+ * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
2402
+ */
2403
+
2404
+ #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
2405
+ ((Tcl_CreateInterp)()))
2406
+ EXTERN void Tcl_MainEx(int argc, char **argv,
2407
+ Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
2408
+ EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
2409
+ const char *version, int exact);
2410
+ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
2411
+
2412
+ /*
2413
+ *----------------------------------------------------------------------------
2414
+ * Include the public function declarations that are accessible via the stubs
2415
+ * table.
2416
+ */
2417
+
2418
+ #include "tclDecls.h"
2419
+
2420
+ /*
2421
+ * Include platform specific public function declarations that are accessible
2422
+ * via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only
2423
+ * has effect on building it as a shared library). See ticket [3010352].
2424
+ */
2425
+
2426
+ #if defined(BUILD_tcl)
2427
+ # undef TCLAPI
2428
+ # define TCLAPI MODULE_SCOPE
2429
+ #endif
2430
+
2431
+ #include "tclPlatDecls.h"
2432
+
2433
+ /*
2434
+ *----------------------------------------------------------------------------
2435
+ * The following declarations either map ckalloc and ckfree to malloc and
2436
+ * free, or they map them to functions with all sorts of debugging hooks
2437
+ * defined in tclCkalloc.c.
2438
+ */
2439
+
2440
+ #ifdef TCL_MEM_DEBUG
2441
+
2442
+ # define ckalloc(x) \
2443
+ ((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__))
2444
+ # define ckfree(x) \
2445
+ Tcl_DbCkfree((char *)(x), __FILE__, __LINE__)
2446
+ # define ckrealloc(x,y) \
2447
+ ((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
2448
+ # define attemptckalloc(x) \
2449
+ ((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__))
2450
+ # define attemptckrealloc(x,y) \
2451
+ ((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
2452
+
2453
+ #else /* !TCL_MEM_DEBUG */
2454
+
2455
+ /*
2456
+ * If we are not using the debugging allocator, we should call the Tcl_Alloc,
2457
+ * et al. routines in order to guarantee that every module is using the same
2458
+ * memory allocator both inside and outside of the Tcl library.
2459
+ */
2460
+
2461
+ # define ckalloc(x) \
2462
+ ((void *) Tcl_Alloc((unsigned)(x)))
2463
+ # define ckfree(x) \
2464
+ Tcl_Free((char *)(x))
2465
+ # define ckrealloc(x,y) \
2466
+ ((void *) Tcl_Realloc((char *)(x), (unsigned)(y)))
2467
+ # define attemptckalloc(x) \
2468
+ ((void *) Tcl_AttemptAlloc((unsigned)(x)))
2469
+ # define attemptckrealloc(x,y) \
2470
+ ((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y)))
2471
+ # undef Tcl_InitMemory
2472
+ # define Tcl_InitMemory(x)
2473
+ # undef Tcl_DumpActiveMemory
2474
+ # define Tcl_DumpActiveMemory(x)
2475
+ # undef Tcl_ValidateAllMemory
2476
+ # define Tcl_ValidateAllMemory(x,y)
2477
+
2478
+ #endif /* !TCL_MEM_DEBUG */
2479
+
2480
+ #ifdef TCL_MEM_DEBUG
2481
+ # define Tcl_IncrRefCount(objPtr) \
2482
+ Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
2483
+ # define Tcl_DecrRefCount(objPtr) \
2484
+ Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
2485
+ # define Tcl_IsShared(objPtr) \
2486
+ Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
2487
+ #else
2488
+ # define Tcl_IncrRefCount(objPtr) \
2489
+ ++(objPtr)->refCount
2490
+ /*
2491
+ * Use do/while0 idiom for optimum correctness without compiler warnings.
2492
+ * https://wiki.c2.com/?TrivialDoWhileLoop
2493
+ */
2494
+ # define Tcl_DecrRefCount(objPtr) \
2495
+ do { \
2496
+ Tcl_Obj *_objPtr = (objPtr); \
2497
+ if (_objPtr->refCount-- <= 1) { \
2498
+ TclFreeObj(_objPtr); \
2499
+ } \
2500
+ } while(0)
2501
+ # define Tcl_IsShared(objPtr) \
2502
+ ((objPtr)->refCount > 1)
2503
+ #endif
2504
+
2505
+ /*
2506
+ * Macros and definitions that help to debug the use of Tcl objects. When
2507
+ * TCL_MEM_DEBUG is defined, the Tcl_New declarations are overridden to call
2508
+ * debugging versions of the object creation functions.
2509
+ */
2510
+
2511
+ #ifdef TCL_MEM_DEBUG
2512
+ # undef Tcl_NewBignumObj
2513
+ # define Tcl_NewBignumObj(val) \
2514
+ Tcl_DbNewBignumObj(val, __FILE__, __LINE__)
2515
+ # undef Tcl_NewBooleanObj
2516
+ # define Tcl_NewBooleanObj(val) \
2517
+ Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
2518
+ # undef Tcl_NewByteArrayObj
2519
+ # define Tcl_NewByteArrayObj(bytes, len) \
2520
+ Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
2521
+ # undef Tcl_NewDoubleObj
2522
+ # define Tcl_NewDoubleObj(val) \
2523
+ Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
2524
+ # undef Tcl_NewIntObj
2525
+ # define Tcl_NewIntObj(val) \
2526
+ Tcl_DbNewLongObj(val, __FILE__, __LINE__)
2527
+ # undef Tcl_NewListObj
2528
+ # define Tcl_NewListObj(objc, objv) \
2529
+ Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
2530
+ # undef Tcl_NewLongObj
2531
+ # define Tcl_NewLongObj(val) \
2532
+ Tcl_DbNewLongObj(val, __FILE__, __LINE__)
2533
+ # undef Tcl_NewObj
2534
+ # define Tcl_NewObj() \
2535
+ Tcl_DbNewObj(__FILE__, __LINE__)
2536
+ # undef Tcl_NewStringObj
2537
+ # define Tcl_NewStringObj(bytes, len) \
2538
+ Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
2539
+ # undef Tcl_NewWideIntObj
2540
+ # define Tcl_NewWideIntObj(val) \
2541
+ Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
2542
+ #endif /* TCL_MEM_DEBUG */
2543
+
2544
+ /*
2545
+ *----------------------------------------------------------------------------
2546
+ * Macros for clients to use to access fields of hash entries:
2547
+ */
2548
+
2549
+ #define Tcl_GetHashValue(h) ((h)->clientData)
2550
+ #define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
2551
+ #define Tcl_GetHashKey(tablePtr, h) \
2552
+ ((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
2553
+ (tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
2554
+ ? (h)->key.oneWordValue \
2555
+ : (h)->key.string))
2556
+
2557
+ /*
2558
+ * Macros to use for clients to use to invoke find and create functions for
2559
+ * hash tables:
2560
+ */
2561
+
2562
+ #undef Tcl_FindHashEntry
2563
+ #define Tcl_FindHashEntry(tablePtr, key) \
2564
+ (*((tablePtr)->findProc))(tablePtr, (const char *)(key))
2565
+ #undef Tcl_CreateHashEntry
2566
+ #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
2567
+ (*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
2568
+
2569
+ /*
2570
+ *----------------------------------------------------------------------------
2571
+ * Macros that eliminate the overhead of the thread synchronization functions
2572
+ * when compiling without thread support.
2573
+ */
2574
+
2575
+ #ifndef TCL_THREADS
2576
+ #undef Tcl_MutexLock
2577
+ #define Tcl_MutexLock(mutexPtr)
2578
+ #undef Tcl_MutexUnlock
2579
+ #define Tcl_MutexUnlock(mutexPtr)
2580
+ #undef Tcl_MutexFinalize
2581
+ #define Tcl_MutexFinalize(mutexPtr)
2582
+ #undef Tcl_ConditionNotify
2583
+ #define Tcl_ConditionNotify(condPtr)
2584
+ #undef Tcl_ConditionWait
2585
+ #define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
2586
+ #undef Tcl_ConditionFinalize
2587
+ #define Tcl_ConditionFinalize(condPtr)
2588
+ #endif /* TCL_THREADS */
2589
+
2590
+ /*
2591
+ *----------------------------------------------------------------------------
2592
+ * Deprecated Tcl functions:
2593
+ */
2594
+
2595
+ #ifndef TCL_NO_DEPRECATED
2596
+ /*
2597
+ * These function have been renamed. The old names are deprecated, but we
2598
+ * define these macros for backwards compatibility.
2599
+ */
2600
+
2601
+ # define Tcl_Ckalloc Tcl_Alloc
2602
+ # define Tcl_Ckfree Tcl_Free
2603
+ # define Tcl_Ckrealloc Tcl_Realloc
2604
+ # define Tcl_Return Tcl_SetResult
2605
+ # define Tcl_TildeSubst Tcl_TranslateFileName
2606
+ #if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
2607
+ # define panic Tcl_Panic
2608
+ #endif
2609
+ # define panicVA Tcl_PanicVA
2610
+ #endif /* !TCL_NO_DEPRECATED */
2611
+
2612
+ /*
2613
+ *----------------------------------------------------------------------------
2614
+ * Convenience declaration of Tcl_AppInit for backwards compatibility. This
2615
+ * function is not *implemented* by the tcl library, so the storage class is
2616
+ * neither DLLEXPORT nor DLLIMPORT.
2617
+ */
2618
+
2619
+ extern Tcl_AppInitProc Tcl_AppInit;
2620
+
2621
+ #endif /* RC_INVOKED */
2622
+
2623
+ /*
2624
+ * end block for C++
2625
+ */
2626
+
2627
+ #ifdef __cplusplus
2628
+ }
2629
+ #endif
2630
+
2631
+ #endif /* _TCL */
2632
+
2633
+ /*
2634
+ * Local Variables:
2635
+ * mode: c
2636
+ * c-basic-offset: 4
2637
+ * fill-column: 78
2638
+ * End:
2639
+ */
physworld_p1_20261018/envs/p1/include/tclDecls.h ADDED
The diff for this file is too large to render. See raw diff
 
physworld_p1_20261018/envs/p1/include/tclInt.h ADDED
The diff for this file is too large to render. See raw diff
 
physworld_p1_20261018/envs/p1/include/tclIntDecls.h ADDED
@@ -0,0 +1,1433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclIntDecls.h --
3
+ *
4
+ * This file contains the declarations for all unsupported
5
+ * functions that are exported by the Tcl library. These
6
+ * interfaces are not guaranteed to remain the same between
7
+ * versions. Use at your own risk.
8
+ *
9
+ * Copyright (c) 1998-1999 by Scriptics Corporation.
10
+ *
11
+ * See the file "license.terms" for information on usage and redistribution
12
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
+ */
14
+
15
+ #ifndef _TCLINTDECLS
16
+ #define _TCLINTDECLS
17
+
18
+
19
+ #undef TCL_STORAGE_CLASS
20
+ #ifdef BUILD_tcl
21
+ # define TCL_STORAGE_CLASS DLLEXPORT
22
+ #else
23
+ # ifdef USE_TCL_STUBS
24
+ # define TCL_STORAGE_CLASS
25
+ # else
26
+ # define TCL_STORAGE_CLASS DLLIMPORT
27
+ # endif
28
+ #endif
29
+
30
+ /* [Bug #803489] Tcl_FindNamespace problem in the Stubs table */
31
+ #undef Tcl_CreateNamespace
32
+ #undef Tcl_DeleteNamespace
33
+ #undef Tcl_AppendExportList
34
+ #undef Tcl_Export
35
+ #undef Tcl_Import
36
+ #undef Tcl_ForgetImport
37
+ #undef Tcl_GetCurrentNamespace
38
+ #undef Tcl_GetGlobalNamespace
39
+ #undef Tcl_FindNamespace
40
+ #undef Tcl_FindCommand
41
+ #undef Tcl_GetCommandFromObj
42
+ #undef Tcl_GetCommandFullName
43
+ #undef Tcl_SetStartupScript
44
+ #undef Tcl_GetStartupScript
45
+
46
+ /*
47
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
48
+ * script. Any modifications to the function declarations below should be made
49
+ * in the generic/tclInt.decls script.
50
+ */
51
+
52
+ /* !BEGIN!: Do not edit below this line. */
53
+
54
+ #ifdef __cplusplus
55
+ extern "C" {
56
+ #endif
57
+
58
+ /*
59
+ * Exported function declarations:
60
+ */
61
+
62
+ /* Slot 0 is reserved */
63
+ /* Slot 1 is reserved */
64
+ /* Slot 2 is reserved */
65
+ /* 3 */
66
+ EXTERN void TclAllocateFreeObjects(void);
67
+ /* Slot 4 is reserved */
68
+ /* 5 */
69
+ EXTERN int TclCleanupChildren(Tcl_Interp *interp, int numPids,
70
+ Tcl_Pid *pidPtr, Tcl_Channel errorChan);
71
+ /* 6 */
72
+ EXTERN void TclCleanupCommand(Command *cmdPtr);
73
+ /* 7 */
74
+ EXTERN int TclCopyAndCollapse(int count, const char *src,
75
+ char *dst);
76
+ /* 8 */
77
+ EXTERN int TclCopyChannelOld(Tcl_Interp *interp,
78
+ Tcl_Channel inChan, Tcl_Channel outChan,
79
+ int toRead, Tcl_Obj *cmdPtr);
80
+ /* 9 */
81
+ EXTERN int TclCreatePipeline(Tcl_Interp *interp, int argc,
82
+ const char **argv, Tcl_Pid **pidArrayPtr,
83
+ TclFile *inPipePtr, TclFile *outPipePtr,
84
+ TclFile *errFilePtr);
85
+ /* 10 */
86
+ EXTERN int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr,
87
+ const char *procName, Tcl_Obj *argsPtr,
88
+ Tcl_Obj *bodyPtr, Proc **procPtrPtr);
89
+ /* 11 */
90
+ EXTERN void TclDeleteCompiledLocalVars(Interp *iPtr,
91
+ CallFrame *framePtr);
92
+ /* 12 */
93
+ EXTERN void TclDeleteVars(Interp *iPtr,
94
+ TclVarHashTable *tablePtr);
95
+ /* Slot 13 is reserved */
96
+ /* 14 */
97
+ EXTERN int TclDumpMemoryInfo(ClientData clientData, int flags);
98
+ /* Slot 15 is reserved */
99
+ /* 16 */
100
+ EXTERN void TclExprFloatError(Tcl_Interp *interp, double value);
101
+ /* Slot 17 is reserved */
102
+ /* Slot 18 is reserved */
103
+ /* Slot 19 is reserved */
104
+ /* Slot 20 is reserved */
105
+ /* Slot 21 is reserved */
106
+ /* 22 */
107
+ EXTERN int TclFindElement(Tcl_Interp *interp,
108
+ const char *listStr, int listLength,
109
+ const char **elementPtr,
110
+ const char **nextPtr, int *sizePtr,
111
+ int *bracePtr);
112
+ /* 23 */
113
+ EXTERN Proc * TclFindProc(Interp *iPtr, const char *procName);
114
+ /* 24 */
115
+ EXTERN int TclFormatInt(char *buffer, long n);
116
+ /* 25 */
117
+ EXTERN void TclFreePackageInfo(Interp *iPtr);
118
+ /* Slot 26 is reserved */
119
+ /* Slot 27 is reserved */
120
+ /* 28 */
121
+ EXTERN Tcl_Channel TclpGetDefaultStdChannel(int type);
122
+ /* Slot 29 is reserved */
123
+ /* Slot 30 is reserved */
124
+ /* 31 */
125
+ EXTERN const char * TclGetExtension(const char *name);
126
+ /* 32 */
127
+ EXTERN int TclGetFrame(Tcl_Interp *interp, const char *str,
128
+ CallFrame **framePtrPtr);
129
+ /* Slot 33 is reserved */
130
+ /* 34 */
131
+ EXTERN int TclGetIntForIndex(Tcl_Interp *interp,
132
+ Tcl_Obj *objPtr, int endValue, int *indexPtr);
133
+ /* Slot 35 is reserved */
134
+ /* Slot 36 is reserved */
135
+ /* 37 */
136
+ EXTERN int TclGetLoadedPackages(Tcl_Interp *interp,
137
+ const char *targetName);
138
+ /* 38 */
139
+ EXTERN int TclGetNamespaceForQualName(Tcl_Interp *interp,
140
+ const char *qualName, Namespace *cxtNsPtr,
141
+ int flags, Namespace **nsPtrPtr,
142
+ Namespace **altNsPtrPtr,
143
+ Namespace **actualCxtPtrPtr,
144
+ const char **simpleNamePtr);
145
+ /* 39 */
146
+ EXTERN Tcl_ObjCmdProc * TclGetObjInterpProc(void);
147
+ /* 40 */
148
+ EXTERN int TclGetOpenMode(Tcl_Interp *interp, const char *str,
149
+ int *seekFlagPtr);
150
+ /* 41 */
151
+ EXTERN Tcl_Command TclGetOriginalCommand(Tcl_Command command);
152
+ /* 42 */
153
+ EXTERN CONST86 char * TclpGetUserHome(const char *name,
154
+ Tcl_DString *bufferPtr);
155
+ /* Slot 43 is reserved */
156
+ /* 44 */
157
+ EXTERN int TclGuessPackageName(const char *fileName,
158
+ Tcl_DString *bufPtr);
159
+ /* 45 */
160
+ EXTERN int TclHideUnsafeCommands(Tcl_Interp *interp);
161
+ /* 46 */
162
+ EXTERN int TclInExit(void);
163
+ /* Slot 47 is reserved */
164
+ /* Slot 48 is reserved */
165
+ /* Slot 49 is reserved */
166
+ /* 50 */
167
+ EXTERN void TclInitCompiledLocals(Tcl_Interp *interp,
168
+ CallFrame *framePtr, Namespace *nsPtr);
169
+ /* 51 */
170
+ EXTERN int TclInterpInit(Tcl_Interp *interp);
171
+ /* Slot 52 is reserved */
172
+ /* 53 */
173
+ EXTERN int TclInvokeObjectCommand(ClientData clientData,
174
+ Tcl_Interp *interp, int argc,
175
+ CONST84 char **argv);
176
+ /* 54 */
177
+ EXTERN int TclInvokeStringCommand(ClientData clientData,
178
+ Tcl_Interp *interp, int objc,
179
+ Tcl_Obj *const objv[]);
180
+ /* 55 */
181
+ EXTERN Proc * TclIsProc(Command *cmdPtr);
182
+ /* Slot 56 is reserved */
183
+ /* Slot 57 is reserved */
184
+ /* 58 */
185
+ EXTERN Var * TclLookupVar(Tcl_Interp *interp, const char *part1,
186
+ const char *part2, int flags,
187
+ const char *msg, int createPart1,
188
+ int createPart2, Var **arrayPtrPtr);
189
+ /* Slot 59 is reserved */
190
+ /* 60 */
191
+ EXTERN int TclNeedSpace(const char *start, const char *end);
192
+ /* 61 */
193
+ EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr);
194
+ /* 62 */
195
+ EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr);
196
+ /* 63 */
197
+ EXTERN int TclObjInterpProc(ClientData clientData,
198
+ Tcl_Interp *interp, int objc,
199
+ Tcl_Obj *const objv[]);
200
+ /* 64 */
201
+ EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc,
202
+ Tcl_Obj *const objv[], int flags);
203
+ /* Slot 65 is reserved */
204
+ /* Slot 66 is reserved */
205
+ /* Slot 67 is reserved */
206
+ /* Slot 68 is reserved */
207
+ /* 69 */
208
+ EXTERN char * TclpAlloc(unsigned int size);
209
+ /* Slot 70 is reserved */
210
+ /* Slot 71 is reserved */
211
+ /* Slot 72 is reserved */
212
+ /* Slot 73 is reserved */
213
+ /* 74 */
214
+ EXTERN void TclpFree(char *ptr);
215
+ /* 75 */
216
+ EXTERN unsigned long TclpGetClicks(void);
217
+ /* 76 */
218
+ EXTERN unsigned long TclpGetSeconds(void);
219
+ /* 77 */
220
+ EXTERN void TclpGetTime(Tcl_Time *time);
221
+ /* Slot 78 is reserved */
222
+ /* Slot 79 is reserved */
223
+ /* Slot 80 is reserved */
224
+ /* 81 */
225
+ EXTERN char * TclpRealloc(char *ptr, unsigned int size);
226
+ /* Slot 82 is reserved */
227
+ /* Slot 83 is reserved */
228
+ /* Slot 84 is reserved */
229
+ /* Slot 85 is reserved */
230
+ /* Slot 86 is reserved */
231
+ /* Slot 87 is reserved */
232
+ /* 88 */
233
+ EXTERN char * TclPrecTraceProc(ClientData clientData,
234
+ Tcl_Interp *interp, const char *name1,
235
+ const char *name2, int flags);
236
+ /* 89 */
237
+ EXTERN int TclPreventAliasLoop(Tcl_Interp *interp,
238
+ Tcl_Interp *cmdInterp, Tcl_Command cmd);
239
+ /* Slot 90 is reserved */
240
+ /* 91 */
241
+ EXTERN void TclProcCleanupProc(Proc *procPtr);
242
+ /* 92 */
243
+ EXTERN int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr,
244
+ Tcl_Obj *bodyPtr, Namespace *nsPtr,
245
+ const char *description,
246
+ const char *procName);
247
+ /* 93 */
248
+ EXTERN void TclProcDeleteProc(ClientData clientData);
249
+ /* Slot 94 is reserved */
250
+ /* Slot 95 is reserved */
251
+ /* 96 */
252
+ EXTERN int TclRenameCommand(Tcl_Interp *interp,
253
+ const char *oldName, const char *newName);
254
+ /* 97 */
255
+ EXTERN void TclResetShadowedCmdRefs(Tcl_Interp *interp,
256
+ Command *newCmdPtr);
257
+ /* 98 */
258
+ EXTERN int TclServiceIdle(void);
259
+ /* Slot 99 is reserved */
260
+ /* Slot 100 is reserved */
261
+ /* 101 */
262
+ EXTERN CONST86 char * TclSetPreInitScript(const char *string);
263
+ /* 102 */
264
+ EXTERN void TclSetupEnv(Tcl_Interp *interp);
265
+ /* 103 */
266
+ EXTERN int TclSockGetPort(Tcl_Interp *interp, const char *str,
267
+ const char *proto, int *portPtr);
268
+ /* 104 */
269
+ EXTERN int TclSockMinimumBuffersOld(int sock, int size);
270
+ /* Slot 105 is reserved */
271
+ /* Slot 106 is reserved */
272
+ /* Slot 107 is reserved */
273
+ /* 108 */
274
+ EXTERN void TclTeardownNamespace(Namespace *nsPtr);
275
+ /* 109 */
276
+ EXTERN int TclUpdateReturnInfo(Interp *iPtr);
277
+ /* 110 */
278
+ EXTERN int TclSockMinimumBuffers(void *sock, int size);
279
+ /* 111 */
280
+ EXTERN void Tcl_AddInterpResolvers(Tcl_Interp *interp,
281
+ const char *name,
282
+ Tcl_ResolveCmdProc *cmdProc,
283
+ Tcl_ResolveVarProc *varProc,
284
+ Tcl_ResolveCompiledVarProc *compiledVarProc);
285
+ /* 112 */
286
+ EXTERN int Tcl_AppendExportList(Tcl_Interp *interp,
287
+ Tcl_Namespace *nsPtr, Tcl_Obj *objPtr);
288
+ /* 113 */
289
+ EXTERN Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp,
290
+ const char *name, ClientData clientData,
291
+ Tcl_NamespaceDeleteProc *deleteProc);
292
+ /* 114 */
293
+ EXTERN void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr);
294
+ /* 115 */
295
+ EXTERN int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
296
+ const char *pattern, int resetListFirst);
297
+ /* 116 */
298
+ EXTERN Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name,
299
+ Tcl_Namespace *contextNsPtr, int flags);
300
+ /* 117 */
301
+ EXTERN Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp,
302
+ const char *name,
303
+ Tcl_Namespace *contextNsPtr, int flags);
304
+ /* 118 */
305
+ EXTERN int Tcl_GetInterpResolvers(Tcl_Interp *interp,
306
+ const char *name, Tcl_ResolverInfo *resInfo);
307
+ /* 119 */
308
+ EXTERN int Tcl_GetNamespaceResolvers(
309
+ Tcl_Namespace *namespacePtr,
310
+ Tcl_ResolverInfo *resInfo);
311
+ /* 120 */
312
+ EXTERN Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp,
313
+ const char *name,
314
+ Tcl_Namespace *contextNsPtr, int flags);
315
+ /* 121 */
316
+ EXTERN int Tcl_ForgetImport(Tcl_Interp *interp,
317
+ Tcl_Namespace *nsPtr, const char *pattern);
318
+ /* 122 */
319
+ EXTERN Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp,
320
+ Tcl_Obj *objPtr);
321
+ /* 123 */
322
+ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp,
323
+ Tcl_Command command, Tcl_Obj *objPtr);
324
+ /* 124 */
325
+ EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp);
326
+ /* 125 */
327
+ EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp);
328
+ /* 126 */
329
+ EXTERN void Tcl_GetVariableFullName(Tcl_Interp *interp,
330
+ Tcl_Var variable, Tcl_Obj *objPtr);
331
+ /* 127 */
332
+ EXTERN int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
333
+ const char *pattern, int allowOverwrite);
334
+ /* 128 */
335
+ EXTERN void Tcl_PopCallFrame(Tcl_Interp *interp);
336
+ /* 129 */
337
+ EXTERN int Tcl_PushCallFrame(Tcl_Interp *interp,
338
+ Tcl_CallFrame *framePtr,
339
+ Tcl_Namespace *nsPtr, int isProcCallFrame);
340
+ /* 130 */
341
+ EXTERN int Tcl_RemoveInterpResolvers(Tcl_Interp *interp,
342
+ const char *name);
343
+ /* 131 */
344
+ EXTERN void Tcl_SetNamespaceResolvers(
345
+ Tcl_Namespace *namespacePtr,
346
+ Tcl_ResolveCmdProc *cmdProc,
347
+ Tcl_ResolveVarProc *varProc,
348
+ Tcl_ResolveCompiledVarProc *compiledVarProc);
349
+ /* 132 */
350
+ EXTERN int TclpHasSockets(Tcl_Interp *interp);
351
+ /* 133 */
352
+ EXTERN struct tm * TclpGetDate(const time_t *time, int useGMT);
353
+ /* Slot 134 is reserved */
354
+ /* Slot 135 is reserved */
355
+ /* Slot 136 is reserved */
356
+ /* Slot 137 is reserved */
357
+ /* 138 */
358
+ EXTERN CONST84_RETURN char * TclGetEnv(const char *name,
359
+ Tcl_DString *valuePtr);
360
+ /* Slot 139 is reserved */
361
+ /* Slot 140 is reserved */
362
+ /* 141 */
363
+ EXTERN CONST84_RETURN char * TclpGetCwd(Tcl_Interp *interp,
364
+ Tcl_DString *cwdPtr);
365
+ /* 142 */
366
+ EXTERN int TclSetByteCodeFromAny(Tcl_Interp *interp,
367
+ Tcl_Obj *objPtr, CompileHookProc *hookProc,
368
+ ClientData clientData);
369
+ /* 143 */
370
+ EXTERN int TclAddLiteralObj(struct CompileEnv *envPtr,
371
+ Tcl_Obj *objPtr, LiteralEntry **litPtrPtr);
372
+ /* 144 */
373
+ EXTERN void TclHideLiteral(Tcl_Interp *interp,
374
+ struct CompileEnv *envPtr, int index);
375
+ /* 145 */
376
+ EXTERN const struct AuxDataType * TclGetAuxDataType(const char *typeName);
377
+ /* 146 */
378
+ EXTERN TclHandle TclHandleCreate(void *ptr);
379
+ /* 147 */
380
+ EXTERN void TclHandleFree(TclHandle handle);
381
+ /* 148 */
382
+ EXTERN TclHandle TclHandlePreserve(TclHandle handle);
383
+ /* 149 */
384
+ EXTERN void TclHandleRelease(TclHandle handle);
385
+ /* 150 */
386
+ EXTERN int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re);
387
+ /* 151 */
388
+ EXTERN void TclRegExpRangeUniChar(Tcl_RegExp re, int index,
389
+ int *startPtr, int *endPtr);
390
+ /* 152 */
391
+ EXTERN void TclSetLibraryPath(Tcl_Obj *pathPtr);
392
+ /* 153 */
393
+ EXTERN Tcl_Obj * TclGetLibraryPath(void);
394
+ /* Slot 154 is reserved */
395
+ /* Slot 155 is reserved */
396
+ /* 156 */
397
+ EXTERN void TclRegError(Tcl_Interp *interp, const char *msg,
398
+ int status);
399
+ /* 157 */
400
+ EXTERN Var * TclVarTraceExists(Tcl_Interp *interp,
401
+ const char *varName);
402
+ /* 158 */
403
+ EXTERN void TclSetStartupScriptFileName(const char *filename);
404
+ /* 159 */
405
+ EXTERN const char * TclGetStartupScriptFileName(void);
406
+ /* Slot 160 is reserved */
407
+ /* 161 */
408
+ EXTERN int TclChannelTransform(Tcl_Interp *interp,
409
+ Tcl_Channel chan, Tcl_Obj *cmdObjPtr);
410
+ /* 162 */
411
+ EXTERN void TclChannelEventScriptInvoker(ClientData clientData,
412
+ int flags);
413
+ /* 163 */
414
+ EXTERN const void * TclGetInstructionTable(void);
415
+ /* 164 */
416
+ EXTERN void TclExpandCodeArray(void *envPtr);
417
+ /* 165 */
418
+ EXTERN void TclpSetInitialEncodings(void);
419
+ /* 166 */
420
+ EXTERN int TclListObjSetElement(Tcl_Interp *interp,
421
+ Tcl_Obj *listPtr, int index,
422
+ Tcl_Obj *valuePtr);
423
+ /* 167 */
424
+ EXTERN void TclSetStartupScriptPath(Tcl_Obj *pathPtr);
425
+ /* 168 */
426
+ EXTERN Tcl_Obj * TclGetStartupScriptPath(void);
427
+ /* 169 */
428
+ EXTERN int TclpUtfNcmp2(const char *s1, const char *s2,
429
+ unsigned long n);
430
+ /* 170 */
431
+ EXTERN int TclCheckInterpTraces(Tcl_Interp *interp,
432
+ const char *command, int numChars,
433
+ Command *cmdPtr, int result, int traceFlags,
434
+ int objc, Tcl_Obj *const objv[]);
435
+ /* 171 */
436
+ EXTERN int TclCheckExecutionTraces(Tcl_Interp *interp,
437
+ const char *command, int numChars,
438
+ Command *cmdPtr, int result, int traceFlags,
439
+ int objc, Tcl_Obj *const objv[]);
440
+ /* 172 */
441
+ EXTERN int TclInThreadExit(void);
442
+ /* 173 */
443
+ EXTERN int TclUniCharMatch(const Tcl_UniChar *string,
444
+ int strLen, const Tcl_UniChar *pattern,
445
+ int ptnLen, int flags);
446
+ /* Slot 174 is reserved */
447
+ /* 175 */
448
+ EXTERN int TclCallVarTraces(Interp *iPtr, Var *arrayPtr,
449
+ Var *varPtr, const char *part1,
450
+ const char *part2, int flags,
451
+ int leaveErrMsg);
452
+ /* 176 */
453
+ EXTERN void TclCleanupVar(Var *varPtr, Var *arrayPtr);
454
+ /* 177 */
455
+ EXTERN void TclVarErrMsg(Tcl_Interp *interp, const char *part1,
456
+ const char *part2, const char *operation,
457
+ const char *reason);
458
+ /* 178 */
459
+ EXTERN void Tcl_SetStartupScript(Tcl_Obj *pathPtr,
460
+ const char *encodingName);
461
+ /* 179 */
462
+ EXTERN Tcl_Obj * Tcl_GetStartupScript(const char **encodingNamePtr);
463
+ /* Slot 180 is reserved */
464
+ /* Slot 181 is reserved */
465
+ /* 182 */
466
+ EXTERN struct tm * TclpLocaltime(const time_t *clock);
467
+ /* 183 */
468
+ EXTERN struct tm * TclpGmtime(const time_t *clock);
469
+ /* Slot 184 is reserved */
470
+ /* Slot 185 is reserved */
471
+ /* Slot 186 is reserved */
472
+ /* Slot 187 is reserved */
473
+ /* Slot 188 is reserved */
474
+ /* Slot 189 is reserved */
475
+ /* Slot 190 is reserved */
476
+ /* Slot 191 is reserved */
477
+ /* Slot 192 is reserved */
478
+ /* Slot 193 is reserved */
479
+ /* Slot 194 is reserved */
480
+ /* Slot 195 is reserved */
481
+ /* Slot 196 is reserved */
482
+ /* Slot 197 is reserved */
483
+ /* 198 */
484
+ EXTERN int TclObjGetFrame(Tcl_Interp *interp, Tcl_Obj *objPtr,
485
+ CallFrame **framePtrPtr);
486
+ /* Slot 199 is reserved */
487
+ /* 200 */
488
+ EXTERN int TclpObjRemoveDirectory(Tcl_Obj *pathPtr,
489
+ int recursive, Tcl_Obj **errorPtr);
490
+ /* 201 */
491
+ EXTERN int TclpObjCopyDirectory(Tcl_Obj *srcPathPtr,
492
+ Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr);
493
+ /* 202 */
494
+ EXTERN int TclpObjCreateDirectory(Tcl_Obj *pathPtr);
495
+ /* 203 */
496
+ EXTERN int TclpObjDeleteFile(Tcl_Obj *pathPtr);
497
+ /* 204 */
498
+ EXTERN int TclpObjCopyFile(Tcl_Obj *srcPathPtr,
499
+ Tcl_Obj *destPathPtr);
500
+ /* 205 */
501
+ EXTERN int TclpObjRenameFile(Tcl_Obj *srcPathPtr,
502
+ Tcl_Obj *destPathPtr);
503
+ /* 206 */
504
+ EXTERN int TclpObjStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
505
+ /* 207 */
506
+ EXTERN int TclpObjAccess(Tcl_Obj *pathPtr, int mode);
507
+ /* 208 */
508
+ EXTERN Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp,
509
+ Tcl_Obj *pathPtr, int mode, int permissions);
510
+ /* Slot 209 is reserved */
511
+ /* Slot 210 is reserved */
512
+ /* Slot 211 is reserved */
513
+ /* 212 */
514
+ EXTERN void TclpFindExecutable(const char *argv0);
515
+ /* 213 */
516
+ EXTERN Tcl_Obj * TclGetObjNameOfExecutable(void);
517
+ /* 214 */
518
+ EXTERN void TclSetObjNameOfExecutable(Tcl_Obj *name,
519
+ Tcl_Encoding encoding);
520
+ /* 215 */
521
+ EXTERN void * TclStackAlloc(Tcl_Interp *interp, int numBytes);
522
+ /* 216 */
523
+ EXTERN void TclStackFree(Tcl_Interp *interp, void *freePtr);
524
+ /* 217 */
525
+ EXTERN int TclPushStackFrame(Tcl_Interp *interp,
526
+ Tcl_CallFrame **framePtrPtr,
527
+ Tcl_Namespace *namespacePtr,
528
+ int isProcCallFrame);
529
+ /* 218 */
530
+ EXTERN void TclPopStackFrame(Tcl_Interp *interp);
531
+ /* Slot 219 is reserved */
532
+ /* Slot 220 is reserved */
533
+ /* Slot 221 is reserved */
534
+ /* Slot 222 is reserved */
535
+ /* Slot 223 is reserved */
536
+ /* 224 */
537
+ EXTERN TclPlatformType * TclGetPlatform(void);
538
+ /* 225 */
539
+ EXTERN Tcl_Obj * TclTraceDictPath(Tcl_Interp *interp,
540
+ Tcl_Obj *rootPtr, int keyc,
541
+ Tcl_Obj *const keyv[], int flags);
542
+ /* 226 */
543
+ EXTERN int TclObjBeingDeleted(Tcl_Obj *objPtr);
544
+ /* 227 */
545
+ EXTERN void TclSetNsPath(Namespace *nsPtr, int pathLength,
546
+ Tcl_Namespace *pathAry[]);
547
+ /* Slot 228 is reserved */
548
+ /* 229 */
549
+ EXTERN int TclPtrMakeUpvar(Tcl_Interp *interp, Var *otherP1Ptr,
550
+ const char *myName, int myFlags, int index);
551
+ /* 230 */
552
+ EXTERN Var * TclObjLookupVar(Tcl_Interp *interp,
553
+ Tcl_Obj *part1Ptr, const char *part2,
554
+ int flags, const char *msg,
555
+ const int createPart1, const int createPart2,
556
+ Var **arrayPtrPtr);
557
+ /* 231 */
558
+ EXTERN int TclGetNamespaceFromObj(Tcl_Interp *interp,
559
+ Tcl_Obj *objPtr, Tcl_Namespace **nsPtrPtr);
560
+ /* 232 */
561
+ EXTERN int TclEvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr,
562
+ int flags, const CmdFrame *invoker, int word);
563
+ /* 233 */
564
+ EXTERN void TclGetSrcInfoForPc(CmdFrame *contextPtr);
565
+ /* 234 */
566
+ EXTERN Var * TclVarHashCreateVar(TclVarHashTable *tablePtr,
567
+ const char *key, int *newPtr);
568
+ /* 235 */
569
+ EXTERN void TclInitVarHashTable(TclVarHashTable *tablePtr,
570
+ Namespace *nsPtr);
571
+ /* 236 */
572
+ EXTERN void TclBackgroundException(Tcl_Interp *interp, int code);
573
+ /* 237 */
574
+ EXTERN int TclResetCancellation(Tcl_Interp *interp, int force);
575
+ /* 238 */
576
+ EXTERN int TclNRInterpProc(ClientData clientData,
577
+ Tcl_Interp *interp, int objc,
578
+ Tcl_Obj *const objv[]);
579
+ /* 239 */
580
+ EXTERN int TclNRInterpProcCore(Tcl_Interp *interp,
581
+ Tcl_Obj *procNameObj, int skip,
582
+ ProcErrorProc *errorProc);
583
+ /* 240 */
584
+ EXTERN int TclNRRunCallbacks(Tcl_Interp *interp, int result,
585
+ struct NRE_callback *rootPtr);
586
+ /* 241 */
587
+ EXTERN int TclNREvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr,
588
+ int flags, const CmdFrame *invoker, int word);
589
+ /* 242 */
590
+ EXTERN int TclNREvalObjv(Tcl_Interp *interp, int objc,
591
+ Tcl_Obj *const objv[], int flags,
592
+ Command *cmdPtr);
593
+ /* 243 */
594
+ EXTERN void TclDbDumpActiveObjects(FILE *outFile);
595
+ /* 244 */
596
+ EXTERN Tcl_HashTable * TclGetNamespaceChildTable(Tcl_Namespace *nsPtr);
597
+ /* 245 */
598
+ EXTERN Tcl_HashTable * TclGetNamespaceCommandTable(Tcl_Namespace *nsPtr);
599
+ /* 246 */
600
+ EXTERN int TclInitRewriteEnsemble(Tcl_Interp *interp,
601
+ int numRemoved, int numInserted,
602
+ Tcl_Obj *const *objv);
603
+ /* 247 */
604
+ EXTERN void TclResetRewriteEnsemble(Tcl_Interp *interp,
605
+ int isRootEnsemble);
606
+ /* 248 */
607
+ EXTERN int TclCopyChannel(Tcl_Interp *interp,
608
+ Tcl_Channel inChan, Tcl_Channel outChan,
609
+ Tcl_WideInt toRead, Tcl_Obj *cmdPtr);
610
+ /* 249 */
611
+ EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags,
612
+ int *decpt, int *signum, char **endPtr);
613
+ /* 250 */
614
+ EXTERN void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags,
615
+ int force);
616
+ /* 251 */
617
+ EXTERN int TclRegisterLiteral(void *envPtr, char *bytes,
618
+ int length, int flags);
619
+ /* 252 */
620
+ EXTERN Tcl_Obj * TclPtrGetVar(Tcl_Interp *interp, Tcl_Var varPtr,
621
+ Tcl_Var arrayPtr, Tcl_Obj *part1Ptr,
622
+ Tcl_Obj *part2Ptr, const int flags);
623
+ /* 253 */
624
+ EXTERN Tcl_Obj * TclPtrSetVar(Tcl_Interp *interp, Tcl_Var varPtr,
625
+ Tcl_Var arrayPtr, Tcl_Obj *part1Ptr,
626
+ Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr,
627
+ const int flags);
628
+ /* 254 */
629
+ EXTERN Tcl_Obj * TclPtrIncrObjVar(Tcl_Interp *interp, Tcl_Var varPtr,
630
+ Tcl_Var arrayPtr, Tcl_Obj *part1Ptr,
631
+ Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr,
632
+ const int flags);
633
+ /* 255 */
634
+ EXTERN int TclPtrObjMakeUpvar(Tcl_Interp *interp,
635
+ Tcl_Var otherPtr, Tcl_Obj *myNamePtr,
636
+ int myFlags);
637
+ /* 256 */
638
+ EXTERN int TclPtrUnsetVar(Tcl_Interp *interp, Tcl_Var varPtr,
639
+ Tcl_Var arrayPtr, Tcl_Obj *part1Ptr,
640
+ Tcl_Obj *part2Ptr, const int flags);
641
+ /* 257 */
642
+ EXTERN void TclStaticPackage(Tcl_Interp *interp,
643
+ const char *prefix,
644
+ Tcl_PackageInitProc *initProc,
645
+ Tcl_PackageInitProc *safeInitProc);
646
+ /* Slot 258 is reserved */
647
+ /* Slot 259 is reserved */
648
+ /* Slot 260 is reserved */
649
+ /* 261 */
650
+ EXTERN void TclUnusedStubEntry(void);
651
+
652
+ typedef struct TclIntStubs {
653
+ int magic;
654
+ void *hooks;
655
+
656
+ void (*reserved0)(void);
657
+ void (*reserved1)(void);
658
+ void (*reserved2)(void);
659
+ void (*tclAllocateFreeObjects) (void); /* 3 */
660
+ void (*reserved4)(void);
661
+ int (*tclCleanupChildren) (Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 5 */
662
+ void (*tclCleanupCommand) (Command *cmdPtr); /* 6 */
663
+ int (*tclCopyAndCollapse) (int count, const char *src, char *dst); /* 7 */
664
+ int (*tclCopyChannelOld) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr); /* 8 */
665
+ int (*tclCreatePipeline) (Tcl_Interp *interp, int argc, const char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr); /* 9 */
666
+ int (*tclCreateProc) (Tcl_Interp *interp, Namespace *nsPtr, const char *procName, Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr); /* 10 */
667
+ void (*tclDeleteCompiledLocalVars) (Interp *iPtr, CallFrame *framePtr); /* 11 */
668
+ void (*tclDeleteVars) (Interp *iPtr, TclVarHashTable *tablePtr); /* 12 */
669
+ void (*reserved13)(void);
670
+ int (*tclDumpMemoryInfo) (ClientData clientData, int flags); /* 14 */
671
+ void (*reserved15)(void);
672
+ void (*tclExprFloatError) (Tcl_Interp *interp, double value); /* 16 */
673
+ void (*reserved17)(void);
674
+ void (*reserved18)(void);
675
+ void (*reserved19)(void);
676
+ void (*reserved20)(void);
677
+ void (*reserved21)(void);
678
+ int (*tclFindElement) (Tcl_Interp *interp, const char *listStr, int listLength, const char **elementPtr, const char **nextPtr, int *sizePtr, int *bracePtr); /* 22 */
679
+ Proc * (*tclFindProc) (Interp *iPtr, const char *procName); /* 23 */
680
+ int (*tclFormatInt) (char *buffer, long n); /* 24 */
681
+ void (*tclFreePackageInfo) (Interp *iPtr); /* 25 */
682
+ void (*reserved26)(void);
683
+ void (*reserved27)(void);
684
+ Tcl_Channel (*tclpGetDefaultStdChannel) (int type); /* 28 */
685
+ void (*reserved29)(void);
686
+ void (*reserved30)(void);
687
+ const char * (*tclGetExtension) (const char *name); /* 31 */
688
+ int (*tclGetFrame) (Tcl_Interp *interp, const char *str, CallFrame **framePtrPtr); /* 32 */
689
+ void (*reserved33)(void);
690
+ int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 34 */
691
+ void (*reserved35)(void);
692
+ void (*reserved36)(void);
693
+ int (*tclGetLoadedPackages) (Tcl_Interp *interp, const char *targetName); /* 37 */
694
+ int (*tclGetNamespaceForQualName) (Tcl_Interp *interp, const char *qualName, Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr, Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr, const char **simpleNamePtr); /* 38 */
695
+ Tcl_ObjCmdProc * (*tclGetObjInterpProc) (void); /* 39 */
696
+ int (*tclGetOpenMode) (Tcl_Interp *interp, const char *str, int *seekFlagPtr); /* 40 */
697
+ Tcl_Command (*tclGetOriginalCommand) (Tcl_Command command); /* 41 */
698
+ CONST86 char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */
699
+ void (*reserved43)(void);
700
+ int (*tclGuessPackageName) (const char *fileName, Tcl_DString *bufPtr); /* 44 */
701
+ int (*tclHideUnsafeCommands) (Tcl_Interp *interp); /* 45 */
702
+ int (*tclInExit) (void); /* 46 */
703
+ void (*reserved47)(void);
704
+ void (*reserved48)(void);
705
+ void (*reserved49)(void);
706
+ void (*tclInitCompiledLocals) (Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 50 */
707
+ int (*tclInterpInit) (Tcl_Interp *interp); /* 51 */
708
+ void (*reserved52)(void);
709
+ int (*tclInvokeObjectCommand) (ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char **argv); /* 53 */
710
+ int (*tclInvokeStringCommand) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 54 */
711
+ Proc * (*tclIsProc) (Command *cmdPtr); /* 55 */
712
+ void (*reserved56)(void);
713
+ void (*reserved57)(void);
714
+ Var * (*tclLookupVar) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, const char *msg, int createPart1, int createPart2, Var **arrayPtrPtr); /* 58 */
715
+ void (*reserved59)(void);
716
+ int (*tclNeedSpace) (const char *start, const char *end); /* 60 */
717
+ Tcl_Obj * (*tclNewProcBodyObj) (Proc *procPtr); /* 61 */
718
+ int (*tclObjCommandComplete) (Tcl_Obj *cmdPtr); /* 62 */
719
+ int (*tclObjInterpProc) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 63 */
720
+ int (*tclObjInvoke) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 64 */
721
+ void (*reserved65)(void);
722
+ void (*reserved66)(void);
723
+ void (*reserved67)(void);
724
+ void (*reserved68)(void);
725
+ char * (*tclpAlloc) (unsigned int size); /* 69 */
726
+ void (*reserved70)(void);
727
+ void (*reserved71)(void);
728
+ void (*reserved72)(void);
729
+ void (*reserved73)(void);
730
+ void (*tclpFree) (char *ptr); /* 74 */
731
+ unsigned long (*tclpGetClicks) (void); /* 75 */
732
+ unsigned long (*tclpGetSeconds) (void); /* 76 */
733
+ void (*tclpGetTime) (Tcl_Time *time); /* 77 */
734
+ void (*reserved78)(void);
735
+ void (*reserved79)(void);
736
+ void (*reserved80)(void);
737
+ char * (*tclpRealloc) (char *ptr, unsigned int size); /* 81 */
738
+ void (*reserved82)(void);
739
+ void (*reserved83)(void);
740
+ void (*reserved84)(void);
741
+ void (*reserved85)(void);
742
+ void (*reserved86)(void);
743
+ void (*reserved87)(void);
744
+ char * (*tclPrecTraceProc) (ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); /* 88 */
745
+ int (*tclPreventAliasLoop) (Tcl_Interp *interp, Tcl_Interp *cmdInterp, Tcl_Command cmd); /* 89 */
746
+ void (*reserved90)(void);
747
+ void (*tclProcCleanupProc) (Proc *procPtr); /* 91 */
748
+ int (*tclProcCompileProc) (Tcl_Interp *interp, Proc *procPtr, Tcl_Obj *bodyPtr, Namespace *nsPtr, const char *description, const char *procName); /* 92 */
749
+ void (*tclProcDeleteProc) (ClientData clientData); /* 93 */
750
+ void (*reserved94)(void);
751
+ void (*reserved95)(void);
752
+ int (*tclRenameCommand) (Tcl_Interp *interp, const char *oldName, const char *newName); /* 96 */
753
+ void (*tclResetShadowedCmdRefs) (Tcl_Interp *interp, Command *newCmdPtr); /* 97 */
754
+ int (*tclServiceIdle) (void); /* 98 */
755
+ void (*reserved99)(void);
756
+ void (*reserved100)(void);
757
+ CONST86 char * (*tclSetPreInitScript) (const char *string); /* 101 */
758
+ void (*tclSetupEnv) (Tcl_Interp *interp); /* 102 */
759
+ int (*tclSockGetPort) (Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); /* 103 */
760
+ int (*tclSockMinimumBuffersOld) (int sock, int size); /* 104 */
761
+ void (*reserved105)(void);
762
+ void (*reserved106)(void);
763
+ void (*reserved107)(void);
764
+ void (*tclTeardownNamespace) (Namespace *nsPtr); /* 108 */
765
+ int (*tclUpdateReturnInfo) (Interp *iPtr); /* 109 */
766
+ int (*tclSockMinimumBuffers) (void *sock, int size); /* 110 */
767
+ void (*tcl_AddInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 111 */
768
+ int (*tcl_AppendExportList) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 112 */
769
+ Tcl_Namespace * (*tcl_CreateNamespace) (Tcl_Interp *interp, const char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 113 */
770
+ void (*tcl_DeleteNamespace) (Tcl_Namespace *nsPtr); /* 114 */
771
+ int (*tcl_Export) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 115 */
772
+ Tcl_Command (*tcl_FindCommand) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 116 */
773
+ Tcl_Namespace * (*tcl_FindNamespace) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */
774
+ int (*tcl_GetInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolverInfo *resInfo); /* 118 */
775
+ int (*tcl_GetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolverInfo *resInfo); /* 119 */
776
+ Tcl_Var (*tcl_FindNamespaceVar) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 120 */
777
+ int (*tcl_ForgetImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 121 */
778
+ Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 122 */
779
+ void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 123 */
780
+ Tcl_Namespace * (*tcl_GetCurrentNamespace) (Tcl_Interp *interp); /* 124 */
781
+ Tcl_Namespace * (*tcl_GetGlobalNamespace) (Tcl_Interp *interp); /* 125 */
782
+ void (*tcl_GetVariableFullName) (Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr); /* 126 */
783
+ int (*tcl_Import) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 127 */
784
+ void (*tcl_PopCallFrame) (Tcl_Interp *interp); /* 128 */
785
+ int (*tcl_PushCallFrame) (Tcl_Interp *interp, Tcl_CallFrame *framePtr, Tcl_Namespace *nsPtr, int isProcCallFrame); /* 129 */
786
+ int (*tcl_RemoveInterpResolvers) (Tcl_Interp *interp, const char *name); /* 130 */
787
+ void (*tcl_SetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 131 */
788
+ int (*tclpHasSockets) (Tcl_Interp *interp); /* 132 */
789
+ struct tm * (*tclpGetDate) (const time_t *time, int useGMT); /* 133 */
790
+ void (*reserved134)(void);
791
+ void (*reserved135)(void);
792
+ void (*reserved136)(void);
793
+ void (*reserved137)(void);
794
+ CONST84_RETURN char * (*tclGetEnv) (const char *name, Tcl_DString *valuePtr); /* 138 */
795
+ void (*reserved139)(void);
796
+ void (*reserved140)(void);
797
+ CONST84_RETURN char * (*tclpGetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 141 */
798
+ int (*tclSetByteCodeFromAny) (Tcl_Interp *interp, Tcl_Obj *objPtr, CompileHookProc *hookProc, ClientData clientData); /* 142 */
799
+ int (*tclAddLiteralObj) (struct CompileEnv *envPtr, Tcl_Obj *objPtr, LiteralEntry **litPtrPtr); /* 143 */
800
+ void (*tclHideLiteral) (Tcl_Interp *interp, struct CompileEnv *envPtr, int index); /* 144 */
801
+ const struct AuxDataType * (*tclGetAuxDataType) (const char *typeName); /* 145 */
802
+ TclHandle (*tclHandleCreate) (void *ptr); /* 146 */
803
+ void (*tclHandleFree) (TclHandle handle); /* 147 */
804
+ TclHandle (*tclHandlePreserve) (TclHandle handle); /* 148 */
805
+ void (*tclHandleRelease) (TclHandle handle); /* 149 */
806
+ int (*tclRegAbout) (Tcl_Interp *interp, Tcl_RegExp re); /* 150 */
807
+ void (*tclRegExpRangeUniChar) (Tcl_RegExp re, int index, int *startPtr, int *endPtr); /* 151 */
808
+ void (*tclSetLibraryPath) (Tcl_Obj *pathPtr); /* 152 */
809
+ Tcl_Obj * (*tclGetLibraryPath) (void); /* 153 */
810
+ void (*reserved154)(void);
811
+ void (*reserved155)(void);
812
+ void (*tclRegError) (Tcl_Interp *interp, const char *msg, int status); /* 156 */
813
+ Var * (*tclVarTraceExists) (Tcl_Interp *interp, const char *varName); /* 157 */
814
+ void (*tclSetStartupScriptFileName) (const char *filename); /* 158 */
815
+ const char * (*tclGetStartupScriptFileName) (void); /* 159 */
816
+ void (*reserved160)(void);
817
+ int (*tclChannelTransform) (Tcl_Interp *interp, Tcl_Channel chan, Tcl_Obj *cmdObjPtr); /* 161 */
818
+ void (*tclChannelEventScriptInvoker) (ClientData clientData, int flags); /* 162 */
819
+ const void * (*tclGetInstructionTable) (void); /* 163 */
820
+ void (*tclExpandCodeArray) (void *envPtr); /* 164 */
821
+ void (*tclpSetInitialEncodings) (void); /* 165 */
822
+ int (*tclListObjSetElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj *valuePtr); /* 166 */
823
+ void (*tclSetStartupScriptPath) (Tcl_Obj *pathPtr); /* 167 */
824
+ Tcl_Obj * (*tclGetStartupScriptPath) (void); /* 168 */
825
+ int (*tclpUtfNcmp2) (const char *s1, const char *s2, unsigned long n); /* 169 */
826
+ int (*tclCheckInterpTraces) (Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 170 */
827
+ int (*tclCheckExecutionTraces) (Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 171 */
828
+ int (*tclInThreadExit) (void); /* 172 */
829
+ int (*tclUniCharMatch) (const Tcl_UniChar *string, int strLen, const Tcl_UniChar *pattern, int ptnLen, int flags); /* 173 */
830
+ void (*reserved174)(void);
831
+ int (*tclCallVarTraces) (Interp *iPtr, Var *arrayPtr, Var *varPtr, const char *part1, const char *part2, int flags, int leaveErrMsg); /* 175 */
832
+ void (*tclCleanupVar) (Var *varPtr, Var *arrayPtr); /* 176 */
833
+ void (*tclVarErrMsg) (Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason); /* 177 */
834
+ void (*tcl_SetStartupScript) (Tcl_Obj *pathPtr, const char *encodingName); /* 178 */
835
+ Tcl_Obj * (*tcl_GetStartupScript) (const char **encodingNamePtr); /* 179 */
836
+ void (*reserved180)(void);
837
+ void (*reserved181)(void);
838
+ struct tm * (*tclpLocaltime) (const time_t *clock); /* 182 */
839
+ struct tm * (*tclpGmtime) (const time_t *clock); /* 183 */
840
+ void (*reserved184)(void);
841
+ void (*reserved185)(void);
842
+ void (*reserved186)(void);
843
+ void (*reserved187)(void);
844
+ void (*reserved188)(void);
845
+ void (*reserved189)(void);
846
+ void (*reserved190)(void);
847
+ void (*reserved191)(void);
848
+ void (*reserved192)(void);
849
+ void (*reserved193)(void);
850
+ void (*reserved194)(void);
851
+ void (*reserved195)(void);
852
+ void (*reserved196)(void);
853
+ void (*reserved197)(void);
854
+ int (*tclObjGetFrame) (Tcl_Interp *interp, Tcl_Obj *objPtr, CallFrame **framePtrPtr); /* 198 */
855
+ void (*reserved199)(void);
856
+ int (*tclpObjRemoveDirectory) (Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr); /* 200 */
857
+ int (*tclpObjCopyDirectory) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr); /* 201 */
858
+ int (*tclpObjCreateDirectory) (Tcl_Obj *pathPtr); /* 202 */
859
+ int (*tclpObjDeleteFile) (Tcl_Obj *pathPtr); /* 203 */
860
+ int (*tclpObjCopyFile) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 204 */
861
+ int (*tclpObjRenameFile) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 205 */
862
+ int (*tclpObjStat) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 206 */
863
+ int (*tclpObjAccess) (Tcl_Obj *pathPtr, int mode); /* 207 */
864
+ Tcl_Channel (*tclpOpenFileChannel) (Tcl_Interp *interp, Tcl_Obj *pathPtr, int mode, int permissions); /* 208 */
865
+ void (*reserved209)(void);
866
+ void (*reserved210)(void);
867
+ void (*reserved211)(void);
868
+ void (*tclpFindExecutable) (const char *argv0); /* 212 */
869
+ Tcl_Obj * (*tclGetObjNameOfExecutable) (void); /* 213 */
870
+ void (*tclSetObjNameOfExecutable) (Tcl_Obj *name, Tcl_Encoding encoding); /* 214 */
871
+ void * (*tclStackAlloc) (Tcl_Interp *interp, int numBytes); /* 215 */
872
+ void (*tclStackFree) (Tcl_Interp *interp, void *freePtr); /* 216 */
873
+ int (*tclPushStackFrame) (Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 217 */
874
+ void (*tclPopStackFrame) (Tcl_Interp *interp); /* 218 */
875
+ void (*reserved219)(void);
876
+ void (*reserved220)(void);
877
+ void (*reserved221)(void);
878
+ void (*reserved222)(void);
879
+ void (*reserved223)(void);
880
+ TclPlatformType * (*tclGetPlatform) (void); /* 224 */
881
+ Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, int keyc, Tcl_Obj *const keyv[], int flags); /* 225 */
882
+ int (*tclObjBeingDeleted) (Tcl_Obj *objPtr); /* 226 */
883
+ void (*tclSetNsPath) (Namespace *nsPtr, int pathLength, Tcl_Namespace *pathAry[]); /* 227 */
884
+ void (*reserved228)(void);
885
+ int (*tclPtrMakeUpvar) (Tcl_Interp *interp, Var *otherP1Ptr, const char *myName, int myFlags, int index); /* 229 */
886
+ Var * (*tclObjLookupVar) (Tcl_Interp *interp, Tcl_Obj *part1Ptr, const char *part2, int flags, const char *msg, const int createPart1, const int createPart2, Var **arrayPtrPtr); /* 230 */
887
+ int (*tclGetNamespaceFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Namespace **nsPtrPtr); /* 231 */
888
+ int (*tclEvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 232 */
889
+ void (*tclGetSrcInfoForPc) (CmdFrame *contextPtr); /* 233 */
890
+ Var * (*tclVarHashCreateVar) (TclVarHashTable *tablePtr, const char *key, int *newPtr); /* 234 */
891
+ void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */
892
+ void (*tclBackgroundException) (Tcl_Interp *interp, int code); /* 236 */
893
+ int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */
894
+ int (*tclNRInterpProc) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */
895
+ int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, int skip, ProcErrorProc *errorProc); /* 239 */
896
+ int (*tclNRRunCallbacks) (Tcl_Interp *interp, int result, struct NRE_callback *rootPtr); /* 240 */
897
+ int (*tclNREvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 241 */
898
+ int (*tclNREvalObjv) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags, Command *cmdPtr); /* 242 */
899
+ void (*tclDbDumpActiveObjects) (FILE *outFile); /* 243 */
900
+ Tcl_HashTable * (*tclGetNamespaceChildTable) (Tcl_Namespace *nsPtr); /* 244 */
901
+ Tcl_HashTable * (*tclGetNamespaceCommandTable) (Tcl_Namespace *nsPtr); /* 245 */
902
+ int (*tclInitRewriteEnsemble) (Tcl_Interp *interp, int numRemoved, int numInserted, Tcl_Obj *const *objv); /* 246 */
903
+ void (*tclResetRewriteEnsemble) (Tcl_Interp *interp, int isRootEnsemble); /* 247 */
904
+ int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr); /* 248 */
905
+ char * (*tclDoubleDigits) (double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 249 */
906
+ void (*tclSetSlaveCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */
907
+ int (*tclRegisterLiteral) (void *envPtr, char *bytes, int length, int flags); /* 251 */
908
+ Tcl_Obj * (*tclPtrGetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 252 */
909
+ Tcl_Obj * (*tclPtrSetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, const int flags); /* 253 */
910
+ Tcl_Obj * (*tclPtrIncrObjVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, const int flags); /* 254 */
911
+ int (*tclPtrObjMakeUpvar) (Tcl_Interp *interp, Tcl_Var otherPtr, Tcl_Obj *myNamePtr, int myFlags); /* 255 */
912
+ int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const int flags); /* 256 */
913
+ void (*tclStaticPackage) (Tcl_Interp *interp, const char *prefix, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 257 */
914
+ void (*reserved258)(void);
915
+ void (*reserved259)(void);
916
+ void (*reserved260)(void);
917
+ void (*tclUnusedStubEntry) (void); /* 261 */
918
+ } TclIntStubs;
919
+
920
+ extern const TclIntStubs *tclIntStubsPtr;
921
+
922
+ #ifdef __cplusplus
923
+ }
924
+ #endif
925
+
926
+ #if defined(USE_TCL_STUBS)
927
+
928
+ /*
929
+ * Inline function declarations:
930
+ */
931
+
932
+ /* Slot 0 is reserved */
933
+ /* Slot 1 is reserved */
934
+ /* Slot 2 is reserved */
935
+ #define TclAllocateFreeObjects \
936
+ (tclIntStubsPtr->tclAllocateFreeObjects) /* 3 */
937
+ /* Slot 4 is reserved */
938
+ #define TclCleanupChildren \
939
+ (tclIntStubsPtr->tclCleanupChildren) /* 5 */
940
+ #define TclCleanupCommand \
941
+ (tclIntStubsPtr->tclCleanupCommand) /* 6 */
942
+ #define TclCopyAndCollapse \
943
+ (tclIntStubsPtr->tclCopyAndCollapse) /* 7 */
944
+ #define TclCopyChannelOld \
945
+ (tclIntStubsPtr->tclCopyChannelOld) /* 8 */
946
+ #define TclCreatePipeline \
947
+ (tclIntStubsPtr->tclCreatePipeline) /* 9 */
948
+ #define TclCreateProc \
949
+ (tclIntStubsPtr->tclCreateProc) /* 10 */
950
+ #define TclDeleteCompiledLocalVars \
951
+ (tclIntStubsPtr->tclDeleteCompiledLocalVars) /* 11 */
952
+ #define TclDeleteVars \
953
+ (tclIntStubsPtr->tclDeleteVars) /* 12 */
954
+ /* Slot 13 is reserved */
955
+ #define TclDumpMemoryInfo \
956
+ (tclIntStubsPtr->tclDumpMemoryInfo) /* 14 */
957
+ /* Slot 15 is reserved */
958
+ #define TclExprFloatError \
959
+ (tclIntStubsPtr->tclExprFloatError) /* 16 */
960
+ /* Slot 17 is reserved */
961
+ /* Slot 18 is reserved */
962
+ /* Slot 19 is reserved */
963
+ /* Slot 20 is reserved */
964
+ /* Slot 21 is reserved */
965
+ #define TclFindElement \
966
+ (tclIntStubsPtr->tclFindElement) /* 22 */
967
+ #define TclFindProc \
968
+ (tclIntStubsPtr->tclFindProc) /* 23 */
969
+ #define TclFormatInt \
970
+ (tclIntStubsPtr->tclFormatInt) /* 24 */
971
+ #define TclFreePackageInfo \
972
+ (tclIntStubsPtr->tclFreePackageInfo) /* 25 */
973
+ /* Slot 26 is reserved */
974
+ /* Slot 27 is reserved */
975
+ #define TclpGetDefaultStdChannel \
976
+ (tclIntStubsPtr->tclpGetDefaultStdChannel) /* 28 */
977
+ /* Slot 29 is reserved */
978
+ /* Slot 30 is reserved */
979
+ #define TclGetExtension \
980
+ (tclIntStubsPtr->tclGetExtension) /* 31 */
981
+ #define TclGetFrame \
982
+ (tclIntStubsPtr->tclGetFrame) /* 32 */
983
+ /* Slot 33 is reserved */
984
+ #define TclGetIntForIndex \
985
+ (tclIntStubsPtr->tclGetIntForIndex) /* 34 */
986
+ /* Slot 35 is reserved */
987
+ /* Slot 36 is reserved */
988
+ #define TclGetLoadedPackages \
989
+ (tclIntStubsPtr->tclGetLoadedPackages) /* 37 */
990
+ #define TclGetNamespaceForQualName \
991
+ (tclIntStubsPtr->tclGetNamespaceForQualName) /* 38 */
992
+ #define TclGetObjInterpProc \
993
+ (tclIntStubsPtr->tclGetObjInterpProc) /* 39 */
994
+ #define TclGetOpenMode \
995
+ (tclIntStubsPtr->tclGetOpenMode) /* 40 */
996
+ #define TclGetOriginalCommand \
997
+ (tclIntStubsPtr->tclGetOriginalCommand) /* 41 */
998
+ #define TclpGetUserHome \
999
+ (tclIntStubsPtr->tclpGetUserHome) /* 42 */
1000
+ /* Slot 43 is reserved */
1001
+ #define TclGuessPackageName \
1002
+ (tclIntStubsPtr->tclGuessPackageName) /* 44 */
1003
+ #define TclHideUnsafeCommands \
1004
+ (tclIntStubsPtr->tclHideUnsafeCommands) /* 45 */
1005
+ #define TclInExit \
1006
+ (tclIntStubsPtr->tclInExit) /* 46 */
1007
+ /* Slot 47 is reserved */
1008
+ /* Slot 48 is reserved */
1009
+ /* Slot 49 is reserved */
1010
+ #define TclInitCompiledLocals \
1011
+ (tclIntStubsPtr->tclInitCompiledLocals) /* 50 */
1012
+ #define TclInterpInit \
1013
+ (tclIntStubsPtr->tclInterpInit) /* 51 */
1014
+ /* Slot 52 is reserved */
1015
+ #define TclInvokeObjectCommand \
1016
+ (tclIntStubsPtr->tclInvokeObjectCommand) /* 53 */
1017
+ #define TclInvokeStringCommand \
1018
+ (tclIntStubsPtr->tclInvokeStringCommand) /* 54 */
1019
+ #define TclIsProc \
1020
+ (tclIntStubsPtr->tclIsProc) /* 55 */
1021
+ /* Slot 56 is reserved */
1022
+ /* Slot 57 is reserved */
1023
+ #define TclLookupVar \
1024
+ (tclIntStubsPtr->tclLookupVar) /* 58 */
1025
+ /* Slot 59 is reserved */
1026
+ #define TclNeedSpace \
1027
+ (tclIntStubsPtr->tclNeedSpace) /* 60 */
1028
+ #define TclNewProcBodyObj \
1029
+ (tclIntStubsPtr->tclNewProcBodyObj) /* 61 */
1030
+ #define TclObjCommandComplete \
1031
+ (tclIntStubsPtr->tclObjCommandComplete) /* 62 */
1032
+ #define TclObjInterpProc \
1033
+ (tclIntStubsPtr->tclObjInterpProc) /* 63 */
1034
+ #define TclObjInvoke \
1035
+ (tclIntStubsPtr->tclObjInvoke) /* 64 */
1036
+ /* Slot 65 is reserved */
1037
+ /* Slot 66 is reserved */
1038
+ /* Slot 67 is reserved */
1039
+ /* Slot 68 is reserved */
1040
+ #define TclpAlloc \
1041
+ (tclIntStubsPtr->tclpAlloc) /* 69 */
1042
+ /* Slot 70 is reserved */
1043
+ /* Slot 71 is reserved */
1044
+ /* Slot 72 is reserved */
1045
+ /* Slot 73 is reserved */
1046
+ #define TclpFree \
1047
+ (tclIntStubsPtr->tclpFree) /* 74 */
1048
+ #define TclpGetClicks \
1049
+ (tclIntStubsPtr->tclpGetClicks) /* 75 */
1050
+ #define TclpGetSeconds \
1051
+ (tclIntStubsPtr->tclpGetSeconds) /* 76 */
1052
+ #define TclpGetTime \
1053
+ (tclIntStubsPtr->tclpGetTime) /* 77 */
1054
+ /* Slot 78 is reserved */
1055
+ /* Slot 79 is reserved */
1056
+ /* Slot 80 is reserved */
1057
+ #define TclpRealloc \
1058
+ (tclIntStubsPtr->tclpRealloc) /* 81 */
1059
+ /* Slot 82 is reserved */
1060
+ /* Slot 83 is reserved */
1061
+ /* Slot 84 is reserved */
1062
+ /* Slot 85 is reserved */
1063
+ /* Slot 86 is reserved */
1064
+ /* Slot 87 is reserved */
1065
+ #define TclPrecTraceProc \
1066
+ (tclIntStubsPtr->tclPrecTraceProc) /* 88 */
1067
+ #define TclPreventAliasLoop \
1068
+ (tclIntStubsPtr->tclPreventAliasLoop) /* 89 */
1069
+ /* Slot 90 is reserved */
1070
+ #define TclProcCleanupProc \
1071
+ (tclIntStubsPtr->tclProcCleanupProc) /* 91 */
1072
+ #define TclProcCompileProc \
1073
+ (tclIntStubsPtr->tclProcCompileProc) /* 92 */
1074
+ #define TclProcDeleteProc \
1075
+ (tclIntStubsPtr->tclProcDeleteProc) /* 93 */
1076
+ /* Slot 94 is reserved */
1077
+ /* Slot 95 is reserved */
1078
+ #define TclRenameCommand \
1079
+ (tclIntStubsPtr->tclRenameCommand) /* 96 */
1080
+ #define TclResetShadowedCmdRefs \
1081
+ (tclIntStubsPtr->tclResetShadowedCmdRefs) /* 97 */
1082
+ #define TclServiceIdle \
1083
+ (tclIntStubsPtr->tclServiceIdle) /* 98 */
1084
+ /* Slot 99 is reserved */
1085
+ /* Slot 100 is reserved */
1086
+ #define TclSetPreInitScript \
1087
+ (tclIntStubsPtr->tclSetPreInitScript) /* 101 */
1088
+ #define TclSetupEnv \
1089
+ (tclIntStubsPtr->tclSetupEnv) /* 102 */
1090
+ #define TclSockGetPort \
1091
+ (tclIntStubsPtr->tclSockGetPort) /* 103 */
1092
+ #define TclSockMinimumBuffersOld \
1093
+ (tclIntStubsPtr->tclSockMinimumBuffersOld) /* 104 */
1094
+ /* Slot 105 is reserved */
1095
+ /* Slot 106 is reserved */
1096
+ /* Slot 107 is reserved */
1097
+ #define TclTeardownNamespace \
1098
+ (tclIntStubsPtr->tclTeardownNamespace) /* 108 */
1099
+ #define TclUpdateReturnInfo \
1100
+ (tclIntStubsPtr->tclUpdateReturnInfo) /* 109 */
1101
+ #define TclSockMinimumBuffers \
1102
+ (tclIntStubsPtr->tclSockMinimumBuffers) /* 110 */
1103
+ #define Tcl_AddInterpResolvers \
1104
+ (tclIntStubsPtr->tcl_AddInterpResolvers) /* 111 */
1105
+ #define Tcl_AppendExportList \
1106
+ (tclIntStubsPtr->tcl_AppendExportList) /* 112 */
1107
+ #define Tcl_CreateNamespace \
1108
+ (tclIntStubsPtr->tcl_CreateNamespace) /* 113 */
1109
+ #define Tcl_DeleteNamespace \
1110
+ (tclIntStubsPtr->tcl_DeleteNamespace) /* 114 */
1111
+ #define Tcl_Export \
1112
+ (tclIntStubsPtr->tcl_Export) /* 115 */
1113
+ #define Tcl_FindCommand \
1114
+ (tclIntStubsPtr->tcl_FindCommand) /* 116 */
1115
+ #define Tcl_FindNamespace \
1116
+ (tclIntStubsPtr->tcl_FindNamespace) /* 117 */
1117
+ #define Tcl_GetInterpResolvers \
1118
+ (tclIntStubsPtr->tcl_GetInterpResolvers) /* 118 */
1119
+ #define Tcl_GetNamespaceResolvers \
1120
+ (tclIntStubsPtr->tcl_GetNamespaceResolvers) /* 119 */
1121
+ #define Tcl_FindNamespaceVar \
1122
+ (tclIntStubsPtr->tcl_FindNamespaceVar) /* 120 */
1123
+ #define Tcl_ForgetImport \
1124
+ (tclIntStubsPtr->tcl_ForgetImport) /* 121 */
1125
+ #define Tcl_GetCommandFromObj \
1126
+ (tclIntStubsPtr->tcl_GetCommandFromObj) /* 122 */
1127
+ #define Tcl_GetCommandFullName \
1128
+ (tclIntStubsPtr->tcl_GetCommandFullName) /* 123 */
1129
+ #define Tcl_GetCurrentNamespace \
1130
+ (tclIntStubsPtr->tcl_GetCurrentNamespace) /* 124 */
1131
+ #define Tcl_GetGlobalNamespace \
1132
+ (tclIntStubsPtr->tcl_GetGlobalNamespace) /* 125 */
1133
+ #define Tcl_GetVariableFullName \
1134
+ (tclIntStubsPtr->tcl_GetVariableFullName) /* 126 */
1135
+ #define Tcl_Import \
1136
+ (tclIntStubsPtr->tcl_Import) /* 127 */
1137
+ #define Tcl_PopCallFrame \
1138
+ (tclIntStubsPtr->tcl_PopCallFrame) /* 128 */
1139
+ #define Tcl_PushCallFrame \
1140
+ (tclIntStubsPtr->tcl_PushCallFrame) /* 129 */
1141
+ #define Tcl_RemoveInterpResolvers \
1142
+ (tclIntStubsPtr->tcl_RemoveInterpResolvers) /* 130 */
1143
+ #define Tcl_SetNamespaceResolvers \
1144
+ (tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */
1145
+ #define TclpHasSockets \
1146
+ (tclIntStubsPtr->tclpHasSockets) /* 132 */
1147
+ #define TclpGetDate \
1148
+ (tclIntStubsPtr->tclpGetDate) /* 133 */
1149
+ /* Slot 134 is reserved */
1150
+ /* Slot 135 is reserved */
1151
+ /* Slot 136 is reserved */
1152
+ /* Slot 137 is reserved */
1153
+ #define TclGetEnv \
1154
+ (tclIntStubsPtr->tclGetEnv) /* 138 */
1155
+ /* Slot 139 is reserved */
1156
+ /* Slot 140 is reserved */
1157
+ #define TclpGetCwd \
1158
+ (tclIntStubsPtr->tclpGetCwd) /* 141 */
1159
+ #define TclSetByteCodeFromAny \
1160
+ (tclIntStubsPtr->tclSetByteCodeFromAny) /* 142 */
1161
+ #define TclAddLiteralObj \
1162
+ (tclIntStubsPtr->tclAddLiteralObj) /* 143 */
1163
+ #define TclHideLiteral \
1164
+ (tclIntStubsPtr->tclHideLiteral) /* 144 */
1165
+ #define TclGetAuxDataType \
1166
+ (tclIntStubsPtr->tclGetAuxDataType) /* 145 */
1167
+ #define TclHandleCreate \
1168
+ (tclIntStubsPtr->tclHandleCreate) /* 146 */
1169
+ #define TclHandleFree \
1170
+ (tclIntStubsPtr->tclHandleFree) /* 147 */
1171
+ #define TclHandlePreserve \
1172
+ (tclIntStubsPtr->tclHandlePreserve) /* 148 */
1173
+ #define TclHandleRelease \
1174
+ (tclIntStubsPtr->tclHandleRelease) /* 149 */
1175
+ #define TclRegAbout \
1176
+ (tclIntStubsPtr->tclRegAbout) /* 150 */
1177
+ #define TclRegExpRangeUniChar \
1178
+ (tclIntStubsPtr->tclRegExpRangeUniChar) /* 151 */
1179
+ #define TclSetLibraryPath \
1180
+ (tclIntStubsPtr->tclSetLibraryPath) /* 152 */
1181
+ #define TclGetLibraryPath \
1182
+ (tclIntStubsPtr->tclGetLibraryPath) /* 153 */
1183
+ /* Slot 154 is reserved */
1184
+ /* Slot 155 is reserved */
1185
+ #define TclRegError \
1186
+ (tclIntStubsPtr->tclRegError) /* 156 */
1187
+ #define TclVarTraceExists \
1188
+ (tclIntStubsPtr->tclVarTraceExists) /* 157 */
1189
+ #define TclSetStartupScriptFileName \
1190
+ (tclIntStubsPtr->tclSetStartupScriptFileName) /* 158 */
1191
+ #define TclGetStartupScriptFileName \
1192
+ (tclIntStubsPtr->tclGetStartupScriptFileName) /* 159 */
1193
+ /* Slot 160 is reserved */
1194
+ #define TclChannelTransform \
1195
+ (tclIntStubsPtr->tclChannelTransform) /* 161 */
1196
+ #define TclChannelEventScriptInvoker \
1197
+ (tclIntStubsPtr->tclChannelEventScriptInvoker) /* 162 */
1198
+ #define TclGetInstructionTable \
1199
+ (tclIntStubsPtr->tclGetInstructionTable) /* 163 */
1200
+ #define TclExpandCodeArray \
1201
+ (tclIntStubsPtr->tclExpandCodeArray) /* 164 */
1202
+ #define TclpSetInitialEncodings \
1203
+ (tclIntStubsPtr->tclpSetInitialEncodings) /* 165 */
1204
+ #define TclListObjSetElement \
1205
+ (tclIntStubsPtr->tclListObjSetElement) /* 166 */
1206
+ #define TclSetStartupScriptPath \
1207
+ (tclIntStubsPtr->tclSetStartupScriptPath) /* 167 */
1208
+ #define TclGetStartupScriptPath \
1209
+ (tclIntStubsPtr->tclGetStartupScriptPath) /* 168 */
1210
+ #define TclpUtfNcmp2 \
1211
+ (tclIntStubsPtr->tclpUtfNcmp2) /* 169 */
1212
+ #define TclCheckInterpTraces \
1213
+ (tclIntStubsPtr->tclCheckInterpTraces) /* 170 */
1214
+ #define TclCheckExecutionTraces \
1215
+ (tclIntStubsPtr->tclCheckExecutionTraces) /* 171 */
1216
+ #define TclInThreadExit \
1217
+ (tclIntStubsPtr->tclInThreadExit) /* 172 */
1218
+ #define TclUniCharMatch \
1219
+ (tclIntStubsPtr->tclUniCharMatch) /* 173 */
1220
+ /* Slot 174 is reserved */
1221
+ #define TclCallVarTraces \
1222
+ (tclIntStubsPtr->tclCallVarTraces) /* 175 */
1223
+ #define TclCleanupVar \
1224
+ (tclIntStubsPtr->tclCleanupVar) /* 176 */
1225
+ #define TclVarErrMsg \
1226
+ (tclIntStubsPtr->tclVarErrMsg) /* 177 */
1227
+ #define Tcl_SetStartupScript \
1228
+ (tclIntStubsPtr->tcl_SetStartupScript) /* 178 */
1229
+ #define Tcl_GetStartupScript \
1230
+ (tclIntStubsPtr->tcl_GetStartupScript) /* 179 */
1231
+ /* Slot 180 is reserved */
1232
+ /* Slot 181 is reserved */
1233
+ #define TclpLocaltime \
1234
+ (tclIntStubsPtr->tclpLocaltime) /* 182 */
1235
+ #define TclpGmtime \
1236
+ (tclIntStubsPtr->tclpGmtime) /* 183 */
1237
+ /* Slot 184 is reserved */
1238
+ /* Slot 185 is reserved */
1239
+ /* Slot 186 is reserved */
1240
+ /* Slot 187 is reserved */
1241
+ /* Slot 188 is reserved */
1242
+ /* Slot 189 is reserved */
1243
+ /* Slot 190 is reserved */
1244
+ /* Slot 191 is reserved */
1245
+ /* Slot 192 is reserved */
1246
+ /* Slot 193 is reserved */
1247
+ /* Slot 194 is reserved */
1248
+ /* Slot 195 is reserved */
1249
+ /* Slot 196 is reserved */
1250
+ /* Slot 197 is reserved */
1251
+ #define TclObjGetFrame \
1252
+ (tclIntStubsPtr->tclObjGetFrame) /* 198 */
1253
+ /* Slot 199 is reserved */
1254
+ #define TclpObjRemoveDirectory \
1255
+ (tclIntStubsPtr->tclpObjRemoveDirectory) /* 200 */
1256
+ #define TclpObjCopyDirectory \
1257
+ (tclIntStubsPtr->tclpObjCopyDirectory) /* 201 */
1258
+ #define TclpObjCreateDirectory \
1259
+ (tclIntStubsPtr->tclpObjCreateDirectory) /* 202 */
1260
+ #define TclpObjDeleteFile \
1261
+ (tclIntStubsPtr->tclpObjDeleteFile) /* 203 */
1262
+ #define TclpObjCopyFile \
1263
+ (tclIntStubsPtr->tclpObjCopyFile) /* 204 */
1264
+ #define TclpObjRenameFile \
1265
+ (tclIntStubsPtr->tclpObjRenameFile) /* 205 */
1266
+ #define TclpObjStat \
1267
+ (tclIntStubsPtr->tclpObjStat) /* 206 */
1268
+ #define TclpObjAccess \
1269
+ (tclIntStubsPtr->tclpObjAccess) /* 207 */
1270
+ #define TclpOpenFileChannel \
1271
+ (tclIntStubsPtr->tclpOpenFileChannel) /* 208 */
1272
+ /* Slot 209 is reserved */
1273
+ /* Slot 210 is reserved */
1274
+ /* Slot 211 is reserved */
1275
+ #define TclpFindExecutable \
1276
+ (tclIntStubsPtr->tclpFindExecutable) /* 212 */
1277
+ #define TclGetObjNameOfExecutable \
1278
+ (tclIntStubsPtr->tclGetObjNameOfExecutable) /* 213 */
1279
+ #define TclSetObjNameOfExecutable \
1280
+ (tclIntStubsPtr->tclSetObjNameOfExecutable) /* 214 */
1281
+ #define TclStackAlloc \
1282
+ (tclIntStubsPtr->tclStackAlloc) /* 215 */
1283
+ #define TclStackFree \
1284
+ (tclIntStubsPtr->tclStackFree) /* 216 */
1285
+ #define TclPushStackFrame \
1286
+ (tclIntStubsPtr->tclPushStackFrame) /* 217 */
1287
+ #define TclPopStackFrame \
1288
+ (tclIntStubsPtr->tclPopStackFrame) /* 218 */
1289
+ /* Slot 219 is reserved */
1290
+ /* Slot 220 is reserved */
1291
+ /* Slot 221 is reserved */
1292
+ /* Slot 222 is reserved */
1293
+ /* Slot 223 is reserved */
1294
+ #define TclGetPlatform \
1295
+ (tclIntStubsPtr->tclGetPlatform) /* 224 */
1296
+ #define TclTraceDictPath \
1297
+ (tclIntStubsPtr->tclTraceDictPath) /* 225 */
1298
+ #define TclObjBeingDeleted \
1299
+ (tclIntStubsPtr->tclObjBeingDeleted) /* 226 */
1300
+ #define TclSetNsPath \
1301
+ (tclIntStubsPtr->tclSetNsPath) /* 227 */
1302
+ /* Slot 228 is reserved */
1303
+ #define TclPtrMakeUpvar \
1304
+ (tclIntStubsPtr->tclPtrMakeUpvar) /* 229 */
1305
+ #define TclObjLookupVar \
1306
+ (tclIntStubsPtr->tclObjLookupVar) /* 230 */
1307
+ #define TclGetNamespaceFromObj \
1308
+ (tclIntStubsPtr->tclGetNamespaceFromObj) /* 231 */
1309
+ #define TclEvalObjEx \
1310
+ (tclIntStubsPtr->tclEvalObjEx) /* 232 */
1311
+ #define TclGetSrcInfoForPc \
1312
+ (tclIntStubsPtr->tclGetSrcInfoForPc) /* 233 */
1313
+ #define TclVarHashCreateVar \
1314
+ (tclIntStubsPtr->tclVarHashCreateVar) /* 234 */
1315
+ #define TclInitVarHashTable \
1316
+ (tclIntStubsPtr->tclInitVarHashTable) /* 235 */
1317
+ #define TclBackgroundException \
1318
+ (tclIntStubsPtr->tclBackgroundException) /* 236 */
1319
+ #define TclResetCancellation \
1320
+ (tclIntStubsPtr->tclResetCancellation) /* 237 */
1321
+ #define TclNRInterpProc \
1322
+ (tclIntStubsPtr->tclNRInterpProc) /* 238 */
1323
+ #define TclNRInterpProcCore \
1324
+ (tclIntStubsPtr->tclNRInterpProcCore) /* 239 */
1325
+ #define TclNRRunCallbacks \
1326
+ (tclIntStubsPtr->tclNRRunCallbacks) /* 240 */
1327
+ #define TclNREvalObjEx \
1328
+ (tclIntStubsPtr->tclNREvalObjEx) /* 241 */
1329
+ #define TclNREvalObjv \
1330
+ (tclIntStubsPtr->tclNREvalObjv) /* 242 */
1331
+ #define TclDbDumpActiveObjects \
1332
+ (tclIntStubsPtr->tclDbDumpActiveObjects) /* 243 */
1333
+ #define TclGetNamespaceChildTable \
1334
+ (tclIntStubsPtr->tclGetNamespaceChildTable) /* 244 */
1335
+ #define TclGetNamespaceCommandTable \
1336
+ (tclIntStubsPtr->tclGetNamespaceCommandTable) /* 245 */
1337
+ #define TclInitRewriteEnsemble \
1338
+ (tclIntStubsPtr->tclInitRewriteEnsemble) /* 246 */
1339
+ #define TclResetRewriteEnsemble \
1340
+ (tclIntStubsPtr->tclResetRewriteEnsemble) /* 247 */
1341
+ #define TclCopyChannel \
1342
+ (tclIntStubsPtr->tclCopyChannel) /* 248 */
1343
+ #define TclDoubleDigits \
1344
+ (tclIntStubsPtr->tclDoubleDigits) /* 249 */
1345
+ #define TclSetSlaveCancelFlags \
1346
+ (tclIntStubsPtr->tclSetSlaveCancelFlags) /* 250 */
1347
+ #define TclRegisterLiteral \
1348
+ (tclIntStubsPtr->tclRegisterLiteral) /* 251 */
1349
+ #define TclPtrGetVar \
1350
+ (tclIntStubsPtr->tclPtrGetVar) /* 252 */
1351
+ #define TclPtrSetVar \
1352
+ (tclIntStubsPtr->tclPtrSetVar) /* 253 */
1353
+ #define TclPtrIncrObjVar \
1354
+ (tclIntStubsPtr->tclPtrIncrObjVar) /* 254 */
1355
+ #define TclPtrObjMakeUpvar \
1356
+ (tclIntStubsPtr->tclPtrObjMakeUpvar) /* 255 */
1357
+ #define TclPtrUnsetVar \
1358
+ (tclIntStubsPtr->tclPtrUnsetVar) /* 256 */
1359
+ #define TclStaticPackage \
1360
+ (tclIntStubsPtr->tclStaticPackage) /* 257 */
1361
+ /* Slot 258 is reserved */
1362
+ /* Slot 259 is reserved */
1363
+ /* Slot 260 is reserved */
1364
+ #define TclUnusedStubEntry \
1365
+ (tclIntStubsPtr->tclUnusedStubEntry) /* 261 */
1366
+
1367
+ #endif /* defined(USE_TCL_STUBS) */
1368
+
1369
+ /* !END!: Do not edit above this line. */
1370
+
1371
+ #undef TCL_STORAGE_CLASS
1372
+ #define TCL_STORAGE_CLASS DLLIMPORT
1373
+
1374
+ #undef TclGetStartupScriptFileName
1375
+ #undef TclSetStartupScriptFileName
1376
+ #undef TclGetStartupScriptPath
1377
+ #undef TclSetStartupScriptPath
1378
+ #undef TclBackgroundException
1379
+ #undef TclUnusedStubEntry
1380
+ #undef TclObjInterpProc
1381
+ #define TclObjInterpProc TclGetObjInterpProc()
1382
+
1383
+ #if defined(USE_TCL_STUBS) && defined(TCL_NO_DEPRECATED)
1384
+ # undef Tcl_SetStartupScript
1385
+ # define Tcl_SetStartupScript \
1386
+ (tclStubsPtr->tcl_SetStartupScript) /* 622 */
1387
+ # undef Tcl_GetStartupScript
1388
+ # define Tcl_GetStartupScript \
1389
+ (tclStubsPtr->tcl_GetStartupScript) /* 623 */
1390
+ # undef Tcl_CreateNamespace
1391
+ # define Tcl_CreateNamespace \
1392
+ (tclStubsPtr->tcl_CreateNamespace) /* 506 */
1393
+ # undef Tcl_DeleteNamespace
1394
+ # define Tcl_DeleteNamespace \
1395
+ (tclStubsPtr->tcl_DeleteNamespace) /* 507 */
1396
+ # undef Tcl_AppendExportList
1397
+ # define Tcl_AppendExportList \
1398
+ (tclStubsPtr->tcl_AppendExportList) /* 508 */
1399
+ # undef Tcl_Export
1400
+ # define Tcl_Export \
1401
+ (tclStubsPtr->tcl_Export) /* 509 */
1402
+ # undef Tcl_Import
1403
+ # define Tcl_Import \
1404
+ (tclStubsPtr->tcl_Import) /* 510 */
1405
+ # undef Tcl_ForgetImport
1406
+ # define Tcl_ForgetImport \
1407
+ (tclStubsPtr->tcl_ForgetImport) /* 511 */
1408
+ # undef Tcl_GetCurrentNamespace
1409
+ # define Tcl_GetCurrentNamespace \
1410
+ (tclStubsPtr->tcl_GetCurrentNamespace) /* 512 */
1411
+ # undef Tcl_GetGlobalNamespace
1412
+ # define Tcl_GetGlobalNamespace \
1413
+ (tclStubsPtr->tcl_GetGlobalNamespace) /* 513 */
1414
+ # undef Tcl_FindNamespace
1415
+ # define Tcl_FindNamespace \
1416
+ (tclStubsPtr->tcl_FindNamespace) /* 514 */
1417
+ # undef Tcl_FindCommand
1418
+ # define Tcl_FindCommand \
1419
+ (tclStubsPtr->tcl_FindCommand) /* 515 */
1420
+ # undef Tcl_GetCommandFromObj
1421
+ # define Tcl_GetCommandFromObj \
1422
+ (tclStubsPtr->tcl_GetCommandFromObj) /* 516 */
1423
+ # undef Tcl_GetCommandFullName
1424
+ # define Tcl_GetCommandFullName \
1425
+ (tclStubsPtr->tcl_GetCommandFullName) /* 517 */
1426
+ #endif
1427
+
1428
+ #undef TclCopyChannelOld
1429
+ #undef TclSockMinimumBuffersOld
1430
+
1431
+ #define TclSetChildCancelFlags TclSetSlaveCancelFlags
1432
+
1433
+ #endif /* _TCLINTDECLS */
physworld_p1_20261018/envs/p1/include/tclIntPlatDecls.h ADDED
@@ -0,0 +1,600 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclIntPlatDecls.h --
3
+ *
4
+ * This file contains the declarations for all platform dependent
5
+ * unsupported functions that are exported by the Tcl library. These
6
+ * interfaces are not guaranteed to remain the same between
7
+ * versions. Use at your own risk.
8
+ *
9
+ * Copyright (c) 1998-1999 by Scriptics Corporation.
10
+ * All rights reserved.
11
+ */
12
+
13
+ #ifndef _TCLINTPLATDECLS
14
+ #define _TCLINTPLATDECLS
15
+
16
+ #undef TCL_STORAGE_CLASS
17
+ #ifdef BUILD_tcl
18
+ # define TCL_STORAGE_CLASS DLLEXPORT
19
+ #else
20
+ # ifdef USE_TCL_STUBS
21
+ # define TCL_STORAGE_CLASS
22
+ # else
23
+ # define TCL_STORAGE_CLASS DLLIMPORT
24
+ # endif
25
+ #endif
26
+
27
+ /*
28
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
29
+ * script. Any modifications to the function declarations below should be made
30
+ * in the generic/tclInt.decls script.
31
+ */
32
+
33
+ /* !BEGIN!: Do not edit below this line. */
34
+
35
+ #ifdef __cplusplus
36
+ extern "C" {
37
+ #endif
38
+
39
+ /*
40
+ * Exported function declarations:
41
+ */
42
+
43
+ #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
44
+ /* 0 */
45
+ EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
46
+ Tcl_Channel chan);
47
+ /* 1 */
48
+ EXTERN int TclpCloseFile(TclFile file);
49
+ /* 2 */
50
+ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
51
+ TclFile writeFile, TclFile errorFile,
52
+ int numPids, Tcl_Pid *pidPtr);
53
+ /* 3 */
54
+ EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
55
+ /* 4 */
56
+ EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
57
+ const char **argv, TclFile inputFile,
58
+ TclFile outputFile, TclFile errorFile,
59
+ Tcl_Pid *pidPtr);
60
+ /* 5 */
61
+ EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
62
+ /* 6 */
63
+ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
64
+ /* 7 */
65
+ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
66
+ /* 8 */
67
+ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
68
+ /* 9 */
69
+ EXTERN TclFile TclpCreateTempFile(const char *contents);
70
+ /* 10 */
71
+ EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
72
+ /* 11 */
73
+ EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
74
+ /* 12 */
75
+ EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
76
+ /* 13 */
77
+ EXTERN char * TclpInetNtoa(struct in_addr addr);
78
+ /* 14 */
79
+ EXTERN int TclUnixCopyFile(const char *src, const char *dst,
80
+ const Tcl_StatBuf *statBufPtr,
81
+ int dontCopyAtts);
82
+ /* 15 */
83
+ EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
84
+ int objIndex, Tcl_Obj *fileName,
85
+ Tcl_Obj **attributePtrPtr);
86
+ /* 16 */
87
+ EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
88
+ int objIndex, Tcl_Obj *fileName,
89
+ Tcl_Obj *attributePtr);
90
+ /* 17 */
91
+ EXTERN int TclMacOSXCopyFileAttributes(const char *src,
92
+ const char *dst,
93
+ const Tcl_StatBuf *statBufPtr);
94
+ /* 18 */
95
+ EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
96
+ const char *pathName, const char *fileName,
97
+ Tcl_StatBuf *statBufPtr,
98
+ Tcl_GlobTypeData *types);
99
+ /* 19 */
100
+ EXTERN void TclMacOSXNotifierAddRunLoopMode(
101
+ const void *runLoopMode);
102
+ /* Slot 20 is reserved */
103
+ /* Slot 21 is reserved */
104
+ /* 22 */
105
+ EXTERN TclFile TclpCreateTempFile_(const char *contents);
106
+ /* Slot 23 is reserved */
107
+ /* Slot 24 is reserved */
108
+ /* Slot 25 is reserved */
109
+ /* Slot 26 is reserved */
110
+ /* Slot 27 is reserved */
111
+ /* Slot 28 is reserved */
112
+ /* 29 */
113
+ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
114
+ /* 30 */
115
+ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
116
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
117
+ Tcl_Obj *resultingNameObj);
118
+ #endif /* UNIX */
119
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
120
+ /* 0 */
121
+ EXTERN void TclWinConvertError(DWORD errCode);
122
+ /* 1 */
123
+ EXTERN void TclWinConvertWSAError(DWORD errCode);
124
+ /* 2 */
125
+ EXTERN struct servent * TclWinGetServByName(const char *nm,
126
+ const char *proto);
127
+ /* 3 */
128
+ EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
129
+ char *optval, int *optlen);
130
+ /* 4 */
131
+ EXTERN HINSTANCE TclWinGetTclInstance(void);
132
+ /* 5 */
133
+ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
134
+ /* 6 */
135
+ EXTERN unsigned short TclWinNToHS(unsigned short ns);
136
+ /* 7 */
137
+ EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
138
+ const char *optval, int optlen);
139
+ /* 8 */
140
+ EXTERN int TclpGetPid(Tcl_Pid pid);
141
+ /* 9 */
142
+ EXTERN int TclWinGetPlatformId(void);
143
+ /* 10 */
144
+ EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
145
+ /* 11 */
146
+ EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
147
+ Tcl_Channel chan);
148
+ /* 12 */
149
+ EXTERN int TclpCloseFile(TclFile file);
150
+ /* 13 */
151
+ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
152
+ TclFile writeFile, TclFile errorFile,
153
+ int numPids, Tcl_Pid *pidPtr);
154
+ /* 14 */
155
+ EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
156
+ /* 15 */
157
+ EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
158
+ const char **argv, TclFile inputFile,
159
+ TclFile outputFile, TclFile errorFile,
160
+ Tcl_Pid *pidPtr);
161
+ /* 16 */
162
+ EXTERN int TclpIsAtty(int fd);
163
+ /* 17 */
164
+ EXTERN int TclUnixCopyFile(const char *src, const char *dst,
165
+ const Tcl_StatBuf *statBufPtr,
166
+ int dontCopyAtts);
167
+ /* 18 */
168
+ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
169
+ /* 19 */
170
+ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
171
+ /* 20 */
172
+ EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
173
+ /* 21 */
174
+ EXTERN char * TclpInetNtoa(struct in_addr addr);
175
+ /* 22 */
176
+ EXTERN TclFile TclpCreateTempFile(const char *contents);
177
+ /* Slot 23 is reserved */
178
+ /* 24 */
179
+ EXTERN char * TclWinNoBackslash(char *path);
180
+ /* Slot 25 is reserved */
181
+ /* 26 */
182
+ EXTERN void TclWinSetInterfaces(int wide);
183
+ /* 27 */
184
+ EXTERN void TclWinFlushDirtyChannels(void);
185
+ /* 28 */
186
+ EXTERN void TclWinResetInterfaces(void);
187
+ /* 29 */
188
+ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
189
+ /* 30 */
190
+ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
191
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
192
+ Tcl_Obj *resultingNameObj);
193
+ #endif /* WIN */
194
+ #ifdef MAC_OSX_TCL /* MACOSX */
195
+ /* 0 */
196
+ EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
197
+ Tcl_Channel chan);
198
+ /* 1 */
199
+ EXTERN int TclpCloseFile(TclFile file);
200
+ /* 2 */
201
+ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
202
+ TclFile writeFile, TclFile errorFile,
203
+ int numPids, Tcl_Pid *pidPtr);
204
+ /* 3 */
205
+ EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
206
+ /* 4 */
207
+ EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
208
+ const char **argv, TclFile inputFile,
209
+ TclFile outputFile, TclFile errorFile,
210
+ Tcl_Pid *pidPtr);
211
+ /* 5 */
212
+ EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
213
+ /* 6 */
214
+ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
215
+ /* 7 */
216
+ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
217
+ /* 8 */
218
+ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
219
+ /* 9 */
220
+ EXTERN TclFile TclpCreateTempFile(const char *contents);
221
+ /* 10 */
222
+ EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
223
+ /* 11 */
224
+ EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
225
+ /* 12 */
226
+ EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
227
+ /* 13 */
228
+ EXTERN char * TclpInetNtoa(struct in_addr addr);
229
+ /* 14 */
230
+ EXTERN int TclUnixCopyFile(const char *src, const char *dst,
231
+ const Tcl_StatBuf *statBufPtr,
232
+ int dontCopyAtts);
233
+ /* 15 */
234
+ EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
235
+ int objIndex, Tcl_Obj *fileName,
236
+ Tcl_Obj **attributePtrPtr);
237
+ /* 16 */
238
+ EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
239
+ int objIndex, Tcl_Obj *fileName,
240
+ Tcl_Obj *attributePtr);
241
+ /* 17 */
242
+ EXTERN int TclMacOSXCopyFileAttributes(const char *src,
243
+ const char *dst,
244
+ const Tcl_StatBuf *statBufPtr);
245
+ /* 18 */
246
+ EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
247
+ const char *pathName, const char *fileName,
248
+ Tcl_StatBuf *statBufPtr,
249
+ Tcl_GlobTypeData *types);
250
+ /* 19 */
251
+ EXTERN void TclMacOSXNotifierAddRunLoopMode(
252
+ const void *runLoopMode);
253
+ /* Slot 20 is reserved */
254
+ /* Slot 21 is reserved */
255
+ /* 22 */
256
+ EXTERN TclFile TclpCreateTempFile_(const char *contents);
257
+ /* Slot 23 is reserved */
258
+ /* Slot 24 is reserved */
259
+ /* Slot 25 is reserved */
260
+ /* Slot 26 is reserved */
261
+ /* Slot 27 is reserved */
262
+ /* Slot 28 is reserved */
263
+ /* 29 */
264
+ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
265
+ /* 30 */
266
+ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
267
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
268
+ Tcl_Obj *resultingNameObj);
269
+ #endif /* MACOSX */
270
+
271
+ typedef struct TclIntPlatStubs {
272
+ int magic;
273
+ void *hooks;
274
+
275
+ #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
276
+ void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
277
+ int (*tclpCloseFile) (TclFile file); /* 1 */
278
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
279
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
280
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
281
+ int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
282
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
283
+ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
284
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
285
+ TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
286
+ Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
287
+ struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
288
+ struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
289
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
290
+ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
291
+ int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
292
+ int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
293
+ int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
294
+ int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
295
+ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
296
+ void (*reserved20)(void);
297
+ void (*reserved21)(void);
298
+ TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
299
+ void (*reserved23)(void);
300
+ void (*reserved24)(void);
301
+ void (*reserved25)(void);
302
+ void (*reserved26)(void);
303
+ void (*reserved27)(void);
304
+ void (*reserved28)(void);
305
+ int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
306
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
307
+ #endif /* UNIX */
308
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
309
+ void (*tclWinConvertError) (DWORD errCode); /* 0 */
310
+ void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
311
+ struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
312
+ int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
313
+ HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
314
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
315
+ unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
316
+ int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char *optval, int optlen); /* 7 */
317
+ int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
318
+ int (*tclWinGetPlatformId) (void); /* 9 */
319
+ Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
320
+ void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
321
+ int (*tclpCloseFile) (TclFile file); /* 12 */
322
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
323
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
324
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
325
+ int (*tclpIsAtty) (int fd); /* 16 */
326
+ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
327
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
328
+ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
329
+ void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */
330
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 21 */
331
+ TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
332
+ void (*reserved23)(void);
333
+ char * (*tclWinNoBackslash) (char *path); /* 24 */
334
+ void (*reserved25)(void);
335
+ void (*tclWinSetInterfaces) (int wide); /* 26 */
336
+ void (*tclWinFlushDirtyChannels) (void); /* 27 */
337
+ void (*tclWinResetInterfaces) (void); /* 28 */
338
+ int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
339
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
340
+ #endif /* WIN */
341
+ #ifdef MAC_OSX_TCL /* MACOSX */
342
+ void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
343
+ int (*tclpCloseFile) (TclFile file); /* 1 */
344
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
345
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
346
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
347
+ int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
348
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
349
+ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
350
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
351
+ TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
352
+ Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
353
+ struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
354
+ struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
355
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
356
+ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
357
+ int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
358
+ int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
359
+ int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
360
+ int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
361
+ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
362
+ void (*reserved20)(void);
363
+ void (*reserved21)(void);
364
+ TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
365
+ void (*reserved23)(void);
366
+ void (*reserved24)(void);
367
+ void (*reserved25)(void);
368
+ void (*reserved26)(void);
369
+ void (*reserved27)(void);
370
+ void (*reserved28)(void);
371
+ int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
372
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
373
+ #endif /* MACOSX */
374
+ } TclIntPlatStubs;
375
+
376
+ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
377
+
378
+ #ifdef __cplusplus
379
+ }
380
+ #endif
381
+
382
+ #if defined(USE_TCL_STUBS)
383
+
384
+ /*
385
+ * Inline function declarations:
386
+ */
387
+
388
+ #if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
389
+ #define TclGetAndDetachPids \
390
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
391
+ #define TclpCloseFile \
392
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
393
+ #define TclpCreateCommandChannel \
394
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
395
+ #define TclpCreatePipe \
396
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
397
+ #define TclpCreateProcess \
398
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
399
+ #define TclUnixWaitForFile_ \
400
+ (tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
401
+ #define TclpMakeFile \
402
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
403
+ #define TclpOpenFile \
404
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
405
+ #define TclUnixWaitForFile \
406
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
407
+ #define TclpCreateTempFile \
408
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
409
+ #define TclpReaddir \
410
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
411
+ #define TclpLocaltime_unix \
412
+ (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
413
+ #define TclpGmtime_unix \
414
+ (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
415
+ #define TclpInetNtoa \
416
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
417
+ #define TclUnixCopyFile \
418
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
419
+ #define TclMacOSXGetFileAttribute \
420
+ (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
421
+ #define TclMacOSXSetFileAttribute \
422
+ (tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
423
+ #define TclMacOSXCopyFileAttributes \
424
+ (tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
425
+ #define TclMacOSXMatchType \
426
+ (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
427
+ #define TclMacOSXNotifierAddRunLoopMode \
428
+ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
429
+ /* Slot 20 is reserved */
430
+ /* Slot 21 is reserved */
431
+ #define TclpCreateTempFile_ \
432
+ (tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
433
+ /* Slot 23 is reserved */
434
+ /* Slot 24 is reserved */
435
+ /* Slot 25 is reserved */
436
+ /* Slot 26 is reserved */
437
+ /* Slot 27 is reserved */
438
+ /* Slot 28 is reserved */
439
+ #define TclWinCPUID \
440
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
441
+ #define TclUnixOpenTemporaryFile \
442
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
443
+ #endif /* UNIX */
444
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
445
+ #define TclWinConvertError \
446
+ (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
447
+ #define TclWinConvertWSAError \
448
+ (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
449
+ #define TclWinGetServByName \
450
+ (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
451
+ #define TclWinGetSockOpt \
452
+ (tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
453
+ #define TclWinGetTclInstance \
454
+ (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
455
+ #define TclUnixWaitForFile \
456
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
457
+ #define TclWinNToHS \
458
+ (tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
459
+ #define TclWinSetSockOpt \
460
+ (tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
461
+ #define TclpGetPid \
462
+ (tclIntPlatStubsPtr->tclpGetPid) /* 8 */
463
+ #define TclWinGetPlatformId \
464
+ (tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
465
+ #define TclpReaddir \
466
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
467
+ #define TclGetAndDetachPids \
468
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
469
+ #define TclpCloseFile \
470
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
471
+ #define TclpCreateCommandChannel \
472
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
473
+ #define TclpCreatePipe \
474
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
475
+ #define TclpCreateProcess \
476
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
477
+ #define TclpIsAtty \
478
+ (tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
479
+ #define TclUnixCopyFile \
480
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
481
+ #define TclpMakeFile \
482
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
483
+ #define TclpOpenFile \
484
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
485
+ #define TclWinAddProcess \
486
+ (tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
487
+ #define TclpInetNtoa \
488
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
489
+ #define TclpCreateTempFile \
490
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
491
+ /* Slot 23 is reserved */
492
+ #define TclWinNoBackslash \
493
+ (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
494
+ /* Slot 25 is reserved */
495
+ #define TclWinSetInterfaces \
496
+ (tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
497
+ #define TclWinFlushDirtyChannels \
498
+ (tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
499
+ #define TclWinResetInterfaces \
500
+ (tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
501
+ #define TclWinCPUID \
502
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
503
+ #define TclUnixOpenTemporaryFile \
504
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
505
+ #endif /* WIN */
506
+ #ifdef MAC_OSX_TCL /* MACOSX */
507
+ #define TclGetAndDetachPids \
508
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
509
+ #define TclpCloseFile \
510
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
511
+ #define TclpCreateCommandChannel \
512
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
513
+ #define TclpCreatePipe \
514
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
515
+ #define TclpCreateProcess \
516
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
517
+ #define TclUnixWaitForFile_ \
518
+ (tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
519
+ #define TclpMakeFile \
520
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
521
+ #define TclpOpenFile \
522
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
523
+ #define TclUnixWaitForFile \
524
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
525
+ #define TclpCreateTempFile \
526
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
527
+ #define TclpReaddir \
528
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
529
+ #define TclpLocaltime_unix \
530
+ (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
531
+ #define TclpGmtime_unix \
532
+ (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
533
+ #define TclpInetNtoa \
534
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
535
+ #define TclUnixCopyFile \
536
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
537
+ #define TclMacOSXGetFileAttribute \
538
+ (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
539
+ #define TclMacOSXSetFileAttribute \
540
+ (tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
541
+ #define TclMacOSXCopyFileAttributes \
542
+ (tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
543
+ #define TclMacOSXMatchType \
544
+ (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
545
+ #define TclMacOSXNotifierAddRunLoopMode \
546
+ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
547
+ /* Slot 20 is reserved */
548
+ /* Slot 21 is reserved */
549
+ #define TclpCreateTempFile_ \
550
+ (tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
551
+ /* Slot 23 is reserved */
552
+ /* Slot 24 is reserved */
553
+ /* Slot 25 is reserved */
554
+ /* Slot 26 is reserved */
555
+ /* Slot 27 is reserved */
556
+ /* Slot 28 is reserved */
557
+ #define TclWinCPUID \
558
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
559
+ #define TclUnixOpenTemporaryFile \
560
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
561
+ #endif /* MACOSX */
562
+
563
+ #endif /* defined(USE_TCL_STUBS) */
564
+
565
+ /* !END!: Do not edit above this line. */
566
+
567
+ #undef TCL_STORAGE_CLASS
568
+ #define TCL_STORAGE_CLASS DLLIMPORT
569
+ #undef TclpLocaltime_unix
570
+ #undef TclpGmtime_unix
571
+ #undef TclWinConvertWSAError
572
+ #define TclWinConvertWSAError TclWinConvertError
573
+ #undef TclpInetNtoa
574
+ #define TclpInetNtoa inet_ntoa
575
+
576
+ #undef TclpCreateTempFile_
577
+ #undef TclUnixWaitForFile_
578
+ #ifndef MAC_OSX_TCL /* not accessable on Win32/UNIX */
579
+ #undef TclMacOSXGetFileAttribute /* 15 */
580
+ #undef TclMacOSXSetFileAttribute /* 16 */
581
+ #undef TclMacOSXCopyFileAttributes /* 17 */
582
+ #undef TclMacOSXMatchType /* 18 */
583
+ #undef TclMacOSXNotifierAddRunLoopMode /* 19 */
584
+ #endif
585
+
586
+ #if defined(_WIN32)
587
+ # undef TclWinNToHS
588
+ # undef TclWinGetServByName
589
+ # undef TclWinGetSockOpt
590
+ # undef TclWinSetSockOpt
591
+ # define TclWinNToHS ntohs
592
+ # define TclWinGetServByName getservbyname
593
+ # define TclWinGetSockOpt getsockopt
594
+ # define TclWinSetSockOpt setsockopt
595
+ #else
596
+ # undef TclpGetPid
597
+ # define TclpGetPid(pid) ((unsigned long) (pid))
598
+ #endif
599
+
600
+ #endif /* _TCLINTPLATDECLS */
physworld_p1_20261018/envs/p1/include/tclOO.h ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclOO.h --
3
+ *
4
+ * This file contains the public API definitions and some of the function
5
+ * declarations for the object-system (NB: not Tcl_Obj, but ::oo).
6
+ *
7
+ * Copyright (c) 2006-2010 by Donal K. Fellows
8
+ *
9
+ * See the file "license.terms" for information on usage and redistribution of
10
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
+ */
12
+
13
+ #ifndef TCLOO_H_INCLUDED
14
+ #define TCLOO_H_INCLUDED
15
+
16
+ /*
17
+ * Be careful when it comes to versioning; need to make sure that the
18
+ * standalone TclOO version matches. Also make sure that this matches the
19
+ * version in the files:
20
+ *
21
+ * tests/oo.test
22
+ * tests/ooNext2.test
23
+ * unix/tclooConfig.sh
24
+ * win/tclooConfig.sh
25
+ */
26
+
27
+ #define TCLOO_VERSION "1.1.0"
28
+ #define TCLOO_PATCHLEVEL TCLOO_VERSION
29
+
30
+ #include "tcl.h"
31
+
32
+ /*
33
+ * For C++ compilers, use extern "C"
34
+ */
35
+
36
+ #ifdef __cplusplus
37
+ extern "C" {
38
+ #endif
39
+
40
+ extern const char *TclOOInitializeStubs(
41
+ Tcl_Interp *, const char *version);
42
+ #define Tcl_OOInitStubs(interp) \
43
+ TclOOInitializeStubs((interp), TCLOO_VERSION)
44
+ #ifndef USE_TCL_STUBS
45
+ # define TclOOInitializeStubs(interp, version) (TCLOO_PATCHLEVEL)
46
+ #endif
47
+
48
+ /*
49
+ * These are opaque types.
50
+ */
51
+
52
+ typedef struct Tcl_Class_ *Tcl_Class;
53
+ typedef struct Tcl_Method_ *Tcl_Method;
54
+ typedef struct Tcl_Object_ *Tcl_Object;
55
+ typedef struct Tcl_ObjectContext_ *Tcl_ObjectContext;
56
+
57
+ /*
58
+ * Public datatypes for callbacks and structures used in the TIP#257 (OO)
59
+ * implementation. These are used to implement custom types of method calls
60
+ * and to allow the attachment of arbitrary data to objects and classes.
61
+ */
62
+
63
+ typedef int (Tcl_MethodCallProc)(void *clientData, Tcl_Interp *interp,
64
+ Tcl_ObjectContext objectContext, int objc, Tcl_Obj *const *objv);
65
+ typedef void (Tcl_MethodDeleteProc)(void *clientData);
66
+ typedef int (Tcl_CloneProc)(Tcl_Interp *interp, void *oldClientData,
67
+ void **newClientData);
68
+ typedef void (Tcl_ObjectMetadataDeleteProc)(void *clientData);
69
+ typedef int (Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp,
70
+ Tcl_Object object, Tcl_Class *startClsPtr, Tcl_Obj *methodNameObj);
71
+
72
+ /*
73
+ * The type of a method implementation. This describes how to call the method
74
+ * implementation, how to delete it (when the object or class is deleted) and
75
+ * how to create a clone of it (when the object or class is copied).
76
+ */
77
+
78
+ typedef struct {
79
+ int version; /* Structure version field. Always to be equal
80
+ * to TCL_OO_METHOD_VERSION_CURRENT in
81
+ * declarations. */
82
+ const char *name; /* Name of this type of method, mostly for
83
+ * debugging purposes. */
84
+ Tcl_MethodCallProc *callProc;
85
+ /* How to invoke this method. */
86
+ Tcl_MethodDeleteProc *deleteProc;
87
+ /* How to delete this method's type-specific
88
+ * data, or NULL if the type-specific data
89
+ * does not need deleting. */
90
+ Tcl_CloneProc *cloneProc; /* How to copy this method's type-specific
91
+ * data, or NULL if the type-specific data can
92
+ * be copied directly. */
93
+ } Tcl_MethodType;
94
+
95
+ /*
96
+ * The correct value for the version field of the Tcl_MethodType structure.
97
+ * This allows new versions of the structure to be introduced without breaking
98
+ * binary compatibility.
99
+ */
100
+
101
+ #define TCL_OO_METHOD_VERSION_CURRENT 1
102
+
103
+ /*
104
+ * The type of some object (or class) metadata. This describes how to delete
105
+ * the metadata (when the object or class is deleted) and how to create a
106
+ * clone of it (when the object or class is copied).
107
+ */
108
+
109
+ typedef struct {
110
+ int version; /* Structure version field. Always to be equal
111
+ * to TCL_OO_METADATA_VERSION_CURRENT in
112
+ * declarations. */
113
+ const char *name;
114
+ Tcl_ObjectMetadataDeleteProc *deleteProc;
115
+ /* How to delete the metadata. This must not
116
+ * be NULL. */
117
+ Tcl_CloneProc *cloneProc; /* How to copy the metadata, or NULL if the
118
+ * type-specific data can be copied
119
+ * directly. */
120
+ } Tcl_ObjectMetadataType;
121
+
122
+ /*
123
+ * The correct value for the version field of the Tcl_ObjectMetadataType
124
+ * structure. This allows new versions of the structure to be introduced
125
+ * without breaking binary compatibility.
126
+ */
127
+
128
+ #define TCL_OO_METADATA_VERSION_CURRENT 1
129
+
130
+ /*
131
+ * Include all the public API, generated from tclOO.decls.
132
+ */
133
+
134
+ #include "tclOODecls.h"
135
+
136
+ #ifdef __cplusplus
137
+ }
138
+ #endif
139
+ #endif
140
+
141
+ /*
142
+ * Local Variables:
143
+ * mode: c
144
+ * c-basic-offset: 4
145
+ * fill-column: 78
146
+ * End:
147
+ */
physworld_p1_20261018/envs/p1/include/tclOODecls.h ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file is (mostly) automatically generated from tclOO.decls.
3
+ */
4
+
5
+ #ifndef _TCLOODECLS
6
+ #define _TCLOODECLS
7
+
8
+ #ifndef TCLAPI
9
+ # ifdef BUILD_tcl
10
+ # define TCLAPI extern DLLEXPORT
11
+ # else
12
+ # define TCLAPI extern DLLIMPORT
13
+ # endif
14
+ #endif
15
+
16
+ #ifdef USE_TCL_STUBS
17
+ # undef USE_TCLOO_STUBS
18
+ # define USE_TCLOO_STUBS
19
+ #endif
20
+
21
+ /* !BEGIN!: Do not edit below this line. */
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ /*
28
+ * Exported function declarations:
29
+ */
30
+
31
+ /* 0 */
32
+ TCLAPI Tcl_Object Tcl_CopyObjectInstance(Tcl_Interp *interp,
33
+ Tcl_Object sourceObject,
34
+ const char *targetName,
35
+ const char *targetNamespaceName);
36
+ /* 1 */
37
+ TCLAPI Tcl_Object Tcl_GetClassAsObject(Tcl_Class clazz);
38
+ /* 2 */
39
+ TCLAPI Tcl_Class Tcl_GetObjectAsClass(Tcl_Object object);
40
+ /* 3 */
41
+ TCLAPI Tcl_Command Tcl_GetObjectCommand(Tcl_Object object);
42
+ /* 4 */
43
+ TCLAPI Tcl_Object Tcl_GetObjectFromObj(Tcl_Interp *interp,
44
+ Tcl_Obj *objPtr);
45
+ /* 5 */
46
+ TCLAPI Tcl_Namespace * Tcl_GetObjectNamespace(Tcl_Object object);
47
+ /* 6 */
48
+ TCLAPI Tcl_Class Tcl_MethodDeclarerClass(Tcl_Method method);
49
+ /* 7 */
50
+ TCLAPI Tcl_Object Tcl_MethodDeclarerObject(Tcl_Method method);
51
+ /* 8 */
52
+ TCLAPI int Tcl_MethodIsPublic(Tcl_Method method);
53
+ /* 9 */
54
+ TCLAPI int Tcl_MethodIsType(Tcl_Method method,
55
+ const Tcl_MethodType *typePtr,
56
+ void **clientDataPtr);
57
+ /* 10 */
58
+ TCLAPI Tcl_Obj * Tcl_MethodName(Tcl_Method method);
59
+ /* 11 */
60
+ TCLAPI Tcl_Method Tcl_NewInstanceMethod(Tcl_Interp *interp,
61
+ Tcl_Object object, Tcl_Obj *nameObj,
62
+ int isPublic, const Tcl_MethodType *typePtr,
63
+ void *clientData);
64
+ /* 12 */
65
+ TCLAPI Tcl_Method Tcl_NewMethod(Tcl_Interp *interp, Tcl_Class cls,
66
+ Tcl_Obj *nameObj, int isPublic,
67
+ const Tcl_MethodType *typePtr,
68
+ void *clientData);
69
+ /* 13 */
70
+ TCLAPI Tcl_Object Tcl_NewObjectInstance(Tcl_Interp *interp,
71
+ Tcl_Class cls, const char *nameStr,
72
+ const char *nsNameStr, int objc,
73
+ Tcl_Obj *const *objv, int skip);
74
+ /* 14 */
75
+ TCLAPI int Tcl_ObjectDeleted(Tcl_Object object);
76
+ /* 15 */
77
+ TCLAPI int Tcl_ObjectContextIsFiltering(
78
+ Tcl_ObjectContext context);
79
+ /* 16 */
80
+ TCLAPI Tcl_Method Tcl_ObjectContextMethod(Tcl_ObjectContext context);
81
+ /* 17 */
82
+ TCLAPI Tcl_Object Tcl_ObjectContextObject(Tcl_ObjectContext context);
83
+ /* 18 */
84
+ TCLAPI int Tcl_ObjectContextSkippedArgs(
85
+ Tcl_ObjectContext context);
86
+ /* 19 */
87
+ TCLAPI void * Tcl_ClassGetMetadata(Tcl_Class clazz,
88
+ const Tcl_ObjectMetadataType *typePtr);
89
+ /* 20 */
90
+ TCLAPI void Tcl_ClassSetMetadata(Tcl_Class clazz,
91
+ const Tcl_ObjectMetadataType *typePtr,
92
+ void *metadata);
93
+ /* 21 */
94
+ TCLAPI void * Tcl_ObjectGetMetadata(Tcl_Object object,
95
+ const Tcl_ObjectMetadataType *typePtr);
96
+ /* 22 */
97
+ TCLAPI void Tcl_ObjectSetMetadata(Tcl_Object object,
98
+ const Tcl_ObjectMetadataType *typePtr,
99
+ void *metadata);
100
+ /* 23 */
101
+ TCLAPI int Tcl_ObjectContextInvokeNext(Tcl_Interp *interp,
102
+ Tcl_ObjectContext context, int objc,
103
+ Tcl_Obj *const *objv, int skip);
104
+ /* 24 */
105
+ TCLAPI Tcl_ObjectMapMethodNameProc * Tcl_ObjectGetMethodNameMapper(
106
+ Tcl_Object object);
107
+ /* 25 */
108
+ TCLAPI void Tcl_ObjectSetMethodNameMapper(Tcl_Object object,
109
+ Tcl_ObjectMapMethodNameProc *mapMethodNameProc);
110
+ /* 26 */
111
+ TCLAPI void Tcl_ClassSetConstructor(Tcl_Interp *interp,
112
+ Tcl_Class clazz, Tcl_Method method);
113
+ /* 27 */
114
+ TCLAPI void Tcl_ClassSetDestructor(Tcl_Interp *interp,
115
+ Tcl_Class clazz, Tcl_Method method);
116
+ /* 28 */
117
+ TCLAPI Tcl_Obj * Tcl_GetObjectName(Tcl_Interp *interp,
118
+ Tcl_Object object);
119
+ /* Slot 29 is reserved */
120
+ /* Slot 30 is reserved */
121
+ /* Slot 31 is reserved */
122
+ /* Slot 32 is reserved */
123
+ /* Slot 33 is reserved */
124
+ /* 34 */
125
+ TCLAPI void TclOOUnusedStubEntry(void);
126
+
127
+ typedef struct {
128
+ const struct TclOOIntStubs *tclOOIntStubs;
129
+ } TclOOStubHooks;
130
+
131
+ typedef struct TclOOStubs {
132
+ int magic;
133
+ const TclOOStubHooks *hooks;
134
+
135
+ Tcl_Object (*tcl_CopyObjectInstance) (Tcl_Interp *interp, Tcl_Object sourceObject, const char *targetName, const char *targetNamespaceName); /* 0 */
136
+ Tcl_Object (*tcl_GetClassAsObject) (Tcl_Class clazz); /* 1 */
137
+ Tcl_Class (*tcl_GetObjectAsClass) (Tcl_Object object); /* 2 */
138
+ Tcl_Command (*tcl_GetObjectCommand) (Tcl_Object object); /* 3 */
139
+ Tcl_Object (*tcl_GetObjectFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 4 */
140
+ Tcl_Namespace * (*tcl_GetObjectNamespace) (Tcl_Object object); /* 5 */
141
+ Tcl_Class (*tcl_MethodDeclarerClass) (Tcl_Method method); /* 6 */
142
+ Tcl_Object (*tcl_MethodDeclarerObject) (Tcl_Method method); /* 7 */
143
+ int (*tcl_MethodIsPublic) (Tcl_Method method); /* 8 */
144
+ int (*tcl_MethodIsType) (Tcl_Method method, const Tcl_MethodType *typePtr, void **clientDataPtr); /* 9 */
145
+ Tcl_Obj * (*tcl_MethodName) (Tcl_Method method); /* 10 */
146
+ Tcl_Method (*tcl_NewInstanceMethod) (Tcl_Interp *interp, Tcl_Object object, Tcl_Obj *nameObj, int isPublic, const Tcl_MethodType *typePtr, void *clientData); /* 11 */
147
+ Tcl_Method (*tcl_NewMethod) (Tcl_Interp *interp, Tcl_Class cls, Tcl_Obj *nameObj, int isPublic, const Tcl_MethodType *typePtr, void *clientData); /* 12 */
148
+ Tcl_Object (*tcl_NewObjectInstance) (Tcl_Interp *interp, Tcl_Class cls, const char *nameStr, const char *nsNameStr, int objc, Tcl_Obj *const *objv, int skip); /* 13 */
149
+ int (*tcl_ObjectDeleted) (Tcl_Object object); /* 14 */
150
+ int (*tcl_ObjectContextIsFiltering) (Tcl_ObjectContext context); /* 15 */
151
+ Tcl_Method (*tcl_ObjectContextMethod) (Tcl_ObjectContext context); /* 16 */
152
+ Tcl_Object (*tcl_ObjectContextObject) (Tcl_ObjectContext context); /* 17 */
153
+ int (*tcl_ObjectContextSkippedArgs) (Tcl_ObjectContext context); /* 18 */
154
+ void * (*tcl_ClassGetMetadata) (Tcl_Class clazz, const Tcl_ObjectMetadataType *typePtr); /* 19 */
155
+ void (*tcl_ClassSetMetadata) (Tcl_Class clazz, const Tcl_ObjectMetadataType *typePtr, void *metadata); /* 20 */
156
+ void * (*tcl_ObjectGetMetadata) (Tcl_Object object, const Tcl_ObjectMetadataType *typePtr); /* 21 */
157
+ void (*tcl_ObjectSetMetadata) (Tcl_Object object, const Tcl_ObjectMetadataType *typePtr, void *metadata); /* 22 */
158
+ int (*tcl_ObjectContextInvokeNext) (Tcl_Interp *interp, Tcl_ObjectContext context, int objc, Tcl_Obj *const *objv, int skip); /* 23 */
159
+ Tcl_ObjectMapMethodNameProc * (*tcl_ObjectGetMethodNameMapper) (Tcl_Object object); /* 24 */
160
+ void (*tcl_ObjectSetMethodNameMapper) (Tcl_Object object, Tcl_ObjectMapMethodNameProc *mapMethodNameProc); /* 25 */
161
+ void (*tcl_ClassSetConstructor) (Tcl_Interp *interp, Tcl_Class clazz, Tcl_Method method); /* 26 */
162
+ void (*tcl_ClassSetDestructor) (Tcl_Interp *interp, Tcl_Class clazz, Tcl_Method method); /* 27 */
163
+ Tcl_Obj * (*tcl_GetObjectName) (Tcl_Interp *interp, Tcl_Object object); /* 28 */
164
+ void (*reserved29)(void);
165
+ void (*reserved30)(void);
166
+ void (*reserved31)(void);
167
+ void (*reserved32)(void);
168
+ void (*reserved33)(void);
169
+ void (*tclOOUnusedStubEntry) (void); /* 34 */
170
+ } TclOOStubs;
171
+
172
+ extern const TclOOStubs *tclOOStubsPtr;
173
+
174
+ #ifdef __cplusplus
175
+ }
176
+ #endif
177
+
178
+ #if defined(USE_TCLOO_STUBS)
179
+
180
+ /*
181
+ * Inline function declarations:
182
+ */
183
+
184
+ #define Tcl_CopyObjectInstance \
185
+ (tclOOStubsPtr->tcl_CopyObjectInstance) /* 0 */
186
+ #define Tcl_GetClassAsObject \
187
+ (tclOOStubsPtr->tcl_GetClassAsObject) /* 1 */
188
+ #define Tcl_GetObjectAsClass \
189
+ (tclOOStubsPtr->tcl_GetObjectAsClass) /* 2 */
190
+ #define Tcl_GetObjectCommand \
191
+ (tclOOStubsPtr->tcl_GetObjectCommand) /* 3 */
192
+ #define Tcl_GetObjectFromObj \
193
+ (tclOOStubsPtr->tcl_GetObjectFromObj) /* 4 */
194
+ #define Tcl_GetObjectNamespace \
195
+ (tclOOStubsPtr->tcl_GetObjectNamespace) /* 5 */
196
+ #define Tcl_MethodDeclarerClass \
197
+ (tclOOStubsPtr->tcl_MethodDeclarerClass) /* 6 */
198
+ #define Tcl_MethodDeclarerObject \
199
+ (tclOOStubsPtr->tcl_MethodDeclarerObject) /* 7 */
200
+ #define Tcl_MethodIsPublic \
201
+ (tclOOStubsPtr->tcl_MethodIsPublic) /* 8 */
202
+ #define Tcl_MethodIsType \
203
+ (tclOOStubsPtr->tcl_MethodIsType) /* 9 */
204
+ #define Tcl_MethodName \
205
+ (tclOOStubsPtr->tcl_MethodName) /* 10 */
206
+ #define Tcl_NewInstanceMethod \
207
+ (tclOOStubsPtr->tcl_NewInstanceMethod) /* 11 */
208
+ #define Tcl_NewMethod \
209
+ (tclOOStubsPtr->tcl_NewMethod) /* 12 */
210
+ #define Tcl_NewObjectInstance \
211
+ (tclOOStubsPtr->tcl_NewObjectInstance) /* 13 */
212
+ #define Tcl_ObjectDeleted \
213
+ (tclOOStubsPtr->tcl_ObjectDeleted) /* 14 */
214
+ #define Tcl_ObjectContextIsFiltering \
215
+ (tclOOStubsPtr->tcl_ObjectContextIsFiltering) /* 15 */
216
+ #define Tcl_ObjectContextMethod \
217
+ (tclOOStubsPtr->tcl_ObjectContextMethod) /* 16 */
218
+ #define Tcl_ObjectContextObject \
219
+ (tclOOStubsPtr->tcl_ObjectContextObject) /* 17 */
220
+ #define Tcl_ObjectContextSkippedArgs \
221
+ (tclOOStubsPtr->tcl_ObjectContextSkippedArgs) /* 18 */
222
+ #define Tcl_ClassGetMetadata \
223
+ (tclOOStubsPtr->tcl_ClassGetMetadata) /* 19 */
224
+ #define Tcl_ClassSetMetadata \
225
+ (tclOOStubsPtr->tcl_ClassSetMetadata) /* 20 */
226
+ #define Tcl_ObjectGetMetadata \
227
+ (tclOOStubsPtr->tcl_ObjectGetMetadata) /* 21 */
228
+ #define Tcl_ObjectSetMetadata \
229
+ (tclOOStubsPtr->tcl_ObjectSetMetadata) /* 22 */
230
+ #define Tcl_ObjectContextInvokeNext \
231
+ (tclOOStubsPtr->tcl_ObjectContextInvokeNext) /* 23 */
232
+ #define Tcl_ObjectGetMethodNameMapper \
233
+ (tclOOStubsPtr->tcl_ObjectGetMethodNameMapper) /* 24 */
234
+ #define Tcl_ObjectSetMethodNameMapper \
235
+ (tclOOStubsPtr->tcl_ObjectSetMethodNameMapper) /* 25 */
236
+ #define Tcl_ClassSetConstructor \
237
+ (tclOOStubsPtr->tcl_ClassSetConstructor) /* 26 */
238
+ #define Tcl_ClassSetDestructor \
239
+ (tclOOStubsPtr->tcl_ClassSetDestructor) /* 27 */
240
+ #define Tcl_GetObjectName \
241
+ (tclOOStubsPtr->tcl_GetObjectName) /* 28 */
242
+ /* Slot 29 is reserved */
243
+ /* Slot 30 is reserved */
244
+ /* Slot 31 is reserved */
245
+ /* Slot 32 is reserved */
246
+ /* Slot 33 is reserved */
247
+ #define TclOOUnusedStubEntry \
248
+ (tclOOStubsPtr->tclOOUnusedStubEntry) /* 34 */
249
+
250
+ #endif /* defined(USE_TCLOO_STUBS) */
251
+
252
+ /* !END!: Do not edit above this line. */
253
+
254
+ #undef TclOOUnusedStubEntry
255
+
256
+ #endif /* _TCLOODECLS */
physworld_p1_20261018/envs/p1/include/tclOOInt.h ADDED
@@ -0,0 +1,607 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclOOInt.h --
3
+ *
4
+ * This file contains the structure definitions and some of the function
5
+ * declarations for the object-system (NB: not Tcl_Obj, but ::oo).
6
+ *
7
+ * Copyright (c) 2006-2012 by Donal K. Fellows
8
+ *
9
+ * See the file "license.terms" for information on usage and redistribution of
10
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
+ */
12
+
13
+ #ifndef TCL_OO_INTERNAL_H
14
+ #define TCL_OO_INTERNAL_H 1
15
+
16
+ #include "tclInt.h"
17
+ #include "tclOO.h"
18
+
19
+ /*
20
+ * Hack to make things work with Objective C. Note that ObjC isn't really
21
+ * supported, but we don't want to to be actively hostile to it. [Bug 2163447]
22
+ */
23
+
24
+ #ifdef __OBJC__
25
+ #define Class TclOOClass
26
+ #define Object TclOOObject
27
+ #endif /* __OBJC__ */
28
+
29
+ /*
30
+ * Forward declarations.
31
+ */
32
+
33
+ struct CallChain;
34
+ struct Class;
35
+ struct Foundation;
36
+ struct Object;
37
+
38
+ /*
39
+ * The data that needs to be stored per method. This record is used to collect
40
+ * information about all sorts of methods, including forwards, constructors
41
+ * and destructors.
42
+ */
43
+
44
+ typedef struct Method {
45
+ const Tcl_MethodType *typePtr;
46
+ /* The type of method. If NULL, this is a
47
+ * special flag record which is just used for
48
+ * the setting of the flags field. */
49
+ int refCount;
50
+ void *clientData; /* Type-specific data. */
51
+ Tcl_Obj *namePtr; /* Name of the method. */
52
+ struct Object *declaringObjectPtr;
53
+ /* The object that declares this method, or
54
+ * NULL if it was declared by a class. */
55
+ struct Class *declaringClassPtr;
56
+ /* The class that declares this method, or
57
+ * NULL if it was declared directly on an
58
+ * object. */
59
+ int flags; /* Assorted flags. Includes whether this
60
+ * method is public/exported or not. */
61
+ } Method;
62
+
63
+ /*
64
+ * Pre- and post-call callbacks, to allow procedure-like methods to be fine
65
+ * tuned in their behaviour.
66
+ */
67
+
68
+ typedef int (TclOO_PreCallProc)(void *clientData, Tcl_Interp *interp,
69
+ Tcl_ObjectContext context, Tcl_CallFrame *framePtr, int *isFinished);
70
+ typedef int (TclOO_PostCallProc)(void *clientData, Tcl_Interp *interp,
71
+ Tcl_ObjectContext context, Tcl_Namespace *namespacePtr, int result);
72
+ typedef void (TclOO_PmCDDeleteProc)(void *clientData);
73
+ typedef void *(TclOO_PmCDCloneProc)(void *clientData);
74
+
75
+ /*
76
+ * Procedure-like methods have the following extra information.
77
+ */
78
+
79
+ typedef struct ProcedureMethod {
80
+ int version; /* Version of this structure. Currently must
81
+ * be 0. */
82
+ Proc *procPtr; /* Core of the implementation of the method;
83
+ * includes the argument definition and the
84
+ * body bytecodes. */
85
+ int flags; /* Flags to control features. */
86
+ int refCount;
87
+ void *clientData;
88
+ TclOO_PmCDDeleteProc *deleteClientdataProc;
89
+ TclOO_PmCDCloneProc *cloneClientdataProc;
90
+ ProcErrorProc *errProc; /* Replacement error handler. */
91
+ TclOO_PreCallProc *preCallProc;
92
+ /* Callback to allow for additional setup
93
+ * before the method executes. */
94
+ TclOO_PostCallProc *postCallProc;
95
+ /* Callback to allow for additional cleanup
96
+ * after the method executes. */
97
+ GetFrameInfoValueProc *gfivProc;
98
+ /* Callback to allow for fine tuning of how
99
+ * the method reports itself. */
100
+ } ProcedureMethod;
101
+
102
+ #define TCLOO_PROCEDURE_METHOD_VERSION 0
103
+
104
+ /*
105
+ * Flags for use in a ProcedureMethod.
106
+ *
107
+ * When the USE_DECLARER_NS flag is set, the method will use the namespace of
108
+ * the object or class that declared it (or the clone of it, if it was from
109
+ * such that the implementation of the method came to the particular use)
110
+ * instead of the namespace of the object on which the method was invoked.
111
+ * This flag must be distinct from all others that are associated with
112
+ * methods.
113
+ */
114
+
115
+ #define USE_DECLARER_NS 0x80
116
+
117
+ /*
118
+ * Forwarded methods have the following extra information.
119
+ */
120
+
121
+ typedef struct ForwardMethod {
122
+ Tcl_Obj *prefixObj; /* The list of values to use to replace the
123
+ * object and method name with. Will be a
124
+ * non-empty list. */
125
+ } ForwardMethod;
126
+
127
+ /*
128
+ * Helper definitions that declare a "list" array. The two varieties are
129
+ * either optimized for simplicity (in the case that the whole array is
130
+ * typically assigned at once) or efficiency (in the case that the array is
131
+ * expected to be expanded over time). These lists are designed to be iterated
132
+ * over with the help of the FOREACH macro (see later in this file).
133
+ *
134
+ * The "num" field always counts the number of listType_t elements used in the
135
+ * "list" field. When a "size" field exists, it describes how many elements
136
+ * are present in the list; when absent, exactly "num" elements are present.
137
+ */
138
+
139
+ #define LIST_STATIC(listType_t) \
140
+ struct { int num; listType_t *list; }
141
+ #define LIST_DYNAMIC(listType_t) \
142
+ struct { int num, size; listType_t *list; }
143
+
144
+ /*
145
+ * Now, the definition of what an object actually is.
146
+ */
147
+
148
+ typedef struct Object {
149
+ struct Foundation *fPtr; /* The basis for the object system. Putting
150
+ * this here allows the avoidance of quite a
151
+ * lot of hash lookups on the critical path
152
+ * for object invocation and creation. */
153
+ Tcl_Namespace *namespacePtr;/* This object's namespace. */
154
+ Tcl_Command command; /* Reference to this object's public
155
+ * command. */
156
+ Tcl_Command myCommand; /* Reference to this object's internal
157
+ * command. */
158
+ struct Class *selfCls; /* This object's class. */
159
+ Tcl_HashTable *methodsPtr; /* Object-local Tcl_Obj (method name) to
160
+ * Method* mapping. */
161
+ LIST_STATIC(struct Class *) mixins;
162
+ /* Classes mixed into this object. */
163
+ LIST_STATIC(Tcl_Obj *) filters;
164
+ /* List of filter names. */
165
+ struct Class *classPtr; /* This is non-NULL for all classes, and NULL
166
+ * for everything else. It points to the class
167
+ * structure. */
168
+ int refCount; /* Number of strong references to this object.
169
+ * Note that there may be many more weak
170
+ * references; this mechanism exists to
171
+ * avoid Tcl_Preserve. */
172
+ int flags;
173
+ int creationEpoch; /* Unique value to make comparisons of objects
174
+ * easier. */
175
+ int epoch; /* Per-object epoch, incremented when the way
176
+ * an object should resolve call chains is
177
+ * changed. */
178
+ Tcl_HashTable *metadataPtr; /* Mapping from pointers to metadata type to
179
+ * the ClientData values that are the values
180
+ * of each piece of attached metadata. This
181
+ * field starts out as NULL and is only
182
+ * allocated if metadata is attached. */
183
+ Tcl_Obj *cachedNameObj; /* Cache of the name of the object. */
184
+ Tcl_HashTable *chainCache; /* Place to keep unused contexts. This table
185
+ * is indexed by method name as Tcl_Obj. */
186
+ Tcl_ObjectMapMethodNameProc *mapMethodNameProc;
187
+ /* Function to allow remapping of method
188
+ * names. For itcl-ng. */
189
+ LIST_STATIC(Tcl_Obj *) variables;
190
+ } Object;
191
+
192
+ #define OBJECT_DESTRUCTING 1 /* Indicates that an object is being or has
193
+ * been destroyed */
194
+ #define DESTRUCTOR_CALLED 2 /* Indicates that evaluation of destructor script for the
195
+ object has began */
196
+ #define OO_UNUSED_4 4 /* No longer used. */
197
+ #define ROOT_OBJECT 0x1000 /* Flag to say that this object is the root of
198
+ * the class hierarchy and should be treated
199
+ * specially during teardown. */
200
+ #define FILTER_HANDLING 0x2000 /* Flag set when the object is processing a
201
+ * filter; when set, filters are *not*
202
+ * processed on the object, preventing nasty
203
+ * recursive filtering problems. */
204
+ #define USE_CLASS_CACHE 0x4000 /* Flag set to say that the object is a pure
205
+ * instance of the class, and has had nothing
206
+ * added that changes the dispatch chain (i.e.
207
+ * no methods, mixins, or filters. */
208
+ #define ROOT_CLASS 0x8000 /* Flag to say that this object is the root
209
+ * class of classes, and should be treated
210
+ * specially during teardown (and in a few
211
+ * other spots). */
212
+ #define FORCE_UNKNOWN 0x10000 /* States that we are *really* looking up the
213
+ * unknown method handler at that point. */
214
+ #define DONT_DELETE 0x20000 /* Inhibit deletion of this object. */
215
+
216
+ /*
217
+ * And the definition of a class. Note that every class also has an associated
218
+ * object, through which it is manipulated.
219
+ */
220
+
221
+ typedef struct Class {
222
+ Object *thisPtr; /* Reference to the object associated with
223
+ * this class. */
224
+ int flags; /* Assorted flags. */
225
+ LIST_STATIC(struct Class *) superclasses;
226
+ /* List of superclasses, used for generation
227
+ * of method call chains. */
228
+ LIST_DYNAMIC(struct Class *) subclasses;
229
+ /* List of subclasses, used to ensure deletion
230
+ * of dependent entities happens properly when
231
+ * the class itself is deleted. */
232
+ LIST_DYNAMIC(Object *) instances;
233
+ /* List of instances, used to ensure deletion
234
+ * of dependent entities happens properly when
235
+ * the class itself is deleted. */
236
+ LIST_STATIC(Tcl_Obj *) filters;
237
+ /* List of filter names, used for generation
238
+ * of method call chains. */
239
+ LIST_STATIC(struct Class *) mixins;
240
+ /* List of mixin classes, used for generation
241
+ * of method call chains. */
242
+ LIST_DYNAMIC(struct Class *) mixinSubs;
243
+ /* List of classes that this class is mixed
244
+ * into, used to ensure deletion of dependent
245
+ * entities happens properly when the class
246
+ * itself is deleted. */
247
+ Tcl_HashTable classMethods; /* Hash table of all methods. Hash maps from
248
+ * the (Tcl_Obj*) method name to the (Method*)
249
+ * method record. */
250
+ Method *constructorPtr; /* Method record of the class constructor (if
251
+ * any). */
252
+ Method *destructorPtr; /* Method record of the class destructor (if
253
+ * any). */
254
+ Tcl_HashTable *metadataPtr; /* Mapping from pointers to metadata type to
255
+ * the ClientData values that are the values
256
+ * of each piece of attached metadata. This
257
+ * field starts out as NULL and is only
258
+ * allocated if metadata is attached. */
259
+ struct CallChain *constructorChainPtr;
260
+ struct CallChain *destructorChainPtr;
261
+ Tcl_HashTable *classChainCache;
262
+ /* Places where call chains are stored. For
263
+ * constructors, the class chain is always
264
+ * used. For destructors and ordinary methods,
265
+ * the class chain is only used when the
266
+ * object doesn't override with its own mixins
267
+ * (and filters and method implementations for
268
+ * when getting method chains). */
269
+ LIST_STATIC(Tcl_Obj *) variables;
270
+ } Class;
271
+
272
+ /*
273
+ * The foundation of the object system within an interpreter contains
274
+ * references to the key classes and namespaces, together with a few other
275
+ * useful bits and pieces. Probably ought to eventually go in the Interp
276
+ * structure itself.
277
+ */
278
+
279
+ typedef struct ThreadLocalData {
280
+ int nsCount; /* Epoch counter is used for keeping
281
+ * the values used in Tcl_Obj internal
282
+ * representations sane. Must be thread-local
283
+ * because Tcl_Objs can cross interpreter
284
+ * boundaries within a thread (objects don't
285
+ * generally cross threads). */
286
+ } ThreadLocalData;
287
+
288
+ typedef struct Foundation {
289
+ Tcl_Interp *interp;
290
+ Class *objectCls; /* The root of the object system. */
291
+ Class *classCls; /* The class of all classes. */
292
+ Tcl_Namespace *ooNs; /* ::oo namespace. */
293
+ Tcl_Namespace *defineNs; /* Namespace containing special commands for
294
+ * manipulating objects and classes. The
295
+ * "oo::define" command acts as a special kind
296
+ * of ensemble for this namespace. */
297
+ Tcl_Namespace *objdefNs; /* Namespace containing special commands for
298
+ * manipulating objects and classes. The
299
+ * "oo::objdefine" command acts as a special
300
+ * kind of ensemble for this namespace. */
301
+ Tcl_Namespace *helpersNs; /* Namespace containing the commands that are
302
+ * only valid when executing inside a
303
+ * procedural method. */
304
+ int epoch; /* Used to invalidate method chains when the
305
+ * class structure changes. */
306
+ ThreadLocalData *tsdPtr; /* Counter so we can allocate a unique
307
+ * namespace to each object. */
308
+ Tcl_Obj *unknownMethodNameObj;
309
+ /* Shared object containing the name of the
310
+ * unknown method handler method. */
311
+ Tcl_Obj *constructorName; /* Shared object containing the "name" of a
312
+ * constructor. */
313
+ Tcl_Obj *destructorName; /* Shared object containing the "name" of a
314
+ * destructor. */
315
+ Tcl_Obj *clonedName; /* Shared object containing the name of a
316
+ * "<cloned>" pseudo-constructor. */
317
+ Tcl_Obj *defineName; /* Fully qualified name of oo::define. */
318
+ } Foundation;
319
+
320
+ /*
321
+ * A call context structure is built when a method is called. It contains the
322
+ * chain of method implementations that are to be invoked by a particular
323
+ * call, and the process of calling walks the chain, with the [next] command
324
+ * proceeding to the next entry in the chain.
325
+ */
326
+
327
+ #define CALL_CHAIN_STATIC_SIZE 4
328
+
329
+ struct MInvoke {
330
+ Method *mPtr; /* Reference to the method implementation
331
+ * record. */
332
+ int isFilter; /* Whether this is a filter invocation. */
333
+ Class *filterDeclarer; /* What class decided to add the filter; if
334
+ * NULL, it was added by the object. */
335
+ };
336
+
337
+ typedef struct CallChain {
338
+ int objectCreationEpoch; /* The object's creation epoch. Note that the
339
+ * object reference is not stored in the call
340
+ * chain; it is in the call context. */
341
+ int objectEpoch; /* Local (object structure) epoch counter
342
+ * snapshot. */
343
+ int epoch; /* Global (class structure) epoch counter
344
+ * snapshot. */
345
+ int flags; /* Assorted flags, see below. */
346
+ int refCount; /* Reference count. */
347
+ int numChain; /* Size of the call chain. */
348
+ struct MInvoke *chain; /* Array of call chain entries. May point to
349
+ * staticChain if the number of entries is
350
+ * small. */
351
+ struct MInvoke staticChain[CALL_CHAIN_STATIC_SIZE];
352
+ } CallChain;
353
+
354
+ typedef struct CallContext {
355
+ Object *oPtr; /* The object associated with this call. */
356
+ int index; /* Index into the call chain of the currently
357
+ * executing method implementation. */
358
+ int skip; /* Current number of arguments to skip; can
359
+ * vary depending on whether it is a direct
360
+ * method call or a continuation via the
361
+ * [next] command. */
362
+ CallChain *callPtr; /* The actual call chain. */
363
+ } CallContext;
364
+
365
+ /*
366
+ * Bits for the 'flags' field of the call chain.
367
+ */
368
+
369
+ #define PUBLIC_METHOD 0x01 /* This is a public (exported) method. */
370
+ #define PRIVATE_METHOD 0x02 /* This is a private (class's direct instances
371
+ * only) method. Supports itcl. */
372
+ #define OO_UNKNOWN_METHOD 0x04 /* This is an unknown method. */
373
+ #define CONSTRUCTOR 0x08 /* This is a constructor. */
374
+ #define DESTRUCTOR 0x10 /* This is a destructor. */
375
+
376
+ /*
377
+ * Structure containing definition information about basic class methods.
378
+ */
379
+
380
+ typedef struct {
381
+ const char *name; /* Name of the method in question. */
382
+ int isPublic; /* Whether the method is public by default. */
383
+ Tcl_MethodType definition; /* How to call the method. */
384
+ } DeclaredClassMethod;
385
+
386
+ /*
387
+ *----------------------------------------------------------------
388
+ * Commands relating to OO support.
389
+ *----------------------------------------------------------------
390
+ */
391
+
392
+ MODULE_SCOPE int TclOOInit(Tcl_Interp *interp);
393
+ MODULE_SCOPE int TclOODefineObjCmd(void *clientData,
394
+ Tcl_Interp *interp, int objc,
395
+ Tcl_Obj *const *objv);
396
+ MODULE_SCOPE int TclOOObjDefObjCmd(void *clientData,
397
+ Tcl_Interp *interp, int objc,
398
+ Tcl_Obj *const *objv);
399
+ MODULE_SCOPE int TclOODefineConstructorObjCmd(void *clientData,
400
+ Tcl_Interp *interp, int objc,
401
+ Tcl_Obj *const *objv);
402
+ MODULE_SCOPE int TclOODefineDeleteMethodObjCmd(void *clientData,
403
+ Tcl_Interp *interp, int objc,
404
+ Tcl_Obj *const *objv);
405
+ MODULE_SCOPE int TclOODefineDestructorObjCmd(void *clientData,
406
+ Tcl_Interp *interp, int objc,
407
+ Tcl_Obj *const *objv);
408
+ MODULE_SCOPE int TclOODefineExportObjCmd(void *clientData,
409
+ Tcl_Interp *interp, int objc,
410
+ Tcl_Obj *const *objv);
411
+ MODULE_SCOPE int TclOODefineForwardObjCmd(void *clientData,
412
+ Tcl_Interp *interp, int objc,
413
+ Tcl_Obj *const *objv);
414
+ MODULE_SCOPE int TclOODefineMethodObjCmd(void *clientData,
415
+ Tcl_Interp *interp, int objc,
416
+ Tcl_Obj *const *objv);
417
+ MODULE_SCOPE int TclOODefineRenameMethodObjCmd(void *clientData,
418
+ Tcl_Interp *interp, int objc,
419
+ Tcl_Obj *const *objv);
420
+ MODULE_SCOPE int TclOODefineUnexportObjCmd(void *clientData,
421
+ Tcl_Interp *interp, int objc,
422
+ Tcl_Obj *const *objv);
423
+ MODULE_SCOPE int TclOODefineClassObjCmd(void *clientData,
424
+ Tcl_Interp *interp, int objc,
425
+ Tcl_Obj *const *objv);
426
+ MODULE_SCOPE int TclOODefineSelfObjCmd(void *clientData,
427
+ Tcl_Interp *interp, int objc,
428
+ Tcl_Obj *const *objv);
429
+ MODULE_SCOPE int TclOOUnknownDefinition(void *clientData,
430
+ Tcl_Interp *interp, int objc,
431
+ Tcl_Obj *const *objv);
432
+ MODULE_SCOPE int TclOOCopyObjectCmd(void *clientData,
433
+ Tcl_Interp *interp, int objc,
434
+ Tcl_Obj *const *objv);
435
+ MODULE_SCOPE int TclOONextObjCmd(void *clientData,
436
+ Tcl_Interp *interp, int objc,
437
+ Tcl_Obj *const *objv);
438
+ MODULE_SCOPE int TclOONextToObjCmd(void *clientData,
439
+ Tcl_Interp *interp, int objc,
440
+ Tcl_Obj *const *objv);
441
+ MODULE_SCOPE int TclOOSelfObjCmd(void *clientData,
442
+ Tcl_Interp *interp, int objc,
443
+ Tcl_Obj *const *objv);
444
+
445
+ /*
446
+ * Method implementations (in tclOOBasic.c).
447
+ */
448
+
449
+ MODULE_SCOPE int TclOO_Class_Constructor(void *clientData,
450
+ Tcl_Interp *interp, Tcl_ObjectContext context,
451
+ int objc, Tcl_Obj *const *objv);
452
+ MODULE_SCOPE int TclOO_Class_Create(void *clientData,
453
+ Tcl_Interp *interp, Tcl_ObjectContext context,
454
+ int objc, Tcl_Obj *const *objv);
455
+ MODULE_SCOPE int TclOO_Class_CreateNs(void *clientData,
456
+ Tcl_Interp *interp, Tcl_ObjectContext context,
457
+ int objc, Tcl_Obj *const *objv);
458
+ MODULE_SCOPE int TclOO_Class_New(void *clientData,
459
+ Tcl_Interp *interp, Tcl_ObjectContext context,
460
+ int objc, Tcl_Obj *const *objv);
461
+ MODULE_SCOPE int TclOO_Object_Destroy(void *clientData,
462
+ Tcl_Interp *interp, Tcl_ObjectContext context,
463
+ int objc, Tcl_Obj *const *objv);
464
+ MODULE_SCOPE int TclOO_Object_Eval(void *clientData,
465
+ Tcl_Interp *interp, Tcl_ObjectContext context,
466
+ int objc, Tcl_Obj *const *objv);
467
+ MODULE_SCOPE int TclOO_Object_LinkVar(void *clientData,
468
+ Tcl_Interp *interp, Tcl_ObjectContext context,
469
+ int objc, Tcl_Obj *const *objv);
470
+ MODULE_SCOPE int TclOO_Object_Unknown(void *clientData,
471
+ Tcl_Interp *interp, Tcl_ObjectContext context,
472
+ int objc, Tcl_Obj *const *objv);
473
+ MODULE_SCOPE int TclOO_Object_VarName(void *clientData,
474
+ Tcl_Interp *interp, Tcl_ObjectContext context,
475
+ int objc, Tcl_Obj *const *objv);
476
+
477
+ /*
478
+ * Private definitions, some of which perhaps ought to be exposed properly or
479
+ * maybe just put in the internal stubs table.
480
+ */
481
+
482
+ MODULE_SCOPE void TclOOAddToInstances(Object *oPtr, Class *clsPtr);
483
+ MODULE_SCOPE void TclOOAddToMixinSubs(Class *subPtr, Class *mixinPtr);
484
+ MODULE_SCOPE void TclOOAddToSubclasses(Class *subPtr, Class *superPtr);
485
+ MODULE_SCOPE Class * TclOOAllocClass(Tcl_Interp *interp,
486
+ Object *useThisObj);
487
+ MODULE_SCOPE int TclNRNewObjectInstance(Tcl_Interp *interp,
488
+ Tcl_Class cls, const char *nameStr,
489
+ const char *nsNameStr, int objc,
490
+ Tcl_Obj *const *objv, int skip,
491
+ Tcl_Object *objectPtr);
492
+ MODULE_SCOPE Object * TclNewObjectInstanceCommon(Tcl_Interp *interp,
493
+ Class *classPtr,
494
+ const char *nameStr,
495
+ const char *nsNameStr);
496
+ MODULE_SCOPE int TclOODecrRefCount(Object *oPtr);
497
+ MODULE_SCOPE int TclOOObjectDestroyed(Object *oPtr);
498
+ MODULE_SCOPE int TclOODefineSlots(Foundation *fPtr);
499
+ MODULE_SCOPE void TclOODeleteChain(CallChain *callPtr);
500
+ MODULE_SCOPE void TclOODeleteChainCache(Tcl_HashTable *tablePtr);
501
+ MODULE_SCOPE void TclOODeleteContext(CallContext *contextPtr);
502
+ MODULE_SCOPE void TclOODeleteDescendants(Tcl_Interp *interp,
503
+ Object *oPtr);
504
+ MODULE_SCOPE void TclOODelMethodRef(Method *method);
505
+ MODULE_SCOPE CallContext *TclOOGetCallContext(Object *oPtr,
506
+ Tcl_Obj *methodNameObj, int flags,
507
+ Tcl_Obj *cacheInThisObj);
508
+ MODULE_SCOPE CallChain *TclOOGetStereotypeCallChain(Class *clsPtr,
509
+ Tcl_Obj *methodNameObj, int flags);
510
+ MODULE_SCOPE Foundation *TclOOGetFoundation(Tcl_Interp *interp);
511
+ MODULE_SCOPE Tcl_Obj * TclOOGetFwdFromMethod(Method *mPtr);
512
+ MODULE_SCOPE Proc * TclOOGetProcFromMethod(Method *mPtr);
513
+ MODULE_SCOPE Tcl_Obj * TclOOGetMethodBody(Method *mPtr);
514
+ MODULE_SCOPE int TclOOGetSortedClassMethodList(Class *clsPtr,
515
+ int flags, const char ***stringsPtr);
516
+ MODULE_SCOPE int TclOOGetSortedMethodList(Object *oPtr, int flags,
517
+ const char ***stringsPtr);
518
+ MODULE_SCOPE int TclOOInit(Tcl_Interp *interp);
519
+ MODULE_SCOPE void TclOOInitInfo(Tcl_Interp *interp);
520
+ MODULE_SCOPE int TclOOInvokeContext(void *clientData,
521
+ Tcl_Interp *interp, int objc,
522
+ Tcl_Obj *const objv[]);
523
+ MODULE_SCOPE int TclNRObjectContextInvokeNext(Tcl_Interp *interp,
524
+ Tcl_ObjectContext context, int objc,
525
+ Tcl_Obj *const *objv, int skip);
526
+ MODULE_SCOPE void TclOONewBasicMethod(Tcl_Interp *interp, Class *clsPtr,
527
+ const DeclaredClassMethod *dcm);
528
+ MODULE_SCOPE Tcl_Obj * TclOOObjectName(Tcl_Interp *interp, Object *oPtr);
529
+ MODULE_SCOPE void TclOOReleaseClassContents(Tcl_Interp *interp,
530
+ Object *oPtr);
531
+ MODULE_SCOPE int TclOORemoveFromInstances(Object *oPtr, Class *clsPtr);
532
+ MODULE_SCOPE int TclOORemoveFromMixins(Class *mixinPtr, Object *oPtr);
533
+ MODULE_SCOPE int TclOORemoveFromMixinSubs(Class *subPtr,
534
+ Class *mixinPtr);
535
+ MODULE_SCOPE int TclOORemoveFromSubclasses(Class *subPtr,
536
+ Class *superPtr);
537
+ MODULE_SCOPE Tcl_Obj * TclOORenderCallChain(Tcl_Interp *interp,
538
+ CallChain *callPtr);
539
+ MODULE_SCOPE void TclOOStashContext(Tcl_Obj *objPtr,
540
+ CallContext *contextPtr);
541
+ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr);
542
+
543
+ /*
544
+ * Include all the private API, generated from tclOO.decls.
545
+ */
546
+
547
+ #include "tclOOIntDecls.h"
548
+
549
+ /*
550
+ * Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.
551
+ */
552
+
553
+ #define AddRef(ptr) ((ptr)->refCount++)
554
+
555
+ /*
556
+ * A convenience macro for iterating through the lists used in the internal
557
+ * memory management of objects.
558
+ * REQUIRES DECLARATION: int i;
559
+ */
560
+
561
+ #define FOREACH(var,ary) \
562
+ for(i=0 ; i<(ary).num; i++) if ((ary).list[i] == NULL) { \
563
+ continue; \
564
+ } else if ((var) = (ary).list[i], 1)
565
+
566
+ /*
567
+ * Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
568
+ * sets up the declarations needed for the main macro, FOREACH_HASH, which
569
+ * does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
570
+ * only iterates over values.
571
+ */
572
+
573
+ #define FOREACH_HASH_DECLS \
574
+ Tcl_HashEntry *hPtr;Tcl_HashSearch search
575
+ #define FOREACH_HASH(key,val,tablePtr) \
576
+ for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
577
+ ((key)=(void *)Tcl_GetHashKey((tablePtr),hPtr),\
578
+ (val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
579
+ #define FOREACH_HASH_VALUE(val,tablePtr) \
580
+ for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
581
+ ((val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
582
+
583
+ /*
584
+ * Convenience macro for duplicating a list. Needs no external declaration,
585
+ * but all arguments are used multiple times and so must have no side effects.
586
+ */
587
+
588
+ #undef DUPLICATE /* prevent possible conflict with definition in WINAPI nb30.h */
589
+ #define DUPLICATE(target,source,type) \
590
+ do { \
591
+ size_t len = sizeof(type) * ((target).num=(source).num);\
592
+ if (len != 0) { \
593
+ memcpy(((target).list=(type*)ckalloc(len)), (source).list, len); \
594
+ } else { \
595
+ (target).list = NULL; \
596
+ } \
597
+ } while(0)
598
+
599
+ #endif /* TCL_OO_INTERNAL_H */
600
+
601
+ /*
602
+ * Local Variables:
603
+ * mode: c
604
+ * c-basic-offset: 4
605
+ * fill-column: 78
606
+ * End:
607
+ */
physworld_p1_20261018/envs/p1/include/tclOOIntDecls.h ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file is (mostly) automatically generated from tclOO.decls.
3
+ */
4
+
5
+ #ifndef _TCLOOINTDECLS
6
+ #define _TCLOOINTDECLS
7
+
8
+ /* !BEGIN!: Do not edit below this line. */
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /*
15
+ * Exported function declarations:
16
+ */
17
+
18
+ /* 0 */
19
+ TCLAPI Tcl_Object TclOOGetDefineCmdContext(Tcl_Interp *interp);
20
+ /* 1 */
21
+ TCLAPI Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp,
22
+ Object *oPtr, int flags, Tcl_Obj *nameObj,
23
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
24
+ const Tcl_MethodType *typePtr,
25
+ void *clientData, Proc **procPtrPtr);
26
+ /* 2 */
27
+ TCLAPI Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp,
28
+ Class *clsPtr, int flags, Tcl_Obj *nameObj,
29
+ const char *namePtr, Tcl_Obj *argsObj,
30
+ Tcl_Obj *bodyObj,
31
+ const Tcl_MethodType *typePtr,
32
+ void *clientData, Proc **procPtrPtr);
33
+ /* 3 */
34
+ TCLAPI Method * TclOONewProcInstanceMethod(Tcl_Interp *interp,
35
+ Object *oPtr, int flags, Tcl_Obj *nameObj,
36
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
37
+ ProcedureMethod **pmPtrPtr);
38
+ /* 4 */
39
+ TCLAPI Method * TclOONewProcMethod(Tcl_Interp *interp, Class *clsPtr,
40
+ int flags, Tcl_Obj *nameObj,
41
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
42
+ ProcedureMethod **pmPtrPtr);
43
+ /* 5 */
44
+ TCLAPI int TclOOObjectCmdCore(Object *oPtr, Tcl_Interp *interp,
45
+ int objc, Tcl_Obj *const *objv,
46
+ int publicOnly, Class *startCls);
47
+ /* 6 */
48
+ TCLAPI int TclOOIsReachable(Class *targetPtr, Class *startPtr);
49
+ /* 7 */
50
+ TCLAPI Method * TclOONewForwardMethod(Tcl_Interp *interp,
51
+ Class *clsPtr, int isPublic,
52
+ Tcl_Obj *nameObj, Tcl_Obj *prefixObj);
53
+ /* 8 */
54
+ TCLAPI Method * TclOONewForwardInstanceMethod(Tcl_Interp *interp,
55
+ Object *oPtr, int isPublic, Tcl_Obj *nameObj,
56
+ Tcl_Obj *prefixObj);
57
+ /* 9 */
58
+ TCLAPI Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp,
59
+ Tcl_Object oPtr,
60
+ TclOO_PreCallProc *preCallPtr,
61
+ TclOO_PostCallProc *postCallPtr,
62
+ ProcErrorProc *errProc, void *clientData,
63
+ Tcl_Obj *nameObj, Tcl_Obj *argsObj,
64
+ Tcl_Obj *bodyObj, int flags,
65
+ void **internalTokenPtr);
66
+ /* 10 */
67
+ TCLAPI Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp,
68
+ Tcl_Class clsPtr,
69
+ TclOO_PreCallProc *preCallPtr,
70
+ TclOO_PostCallProc *postCallPtr,
71
+ ProcErrorProc *errProc, void *clientData,
72
+ Tcl_Obj *nameObj, Tcl_Obj *argsObj,
73
+ Tcl_Obj *bodyObj, int flags,
74
+ void **internalTokenPtr);
75
+ /* 11 */
76
+ TCLAPI int TclOOInvokeObject(Tcl_Interp *interp,
77
+ Tcl_Object object, Tcl_Class startCls,
78
+ int publicPrivate, int objc,
79
+ Tcl_Obj *const *objv);
80
+ /* 12 */
81
+ TCLAPI void TclOOObjectSetFilters(Object *oPtr, int numFilters,
82
+ Tcl_Obj *const *filters);
83
+ /* 13 */
84
+ TCLAPI void TclOOClassSetFilters(Tcl_Interp *interp,
85
+ Class *classPtr, int numFilters,
86
+ Tcl_Obj *const *filters);
87
+ /* 14 */
88
+ TCLAPI void TclOOObjectSetMixins(Object *oPtr, int numMixins,
89
+ Class *const *mixins);
90
+ /* 15 */
91
+ TCLAPI void TclOOClassSetMixins(Tcl_Interp *interp,
92
+ Class *classPtr, int numMixins,
93
+ Class *const *mixins);
94
+
95
+ typedef struct TclOOIntStubs {
96
+ int magic;
97
+ void *hooks;
98
+
99
+ Tcl_Object (*tclOOGetDefineCmdContext) (Tcl_Interp *interp); /* 0 */
100
+ Tcl_Method (*tclOOMakeProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 1 */
101
+ Tcl_Method (*tclOOMakeProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 2 */
102
+ Method * (*tclOONewProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 3 */
103
+ Method * (*tclOONewProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 4 */
104
+ int (*tclOOObjectCmdCore) (Object *oPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int publicOnly, Class *startCls); /* 5 */
105
+ int (*tclOOIsReachable) (Class *targetPtr, Class *startPtr); /* 6 */
106
+ Method * (*tclOONewForwardMethod) (Tcl_Interp *interp, Class *clsPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 7 */
107
+ Method * (*tclOONewForwardInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 8 */
108
+ Tcl_Method (*tclOONewProcInstanceMethodEx) (Tcl_Interp *interp, Tcl_Object oPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 9 */
109
+ Tcl_Method (*tclOONewProcMethodEx) (Tcl_Interp *interp, Tcl_Class clsPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 10 */
110
+ int (*tclOOInvokeObject) (Tcl_Interp *interp, Tcl_Object object, Tcl_Class startCls, int publicPrivate, int objc, Tcl_Obj *const *objv); /* 11 */
111
+ void (*tclOOObjectSetFilters) (Object *oPtr, int numFilters, Tcl_Obj *const *filters); /* 12 */
112
+ void (*tclOOClassSetFilters) (Tcl_Interp *interp, Class *classPtr, int numFilters, Tcl_Obj *const *filters); /* 13 */
113
+ void (*tclOOObjectSetMixins) (Object *oPtr, int numMixins, Class *const *mixins); /* 14 */
114
+ void (*tclOOClassSetMixins) (Tcl_Interp *interp, Class *classPtr, int numMixins, Class *const *mixins); /* 15 */
115
+ } TclOOIntStubs;
116
+
117
+ extern const TclOOIntStubs *tclOOIntStubsPtr;
118
+
119
+ #ifdef __cplusplus
120
+ }
121
+ #endif
122
+
123
+ #if defined(USE_TCLOO_STUBS)
124
+
125
+ /*
126
+ * Inline function declarations:
127
+ */
128
+
129
+ #define TclOOGetDefineCmdContext \
130
+ (tclOOIntStubsPtr->tclOOGetDefineCmdContext) /* 0 */
131
+ #define TclOOMakeProcInstanceMethod \
132
+ (tclOOIntStubsPtr->tclOOMakeProcInstanceMethod) /* 1 */
133
+ #define TclOOMakeProcMethod \
134
+ (tclOOIntStubsPtr->tclOOMakeProcMethod) /* 2 */
135
+ #define TclOONewProcInstanceMethod \
136
+ (tclOOIntStubsPtr->tclOONewProcInstanceMethod) /* 3 */
137
+ #define TclOONewProcMethod \
138
+ (tclOOIntStubsPtr->tclOONewProcMethod) /* 4 */
139
+ #define TclOOObjectCmdCore \
140
+ (tclOOIntStubsPtr->tclOOObjectCmdCore) /* 5 */
141
+ #define TclOOIsReachable \
142
+ (tclOOIntStubsPtr->tclOOIsReachable) /* 6 */
143
+ #define TclOONewForwardMethod \
144
+ (tclOOIntStubsPtr->tclOONewForwardMethod) /* 7 */
145
+ #define TclOONewForwardInstanceMethod \
146
+ (tclOOIntStubsPtr->tclOONewForwardInstanceMethod) /* 8 */
147
+ #define TclOONewProcInstanceMethodEx \
148
+ (tclOOIntStubsPtr->tclOONewProcInstanceMethodEx) /* 9 */
149
+ #define TclOONewProcMethodEx \
150
+ (tclOOIntStubsPtr->tclOONewProcMethodEx) /* 10 */
151
+ #define TclOOInvokeObject \
152
+ (tclOOIntStubsPtr->tclOOInvokeObject) /* 11 */
153
+ #define TclOOObjectSetFilters \
154
+ (tclOOIntStubsPtr->tclOOObjectSetFilters) /* 12 */
155
+ #define TclOOClassSetFilters \
156
+ (tclOOIntStubsPtr->tclOOClassSetFilters) /* 13 */
157
+ #define TclOOObjectSetMixins \
158
+ (tclOOIntStubsPtr->tclOOObjectSetMixins) /* 14 */
159
+ #define TclOOClassSetMixins \
160
+ (tclOOIntStubsPtr->tclOOClassSetMixins) /* 15 */
161
+
162
+ #endif /* defined(USE_TCLOO_STUBS) */
163
+
164
+ /* !END!: Do not edit above this line. */
165
+
166
+ #endif /* _TCLOOINTDECLS */
physworld_p1_20261018/envs/p1/include/tclPlatDecls.h ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclPlatDecls.h --
3
+ *
4
+ * Declarations of platform specific Tcl APIs.
5
+ *
6
+ * Copyright (c) 1998-1999 by Scriptics Corporation.
7
+ * All rights reserved.
8
+ */
9
+
10
+ #ifndef _TCLPLATDECLS
11
+ #define _TCLPLATDECLS
12
+
13
+ #undef TCL_STORAGE_CLASS
14
+ #ifdef BUILD_tcl
15
+ # define TCL_STORAGE_CLASS DLLEXPORT
16
+ #else
17
+ # ifdef USE_TCL_STUBS
18
+ # define TCL_STORAGE_CLASS
19
+ # else
20
+ # define TCL_STORAGE_CLASS DLLIMPORT
21
+ # endif
22
+ #endif
23
+
24
+ /*
25
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
26
+ * script. Any modifications to the function declarations below should be made
27
+ * in the generic/tcl.decls script.
28
+ */
29
+
30
+ /*
31
+ * TCHAR is needed here for win32, so if it is not defined yet do it here.
32
+ * This way, we don't need to include <tchar.h> just for one define.
33
+ */
34
+ #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED)
35
+ # if defined(_UNICODE)
36
+ typedef wchar_t TCHAR;
37
+ # else
38
+ typedef char TCHAR;
39
+ # endif
40
+ # define _TCHAR_DEFINED
41
+ #endif
42
+
43
+ /* !BEGIN!: Do not edit below this line. */
44
+
45
+ #ifdef __cplusplus
46
+ extern "C" {
47
+ #endif
48
+
49
+ /*
50
+ * Exported function declarations:
51
+ */
52
+
53
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
54
+ /* 0 */
55
+ EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len,
56
+ Tcl_DString *dsPtr);
57
+ /* 1 */
58
+ EXTERN char * Tcl_WinTCharToUtf(const TCHAR *str, int len,
59
+ Tcl_DString *dsPtr);
60
+ /* Slot 2 is reserved */
61
+ /* 3 */
62
+ EXTERN void TclUnusedStubEntry(void);
63
+ #endif /* WIN */
64
+ #ifdef MAC_OSX_TCL /* MACOSX */
65
+ /* 0 */
66
+ EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
67
+ const char *bundleName, int hasResourceFile,
68
+ int maxPathLen, char *libraryPath);
69
+ /* 1 */
70
+ EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
71
+ Tcl_Interp *interp, const char *bundleName,
72
+ const char *bundleVersion,
73
+ int hasResourceFile, int maxPathLen,
74
+ char *libraryPath);
75
+ /* 2 */
76
+ EXTERN void TclUnusedStubEntry(void);
77
+ #endif /* MACOSX */
78
+
79
+ typedef struct TclPlatStubs {
80
+ int magic;
81
+ void *hooks;
82
+
83
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
84
+ TCHAR * (*tcl_WinUtfToTChar) (const char *str, int len, Tcl_DString *dsPtr); /* 0 */
85
+ char * (*tcl_WinTCharToUtf) (const TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */
86
+ void (*reserved2)(void);
87
+ void (*tclUnusedStubEntry) (void); /* 3 */
88
+ #endif /* WIN */
89
+ #ifdef MAC_OSX_TCL /* MACOSX */
90
+ int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp *interp, const char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath); /* 0 */
91
+ int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp *interp, const char *bundleName, const char *bundleVersion, int hasResourceFile, int maxPathLen, char *libraryPath); /* 1 */
92
+ void (*tclUnusedStubEntry) (void); /* 2 */
93
+ #endif /* MACOSX */
94
+ } TclPlatStubs;
95
+
96
+ extern const TclPlatStubs *tclPlatStubsPtr;
97
+
98
+ #ifdef __cplusplus
99
+ }
100
+ #endif
101
+
102
+ #if defined(USE_TCL_STUBS)
103
+
104
+ /*
105
+ * Inline function declarations:
106
+ */
107
+
108
+ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
109
+ #define Tcl_WinUtfToTChar \
110
+ (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
111
+ #define Tcl_WinTCharToUtf \
112
+ (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
113
+ /* Slot 2 is reserved */
114
+ #define TclUnusedStubEntry \
115
+ (tclPlatStubsPtr->tclUnusedStubEntry) /* 3 */
116
+ #endif /* WIN */
117
+ #ifdef MAC_OSX_TCL /* MACOSX */
118
+ #define Tcl_MacOSXOpenBundleResources \
119
+ (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
120
+ #define Tcl_MacOSXOpenVersionedBundleResources \
121
+ (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
122
+ #define TclUnusedStubEntry \
123
+ (tclPlatStubsPtr->tclUnusedStubEntry) /* 2 */
124
+ #endif /* MACOSX */
125
+
126
+ #endif /* defined(USE_TCL_STUBS) */
127
+
128
+ /* !END!: Do not edit above this line. */
129
+
130
+ #undef TclUnusedStubEntry
131
+ #ifdef MAC_OSX_TCL /* MACOSX */
132
+ #undef Tcl_MacOSXOpenBundleResources
133
+ #define Tcl_MacOSXOpenBundleResources(a,b,c,d,e) Tcl_MacOSXOpenVersionedBundleResources(a,b,NULL,c,d,e)
134
+ #endif
135
+
136
+ #undef TCL_STORAGE_CLASS
137
+ #define TCL_STORAGE_CLASS DLLIMPORT
138
+
139
+ #endif /* _TCLPLATDECLS */
140
+
141
+
physworld_p1_20261018/envs/p1/include/tclPort.h ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclPort.h --
3
+ *
4
+ * This header file handles porting issues that occur because
5
+ * of differences between systems. It reads in platform specific
6
+ * portability files.
7
+ *
8
+ * Copyright (c) 1994-1995 Sun Microsystems, Inc.
9
+ *
10
+ * See the file "license.terms" for information on usage and redistribution
11
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
+ */
13
+
14
+ #ifndef _TCLPORT
15
+ #define _TCLPORT
16
+
17
+ #ifdef HAVE_TCL_CONFIG_H
18
+ #include "tclConfig.h"
19
+ #endif
20
+ #if defined(_WIN32)
21
+ # include "tclWinPort.h"
22
+ #else
23
+ # include "tclUnixPort.h"
24
+ #endif
25
+ #include "tcl.h"
26
+
27
+ #if !defined(LLONG_MIN)
28
+ # ifdef TCL_WIDE_INT_IS_LONG
29
+ # define LLONG_MIN LONG_MIN
30
+ # else
31
+ # ifdef LLONG_BIT
32
+ # define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<(LLONG_BIT-1)))
33
+ # else
34
+ /* Assume we're on a system with a 64-bit 'long long' type */
35
+ # define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<63))
36
+ # endif
37
+ # endif
38
+ /* Assume that if LLONG_MIN is undefined, then so is LLONG_MAX */
39
+ # define LLONG_MAX (~LLONG_MIN)
40
+ #endif
41
+
42
+ #define UWIDE_MAX ((Tcl_WideUInt)-1)
43
+ #define WIDE_MAX ((Tcl_WideInt)(UWIDE_MAX >> 1))
44
+ #define WIDE_MIN ((Tcl_WideInt)((Tcl_WideUInt)WIDE_MAX+1))
45
+
46
+ #endif /* _TCLPORT */
physworld_p1_20261018/envs/p1/include/tclThread.h ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * --------------------------------------------------------------------------
3
+ * tclthread.h --
4
+ *
5
+ * Global header file for the thread extension.
6
+ *
7
+ * Copyright (c) 2002 ActiveState Corporation.
8
+ * Copyright (c) 2002 by Zoran Vasiljevic.
9
+ *
10
+ * See the file "license.terms" for information on usage and redistribution
11
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
+ * ---------------------------------------------------------------------------
13
+ */
14
+
15
+ /*
16
+ * Thread extension version numbers are not stored here
17
+ * because this isn't a public export file.
18
+ */
19
+
20
+ #ifndef _TCL_THREAD_H_
21
+ #define _TCL_THREAD_H_
22
+
23
+ #include <tcl.h>
24
+
25
+ /*
26
+ * Exported from threadCmd.c file.
27
+ */
28
+ #ifdef __cplusplus
29
+ extern "C" {
30
+ #endif
31
+ DLLEXPORT int Thread_Init(Tcl_Interp *interp);
32
+ #ifdef __cplusplus
33
+ }
34
+ #endif
35
+
36
+ #endif /* _TCL_THREAD_H_ */
physworld_p1_20261018/envs/p1/include/tclTomMath.h ADDED
@@ -0,0 +1,1131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* LibTomMath, multiple-precision integer library -- Tom St Denis */
2
+ /* SPDX-License-Identifier: Unlicense */
3
+
4
+ #ifndef BN_H_
5
+ #define BN_H_
6
+
7
+ #ifndef MODULE_SCOPE
8
+ #define MODULE_SCOPE extern
9
+ #endif
10
+
11
+
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+ /* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
18
+ #if (defined(_WIN32) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_64BIT)
19
+ # define MP_32BIT
20
+ #endif
21
+
22
+ /* detect 64-bit mode if possible */
23
+ #if defined(NEVER)
24
+ # if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
25
+ # if defined(__GNUC__)
26
+ /* we support 128bit integers only via: __attribute__((mode(TI))) */
27
+ # define MP_64BIT
28
+ # else
29
+ /* otherwise we fall back to MP_32BIT even on 64bit platforms */
30
+ # define MP_32BIT
31
+ # endif
32
+ # endif
33
+ #endif
34
+
35
+ #ifdef MP_DIGIT_BIT
36
+ # error Defining MP_DIGIT_BIT is disallowed, use MP_8/16/31/32/64BIT
37
+ #endif
38
+
39
+ /* some default configurations.
40
+ *
41
+ * A "mp_digit" must be able to hold MP_DIGIT_BIT + 1 bits
42
+ * A "mp_word" must be able to hold 2*MP_DIGIT_BIT + 1 bits
43
+ *
44
+ * At the very least a mp_digit must be able to hold 7 bits
45
+ * [any size beyond that is ok provided it doesn't overflow the data type]
46
+ */
47
+
48
+ #ifdef MP_8BIT
49
+ #ifndef MP_DIGIT_DECLARED
50
+ typedef unsigned char mp_digit;
51
+ #define MP_DIGIT_DECLARED
52
+ #endif
53
+ #ifndef MP_WORD_DECLARED
54
+ typedef unsigned short private_mp_word;
55
+ #define MP_WORD_DECLARED
56
+ #endif
57
+ # define MP_SIZEOF_MP_DIGIT 1
58
+ # ifdef MP_DIGIT_BIT
59
+ # error You must not define MP_DIGIT_BIT when using MP_8BIT
60
+ # endif
61
+ #elif defined(MP_16BIT)
62
+ #ifndef MP_DIGIT_DECLARED
63
+ typedef unsigned short mp_digit;
64
+ #define MP_DIGIT_DECLARED
65
+ #endif
66
+ #ifndef MP_WORD_DECLARED
67
+ typedef unsigned int private_mp_word;
68
+ #define MP_WORD_DECLARED
69
+ #endif
70
+ # define MP_SIZEOF_MP_DIGIT 2
71
+ # ifdef MP_DIGIT_BIT
72
+ # error You must not define MP_DIGIT_BIT when using MP_16BIT
73
+ # endif
74
+ #elif defined(MP_64BIT)
75
+ /* for GCC only on supported platforms */
76
+ #ifndef MP_DIGIT_DECLARED
77
+ typedef unsigned long long mp_digit;
78
+ #define MP_DIGIT_DECLARED
79
+ #endif
80
+ typedef unsigned long private_mp_word __attribute__((mode(TI)));
81
+ # define MP_DIGIT_BIT 60
82
+ #else
83
+ /* this is the default case, 28-bit digits */
84
+
85
+ /* this is to make porting into LibTomCrypt easier :-) */
86
+ #ifndef MP_DIGIT_DECLARED
87
+ typedef unsigned int mp_digit;
88
+ #define MP_DIGIT_DECLARED
89
+ #endif
90
+ #ifndef MP_WORD_DECLARED
91
+ #ifdef _WIN32
92
+ typedef unsigned __int64 private_mp_word;
93
+ #else
94
+ typedef unsigned long long private_mp_word;
95
+ #endif
96
+ #define MP_WORD_DECLARED
97
+ #endif
98
+
99
+ # ifdef MP_31BIT
100
+ /*
101
+ * This is an extension that uses 31-bit digits.
102
+ * Please be aware that not all functions support this size, especially s_mp_mul_digs_fast
103
+ * will be reduced to work on small numbers only:
104
+ * Up to 8 limbs, 248 bits instead of up to 512 limbs, 15872 bits with MP_28BIT.
105
+ */
106
+ # define MP_DIGIT_BIT 31
107
+ # else
108
+ /* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */
109
+ # define MP_DIGIT_BIT 28
110
+ # define MP_28BIT
111
+ # endif
112
+ #endif
113
+
114
+ /* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
115
+ #ifndef MP_DIGIT_BIT
116
+ # define MP_DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
117
+ #endif
118
+
119
+ #define MP_MASK ((((mp_digit)1)<<((mp_digit)MP_DIGIT_BIT))-((mp_digit)1))
120
+ #define MP_DIGIT_MAX MP_MASK
121
+
122
+ /* Primality generation flags */
123
+ #define MP_PRIME_BBS 0x0001 /* BBS style prime */
124
+ #define MP_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
125
+ #define MP_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
126
+
127
+ #define LTM_PRIME_BBS (MP_DEPRECATED_PRAGMA("LTM_PRIME_BBS has been deprecated, use MP_PRIME_BBS") MP_PRIME_BBS)
128
+ #define LTM_PRIME_SAFE (MP_DEPRECATED_PRAGMA("LTM_PRIME_SAFE has been deprecated, use MP_PRIME_SAFE") MP_PRIME_SAFE)
129
+ #define LTM_PRIME_2MSB_ON (MP_DEPRECATED_PRAGMA("LTM_PRIME_2MSB_ON has been deprecated, use MP_PRIME_2MSB_ON") MP_PRIME_2MSB_ON)
130
+
131
+ #ifdef MP_USE_ENUMS
132
+ typedef enum {
133
+ MP_ZPOS = 0, /* positive */
134
+ MP_NEG = 1 /* negative */
135
+ } mp_sign;
136
+ typedef enum {
137
+ MP_LT = -1, /* less than */
138
+ MP_EQ = 0, /* equal */
139
+ MP_GT = 1 /* greater than */
140
+ } mp_ord;
141
+ typedef enum {
142
+ MP_NO = 0,
143
+ MP_YES = 1
144
+ } mp_bool;
145
+ typedef enum {
146
+ MP_OKAY = 0, /* no error */
147
+ MP_ERR = -1, /* unknown error */
148
+ MP_MEM = -2, /* out of mem */
149
+ MP_VAL = -3, /* invalid input */
150
+ MP_ITER = -4, /* maximum iterations reached */
151
+ MP_BUF = -5 /* buffer overflow, supplied buffer too small */
152
+ } mp_err;
153
+ typedef enum {
154
+ MP_LSB_FIRST = -1,
155
+ MP_MSB_FIRST = 1
156
+ } mp_order;
157
+ typedef enum {
158
+ MP_LITTLE_ENDIAN = -1,
159
+ MP_NATIVE_ENDIAN = 0,
160
+ MP_BIG_ENDIAN = 1
161
+ } mp_endian;
162
+ #else
163
+ typedef int mp_sign;
164
+ #define MP_ZPOS 0 /* positive integer */
165
+ #define MP_NEG 1 /* negative */
166
+ typedef int mp_ord;
167
+ #define MP_LT -1 /* less than */
168
+ #define MP_EQ 0 /* equal to */
169
+ #define MP_GT 1 /* greater than */
170
+ typedef int mp_bool;
171
+ #define MP_YES 1
172
+ #define MP_NO 0
173
+ typedef int mp_err;
174
+ #define MP_OKAY 0 /* no error */
175
+ #define MP_ERR -1 /* unknown error */
176
+ #define MP_MEM -2 /* out of mem */
177
+ #define MP_VAL -3 /* invalid input */
178
+ #define MP_RANGE (MP_DEPRECATED_PRAGMA("MP_RANGE has been deprecated in favor of MP_VAL") MP_VAL)
179
+ #define MP_ITER -4 /* maximum iterations reached */
180
+ #define MP_BUF -5 /* buffer overflow, supplied buffer too small */
181
+ typedef int mp_order;
182
+ #define MP_LSB_FIRST -1
183
+ #define MP_MSB_FIRST 1
184
+ typedef int mp_endian;
185
+ #define MP_LITTLE_ENDIAN -1
186
+ #define MP_NATIVE_ENDIAN 0
187
+ #define MP_BIG_ENDIAN 1
188
+ #endif
189
+
190
+ /* tunable cutoffs */
191
+
192
+ #ifndef MP_FIXED_CUTOFFS
193
+ extern int
194
+ KARATSUBA_MUL_CUTOFF,
195
+ KARATSUBA_SQR_CUTOFF,
196
+ TOOM_MUL_CUTOFF,
197
+ TOOM_SQR_CUTOFF;
198
+ #endif
199
+
200
+ /* define this to use lower memory usage routines (exptmods mostly) */
201
+ /* #define MP_LOW_MEM */
202
+
203
+ /* default precision */
204
+ #ifndef MP_PREC
205
+ # ifndef MP_LOW_MEM
206
+ # define MP_PREC 32 /* default digits of precision */
207
+ # elif defined(MP_8BIT)
208
+ # define MP_PREC 16 /* default digits of precision */
209
+ # else
210
+ # define MP_PREC 8 /* default digits of precision */
211
+ # endif
212
+ #endif
213
+
214
+ /* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
215
+ #define PRIVATE_MP_WARRAY (int)(1 << (((CHAR_BIT * sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
216
+
217
+ #if defined(__GNUC__) && __GNUC__ >= 4
218
+ # define MP_NULL_TERMINATED __attribute__((sentinel))
219
+ #else
220
+ # define MP_NULL_TERMINATED
221
+ #endif
222
+
223
+ /*
224
+ * MP_WUR - warn unused result
225
+ * ---------------------------
226
+ *
227
+ * The result of functions annotated with MP_WUR must be
228
+ * checked and cannot be ignored.
229
+ *
230
+ * Most functions in libtommath return an error code.
231
+ * This error code must be checked in order to prevent crashes or invalid
232
+ * results.
233
+ *
234
+ * If you still want to avoid the error checks for quick and dirty programs
235
+ * without robustness guarantees, you can `#define MP_WUR` before including
236
+ * tommath.h, disabling the warnings.
237
+ */
238
+ #ifndef MP_WUR
239
+ # if defined(__GNUC__) && __GNUC__ >= 4
240
+ # define MP_WUR __attribute__((warn_unused_result))
241
+ # else
242
+ # define MP_WUR
243
+ # endif
244
+ #endif
245
+
246
+ #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
247
+ # define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
248
+ #elif defined(_MSC_VER) && _MSC_VER >= 1500
249
+ # define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x))
250
+ #else
251
+ # define MP_DEPRECATED(x)
252
+ #endif
253
+
254
+ #ifndef MP_NO_DEPRECATED_PRAGMA
255
+ #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
256
+ # define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
257
+ # define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
258
+ #elif defined(_MSC_VER) && _MSC_VER >= 1500
259
+ # define MP_DEPRECATED_PRAGMA(s) __pragma(message(s))
260
+ #endif
261
+ #endif
262
+
263
+ #ifndef MP_DEPRECATED_PRAGMA
264
+ # define MP_DEPRECATED_PRAGMA(s)
265
+ #endif
266
+
267
+ #define DIGIT_BIT MP_DIGIT_BIT
268
+ #define USED(m) ((m)->used)
269
+ #define DIGIT(m,k) ((m)->dp[(k)])
270
+ #define SIGN(m) ((m)->sign)
271
+
272
+ /* the infamous mp_int structure */
273
+ #ifndef MP_INT_DECLARED
274
+ #define MP_INT_DECLARED
275
+ typedef struct mp_int mp_int;
276
+ #endif
277
+ struct mp_int {
278
+ int used, alloc;
279
+ mp_sign sign;
280
+ mp_digit *dp;
281
+ };
282
+
283
+ /* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
284
+ typedef int private_mp_prime_callback(unsigned char *dst, int len, void *dat);
285
+ typedef private_mp_prime_callback MP_DEPRECATED(mp_rand_source) ltm_prime_callback;
286
+
287
+ /* error code to char* string */
288
+ /*
289
+ const char *mp_error_to_string(mp_err code) MP_WUR;
290
+ */
291
+
292
+ /* ---> init and deinit bignum functions <--- */
293
+ /* init a bignum */
294
+ /*
295
+ mp_err mp_init(mp_int *a) MP_WUR;
296
+ */
297
+
298
+ /* free a bignum */
299
+ /*
300
+ void mp_clear(mp_int *a);
301
+ */
302
+
303
+ /* init a null terminated series of arguments */
304
+ /*
305
+ mp_err mp_init_multi(mp_int *mp, ...) MP_NULL_TERMINATED MP_WUR;
306
+ */
307
+
308
+ /* clear a null terminated series of arguments */
309
+ /*
310
+ void mp_clear_multi(mp_int *mp, ...) MP_NULL_TERMINATED;
311
+ */
312
+
313
+ /* exchange two ints */
314
+ /*
315
+ void mp_exch(mp_int *a, mp_int *b);
316
+ */
317
+
318
+ /* shrink ram required for a bignum */
319
+ /*
320
+ mp_err mp_shrink(mp_int *a) MP_WUR;
321
+ */
322
+
323
+ /* grow an int to a given size */
324
+ /*
325
+ mp_err mp_grow(mp_int *a, int size) MP_WUR;
326
+ */
327
+
328
+ /* init to a given number of digits */
329
+ /*
330
+ mp_err mp_init_size(mp_int *a, int size) MP_WUR;
331
+ */
332
+
333
+ /* ---> Basic Manipulations <--- */
334
+ #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
335
+ #define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
336
+ #define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
337
+ #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
338
+
339
+ /* set to zero */
340
+ /*
341
+ void mp_zero(mp_int *a);
342
+ */
343
+
344
+ /* get and set doubles */
345
+ /*
346
+ double mp_get_double(const mp_int *a) MP_WUR;
347
+ */
348
+ /*
349
+ mp_err mp_set_double(mp_int *a, double b) MP_WUR;
350
+ */
351
+
352
+ /* get integer, set integer and init with integer (int32_t) */
353
+ #ifndef MP_NO_STDINT
354
+ /*
355
+ int32_t mp_get_i32(const mp_int *a) MP_WUR;
356
+ */
357
+ /*
358
+ void mp_set_i32(mp_int *a, int32_t b);
359
+ */
360
+ /*
361
+ mp_err mp_init_i32(mp_int *a, int32_t b) MP_WUR;
362
+ */
363
+
364
+ /* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint32_t) */
365
+ #define mp_get_u32(a) ((uint32_t)mp_get_i32(a))
366
+ /*
367
+ void mp_set_u32(mp_int *a, uint32_t b);
368
+ */
369
+ /*
370
+ mp_err mp_init_u32(mp_int *a, uint32_t b) MP_WUR;
371
+ */
372
+
373
+ /* get integer, set integer and init with integer (int64_t) */
374
+ /*
375
+ int64_t mp_get_i64(const mp_int *a) MP_WUR;
376
+ */
377
+ /*
378
+ void mp_set_i64(mp_int *a, int64_t b);
379
+ */
380
+ /*
381
+ mp_err mp_init_i64(mp_int *a, int64_t b) MP_WUR;
382
+ */
383
+
384
+ /* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint64_t) */
385
+ #define mp_get_u64(a) ((uint64_t)mp_get_i64(a))
386
+ /*
387
+ void mp_set_u64(mp_int *a, uint64_t b);
388
+ */
389
+ /*
390
+ mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR;
391
+ */
392
+
393
+ /* get magnitude */
394
+ /*
395
+ uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR;
396
+ */
397
+ /*
398
+ uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR;
399
+ */
400
+ #endif
401
+ /*
402
+ unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR;
403
+ */
404
+ /*
405
+ Tcl_WideUInt mp_get_mag_ull(const mp_int *a) MP_WUR;
406
+ */
407
+
408
+ /* get integer, set integer (long) */
409
+ /*
410
+ long mp_get_l(const mp_int *a) MP_WUR;
411
+ */
412
+ /*
413
+ void mp_set_l(mp_int *a, long b);
414
+ */
415
+ /*
416
+ mp_err mp_init_l(mp_int *a, long b) MP_WUR;
417
+ */
418
+
419
+ /* get integer, set integer (unsigned long) */
420
+ #define mp_get_ul(a) ((unsigned long)mp_get_l(a))
421
+ /*
422
+ void mp_set_ul(mp_int *a, unsigned long b);
423
+ */
424
+ /*
425
+ mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR;
426
+ */
427
+
428
+ /* get integer, set integer (Tcl_WideInt) */
429
+ /*
430
+ Tcl_WideInt mp_get_ll(const mp_int *a) MP_WUR;
431
+ */
432
+ /*
433
+ void mp_set_ll(mp_int *a, Tcl_WideInt b);
434
+ */
435
+ /*
436
+ mp_err mp_init_ll(mp_int *a, Tcl_WideInt b) MP_WUR;
437
+ */
438
+
439
+ /* get integer, set integer (Tcl_WideUInt) */
440
+ #define mp_get_ull(a) ((Tcl_WideUInt)mp_get_ll(a))
441
+ /*
442
+ void mp_set_ull(mp_int *a, Tcl_WideUInt b);
443
+ */
444
+ /*
445
+ mp_err mp_init_ull(mp_int *a, Tcl_WideUInt b) MP_WUR;
446
+ */
447
+
448
+ /* set to single unsigned digit, up to MP_DIGIT_MAX */
449
+ /*
450
+ void mp_set(mp_int *a, mp_digit b);
451
+ */
452
+ /*
453
+ mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR;
454
+ */
455
+
456
+ /* get integer, set integer and init with integer (deprecated) */
457
+ /*
458
+ MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR;
459
+ */
460
+ /*
461
+ MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR;
462
+ */
463
+ /*
464
+ MP_DEPRECATED(mp_get_mag_ull/mp_get_ull) Tcl_WideUInt mp_get_long_long(const mp_int *a) MP_WUR;
465
+ */
466
+ /*
467
+ MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b);
468
+ */
469
+ /*
470
+ MP_DEPRECATED(mp_set_ul) mp_err mp_set_long(mp_int *a, unsigned long b);
471
+ */
472
+ /*
473
+ MP_DEPRECATED(mp_set_ull) mp_err mp_set_long_long(mp_int *a, Tcl_WideUInt b);
474
+ */
475
+ /*
476
+ MP_DEPRECATED(mp_init_ul) mp_err mp_init_set_int(mp_int *a, unsigned long b) MP_WUR;
477
+ */
478
+
479
+ /* copy, b = a */
480
+ /*
481
+ mp_err mp_copy(const mp_int *a, mp_int *b) MP_WUR;
482
+ */
483
+
484
+ /* inits and copies, a = b */
485
+ /*
486
+ mp_err mp_init_copy(mp_int *a, const mp_int *b) MP_WUR;
487
+ */
488
+
489
+ /* trim unused digits */
490
+ /*
491
+ void mp_clamp(mp_int *a);
492
+ */
493
+
494
+ /* export binary data */
495
+ /*
496
+ MP_DEPRECATED(mp_pack) mp_err mp_export(void *rop, size_t *countp, int order, size_t size,
497
+ int endian, size_t nails, const mp_int *op) MP_WUR;
498
+ */
499
+
500
+ /* import binary data */
501
+ /*
502
+ MP_DEPRECATED(mp_unpack) mp_err mp_import(mp_int *rop, size_t count, int order,
503
+ size_t size, int endian, size_t nails,
504
+ const void *op) MP_WUR;
505
+ */
506
+
507
+ /* unpack binary data */
508
+ /*
509
+ mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian,
510
+ size_t nails, const void *op) MP_WUR;
511
+ */
512
+
513
+ /* pack binary data */
514
+ /*
515
+ size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) MP_WUR;
516
+ */
517
+ /*
518
+ mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size,
519
+ mp_endian endian, size_t nails, const mp_int *op) MP_WUR;
520
+ */
521
+
522
+ /* ---> digit manipulation <--- */
523
+
524
+ /* right shift by "b" digits */
525
+ /*
526
+ void mp_rshd(mp_int *a, int b);
527
+ */
528
+
529
+ /* left shift by "b" digits */
530
+ /*
531
+ mp_err mp_lshd(mp_int *a, int b) MP_WUR;
532
+ */
533
+
534
+ /* c = a / 2**b, implemented as c = a >> b */
535
+ /*
536
+ mp_err mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d) MP_WUR;
537
+ */
538
+
539
+ /* b = a/2 */
540
+ /*
541
+ mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR;
542
+ */
543
+
544
+ /* a/3 => 3c + d == a */
545
+ /*
546
+ mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR;
547
+ */
548
+
549
+ /* c = a * 2**b, implemented as c = a << b */
550
+ /*
551
+ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
552
+ */
553
+
554
+ /* b = a*2 */
555
+ /*
556
+ mp_err mp_mul_2(const mp_int *a, mp_int *b) MP_WUR;
557
+ */
558
+
559
+ /* c = a mod 2**b */
560
+ /*
561
+ mp_err mp_mod_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
562
+ */
563
+
564
+ /* computes a = 2**b */
565
+ /*
566
+ mp_err mp_2expt(mp_int *a, int b) MP_WUR;
567
+ */
568
+
569
+ /* Counts the number of lsbs which are zero before the first zero bit */
570
+ /*
571
+ int mp_cnt_lsb(const mp_int *a) MP_WUR;
572
+ */
573
+
574
+ /* I Love Earth! */
575
+
576
+ /* makes a pseudo-random mp_int of a given size */
577
+ /*
578
+ mp_err mp_rand(mp_int *a, int digits) MP_WUR;
579
+ */
580
+ /* makes a pseudo-random small int of a given size */
581
+ /*
582
+ MP_DEPRECATED(mp_rand) mp_err mp_rand_digit(mp_digit *r) MP_WUR;
583
+ */
584
+ /* use custom random data source instead of source provided the platform */
585
+ /*
586
+ void mp_rand_source(mp_err(*source)(void *out, size_t size));
587
+ */
588
+
589
+ #ifdef MP_PRNG_ENABLE_LTM_RNG
590
+ /* A last resort to provide random data on systems without any of the other
591
+ * implemented ways to gather entropy.
592
+ * It is compatible with `rng_get_bytes()` from libtomcrypt so you could
593
+ * provide that one and then set `ltm_rng = rng_get_bytes;` */
594
+ extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
595
+ extern void (*ltm_rng_callback)(void);
596
+ #endif
597
+
598
+ /* ---> binary operations <--- */
599
+
600
+ /* Checks the bit at position b and returns MP_YES
601
+ * if the bit is 1, MP_NO if it is 0 and MP_VAL
602
+ * in case of error
603
+ */
604
+ /*
605
+ MP_DEPRECATED(s_mp_get_bit) int mp_get_bit(const mp_int *a, int b) MP_WUR;
606
+ */
607
+
608
+ /* c = a XOR b (two complement) */
609
+ /*
610
+ MP_DEPRECATED(mp_xor) mp_err mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
611
+ */
612
+ /*
613
+ mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
614
+ */
615
+
616
+ /* c = a OR b (two complement) */
617
+ /*
618
+ MP_DEPRECATED(mp_or) mp_err mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
619
+ */
620
+ /*
621
+ mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
622
+ */
623
+
624
+ /* c = a AND b (two complement) */
625
+ /*
626
+ MP_DEPRECATED(mp_and) mp_err mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
627
+ */
628
+ /*
629
+ mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
630
+ */
631
+
632
+ /* b = ~a (bitwise not, two complement) */
633
+ /*
634
+ mp_err mp_complement(const mp_int *a, mp_int *b) MP_WUR;
635
+ */
636
+
637
+ /* right shift with sign extension */
638
+ /*
639
+ MP_DEPRECATED(mp_signed_rsh) mp_err mp_tc_div_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
640
+ */
641
+ /*
642
+ mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) MP_WUR;
643
+ */
644
+
645
+ /* ---> Basic arithmetic <--- */
646
+
647
+ /* b = -a */
648
+ /*
649
+ mp_err mp_neg(const mp_int *a, mp_int *b) MP_WUR;
650
+ */
651
+
652
+ /* b = |a| */
653
+ /*
654
+ mp_err mp_abs(const mp_int *a, mp_int *b) MP_WUR;
655
+ */
656
+
657
+ /* compare a to b */
658
+ /*
659
+ mp_ord mp_cmp(const mp_int *a, const mp_int *b) MP_WUR;
660
+ */
661
+
662
+ /* compare |a| to |b| */
663
+ /*
664
+ mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b) MP_WUR;
665
+ */
666
+
667
+ /* c = a + b */
668
+ /*
669
+ mp_err mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
670
+ */
671
+
672
+ /* c = a - b */
673
+ /*
674
+ mp_err mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
675
+ */
676
+
677
+ /* c = a * b */
678
+ /*
679
+ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
680
+ */
681
+
682
+ /* b = a*a */
683
+ /*
684
+ mp_err mp_sqr(const mp_int *a, mp_int *b) MP_WUR;
685
+ */
686
+
687
+ /* a/b => cb + d == a */
688
+ /*
689
+ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) MP_WUR;
690
+ */
691
+
692
+ /* c = a mod b, 0 <= c < b */
693
+ /*
694
+ mp_err mp_mod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
695
+ */
696
+
697
+ /* Increment "a" by one like "a++". Changes input! */
698
+ /*
699
+ mp_err mp_incr(mp_int *a) MP_WUR;
700
+ */
701
+
702
+ /* Decrement "a" by one like "a--". Changes input! */
703
+ /*
704
+ mp_err mp_decr(mp_int *a) MP_WUR;
705
+ */
706
+
707
+ /* ---> single digit functions <--- */
708
+
709
+ /* compare against a single digit */
710
+ /*
711
+ mp_ord mp_cmp_d(const mp_int *a, mp_digit b) MP_WUR;
712
+ */
713
+
714
+ /* c = a + b */
715
+ /*
716
+ mp_err mp_add_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
717
+ */
718
+
719
+ /* c = a - b */
720
+ /*
721
+ mp_err mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
722
+ */
723
+
724
+ /* c = a * b */
725
+ /*
726
+ mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
727
+ */
728
+
729
+ /* a/b => cb + d == a */
730
+ /*
731
+ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) MP_WUR;
732
+ */
733
+
734
+ /* c = a mod b, 0 <= c < b */
735
+ /*
736
+ mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) MP_WUR;
737
+ */
738
+
739
+ /* ---> number theory <--- */
740
+
741
+ /* d = a + b (mod c) */
742
+ /*
743
+ mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
744
+ */
745
+
746
+ /* d = a - b (mod c) */
747
+ /*
748
+ mp_err mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
749
+ */
750
+
751
+ /* d = a * b (mod c) */
752
+ /*
753
+ mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
754
+ */
755
+
756
+ /* c = a * a (mod b) */
757
+ /*
758
+ mp_err mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
759
+ */
760
+
761
+ /* c = 1/a (mod b) */
762
+ /*
763
+ mp_err mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
764
+ */
765
+
766
+ /* c = (a, b) */
767
+ /*
768
+ mp_err mp_gcd(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
769
+ */
770
+
771
+ /* produces value such that U1*a + U2*b = U3 */
772
+ /*
773
+ mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) MP_WUR;
774
+ */
775
+
776
+ /* c = [a, b] or (a*b)/(a, b) */
777
+ /*
778
+ mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
779
+ */
780
+
781
+ /* finds one of the b'th root of a, such that |c|**b <= |a|
782
+ *
783
+ * returns error if a < 0 and b is even
784
+ */
785
+ /*
786
+ mp_err mp_root_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
787
+ */
788
+ /*
789
+ MP_DEPRECATED(mp_root_u32) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
790
+ */
791
+ /*
792
+ MP_DEPRECATED(mp_root_u32) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
793
+ */
794
+
795
+ /* special sqrt algo */
796
+ /*
797
+ mp_err mp_sqrt(const mp_int *arg, mp_int *ret) MP_WUR;
798
+ */
799
+
800
+ /* special sqrt (mod prime) */
801
+ /*
802
+ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret) MP_WUR;
803
+ */
804
+
805
+ /* is number a square? */
806
+ /*
807
+ mp_err mp_is_square(const mp_int *arg, mp_bool *ret) MP_WUR;
808
+ */
809
+
810
+ /* computes the jacobi c = (a | n) (or Legendre if b is prime) */
811
+ /*
812
+ MP_DEPRECATED(mp_kronecker) mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) MP_WUR;
813
+ */
814
+
815
+ /* computes the Kronecker symbol c = (a | p) (like jacobi() but with {a,p} in Z */
816
+ /*
817
+ mp_err mp_kronecker(const mp_int *a, const mp_int *p, int *c) MP_WUR;
818
+ */
819
+
820
+ /* used to setup the Barrett reduction for a given modulus b */
821
+ /*
822
+ mp_err mp_reduce_setup(mp_int *a, const mp_int *b) MP_WUR;
823
+ */
824
+
825
+ /* Barrett Reduction, computes a (mod b) with a precomputed value c
826
+ *
827
+ * Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely
828
+ * compute the reduction as -1 * mp_reduce(mp_abs(x)) [pseudo code].
829
+ */
830
+ /*
831
+ mp_err mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu) MP_WUR;
832
+ */
833
+
834
+ /* setups the montgomery reduction */
835
+ /*
836
+ mp_err mp_montgomery_setup(const mp_int *n, mp_digit *rho) MP_WUR;
837
+ */
838
+
839
+ /* computes a = B**n mod b without division or multiplication useful for
840
+ * normalizing numbers in a Montgomery system.
841
+ */
842
+ /*
843
+ mp_err mp_montgomery_calc_normalization(mp_int *a, const mp_int *b) MP_WUR;
844
+ */
845
+
846
+ /* computes x/R == x (mod N) via Montgomery Reduction */
847
+ /*
848
+ mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) MP_WUR;
849
+ */
850
+
851
+ /* returns 1 if a is a valid DR modulus */
852
+ /*
853
+ mp_bool mp_dr_is_modulus(const mp_int *a) MP_WUR;
854
+ */
855
+
856
+ /* sets the value of "d" required for mp_dr_reduce */
857
+ /*
858
+ void mp_dr_setup(const mp_int *a, mp_digit *d);
859
+ */
860
+
861
+ /* reduces a modulo n using the Diminished Radix method */
862
+ /*
863
+ mp_err mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k) MP_WUR;
864
+ */
865
+
866
+ /* returns true if a can be reduced with mp_reduce_2k */
867
+ /*
868
+ mp_bool mp_reduce_is_2k(const mp_int *a) MP_WUR;
869
+ */
870
+
871
+ /* determines k value for 2k reduction */
872
+ /*
873
+ mp_err mp_reduce_2k_setup(const mp_int *a, mp_digit *d) MP_WUR;
874
+ */
875
+
876
+ /* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
877
+ /*
878
+ mp_err mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d) MP_WUR;
879
+ */
880
+
881
+ /* returns true if a can be reduced with mp_reduce_2k_l */
882
+ /*
883
+ mp_bool mp_reduce_is_2k_l(const mp_int *a) MP_WUR;
884
+ */
885
+
886
+ /* determines k value for 2k reduction */
887
+ /*
888
+ mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) MP_WUR;
889
+ */
890
+
891
+ /* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
892
+ /*
893
+ mp_err mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d) MP_WUR;
894
+ */
895
+
896
+ /* Y = G**X (mod P) */
897
+ /*
898
+ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y) MP_WUR;
899
+ */
900
+
901
+ /* ---> Primes <--- */
902
+
903
+ /* number of primes */
904
+ #ifdef MP_8BIT
905
+ # define PRIVATE_MP_PRIME_TAB_SIZE 31
906
+ #else
907
+ # define PRIVATE_MP_PRIME_TAB_SIZE 256
908
+ #endif
909
+ #define PRIME_SIZE (MP_DEPRECATED_PRAGMA("PRIME_SIZE has been made internal") PRIVATE_MP_PRIME_TAB_SIZE)
910
+
911
+ /* table of first PRIME_SIZE primes */
912
+ #if defined(BUILD_tcl) || !defined(_WIN32)
913
+ MODULE_SCOPE const mp_digit ltm_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE];
914
+ #endif
915
+
916
+ /* result=1 if a is divisible by one of the first PRIME_SIZE primes */
917
+ /*
918
+ MP_DEPRECATED(mp_prime_is_prime) mp_err mp_prime_is_divisible(const mp_int *a, mp_bool *result) MP_WUR;
919
+ */
920
+
921
+ /* performs one Fermat test of "a" using base "b".
922
+ * Sets result to 0 if composite or 1 if probable prime
923
+ */
924
+ /*
925
+ mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
926
+ */
927
+
928
+ /* performs one Miller-Rabin test of "a" using base "b".
929
+ * Sets result to 0 if composite or 1 if probable prime
930
+ */
931
+ /*
932
+ mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
933
+ */
934
+
935
+ /* This gives [for a given bit size] the number of trials required
936
+ * such that Miller-Rabin gives a prob of failure lower than 2^-96
937
+ */
938
+ /*
939
+ int mp_prime_rabin_miller_trials(int size) MP_WUR;
940
+ */
941
+
942
+ /* performs one strong Lucas-Selfridge test of "a".
943
+ * Sets result to 0 if composite or 1 if probable prime
944
+ */
945
+ /*
946
+ mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result) MP_WUR;
947
+ */
948
+
949
+ /* performs one Frobenius test of "a" as described by Paul Underwood.
950
+ * Sets result to 0 if composite or 1 if probable prime
951
+ */
952
+ /*
953
+ mp_err mp_prime_frobenius_underwood(const mp_int *N, mp_bool *result) MP_WUR;
954
+ */
955
+
956
+ /* performs t random rounds of Miller-Rabin on "a" additional to
957
+ * bases 2 and 3. Also performs an initial sieve of trial
958
+ * division. Determines if "a" is prime with probability
959
+ * of error no more than (1/4)**t.
960
+ * Both a strong Lucas-Selfridge to complete the BPSW test
961
+ * and a separate Frobenius test are available at compile time.
962
+ * With t<0 a deterministic test is run for primes up to
963
+ * 318665857834031151167461. With t<13 (abs(t)-13) additional
964
+ * tests with sequential small primes are run starting at 43.
965
+ * Is Fips 186.4 compliant if called with t as computed by
966
+ * mp_prime_rabin_miller_trials();
967
+ *
968
+ * Sets result to 1 if probably prime, 0 otherwise
969
+ */
970
+ /*
971
+ mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result) MP_WUR;
972
+ */
973
+
974
+ /* finds the next prime after the number "a" using "t" trials
975
+ * of Miller-Rabin.
976
+ *
977
+ * bbs_style = 1 means the prime must be congruent to 3 mod 4
978
+ */
979
+ /*
980
+ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style) MP_WUR;
981
+ */
982
+
983
+ /* makes a truly random prime of a given size (bytes),
984
+ * call with bbs = 1 if you want it to be congruent to 3 mod 4
985
+ *
986
+ * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
987
+ * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
988
+ * so it can be NULL
989
+ *
990
+ * The prime generated will be larger than 2^(8*size).
991
+ */
992
+ #define mp_prime_random(a, t, size, bbs, cb, dat) (MP_DEPRECATED_PRAGMA("mp_prime_random has been deprecated, use mp_prime_rand instead") mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?MP_PRIME_BBS:0, cb, dat))
993
+
994
+ /* makes a truly random prime of a given size (bits),
995
+ *
996
+ * Flags are as follows:
997
+ *
998
+ * MP_PRIME_BBS - make prime congruent to 3 mod 4
999
+ * MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS)
1000
+ * MP_PRIME_2MSB_ON - make the 2nd highest bit one
1001
+ *
1002
+ * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
1003
+ * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
1004
+ * so it can be NULL
1005
+ *
1006
+ */
1007
+ /*
1008
+ MP_DEPRECATED(mp_prime_rand) mp_err mp_prime_random_ex(mp_int *a, int t, int size, int flags,
1009
+ private_mp_prime_callback cb, void *dat) MP_WUR;
1010
+ */
1011
+ /*
1012
+ mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) MP_WUR;
1013
+ */
1014
+
1015
+ /* Integer logarithm to integer base */
1016
+ /*
1017
+ mp_err mp_log_u32(const mp_int *a, unsigned int base, unsigned int *c) MP_WUR;
1018
+ */
1019
+
1020
+ /* c = a**b */
1021
+ /*
1022
+ mp_err mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
1023
+ */
1024
+ /*
1025
+ MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
1026
+ */
1027
+ /*
1028
+ MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
1029
+ */
1030
+
1031
+ /* ---> radix conversion <--- */
1032
+ /*
1033
+ int mp_count_bits(const mp_int *a) MP_WUR;
1034
+ */
1035
+
1036
+
1037
+ /*
1038
+ MP_DEPRECATED(mp_ubin_size) int mp_unsigned_bin_size(const mp_int *a) MP_WUR;
1039
+ */
1040
+ /*
1041
+ MP_DEPRECATED(mp_from_ubin) mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
1042
+ */
1043
+ /*
1044
+ MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) MP_WUR;
1045
+ */
1046
+ /*
1047
+ MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
1048
+ */
1049
+
1050
+ /*
1051
+ MP_DEPRECATED(mp_sbin_size) int mp_signed_bin_size(const mp_int *a) MP_WUR;
1052
+ */
1053
+ /*
1054
+ MP_DEPRECATED(mp_from_sbin) mp_err mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
1055
+ */
1056
+ /*
1057
+ MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) MP_WUR;
1058
+ */
1059
+ /*
1060
+ MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
1061
+ */
1062
+
1063
+ /*
1064
+ size_t mp_ubin_size(const mp_int *a) MP_WUR;
1065
+ */
1066
+ /*
1067
+ mp_err mp_from_ubin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
1068
+ */
1069
+ /*
1070
+ mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
1071
+ */
1072
+
1073
+ /*
1074
+ size_t mp_sbin_size(const mp_int *a) MP_WUR;
1075
+ */
1076
+ /*
1077
+ mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
1078
+ */
1079
+ /*
1080
+ mp_err mp_to_sbin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
1081
+ */
1082
+
1083
+ /*
1084
+ mp_err mp_read_radix(mp_int *a, const char *str, int radix) MP_WUR;
1085
+ */
1086
+ /*
1087
+ MP_DEPRECATED(mp_to_radix) mp_err mp_toradix(const mp_int *a, char *str, int radix) MP_WUR;
1088
+ */
1089
+ /*
1090
+ MP_DEPRECATED(mp_to_radix) mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen) MP_WUR;
1091
+ */
1092
+ /*
1093
+ mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR;
1094
+ */
1095
+ /*
1096
+ mp_err mp_radix_size(const mp_int *a, int radix, int *size) MP_WUR;
1097
+ */
1098
+
1099
+ #ifndef MP_NO_FILE
1100
+ /*
1101
+ mp_err mp_fread(mp_int *a, int radix, FILE *stream) MP_WUR;
1102
+ */
1103
+ /*
1104
+ mp_err mp_fwrite(const mp_int *a, int radix, FILE *stream) MP_WUR;
1105
+ */
1106
+ #endif
1107
+
1108
+ #define mp_read_raw(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_signed_bin") mp_read_signed_bin((mp), (str), (len)))
1109
+ #define mp_raw_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_signed_bin_size") mp_signed_bin_size(mp))
1110
+ #define mp_toraw(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_signed_bin") mp_to_signed_bin((mp), (str)))
1111
+ #define mp_read_mag(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_unsigned_bin") mp_read_unsigned_bin((mp), (str), (len))
1112
+ #define mp_mag_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_unsigned_bin_size") mp_unsigned_bin_size(mp))
1113
+ #define mp_tomag(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_unsigned_bin") mp_to_unsigned_bin((mp), (str)))
1114
+
1115
+ #define mp_tobinary(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_binary") mp_toradix((M), (S), 2))
1116
+ #define mp_tooctal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_octal") mp_toradix((M), (S), 8))
1117
+ #define mp_todecimal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_decimal") mp_toradix((M), (S), 10))
1118
+ #define mp_tohex(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_hex") mp_toradix((M), (S), 16))
1119
+
1120
+ #define mp_to_binary(M, S, N) mp_to_radix((M), (S), (N), NULL, 2)
1121
+ #define mp_to_octal(M, S, N) mp_to_radix((M), (S), (N), NULL, 8)
1122
+ #define mp_to_decimal(M, S, N) mp_to_radix((M), (S), (N), NULL, 10)
1123
+ #define mp_to_hex(M, S, N) mp_to_radix((M), (S), (N), NULL, 16)
1124
+
1125
+ #ifdef __cplusplus
1126
+ }
1127
+ #endif
1128
+
1129
+ #include "tclTomMathDecls.h"
1130
+
1131
+ #endif
physworld_p1_20261018/envs/p1/include/tclTomMathDecls.h ADDED
@@ -0,0 +1,669 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *----------------------------------------------------------------------
3
+ *
4
+ * tclTomMathDecls.h --
5
+ *
6
+ * This file contains the declarations for the 'libtommath'
7
+ * functions that are exported by the Tcl library.
8
+ *
9
+ * Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
10
+ *
11
+ * See the file "license.terms" for information on usage and redistribution
12
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
+ */
14
+
15
+ #ifndef _TCLTOMMATHDECLS
16
+ #define _TCLTOMMATHDECLS
17
+
18
+ #include "tcl.h"
19
+ #ifndef BN_H_
20
+ #include "tclTomMath.h"
21
+ #endif
22
+
23
+ /*
24
+ * Define the version of the Stubs table that's exported for tommath
25
+ */
26
+
27
+ #define TCLTOMMATH_EPOCH 0
28
+ #define TCLTOMMATH_REVISION 0
29
+
30
+ #define Tcl_TomMath_InitStubs(interp,version) \
31
+ (TclTomMathInitializeStubs((interp),(version),\
32
+ TCLTOMMATH_EPOCH,TCLTOMMATH_REVISION))
33
+
34
+ /* Define custom memory allocation for libtommath */
35
+
36
+ /* MODULE_SCOPE void* TclBNAlloc( size_t ); */
37
+ #define TclBNAlloc(s) ((void*)ckalloc((size_t)(s)))
38
+ /* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */
39
+ #define TclBNCalloc(m,s) memset(ckalloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s))
40
+ /* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */
41
+ #define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s)))
42
+ /* MODULE_SCOPE void TclBNFree( void* ); */
43
+ #define TclBNFree(x) (ckfree((char*)(x)))
44
+
45
+ #define MP_MALLOC(size) TclBNAlloc(size)
46
+ #define MP_CALLOC(nmemb, size) TclBNCalloc(nmemb, size)
47
+ #define MP_REALLOC(mem, oldsize, newsize) TclBNRealloc(mem, newsize)
48
+ #define MP_FREE(mem, size) TclBNFree(mem)
49
+
50
+
51
+ /* Rename the global symbols in libtommath to avoid linkage conflicts */
52
+
53
+ #define bn_reverse TclBN_reverse
54
+ #define mp_add TclBN_mp_add
55
+ #define mp_add_d TclBN_mp_add_d
56
+ #define mp_and TclBN_mp_and
57
+ #define mp_clamp TclBN_mp_clamp
58
+ #define mp_clear TclBN_mp_clear
59
+ #define mp_clear_multi TclBN_mp_clear_multi
60
+ #define mp_cmp TclBN_mp_cmp
61
+ #define mp_cmp_d TclBN_mp_cmp_d
62
+ #define mp_cmp_mag TclBN_mp_cmp_mag
63
+ #define mp_cnt_lsb TclBN_mp_cnt_lsb
64
+ #define mp_copy TclBN_mp_copy
65
+ #define mp_count_bits TclBN_mp_count_bits
66
+ #define mp_div TclBN_mp_div
67
+ #define mp_div_2 TclBN_mp_div_2
68
+ #define mp_div_2d TclBN_mp_div_2d
69
+ #define mp_div_3 TclBN_mp_div_3
70
+ #define mp_div_d TclBN_mp_div_d
71
+ #define mp_exch TclBN_mp_exch
72
+ #define mp_expt_d TclBN_mp_expt_d
73
+ #define mp_expt_d_ex TclBN_mp_expt_d_ex
74
+ #define mp_expt_u32 TclBN_mp_expt_d
75
+ #define mp_get_mag_ull TclBN_mp_get_mag_ull
76
+ #define mp_grow TclBN_mp_grow
77
+ #define mp_init TclBN_mp_init
78
+ #define mp_init_copy TclBN_mp_init_copy
79
+ #define mp_init_multi TclBN_mp_init_multi
80
+ #define mp_init_set TclBN_mp_init_set
81
+ #define mp_init_set_int TclBN_mp_init_set_int
82
+ #define mp_init_size TclBN_mp_init_size
83
+ #define mp_lshd TclBN_mp_lshd
84
+ #define mp_mod TclBN_mp_mod
85
+ #define mp_mod_2d TclBN_mp_mod_2d
86
+ #define mp_mul TclBN_mp_mul
87
+ #define mp_mul_2 TclBN_mp_mul_2
88
+ #define mp_mul_2d TclBN_mp_mul_2d
89
+ #define mp_mul_d TclBN_mp_mul_d
90
+ #define mp_neg TclBN_mp_neg
91
+ #define mp_or TclBN_mp_or
92
+ #define mp_radix_size TclBN_mp_radix_size
93
+ #define mp_read_radix TclBN_mp_read_radix
94
+ #define mp_rshd TclBN_mp_rshd
95
+ #define mp_set TclBN_mp_set
96
+ #define mp_set_int(a,b) (TclBN_mp_set_int(a,(unsigned int)(b)),MP_OKAY)
97
+ #define mp_set_ll TclBN_mp_set_ll
98
+ #define mp_set_long(a,b) (TclBN_mp_set_int(a,b),MP_OKAY)
99
+ #define mp_set_ul(a,b) (void)TclBN_mp_set_int(a,b)
100
+ #define mp_set_ull TclBN_mp_set_ull
101
+ #define mp_set_u64 TclBN_mp_set_ull
102
+ #define mp_shrink TclBN_mp_shrink
103
+ #define mp_sqr TclBN_mp_sqr
104
+ #define mp_sqrt TclBN_mp_sqrt
105
+ #define mp_sub TclBN_mp_sub
106
+ #define mp_sub_d TclBN_mp_sub_d
107
+ #define mp_signed_rsh TclBN_mp_signed_rsh
108
+ #define mp_tc_and TclBN_mp_and
109
+ #define mp_tc_div_2d TclBN_mp_signed_rsh
110
+ #define mp_tc_or TclBN_mp_or
111
+ #define mp_tc_xor TclBN_mp_xor
112
+ #define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
113
+ #define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
114
+ #define mp_toradix_n TclBN_mp_toradix_n
115
+ #define mp_to_radix TclBN_mp_to_radix
116
+ #define mp_to_ubin TclBN_mp_to_ubin
117
+ #define mp_ubin_size TclBN_mp_unsigned_bin_size
118
+ #define mp_unsigned_bin_size(a) ((int)TclBN_mp_unsigned_bin_size(a))
119
+ #define mp_xor TclBN_mp_xor
120
+ #define mp_zero TclBN_mp_zero
121
+ #define s_mp_add TclBN_s_mp_add
122
+ #define s_mp_balance_mul TclBN_mp_balance_mul
123
+ #define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul
124
+ #define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
125
+ #define s_mp_mul_digs TclBN_s_mp_mul_digs
126
+ #define s_mp_mul_digs_fast TclBN_fast_s_mp_mul_digs
127
+ #define s_mp_reverse TclBN_s_mp_reverse
128
+ #define s_mp_sqr TclBN_s_mp_sqr
129
+ #define s_mp_sqr_fast TclBN_fast_s_mp_sqr
130
+ #define s_mp_sub TclBN_s_mp_sub
131
+ #define s_mp_toom_mul TclBN_mp_toom_mul
132
+ #define s_mp_toom_sqr TclBN_mp_toom_sqr
133
+
134
+ #undef TCL_STORAGE_CLASS
135
+ #ifdef BUILD_tcl
136
+ # define TCL_STORAGE_CLASS DLLEXPORT
137
+ #else
138
+ # ifdef USE_TCL_STUBS
139
+ # define TCL_STORAGE_CLASS
140
+ # else
141
+ # define TCL_STORAGE_CLASS DLLIMPORT
142
+ # endif
143
+ #endif
144
+
145
+ /*
146
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
147
+ * script. Any modifications to the function declarations below should be made
148
+ * in the generic/tclInt.decls script.
149
+ */
150
+
151
+ /* !BEGIN!: Do not edit below this line. */
152
+
153
+ #ifdef __cplusplus
154
+ extern "C" {
155
+ #endif
156
+
157
+ /*
158
+ * Exported function declarations:
159
+ */
160
+
161
+ /* 0 */
162
+ EXTERN int TclBN_epoch(void);
163
+ /* 1 */
164
+ EXTERN int TclBN_revision(void);
165
+ /* 2 */
166
+ EXTERN mp_err TclBN_mp_add(const mp_int *a, const mp_int *b,
167
+ mp_int *c);
168
+ /* 3 */
169
+ EXTERN mp_err TclBN_mp_add_d(const mp_int *a, mp_digit b,
170
+ mp_int *c);
171
+ /* 4 */
172
+ EXTERN mp_err TclBN_mp_and(const mp_int *a, const mp_int *b,
173
+ mp_int *c);
174
+ /* 5 */
175
+ EXTERN void TclBN_mp_clamp(mp_int *a);
176
+ /* 6 */
177
+ EXTERN void TclBN_mp_clear(mp_int *a);
178
+ /* 7 */
179
+ EXTERN void TclBN_mp_clear_multi(mp_int *a, ...);
180
+ /* 8 */
181
+ EXTERN mp_ord TclBN_mp_cmp(const mp_int *a, const mp_int *b);
182
+ /* 9 */
183
+ EXTERN mp_ord TclBN_mp_cmp_d(const mp_int *a, mp_digit b);
184
+ /* 10 */
185
+ EXTERN mp_ord TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b);
186
+ /* 11 */
187
+ EXTERN mp_err TclBN_mp_copy(const mp_int *a, mp_int *b);
188
+ /* 12 */
189
+ EXTERN int TclBN_mp_count_bits(const mp_int *a);
190
+ /* 13 */
191
+ EXTERN mp_err TclBN_mp_div(const mp_int *a, const mp_int *b,
192
+ mp_int *q, mp_int *r);
193
+ /* 14 */
194
+ EXTERN mp_err TclBN_mp_div_d(const mp_int *a, mp_digit b,
195
+ mp_int *q, mp_digit *r);
196
+ /* 15 */
197
+ EXTERN mp_err TclBN_mp_div_2(const mp_int *a, mp_int *q);
198
+ /* 16 */
199
+ EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
200
+ mp_int *r);
201
+ /* 17 */
202
+ EXTERN mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q,
203
+ mp_digit *r);
204
+ /* 18 */
205
+ EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
206
+ /* 19 */
207
+ EXTERN mp_err TclBN_mp_expt_d(const mp_int *a, unsigned int b,
208
+ mp_int *c);
209
+ /* 20 */
210
+ EXTERN mp_err TclBN_mp_grow(mp_int *a, int size);
211
+ /* 21 */
212
+ EXTERN mp_err TclBN_mp_init(mp_int *a);
213
+ /* 22 */
214
+ EXTERN mp_err TclBN_mp_init_copy(mp_int *a, const mp_int *b);
215
+ /* 23 */
216
+ EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...);
217
+ /* 24 */
218
+ EXTERN mp_err TclBN_mp_init_set(mp_int *a, mp_digit b);
219
+ /* 25 */
220
+ EXTERN mp_err TclBN_mp_init_size(mp_int *a, int size);
221
+ /* 26 */
222
+ EXTERN mp_err TclBN_mp_lshd(mp_int *a, int shift);
223
+ /* 27 */
224
+ EXTERN mp_err TclBN_mp_mod(const mp_int *a, const mp_int *b,
225
+ mp_int *r);
226
+ /* 28 */
227
+ EXTERN mp_err TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r);
228
+ /* 29 */
229
+ EXTERN mp_err TclBN_mp_mul(const mp_int *a, const mp_int *b,
230
+ mp_int *p);
231
+ /* 30 */
232
+ EXTERN mp_err TclBN_mp_mul_d(const mp_int *a, mp_digit b,
233
+ mp_int *p);
234
+ /* 31 */
235
+ EXTERN mp_err TclBN_mp_mul_2(const mp_int *a, mp_int *p);
236
+ /* 32 */
237
+ EXTERN mp_err TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p);
238
+ /* 33 */
239
+ EXTERN mp_err TclBN_mp_neg(const mp_int *a, mp_int *b);
240
+ /* 34 */
241
+ EXTERN mp_err TclBN_mp_or(const mp_int *a, const mp_int *b,
242
+ mp_int *c);
243
+ /* 35 */
244
+ EXTERN mp_err TclBN_mp_radix_size(const mp_int *a, int radix,
245
+ int *size);
246
+ /* 36 */
247
+ EXTERN mp_err TclBN_mp_read_radix(mp_int *a, const char *str,
248
+ int radix);
249
+ /* 37 */
250
+ EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
251
+ /* 38 */
252
+ EXTERN mp_err TclBN_mp_shrink(mp_int *a);
253
+ /* 39 */
254
+ EXTERN void TclBN_mp_set(mp_int *a, mp_digit b);
255
+ /* 40 */
256
+ EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
257
+ /* 41 */
258
+ EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b);
259
+ /* 42 */
260
+ EXTERN mp_err TclBN_mp_sub(const mp_int *a, const mp_int *b,
261
+ mp_int *c);
262
+ /* 43 */
263
+ EXTERN mp_err TclBN_mp_sub_d(const mp_int *a, mp_digit b,
264
+ mp_int *c);
265
+ /* 44 */
266
+ EXTERN mp_err TclBN_mp_to_unsigned_bin(const mp_int *a,
267
+ unsigned char *b);
268
+ /* 45 */
269
+ EXTERN mp_err TclBN_mp_to_unsigned_bin_n(const mp_int *a,
270
+ unsigned char *b, unsigned long *outlen);
271
+ /* 46 */
272
+ EXTERN mp_err TclBN_mp_toradix_n(const mp_int *a, char *str,
273
+ int radix, int maxlen);
274
+ /* 47 */
275
+ EXTERN size_t TclBN_mp_unsigned_bin_size(const mp_int *a);
276
+ /* 48 */
277
+ EXTERN mp_err TclBN_mp_xor(const mp_int *a, const mp_int *b,
278
+ mp_int *c);
279
+ /* 49 */
280
+ EXTERN void TclBN_mp_zero(mp_int *a);
281
+ /* 50 */
282
+ EXTERN void TclBN_reverse(unsigned char *s, int len);
283
+ /* 51 */
284
+ EXTERN mp_err TclBN_fast_s_mp_mul_digs(const mp_int *a,
285
+ const mp_int *b, mp_int *c, int digs);
286
+ /* 52 */
287
+ EXTERN mp_err TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b);
288
+ /* 53 */
289
+ EXTERN mp_err TclBN_mp_karatsuba_mul(const mp_int *a,
290
+ const mp_int *b, mp_int *c);
291
+ /* 54 */
292
+ EXTERN mp_err TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
293
+ /* 55 */
294
+ EXTERN mp_err TclBN_mp_toom_mul(const mp_int *a, const mp_int *b,
295
+ mp_int *c);
296
+ /* 56 */
297
+ EXTERN mp_err TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
298
+ /* 57 */
299
+ EXTERN mp_err TclBN_s_mp_add(const mp_int *a, const mp_int *b,
300
+ mp_int *c);
301
+ /* 58 */
302
+ EXTERN mp_err TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b,
303
+ mp_int *c, int digs);
304
+ /* 59 */
305
+ EXTERN mp_err TclBN_s_mp_sqr(const mp_int *a, mp_int *b);
306
+ /* 60 */
307
+ EXTERN mp_err TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
308
+ mp_int *c);
309
+ /* 61 */
310
+ EXTERN mp_err TclBN_mp_init_set_int(mp_int *a, unsigned long i);
311
+ /* 62 */
312
+ EXTERN mp_err TclBN_mp_set_int(mp_int *a, unsigned long i);
313
+ /* 63 */
314
+ EXTERN int TclBN_mp_cnt_lsb(const mp_int *a);
315
+ /* 64 */
316
+ EXTERN int TclBNInitBignumFromLong(mp_int *bignum, long initVal);
317
+ /* 65 */
318
+ EXTERN int TclBNInitBignumFromWideInt(mp_int *bignum,
319
+ Tcl_WideInt initVal);
320
+ /* 66 */
321
+ EXTERN int TclBNInitBignumFromWideUInt(mp_int *bignum,
322
+ Tcl_WideUInt initVal);
323
+ /* 67 */
324
+ EXTERN mp_err TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
325
+ mp_int *c, int fast);
326
+ /* 68 */
327
+ EXTERN void TclBN_mp_set_ull(mp_int *a, Tcl_WideUInt i);
328
+ /* 69 */
329
+ EXTERN Tcl_WideUInt TclBN_mp_get_mag_ull(const mp_int *a);
330
+ /* 70 */
331
+ EXTERN void TclBN_mp_set_ll(mp_int *a, Tcl_WideInt i);
332
+ /* Slot 71 is reserved */
333
+ /* Slot 72 is reserved */
334
+ /* 73 */
335
+ EXTERN mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
336
+ mp_int *c);
337
+ /* 74 */
338
+ EXTERN mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b,
339
+ mp_int *c);
340
+ /* 75 */
341
+ EXTERN mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b,
342
+ mp_int *c);
343
+ /* 76 */
344
+ EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b,
345
+ mp_int *c);
346
+ /* Slot 77 is reserved */
347
+ /* 78 */
348
+ EXTERN int TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf,
349
+ size_t maxlen, size_t *written);
350
+ /* 79 */
351
+ EXTERN mp_err TclBN_mp_div_ld(const mp_int *a, Tcl_WideUInt b,
352
+ mp_int *q, Tcl_WideUInt *r);
353
+ /* 80 */
354
+ EXTERN int TclBN_mp_to_radix(const mp_int *a, char *str,
355
+ size_t maxlen, size_t *written, int radix);
356
+
357
+ typedef struct TclTomMathStubs {
358
+ int magic;
359
+ void *hooks;
360
+
361
+ int (*tclBN_epoch) (void); /* 0 */
362
+ int (*tclBN_revision) (void); /* 1 */
363
+ mp_err (*tclBN_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 2 */
364
+ mp_err (*tclBN_mp_add_d) (const mp_int *a, mp_digit b, mp_int *c); /* 3 */
365
+ mp_err (*tclBN_mp_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 4 */
366
+ void (*tclBN_mp_clamp) (mp_int *a); /* 5 */
367
+ void (*tclBN_mp_clear) (mp_int *a); /* 6 */
368
+ void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */
369
+ mp_ord (*tclBN_mp_cmp) (const mp_int *a, const mp_int *b); /* 8 */
370
+ mp_ord (*tclBN_mp_cmp_d) (const mp_int *a, mp_digit b); /* 9 */
371
+ mp_ord (*tclBN_mp_cmp_mag) (const mp_int *a, const mp_int *b); /* 10 */
372
+ mp_err (*tclBN_mp_copy) (const mp_int *a, mp_int *b); /* 11 */
373
+ int (*tclBN_mp_count_bits) (const mp_int *a); /* 12 */
374
+ mp_err (*tclBN_mp_div) (const mp_int *a, const mp_int *b, mp_int *q, mp_int *r); /* 13 */
375
+ mp_err (*tclBN_mp_div_d) (const mp_int *a, mp_digit b, mp_int *q, mp_digit *r); /* 14 */
376
+ mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q); /* 15 */
377
+ mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r); /* 16 */
378
+ mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, mp_digit *r); /* 17 */
379
+ void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
380
+ mp_err (*tclBN_mp_expt_d) (const mp_int *a, unsigned int b, mp_int *c); /* 19 */
381
+ mp_err (*tclBN_mp_grow) (mp_int *a, int size); /* 20 */
382
+ mp_err (*tclBN_mp_init) (mp_int *a); /* 21 */
383
+ mp_err (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b); /* 22 */
384
+ mp_err (*tclBN_mp_init_multi) (mp_int *a, ...); /* 23 */
385
+ mp_err (*tclBN_mp_init_set) (mp_int *a, mp_digit b); /* 24 */
386
+ mp_err (*tclBN_mp_init_size) (mp_int *a, int size); /* 25 */
387
+ mp_err (*tclBN_mp_lshd) (mp_int *a, int shift); /* 26 */
388
+ mp_err (*tclBN_mp_mod) (const mp_int *a, const mp_int *b, mp_int *r); /* 27 */
389
+ mp_err (*tclBN_mp_mod_2d) (const mp_int *a, int b, mp_int *r); /* 28 */
390
+ mp_err (*tclBN_mp_mul) (const mp_int *a, const mp_int *b, mp_int *p); /* 29 */
391
+ mp_err (*tclBN_mp_mul_d) (const mp_int *a, mp_digit b, mp_int *p); /* 30 */
392
+ mp_err (*tclBN_mp_mul_2) (const mp_int *a, mp_int *p); /* 31 */
393
+ mp_err (*tclBN_mp_mul_2d) (const mp_int *a, int d, mp_int *p); /* 32 */
394
+ mp_err (*tclBN_mp_neg) (const mp_int *a, mp_int *b); /* 33 */
395
+ mp_err (*tclBN_mp_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 34 */
396
+ mp_err (*tclBN_mp_radix_size) (const mp_int *a, int radix, int *size); /* 35 */
397
+ mp_err (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix); /* 36 */
398
+ void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
399
+ mp_err (*tclBN_mp_shrink) (mp_int *a); /* 38 */
400
+ void (*tclBN_mp_set) (mp_int *a, mp_digit b); /* 39 */
401
+ mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b); /* 40 */
402
+ mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b); /* 41 */
403
+ mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 42 */
404
+ mp_err (*tclBN_mp_sub_d) (const mp_int *a, mp_digit b, mp_int *c); /* 43 */
405
+ mp_err (*tclBN_mp_to_unsigned_bin) (const mp_int *a, unsigned char *b); /* 44 */
406
+ mp_err (*tclBN_mp_to_unsigned_bin_n) (const mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
407
+ mp_err (*tclBN_mp_toradix_n) (const mp_int *a, char *str, int radix, int maxlen); /* 46 */
408
+ size_t (*tclBN_mp_unsigned_bin_size) (const mp_int *a); /* 47 */
409
+ mp_err (*tclBN_mp_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 48 */
410
+ void (*tclBN_mp_zero) (mp_int *a); /* 49 */
411
+ void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
412
+ mp_err (*tclBN_fast_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 51 */
413
+ mp_err (*tclBN_fast_s_mp_sqr) (const mp_int *a, mp_int *b); /* 52 */
414
+ mp_err (*tclBN_mp_karatsuba_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 53 */
415
+ mp_err (*tclBN_mp_karatsuba_sqr) (const mp_int *a, mp_int *b); /* 54 */
416
+ mp_err (*tclBN_mp_toom_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 55 */
417
+ mp_err (*tclBN_mp_toom_sqr) (const mp_int *a, mp_int *b); /* 56 */
418
+ mp_err (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
419
+ mp_err (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
420
+ mp_err (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
421
+ mp_err (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
422
+ mp_err (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
423
+ mp_err (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
424
+ int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
425
+ int (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
426
+ int (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
427
+ int (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
428
+ mp_err (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
429
+ void (*tclBN_mp_set_ull) (mp_int *a, Tcl_WideUInt i); /* 68 */
430
+ Tcl_WideUInt (*tclBN_mp_get_mag_ull) (const mp_int *a); /* 69 */
431
+ void (*tclBN_mp_set_ll) (mp_int *a, Tcl_WideInt i); /* 70 */
432
+ void (*reserved71)(void);
433
+ void (*reserved72)(void);
434
+ mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
435
+ mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */
436
+ mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */
437
+ mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c); /* 76 */
438
+ void (*reserved77)(void);
439
+ int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written); /* 78 */
440
+ mp_err (*tclBN_mp_div_ld) (const mp_int *a, Tcl_WideUInt b, mp_int *q, Tcl_WideUInt *r); /* 79 */
441
+ int (*tclBN_mp_to_radix) (const mp_int *a, char *str, size_t maxlen, size_t *written, int radix); /* 80 */
442
+ } TclTomMathStubs;
443
+
444
+ extern const TclTomMathStubs *tclTomMathStubsPtr;
445
+
446
+ #ifdef __cplusplus
447
+ }
448
+ #endif
449
+
450
+ #if defined(USE_TCL_STUBS)
451
+
452
+ /*
453
+ * Inline function declarations:
454
+ */
455
+
456
+ #define TclBN_epoch \
457
+ (tclTomMathStubsPtr->tclBN_epoch) /* 0 */
458
+ #define TclBN_revision \
459
+ (tclTomMathStubsPtr->tclBN_revision) /* 1 */
460
+ #define TclBN_mp_add \
461
+ (tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
462
+ #define TclBN_mp_add_d \
463
+ (tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
464
+ #define TclBN_mp_and \
465
+ (tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
466
+ #define TclBN_mp_clamp \
467
+ (tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
468
+ #define TclBN_mp_clear \
469
+ (tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
470
+ #define TclBN_mp_clear_multi \
471
+ (tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
472
+ #define TclBN_mp_cmp \
473
+ (tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
474
+ #define TclBN_mp_cmp_d \
475
+ (tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
476
+ #define TclBN_mp_cmp_mag \
477
+ (tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
478
+ #define TclBN_mp_copy \
479
+ (tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
480
+ #define TclBN_mp_count_bits \
481
+ (tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
482
+ #define TclBN_mp_div \
483
+ (tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
484
+ #define TclBN_mp_div_d \
485
+ (tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
486
+ #define TclBN_mp_div_2 \
487
+ (tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
488
+ #define TclBN_mp_div_2d \
489
+ (tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
490
+ #define TclBN_mp_div_3 \
491
+ (tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
492
+ #define TclBN_mp_exch \
493
+ (tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
494
+ #define TclBN_mp_expt_d \
495
+ (tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
496
+ #define TclBN_mp_grow \
497
+ (tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
498
+ #define TclBN_mp_init \
499
+ (tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
500
+ #define TclBN_mp_init_copy \
501
+ (tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
502
+ #define TclBN_mp_init_multi \
503
+ (tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
504
+ #define TclBN_mp_init_set \
505
+ (tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
506
+ #define TclBN_mp_init_size \
507
+ (tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
508
+ #define TclBN_mp_lshd \
509
+ (tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
510
+ #define TclBN_mp_mod \
511
+ (tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
512
+ #define TclBN_mp_mod_2d \
513
+ (tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
514
+ #define TclBN_mp_mul \
515
+ (tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
516
+ #define TclBN_mp_mul_d \
517
+ (tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
518
+ #define TclBN_mp_mul_2 \
519
+ (tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
520
+ #define TclBN_mp_mul_2d \
521
+ (tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
522
+ #define TclBN_mp_neg \
523
+ (tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
524
+ #define TclBN_mp_or \
525
+ (tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
526
+ #define TclBN_mp_radix_size \
527
+ (tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
528
+ #define TclBN_mp_read_radix \
529
+ (tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
530
+ #define TclBN_mp_rshd \
531
+ (tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
532
+ #define TclBN_mp_shrink \
533
+ (tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
534
+ #define TclBN_mp_set \
535
+ (tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
536
+ #define TclBN_mp_sqr \
537
+ (tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
538
+ #define TclBN_mp_sqrt \
539
+ (tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
540
+ #define TclBN_mp_sub \
541
+ (tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
542
+ #define TclBN_mp_sub_d \
543
+ (tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
544
+ #define TclBN_mp_to_unsigned_bin \
545
+ (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
546
+ #define TclBN_mp_to_unsigned_bin_n \
547
+ (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin_n) /* 45 */
548
+ #define TclBN_mp_toradix_n \
549
+ (tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
550
+ #define TclBN_mp_unsigned_bin_size \
551
+ (tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
552
+ #define TclBN_mp_xor \
553
+ (tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
554
+ #define TclBN_mp_zero \
555
+ (tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
556
+ #define TclBN_reverse \
557
+ (tclTomMathStubsPtr->tclBN_reverse) /* 50 */
558
+ #define TclBN_fast_s_mp_mul_digs \
559
+ (tclTomMathStubsPtr->tclBN_fast_s_mp_mul_digs) /* 51 */
560
+ #define TclBN_fast_s_mp_sqr \
561
+ (tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
562
+ #define TclBN_mp_karatsuba_mul \
563
+ (tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
564
+ #define TclBN_mp_karatsuba_sqr \
565
+ (tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
566
+ #define TclBN_mp_toom_mul \
567
+ (tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
568
+ #define TclBN_mp_toom_sqr \
569
+ (tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
570
+ #define TclBN_s_mp_add \
571
+ (tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
572
+ #define TclBN_s_mp_mul_digs \
573
+ (tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
574
+ #define TclBN_s_mp_sqr \
575
+ (tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
576
+ #define TclBN_s_mp_sub \
577
+ (tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
578
+ #define TclBN_mp_init_set_int \
579
+ (tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
580
+ #define TclBN_mp_set_int \
581
+ (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
582
+ #define TclBN_mp_cnt_lsb \
583
+ (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
584
+ #define TclBNInitBignumFromLong \
585
+ (tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
586
+ #define TclBNInitBignumFromWideInt \
587
+ (tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
588
+ #define TclBNInitBignumFromWideUInt \
589
+ (tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
590
+ #define TclBN_mp_expt_d_ex \
591
+ (tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
592
+ #define TclBN_mp_set_ull \
593
+ (tclTomMathStubsPtr->tclBN_mp_set_ull) /* 68 */
594
+ #define TclBN_mp_get_mag_ull \
595
+ (tclTomMathStubsPtr->tclBN_mp_get_mag_ull) /* 69 */
596
+ #define TclBN_mp_set_ll \
597
+ (tclTomMathStubsPtr->tclBN_mp_set_ll) /* 70 */
598
+ /* Slot 71 is reserved */
599
+ /* Slot 72 is reserved */
600
+ #define TclBN_mp_tc_and \
601
+ (tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */
602
+ #define TclBN_mp_tc_or \
603
+ (tclTomMathStubsPtr->tclBN_mp_tc_or) /* 74 */
604
+ #define TclBN_mp_tc_xor \
605
+ (tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */
606
+ #define TclBN_mp_signed_rsh \
607
+ (tclTomMathStubsPtr->tclBN_mp_signed_rsh) /* 76 */
608
+ /* Slot 77 is reserved */
609
+ #define TclBN_mp_to_ubin \
610
+ (tclTomMathStubsPtr->tclBN_mp_to_ubin) /* 78 */
611
+ #define TclBN_mp_div_ld \
612
+ (tclTomMathStubsPtr->tclBN_mp_div_ld) /* 79 */
613
+ #define TclBN_mp_to_radix \
614
+ (tclTomMathStubsPtr->tclBN_mp_to_radix) /* 80 */
615
+
616
+ #endif /* defined(USE_TCL_STUBS) */
617
+
618
+ /* !END!: Do not edit above this line. */
619
+
620
+ #undef TCL_STORAGE_CLASS
621
+ #define TCL_STORAGE_CLASS DLLIMPORT
622
+
623
+ #ifdef USE_TCL_STUBS
624
+ #undef TclBNInitBignumFromLong
625
+ #define TclBNInitBignumFromLong(a,b) \
626
+ do { \
627
+ (a)->dp = NULL; \
628
+ (void)tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)); \
629
+ if ((a)->dp == NULL) { \
630
+ Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); \
631
+ } \
632
+ } while (0)
633
+ #undef TclBNInitBignumFromWideInt
634
+ #define TclBNInitBignumFromWideInt(a,b) \
635
+ do { \
636
+ (a)->dp = NULL; \
637
+ (void)tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)); \
638
+ if ((a)->dp == NULL) { \
639
+ Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt"); \
640
+ } \
641
+ } while (0)
642
+ #undef TclBNInitBignumFromWideUInt
643
+ #define TclBNInitBignumFromWideUInt(a,b) \
644
+ do { \
645
+ (a)->dp = NULL; \
646
+ (void)tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)); \
647
+ if ((a)->dp == NULL) { \
648
+ Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); \
649
+ } \
650
+ } while (0)
651
+ #define mp_init_i32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
652
+ #define mp_init_l(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
653
+ #define mp_init_ll(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
654
+ #define mp_init_i64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
655
+ #define mp_init_u32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
656
+ #define mp_init_ul(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
657
+ #define mp_init_ull(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
658
+ #define mp_init_u64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
659
+ #else
660
+ #define mp_init_i32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
661
+ #define mp_init_l(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
662
+ #define mp_init_ll(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
663
+ #define mp_init_i64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
664
+ #define mp_init_u32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
665
+ #define mp_init_ul(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
666
+ #define mp_init_ull(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
667
+ #define mp_init_u64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
668
+ #endif /* USE_TCL_STUBS */
669
+ #endif /* _TCLINTDECLS */
physworld_p1_20261018/envs/p1/include/tclUnixPort.h ADDED
@@ -0,0 +1,742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tclUnixPort.h --
3
+ *
4
+ * This header file handles porting issues that occur because of
5
+ * differences between systems. It reads in UNIX-related header files and
6
+ * sets up UNIX-related macros for Tcl's UNIX core. It should be the only
7
+ * file that contains #ifdefs to handle different flavors of UNIX. This
8
+ * file sets up the union of all UNIX-related things needed by any of the
9
+ * Tcl core files. This file depends on configuration #defines such as
10
+ * NO_DIRENT_H that are set up by the "configure" script.
11
+ *
12
+ * Much of the material in this file was originally contributed by Karl
13
+ * Lehenbauer, Mark Diekhans and Peter da Silva.
14
+ *
15
+ * Copyright (c) 1991-1994 The Regents of the University of California.
16
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
17
+ *
18
+ * See the file "license.terms" for information on usage and redistribution of
19
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
20
+ */
21
+
22
+ #ifndef _TCLUNIXPORT
23
+ #define _TCLUNIXPORT
24
+
25
+ /*
26
+ *---------------------------------------------------------------------------
27
+ * The following sets of #includes and #ifdefs are required to get Tcl to
28
+ * compile under the various flavors of unix.
29
+ *---------------------------------------------------------------------------
30
+ */
31
+
32
+ #include <errno.h>
33
+ #include <fcntl.h>
34
+ #ifdef HAVE_NET_ERRNO_H
35
+ # include <net/errno.h>
36
+ #endif
37
+ #include <pwd.h>
38
+ #include <signal.h>
39
+ #ifdef HAVE_SYS_PARAM_H
40
+ # include <sys/param.h>
41
+ #endif
42
+ #include <sys/types.h>
43
+ #ifdef USE_DIRENT2_H
44
+ # include "../compat/dirent2.h"
45
+ #else
46
+ #ifdef NO_DIRENT_H
47
+ # include "../compat/dirent.h"
48
+ #else
49
+ # include <dirent.h>
50
+ #endif
51
+ #endif
52
+
53
+ /*
54
+ *---------------------------------------------------------------------------
55
+ * Parameterize for 64-bit filesystem support.
56
+ *---------------------------------------------------------------------------
57
+ */
58
+
59
+ #ifdef HAVE_STRUCT_DIRENT64
60
+ typedef struct dirent64 Tcl_DirEntry;
61
+ # define TclOSreaddir readdir64
62
+ #else
63
+ typedef struct dirent Tcl_DirEntry;
64
+ # define TclOSreaddir readdir
65
+ #endif
66
+ #ifdef HAVE_DIR64
67
+ typedef DIR64 TclDIR;
68
+ # define TclOSopendir opendir64
69
+ # define TclOSrewinddir rewinddir64
70
+ # define TclOSclosedir closedir64
71
+ #else
72
+ typedef DIR TclDIR;
73
+ # define TclOSopendir opendir
74
+ # define TclOSrewinddir rewinddir
75
+ # define TclOSclosedir closedir
76
+ #endif
77
+
78
+ #ifdef HAVE_TYPE_OFF64_T
79
+ typedef off64_t Tcl_SeekOffset;
80
+ # define TclOSseek lseek64
81
+ # define TclOSopen open64
82
+ #else
83
+ typedef off_t Tcl_SeekOffset;
84
+ # define TclOSseek lseek
85
+ # define TclOSopen open
86
+ #endif
87
+
88
+ #ifdef __CYGWIN__
89
+ #ifdef __cplusplus
90
+ extern "C" {
91
+ #endif
92
+ /* Make some symbols available without including <windows.h> */
93
+ # define DWORD unsigned int
94
+ # define CP_UTF8 65001
95
+ # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
96
+ # define HANDLE void *
97
+ # define HINSTANCE void *
98
+ # define SOCKET unsigned int
99
+ # define WSAEWOULDBLOCK 10035
100
+ typedef unsigned short WCHAR;
101
+ #ifdef __clang__
102
+ #pragma clang diagnostic push
103
+ #pragma clang diagnostic ignored "-Wignored-attributes"
104
+ #endif
105
+ __declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *);
106
+ __declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int);
107
+ __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int,
108
+ char *, int, const char *, void *);
109
+ __declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int,
110
+ WCHAR *, int);
111
+ __declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *);
112
+ __declspec(dllimport) extern __stdcall int IsDebuggerPresent(void);
113
+ __declspec(dllimport) extern __stdcall int GetLastError(void);
114
+ __declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *);
115
+ __declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int);
116
+ __declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int);
117
+ #ifdef __clang__
118
+ #pragma clang diagnostic pop
119
+ #endif
120
+ # define timezone _timezone
121
+ extern int TclOSstat(const char *name, void *statBuf);
122
+ extern int TclOSlstat(const char *name, void *statBuf);
123
+ #ifdef __cplusplus
124
+ }
125
+ #endif
126
+ #elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
127
+ # define TclOSstat(name, buf) stat64(name, (struct stat64 *)buf)
128
+ # define TclOSlstat(name,buf) lstat64(name, (struct stat64 *)buf)
129
+ #else
130
+ # define TclOSstat(name, buf) stat(name, (struct stat *)buf)
131
+ # define TclOSlstat(name, buf) lstat(name, (struct stat *)buf)
132
+ #endif
133
+
134
+ /*
135
+ *---------------------------------------------------------------------------
136
+ * Miscellaneous includes that might be missing.
137
+ *---------------------------------------------------------------------------
138
+ */
139
+
140
+ #include <sys/file.h>
141
+ #ifdef HAVE_SYS_SELECT_H
142
+ # include <sys/select.h>
143
+ #endif
144
+ #include <sys/stat.h>
145
+ #ifdef TIME_WITH_SYS_TIME
146
+ # include <sys/time.h>
147
+ # include <time.h>
148
+ #else
149
+ #ifdef HAVE_SYS_TIME_H
150
+ # include <sys/time.h>
151
+ #else
152
+ # include <time.h>
153
+ #endif
154
+ #endif
155
+ #ifndef NO_SYS_WAIT_H
156
+ # include <sys/wait.h>
157
+ #endif
158
+ #ifdef HAVE_INTTYPES_H
159
+ # include <inttypes.h>
160
+ #endif
161
+ #include <limits.h>
162
+ #ifdef HAVE_STDINT_H
163
+ # include <stdint.h>
164
+ #endif
165
+ #ifdef HAVE_UNISTD_H
166
+ # include <unistd.h>
167
+ #else
168
+ # include "../compat/unistd.h"
169
+ #endif
170
+
171
+ extern int TclUnixSetBlockingMode(int fd, int mode);
172
+
173
+ #include <utime.h>
174
+
175
+ /*
176
+ *---------------------------------------------------------------------------
177
+ * Socket support stuff: This likely needs more work to parameterize for each
178
+ * system.
179
+ *---------------------------------------------------------------------------
180
+ */
181
+
182
+ #include <sys/socket.h> /* struct sockaddr, SOCK_STREAM, ... */
183
+ #ifndef NO_UNAME
184
+ # include <sys/utsname.h> /* uname system call. */
185
+ #endif
186
+ #include <netinet/in.h> /* struct in_addr, struct sockaddr_in */
187
+ #include <arpa/inet.h> /* inet_ntoa() */
188
+ #include <netdb.h> /* getaddrinfo() */
189
+ #ifdef NEED_FAKE_RFC2553
190
+ # include "../compat/fake-rfc2553.h"
191
+ #endif
192
+
193
+ /*
194
+ *---------------------------------------------------------------------------
195
+ * Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look
196
+ * for an alternative definition. If no other alternative is available we use
197
+ * a reasonable guess.
198
+ *---------------------------------------------------------------------------
199
+ */
200
+
201
+ #ifndef NO_FLOAT_H
202
+ # include <float.h>
203
+ #else
204
+ #ifndef NO_VALUES_H
205
+ # include <values.h>
206
+ #endif
207
+ #endif
208
+
209
+ #ifndef FLT_MAX
210
+ # ifdef MAXFLOAT
211
+ # define FLT_MAX MAXFLOAT
212
+ # else
213
+ # define FLT_MAX 3.402823466E+38F
214
+ # endif
215
+ #endif
216
+ #ifndef FLT_MIN
217
+ # ifdef MINFLOAT
218
+ # define FLT_MIN MINFLOAT
219
+ # else
220
+ # define FLT_MIN 1.175494351E-38F
221
+ # endif
222
+ #endif
223
+
224
+ /*
225
+ *---------------------------------------------------------------------------
226
+ * NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
227
+ *---------------------------------------------------------------------------
228
+ */
229
+
230
+ #ifndef O_NONBLOCK
231
+ # define O_NONBLOCK 0x80
232
+ #endif
233
+
234
+ /*
235
+ *---------------------------------------------------------------------------
236
+ * The type of the status returned by wait varies from UNIX system to UNIX
237
+ * system. The macro below defines it:
238
+ *---------------------------------------------------------------------------
239
+ */
240
+
241
+ #ifdef _AIX
242
+ # define WAIT_STATUS_TYPE pid_t
243
+ #else
244
+ #ifndef NO_UNION_WAIT
245
+ # define WAIT_STATUS_TYPE union wait
246
+ #else
247
+ # define WAIT_STATUS_TYPE int
248
+ #endif
249
+ #endif
250
+
251
+ /*
252
+ *---------------------------------------------------------------------------
253
+ * Supply definitions for macros to query wait status, if not already defined
254
+ * in header files above.
255
+ *---------------------------------------------------------------------------
256
+ */
257
+
258
+ #ifndef WIFEXITED
259
+ # define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0)
260
+ #endif
261
+
262
+ #ifndef WEXITSTATUS
263
+ # define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
264
+ #endif
265
+
266
+ #ifndef WIFSIGNALED
267
+ # define WIFSIGNALED(stat) \
268
+ (((*((int *) &(stat)))) && ((*((int *) &(stat))) \
269
+ == ((*((int *) &(stat))) & 0x00FF)))
270
+ #endif
271
+
272
+ #ifndef WTERMSIG
273
+ # define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
274
+ #endif
275
+
276
+ #ifndef WIFSTOPPED
277
+ # define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177)
278
+ #endif
279
+
280
+ #ifndef WSTOPSIG
281
+ # define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
282
+ #endif
283
+
284
+ /*
285
+ *---------------------------------------------------------------------------
286
+ * Define constants for waitpid() system call if they aren't defined by a
287
+ * system header file.
288
+ *---------------------------------------------------------------------------
289
+ */
290
+
291
+ #ifndef WNOHANG
292
+ # define WNOHANG 1
293
+ #endif
294
+ #ifndef WUNTRACED
295
+ # define WUNTRACED 2
296
+ #endif
297
+
298
+ /*
299
+ *---------------------------------------------------------------------------
300
+ * Supply macros for seek offsets, if they're not already provided by an
301
+ * include file.
302
+ *---------------------------------------------------------------------------
303
+ */
304
+
305
+ #ifndef SEEK_SET
306
+ # define SEEK_SET 0
307
+ #endif
308
+ #ifndef SEEK_CUR
309
+ # define SEEK_CUR 1
310
+ #endif
311
+ #ifndef SEEK_END
312
+ # define SEEK_END 2
313
+ #endif
314
+
315
+ /*
316
+ *---------------------------------------------------------------------------
317
+ * The stuff below is needed by the "time" command. If this system has no
318
+ * gettimeofday call, then must use times() instead.
319
+ *---------------------------------------------------------------------------
320
+ */
321
+
322
+ #ifdef NO_GETTOD
323
+ # include <sys/times.h>
324
+ #else
325
+ # ifdef HAVE_BSDGETTIMEOFDAY
326
+ # define gettimeofday BSDgettimeofday
327
+ # endif
328
+ #endif
329
+
330
+ #ifdef GETTOD_NOT_DECLARED
331
+ extern int gettimeofday(struct timeval *tp,
332
+ struct timezone *tzp);
333
+ #endif
334
+
335
+ /*
336
+ *---------------------------------------------------------------------------
337
+ * Define access mode constants if they aren't already defined.
338
+ *---------------------------------------------------------------------------
339
+ */
340
+
341
+ #ifndef F_OK
342
+ # define F_OK 00
343
+ #endif
344
+ #ifndef X_OK
345
+ # define X_OK 01
346
+ #endif
347
+ #ifndef W_OK
348
+ # define W_OK 02
349
+ #endif
350
+ #ifndef R_OK
351
+ # define R_OK 04
352
+ #endif
353
+
354
+ /*
355
+ *---------------------------------------------------------------------------
356
+ * Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already
357
+ * defined.
358
+ *---------------------------------------------------------------------------
359
+ */
360
+
361
+ #ifndef FD_CLOEXEC
362
+ # define FD_CLOEXEC 1
363
+ #endif
364
+
365
+ /*
366
+ *---------------------------------------------------------------------------
367
+ * On systems without symbolic links (i.e. S_IFLNK isn't defined) define
368
+ * "lstat" to use "stat" instead.
369
+ *---------------------------------------------------------------------------
370
+ */
371
+
372
+ #ifndef S_IFLNK
373
+ # undef TclOSlstat
374
+ # define lstat stat
375
+ # define lstat64 stat64
376
+ # define TclOSlstat TclOSstat
377
+ #endif
378
+
379
+ /*
380
+ *---------------------------------------------------------------------------
381
+ * Define macros to query file type bits, if they're not already defined.
382
+ *---------------------------------------------------------------------------
383
+ */
384
+
385
+ #ifndef S_ISREG
386
+ # ifdef S_IFREG
387
+ # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
388
+ # else
389
+ # define S_ISREG(m) 0
390
+ # endif
391
+ #endif /* !S_ISREG */
392
+ #ifndef S_ISDIR
393
+ # ifdef S_IFDIR
394
+ # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
395
+ # else
396
+ # define S_ISDIR(m) 0
397
+ # endif
398
+ #endif /* !S_ISDIR */
399
+ #ifndef S_ISCHR
400
+ # ifdef S_IFCHR
401
+ # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
402
+ # else
403
+ # define S_ISCHR(m) 0
404
+ # endif
405
+ #endif /* !S_ISCHR */
406
+
407
+ #ifndef S_ISBLK
408
+ # ifdef S_IFBLK
409
+ # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
410
+ # else
411
+ # define S_ISBLK(m) 0
412
+ # endif
413
+ #endif /* !S_ISBLK */
414
+
415
+ #ifndef S_ISFIFO
416
+ # ifdef S_IFIFO
417
+ # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
418
+ # else
419
+ # define S_ISFIFO(m) 0
420
+ # endif
421
+ #endif /* !S_ISFIFO */
422
+
423
+ #ifndef S_ISLNK
424
+ # ifdef S_IFLNK
425
+ # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
426
+ # else
427
+ # define S_ISLNK(m) 0
428
+ # endif
429
+ #endif /* !S_ISLNK */
430
+
431
+ #ifndef S_ISSOCK
432
+ # ifdef S_IFSOCK
433
+ # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
434
+ # else
435
+ # define S_ISSOCK(m) 0
436
+ # endif
437
+ #endif /* !S_ISSOCK */
438
+
439
+ /*
440
+ *---------------------------------------------------------------------------
441
+ * Make sure that MAXPATHLEN and MAXNAMLEN are defined.
442
+ *---------------------------------------------------------------------------
443
+ */
444
+
445
+ #ifndef MAXPATHLEN
446
+ # ifdef PATH_MAX
447
+ # define MAXPATHLEN PATH_MAX
448
+ # else
449
+ # define MAXPATHLEN 2048
450
+ # endif
451
+ #endif
452
+
453
+ #ifndef MAXNAMLEN
454
+ # ifdef NAME_MAX
455
+ # define MAXNAMLEN NAME_MAX
456
+ # else
457
+ # define MAXNAMLEN 255
458
+ # endif
459
+ #endif
460
+
461
+ /*
462
+ *---------------------------------------------------------------------------
463
+ * The following macro defines the type of the mask arguments to select:
464
+ *---------------------------------------------------------------------------
465
+ */
466
+
467
+ #ifndef NO_FD_SET
468
+ # define SELECT_MASK fd_set
469
+ #else /* NO_FD_SET */
470
+ # ifndef _AIX
471
+ typedef long fd_mask;
472
+ # endif /* !AIX */
473
+ # if defined(_IBMR2)
474
+ # define SELECT_MASK void
475
+ # else /* !defined(_IBMR2) */
476
+ # define SELECT_MASK int
477
+ # endif /* defined(_IBMR2) */
478
+ #endif /* !NO_FD_SET */
479
+
480
+ /*
481
+ *---------------------------------------------------------------------------
482
+ * Define "NBBY" (number of bits per byte) if it's not already defined.
483
+ *---------------------------------------------------------------------------
484
+ */
485
+
486
+ #ifndef NBBY
487
+ # define NBBY 8
488
+ #endif
489
+
490
+ /*
491
+ *---------------------------------------------------------------------------
492
+ * The following macro defines the number of fd_masks in an fd_set:
493
+ *---------------------------------------------------------------------------
494
+ */
495
+
496
+ #ifndef FD_SETSIZE
497
+ # ifdef OPEN_MAX
498
+ # define FD_SETSIZE OPEN_MAX
499
+ # else
500
+ # define FD_SETSIZE 256
501
+ # endif
502
+ #endif /* FD_SETSIZE */
503
+
504
+ #ifndef howmany
505
+ # define howmany(x, y) (((x)+((y)-1))/(y))
506
+ #endif /* !defined(howmany) */
507
+
508
+ #ifndef NFDBITS
509
+ # define NFDBITS NBBY*sizeof(fd_mask)
510
+ #endif /* NFDBITS */
511
+
512
+ #define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
513
+
514
+ /*
515
+ *---------------------------------------------------------------------------
516
+ * Not all systems declare the errno variable in errno.h. so this file does it
517
+ * explicitly. The list of system error messages also isn't generally declared
518
+ * in a header file anywhere.
519
+ *---------------------------------------------------------------------------
520
+ */
521
+
522
+ #ifdef NO_ERRNO
523
+ extern int errno;
524
+ #endif /* NO_ERRNO */
525
+
526
+ /*
527
+ *---------------------------------------------------------------------------
528
+ * Not all systems declare all the errors that Tcl uses! Provide some
529
+ * work-arounds...
530
+ *---------------------------------------------------------------------------
531
+ */
532
+
533
+ #ifndef EOVERFLOW
534
+ # ifdef EFBIG
535
+ # define EOVERFLOW EFBIG
536
+ # else /* !EFBIG */
537
+ # define EOVERFLOW EINVAL
538
+ # endif /* EFBIG */
539
+ #endif /* EOVERFLOW */
540
+
541
+ /*
542
+ *---------------------------------------------------------------------------
543
+ * Variables provided by the C library:
544
+ *---------------------------------------------------------------------------
545
+ */
546
+
547
+ #if defined(__APPLE__) && defined(__DYNAMIC__)
548
+ # include <crt_externs.h>
549
+ # define environ (*_NSGetEnviron())
550
+ # define USE_PUTENV 1
551
+ #else
552
+ # if defined(_sgi) || defined(__sgi)
553
+ # define environ _environ
554
+ # endif
555
+ extern char ** environ;
556
+ #endif
557
+
558
+ /*
559
+ *---------------------------------------------------------------------------
560
+ * Darwin specifc configure overrides.
561
+ *---------------------------------------------------------------------------
562
+ */
563
+
564
+ #ifdef __APPLE__
565
+
566
+ /*
567
+ *---------------------------------------------------------------------------
568
+ * Support for fat compiles: configure runs only once for multiple architectures
569
+ *---------------------------------------------------------------------------
570
+ */
571
+
572
+ # if defined(__LP64__) && defined (NO_COREFOUNDATION_64)
573
+ # undef HAVE_COREFOUNDATION
574
+ # endif /* __LP64__ && NO_COREFOUNDATION_64 */
575
+ # include <sys/cdefs.h>
576
+ # ifdef __DARWIN_UNIX03
577
+ # if __DARWIN_UNIX03
578
+ # undef HAVE_PUTENV_THAT_COPIES
579
+ # else
580
+ # define HAVE_PUTENV_THAT_COPIES 1
581
+ # endif
582
+ # endif /* __DARWIN_UNIX03 */
583
+
584
+ /*
585
+ *---------------------------------------------------------------------------
586
+ * Include AvailabilityMacros.h here (when available) to ensure any symbolic
587
+ * MAC_OS_X_VERSION_* constants passed on the command line are translated.
588
+ *---------------------------------------------------------------------------
589
+ */
590
+
591
+ # ifdef HAVE_AVAILABILITYMACROS_H
592
+ # include <AvailabilityMacros.h>
593
+ # endif
594
+
595
+ /*
596
+ *---------------------------------------------------------------------------
597
+ * Support for weak import.
598
+ *---------------------------------------------------------------------------
599
+ */
600
+
601
+ # ifdef HAVE_WEAK_IMPORT
602
+ # if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
603
+ # undef HAVE_WEAK_IMPORT
604
+ # else
605
+ # ifndef WEAK_IMPORT_ATTRIBUTE
606
+ # define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
607
+ # endif
608
+ # endif
609
+ # endif /* HAVE_WEAK_IMPORT */
610
+
611
+ /*
612
+ *---------------------------------------------------------------------------
613
+ * Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
614
+ * only use API available in the indicated OS version or earlier.
615
+ *---------------------------------------------------------------------------
616
+ */
617
+
618
+ # ifdef MAC_OS_X_VERSION_MAX_ALLOWED
619
+ # if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
620
+ # undef HAVE_COREFOUNDATION
621
+ # endif
622
+ # if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
623
+ # undef HAVE_OSSPINLOCKLOCK
624
+ # undef HAVE_PTHREAD_ATFORK
625
+ # undef HAVE_COPYFILE
626
+ # endif
627
+ # if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
628
+ # ifdef TCL_THREADS
629
+ /* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
630
+ # define NO_REALPATH 1
631
+ # endif
632
+ # undef HAVE_LANGINFO
633
+ # endif
634
+ # endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
635
+ # if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
636
+ defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
637
+ # warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
638
+ # endif
639
+
640
+ /*
641
+ *---------------------------------------------------------------------------
642
+ * At present, using vfork() instead of fork() causes execve() to fail
643
+ * intermittently on Darwin x86_64. rdar://4685553
644
+ *---------------------------------------------------------------------------
645
+ */
646
+
647
+ # if defined(__x86_64__) && !defined(FIXED_RDAR_4685553)
648
+ # undef USE_VFORK
649
+ # endif /* __x86_64__ */
650
+ /* Workaround problems with vfork() when building with llvm-gcc-4.2 */
651
+ # if defined (__llvm__) && \
652
+ (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 2 || \
653
+ (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ > 0))))
654
+ # undef USE_VFORK
655
+ # endif /* __llvm__ */
656
+ #endif /* __APPLE__ */
657
+
658
+ /*
659
+ *---------------------------------------------------------------------------
660
+ * The following macros and declarations represent the interface between
661
+ * generic and unix-specific parts of Tcl. Some of the macros may override
662
+ * functions declared in tclInt.h.
663
+ *---------------------------------------------------------------------------
664
+ */
665
+
666
+ /*
667
+ * The default platform eol translation on Unix is TCL_TRANSLATE_LF.
668
+ */
669
+
670
+ #ifdef DJGPP
671
+ #define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
672
+ typedef int socklen_t;
673
+ #else
674
+ #define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
675
+ #endif
676
+
677
+ /*
678
+ *---------------------------------------------------------------------------
679
+ * The following macros have trivial definitions, allowing generic code to
680
+ * address platform-specific issues.
681
+ *---------------------------------------------------------------------------
682
+ */
683
+
684
+ #define TclpReleaseFile(file) /* Nothing. */
685
+
686
+ /*
687
+ *---------------------------------------------------------------------------
688
+ * The following defines wrap the system memory allocation routines.
689
+ *---------------------------------------------------------------------------
690
+ */
691
+
692
+ #define TclpSysAlloc(size, isBin) malloc((size_t)(size))
693
+ #define TclpSysFree(ptr) free((char *)(ptr))
694
+ #define TclpSysRealloc(ptr, size) realloc((char *)(ptr), (size_t)(size))
695
+
696
+ /*
697
+ *---------------------------------------------------------------------------
698
+ * The following macros and declaration wrap the C runtime library functions.
699
+ *---------------------------------------------------------------------------
700
+ */
701
+
702
+ #define TclpExit exit
703
+
704
+ #ifdef TCL_THREADS
705
+ # include <pthread.h>
706
+ #endif /* TCL_THREADS */
707
+
708
+ /* FIXME - Hyper-enormous platform assumption! */
709
+ #ifndef AF_INET6
710
+ # define AF_INET6 10
711
+ #endif
712
+
713
+ /*
714
+ *---------------------------------------------------------------------------
715
+ * Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
716
+ * Instead of returning pointers to the static storage, those return pointers
717
+ * to the TSD data.
718
+ *---------------------------------------------------------------------------
719
+ */
720
+
721
+ #include <pwd.h>
722
+ #include <grp.h>
723
+
724
+ extern struct passwd * TclpGetPwNam(const char *name);
725
+ extern struct group * TclpGetGrNam(const char *name);
726
+ extern struct passwd * TclpGetPwUid(uid_t uid);
727
+ extern struct group * TclpGetGrGid(gid_t gid);
728
+ extern struct hostent * TclpGetHostByName(const char *name);
729
+ extern struct hostent * TclpGetHostByAddr(const char *addr,
730
+ int length, int type);
731
+ extern void *TclpMakeTcpClientChannelMode(
732
+ void *tcpSocket, int mode);
733
+
734
+ #endif /* _TCLUNIXPORT */
735
+
736
+ /*
737
+ * Local Variables:
738
+ * mode: c
739
+ * c-basic-offset: 4
740
+ * fill-column: 78
741
+ * End:
742
+ */
physworld_p1_20261018/envs/p1/include/tdbc.h ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tdbc.h --
3
+ *
4
+ * Declarations of the public API for Tcl DataBase Connectivity (TDBC)
5
+ *
6
+ * Copyright (c) 2006 by Kevin B. Kenny
7
+ *
8
+ * See the file "license.terms" for information on usage and redistribution of
9
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
10
+ *
11
+ * RCS: @(#) $Id$
12
+ *
13
+ *-----------------------------------------------------------------------------
14
+ */
15
+
16
+ #ifndef TDBC_H_INCLUDED
17
+ #define TDBC_H_INCLUDED 1
18
+
19
+ #include <tcl.h>
20
+
21
+ #ifndef TDBCAPI
22
+ # if defined(BUILD_tdbc)
23
+ # define TDBCAPI MODULE_SCOPE
24
+ # else
25
+ # define TDBCAPI extern
26
+ # undef USE_TDBC_STUBS
27
+ # define USE_TDBC_STUBS 1
28
+ # endif
29
+ #endif
30
+
31
+ #ifdef __cplusplus
32
+ extern "C" {
33
+ #endif
34
+
35
+ #if defined(BUILD_tdbc)
36
+ DLLEXPORT int Tdbc_Init(Tcl_Interp *interp);
37
+ #elif defined(STATIC_BUILD)
38
+ extern int Tdbc_Init(Tcl_Interp* interp);
39
+ #else
40
+ DLLIMPORT int Tdbc_Init(Tcl_Interp* interp);
41
+ #endif
42
+
43
+ #define Tdbc_InitStubs(interp) TdbcInitializeStubs(interp, \
44
+ TDBC_VERSION, TDBC_STUBS_EPOCH, TDBC_STUBS_REVISION)
45
+ #if defined(USE_TDBC_STUBS)
46
+ TDBCAPI const char* TdbcInitializeStubs(
47
+ Tcl_Interp* interp, const char* version, int epoch, int revision);
48
+ #else
49
+ # define TdbcInitializeStubs(interp, version, epoch, revision) \
50
+ (Tcl_PkgRequire(interp, "tdbc", version))
51
+ #endif
52
+
53
+ #ifdef __cplusplus
54
+ }
55
+ #endif
56
+
57
+ /*
58
+ * TDBC_VERSION and TDBC_PATCHLEVEL here must match the ones that
59
+ * appear near the top of configure.ac.
60
+ */
61
+
62
+ #define TDBC_VERSION "1.1"
63
+ #define TDBC_PATCHLEVEL "1.1.5"
64
+
65
+ /*
66
+ * Include the Stubs declarations for the public API, generated from
67
+ * tdbc.decls.
68
+ */
69
+
70
+ #include "tdbcDecls.h"
71
+
72
+ #endif
73
+
74
+ /*
75
+ * Local Variables:
76
+ * mode: c
77
+ * c-basic-offset: 4
78
+ * fill-column: 78
79
+ * End:
80
+ */
physworld_p1_20261018/envs/p1/include/tdbcDecls.h ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tdbcDecls.h --
3
+ *
4
+ * Exported Stubs declarations for Tcl DataBaseConnectivity (TDBC).
5
+ *
6
+ * This file is (mostly) generated automatically from tdbc.decls
7
+ *
8
+ * Copyright (c) 2008 by Kevin B. Kenny.
9
+ *
10
+ * See the file "license.terms" for information on usage and redistribution of
11
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
+ *
13
+ * RCS: @(#) $Id$
14
+ *
15
+ */
16
+
17
+ /* !BEGIN!: Do not edit below this line. */
18
+
19
+ #define TDBC_STUBS_EPOCH 0
20
+ #define TDBC_STUBS_REVISION 3
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ /*
27
+ * Exported function declarations:
28
+ */
29
+
30
+ /* 0 */
31
+ TDBCAPI int Tdbc_Init_ (Tcl_Interp* interp);
32
+ /* 1 */
33
+ TDBCAPI Tcl_Obj* Tdbc_TokenizeSql (Tcl_Interp* interp,
34
+ const char* statement);
35
+ /* 2 */
36
+ TDBCAPI const char* Tdbc_MapSqlState (const char* sqlstate);
37
+
38
+ typedef struct TdbcStubs {
39
+ int magic;
40
+ int epoch;
41
+ int revision;
42
+ void *hooks;
43
+
44
+ int (*tdbc_Init_) (Tcl_Interp* interp); /* 0 */
45
+ Tcl_Obj* (*tdbc_TokenizeSql) (Tcl_Interp* interp, const char* statement); /* 1 */
46
+ const char* (*tdbc_MapSqlState) (const char* sqlstate); /* 2 */
47
+ } TdbcStubs;
48
+
49
+ extern const TdbcStubs *tdbcStubsPtr;
50
+
51
+ #ifdef __cplusplus
52
+ }
53
+ #endif
54
+
55
+ #if defined(USE_TDBC_STUBS)
56
+
57
+ /*
58
+ * Inline function declarations:
59
+ */
60
+
61
+ #define Tdbc_Init_ \
62
+ (tdbcStubsPtr->tdbc_Init_) /* 0 */
63
+ #define Tdbc_TokenizeSql \
64
+ (tdbcStubsPtr->tdbc_TokenizeSql) /* 1 */
65
+ #define Tdbc_MapSqlState \
66
+ (tdbcStubsPtr->tdbc_MapSqlState) /* 2 */
67
+
68
+ #endif /* defined(USE_TDBC_STUBS) */
69
+
70
+ /* !END!: Do not edit above this line. */
physworld_p1_20261018/envs/p1/include/tdbcInt.h ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tdbcInt.h --
3
+ *
4
+ * Declarations of the public API for Tcl DataBase Connectivity (TDBC)
5
+ *
6
+ * Copyright (c) 2006 by Kevin B. Kenny
7
+ *
8
+ * See the file "license.terms" for information on usage and redistribution of
9
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
10
+ *
11
+ * RCS: @(#) $Id$
12
+ *
13
+ *-----------------------------------------------------------------------------
14
+ */
15
+ #ifndef TDBCINT_H_INCLUDED
16
+ #define TDBCINT_H_INCLUDED 1
17
+
18
+ #include "tdbc.h"
19
+
20
+ /*
21
+ * Used to tag functions that are only to be visible within the module being
22
+ * built and not outside it (where this is supported by the linker).
23
+ */
24
+
25
+ #ifndef MODULE_SCOPE
26
+ # ifdef __cplusplus
27
+ # define MODULE_SCOPE extern "C"
28
+ # else
29
+ # define MODULE_SCOPE extern
30
+ # endif
31
+ #endif
32
+
33
+ #ifndef JOIN
34
+ # define JOIN(a,b) JOIN1(a,b)
35
+ # define JOIN1(a,b) a##b
36
+ #endif
37
+
38
+ #ifndef TCL_UNUSED
39
+ # if defined(__cplusplus)
40
+ # define TCL_UNUSED(T) T
41
+ # elif defined(__GNUC__) && (__GNUC__ > 2)
42
+ # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
43
+ # else
44
+ # define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
45
+ # endif
46
+ #endif
47
+
48
+ /*
49
+ * Linkage to procedures not exported from this module
50
+ */
51
+
52
+ MODULE_SCOPE int TdbcTokenizeObjCmd(void *clientData, Tcl_Interp* interp,
53
+ int objc, Tcl_Obj *const objv[]);
54
+
55
+ #endif
physworld_p1_20261018/envs/p1/include/term.h ADDED
@@ -0,0 +1,893 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2018-2024,2025 Thomas E. Dickey *
3
+ * Copyright 1998-2013,2017 Free Software Foundation, Inc. *
4
+ * *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a *
6
+ * copy of this software and associated documentation files (the *
7
+ * "Software"), to deal in the Software without restriction, including *
8
+ * without limitation the rights to use, copy, modify, merge, publish, *
9
+ * distribute, distribute with modifications, sublicense, and/or sell *
10
+ * copies of the Software, and to permit persons to whom the Software is *
11
+ * furnished to do so, subject to the following conditions: *
12
+ * *
13
+ * The above copyright notice and this permission notice shall be included *
14
+ * in all copies or substantial portions of the Software. *
15
+ * *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23
+ * *
24
+ * Except as contained in this notice, the name(s) of the above copyright *
25
+ * holders shall not be used in advertising or otherwise to promote the *
26
+ * sale, use or other dealings in this Software without prior written *
27
+ * authorization. *
28
+ ****************************************************************************/
29
+
30
+ /****************************************************************************/
31
+ /* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 */
32
+ /* and: Eric S. Raymond <esr@snark.thyrsus.com> */
33
+ /* and: Thomas E. Dickey 1995-on */
34
+ /****************************************************************************/
35
+
36
+ /* $Id: MKterm.h.awk.in,v 1.94 2025/12/26 23:33:14 tom Exp $ */
37
+
38
+ /*
39
+ ** term.h -- Definition of struct term
40
+ */
41
+
42
+ #ifndef NCURSES_TERM_H_incl
43
+ #define NCURSES_TERM_H_incl 1
44
+
45
+ #undef NCURSES_VERSION
46
+ #define NCURSES_VERSION "6.6"
47
+
48
+ #include <ncursesw/ncurses_dll.h>
49
+
50
+ #ifdef __cplusplus
51
+ extern "C" {
52
+ #endif
53
+
54
+ /* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
55
+ * definition (based on the system for which this was configured).
56
+ */
57
+
58
+ #ifndef __NCURSES_H
59
+
60
+ typedef struct screen SCREEN;
61
+
62
+ /* configured with --enable-sp-funcs? */
63
+ #if 1
64
+ #undef NCURSES_SP_FUNCS
65
+ #define NCURSES_SP_FUNCS 20251230
66
+ #undef NCURSES_SP_NAME
67
+ #define NCURSES_SP_NAME(name) name##_sp
68
+
69
+ /* Define the sp-funcs helper function */
70
+ #undef NCURSES_SP_OUTC
71
+ #define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
72
+ typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
73
+ #endif
74
+
75
+ #endif /* __NCURSES_H */
76
+
77
+ #undef NCURSES_CONST
78
+ #define NCURSES_CONST const
79
+
80
+ #undef NCURSES_SBOOL
81
+ #define NCURSES_SBOOL char
82
+
83
+ #undef NCURSES_USE_DATABASE
84
+ #define NCURSES_USE_DATABASE 1
85
+
86
+ #undef NCURSES_USE_TERMCAP
87
+ #define NCURSES_USE_TERMCAP 1
88
+
89
+ #undef NCURSES_XNAMES
90
+ #define NCURSES_XNAMES 1
91
+
92
+ /* TTY, SET_TTY and GET_TTY are used internally */
93
+ #ifdef NCURSES_INTERNALS
94
+
95
+ /* We use these symbols to hide differences between
96
+ * termios/termio/sgttyb interfaces.
97
+ */
98
+ #undef TTY
99
+ #undef SET_TTY
100
+ #undef GET_TTY
101
+
102
+ #if 1 && 1 /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */
103
+
104
+ #undef TERMIOS
105
+ #define TERMIOS 1
106
+ #include <termios.h>
107
+ #define TTY struct termios
108
+
109
+ #elif 1 /* HAVE_TERMIO_H */
110
+
111
+ #undef TERMIOS
112
+ #define TERMIOS 1
113
+ #include <termio.h>
114
+ #define TTY struct termio
115
+
116
+ #elif (defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__) || defined(__MINGW64__))
117
+
118
+ #include <ncursesw/nc_win32.h>
119
+ #define TTY ConsoleMode
120
+
121
+ #elif 1 /* HAVE_SGTTY_H */
122
+
123
+ #undef TERMIOS
124
+ #include <sgtty.h>
125
+ #include <sys/ioctl.h>
126
+ #define TTY struct sgttyb
127
+
128
+ #else
129
+
130
+ #error no termio/termios/sgtty found
131
+
132
+ #endif /* HAVE_TERMIOS_H */
133
+
134
+ #ifdef TERMIOS
135
+ #define GET_TTY(fd, buf) tcgetattr(fd, buf)
136
+ #define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
137
+ /* configured with --enable-exp-win32? */
138
+ #elif defined(_WIN32) || defined(_WIN64)
139
+ #define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)
140
+ #define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)
141
+ #elif 1 /* HAVE_SGTTY_H */
142
+ #define GET_TTY(fd, buf) gtty(fd, buf)
143
+ #define SET_TTY(fd, buf) stty(fd, buf)
144
+ #endif
145
+
146
+ #endif /* NCURSES_INTERNALS */
147
+
148
+ #ifndef GCC_NORETURN
149
+ #define GCC_NORETURN /* nothing */
150
+ #endif
151
+
152
+ #define NAMESIZE 256
153
+
154
+ /* The cast works because TERMTYPE is the first data in TERMINAL */
155
+ #define CUR ((TERMTYPE *)(cur_term))->
156
+
157
+ #define auto_left_margin CUR Booleans[0]
158
+ #define auto_right_margin CUR Booleans[1]
159
+ #define no_esc_ctlc CUR Booleans[2]
160
+ #define ceol_standout_glitch CUR Booleans[3]
161
+ #define eat_newline_glitch CUR Booleans[4]
162
+ #define erase_overstrike CUR Booleans[5]
163
+ #define generic_type CUR Booleans[6]
164
+ #define hard_copy CUR Booleans[7]
165
+ #define has_meta_key CUR Booleans[8]
166
+ #define has_status_line CUR Booleans[9]
167
+ #define insert_null_glitch CUR Booleans[10]
168
+ #define memory_above CUR Booleans[11]
169
+ #define memory_below CUR Booleans[12]
170
+ #define move_insert_mode CUR Booleans[13]
171
+ #define move_standout_mode CUR Booleans[14]
172
+ #define over_strike CUR Booleans[15]
173
+ #define status_line_esc_ok CUR Booleans[16]
174
+ #define dest_tabs_magic_smso CUR Booleans[17]
175
+ #define tilde_glitch CUR Booleans[18]
176
+ #define transparent_underline CUR Booleans[19]
177
+ #define xon_xoff CUR Booleans[20]
178
+ #define needs_xon_xoff CUR Booleans[21]
179
+ #define prtr_silent CUR Booleans[22]
180
+ #define hard_cursor CUR Booleans[23]
181
+ #define non_rev_rmcup CUR Booleans[24]
182
+ #define no_pad_char CUR Booleans[25]
183
+ #define non_dest_scroll_region CUR Booleans[26]
184
+ #define can_change CUR Booleans[27]
185
+ #define back_color_erase CUR Booleans[28]
186
+ #define hue_lightness_saturation CUR Booleans[29]
187
+ #define col_addr_glitch CUR Booleans[30]
188
+ #define cr_cancels_micro_mode CUR Booleans[31]
189
+ #define has_print_wheel CUR Booleans[32]
190
+ #define row_addr_glitch CUR Booleans[33]
191
+ #define semi_auto_right_margin CUR Booleans[34]
192
+ #define cpi_changes_res CUR Booleans[35]
193
+ #define lpi_changes_res CUR Booleans[36]
194
+ #define columns CUR Numbers[0]
195
+ #define init_tabs CUR Numbers[1]
196
+ #define lines CUR Numbers[2]
197
+ #define lines_of_memory CUR Numbers[3]
198
+ #define magic_cookie_glitch CUR Numbers[4]
199
+ #define padding_baud_rate CUR Numbers[5]
200
+ #define virtual_terminal CUR Numbers[6]
201
+ #define width_status_line CUR Numbers[7]
202
+ #define num_labels CUR Numbers[8]
203
+ #define label_height CUR Numbers[9]
204
+ #define label_width CUR Numbers[10]
205
+ #define max_attributes CUR Numbers[11]
206
+ #define maximum_windows CUR Numbers[12]
207
+ #define max_colors CUR Numbers[13]
208
+ #define max_pairs CUR Numbers[14]
209
+ #define no_color_video CUR Numbers[15]
210
+ #define buffer_capacity CUR Numbers[16]
211
+ #define dot_vert_spacing CUR Numbers[17]
212
+ #define dot_horz_spacing CUR Numbers[18]
213
+ #define max_micro_address CUR Numbers[19]
214
+ #define max_micro_jump CUR Numbers[20]
215
+ #define micro_col_size CUR Numbers[21]
216
+ #define micro_line_size CUR Numbers[22]
217
+ #define number_of_pins CUR Numbers[23]
218
+ #define output_res_char CUR Numbers[24]
219
+ #define output_res_line CUR Numbers[25]
220
+ #define output_res_horz_inch CUR Numbers[26]
221
+ #define output_res_vert_inch CUR Numbers[27]
222
+ #define print_rate CUR Numbers[28]
223
+ #define wide_char_size CUR Numbers[29]
224
+ #define buttons CUR Numbers[30]
225
+ #define bit_image_entwining CUR Numbers[31]
226
+ #define bit_image_type CUR Numbers[32]
227
+ #define back_tab CUR Strings[0]
228
+ #define bell CUR Strings[1]
229
+ #define carriage_return CUR Strings[2]
230
+ #define change_scroll_region CUR Strings[3]
231
+ #define clear_all_tabs CUR Strings[4]
232
+ #define clear_screen CUR Strings[5]
233
+ #define clr_eol CUR Strings[6]
234
+ #define clr_eos CUR Strings[7]
235
+ #define column_address CUR Strings[8]
236
+ #define command_character CUR Strings[9]
237
+ #define cursor_address CUR Strings[10]
238
+ #define cursor_down CUR Strings[11]
239
+ #define cursor_home CUR Strings[12]
240
+ #define cursor_invisible CUR Strings[13]
241
+ #define cursor_left CUR Strings[14]
242
+ #define cursor_mem_address CUR Strings[15]
243
+ #define cursor_normal CUR Strings[16]
244
+ #define cursor_right CUR Strings[17]
245
+ #define cursor_to_ll CUR Strings[18]
246
+ #define cursor_up CUR Strings[19]
247
+ #define cursor_visible CUR Strings[20]
248
+ #define delete_character CUR Strings[21]
249
+ #define delete_line CUR Strings[22]
250
+ #define dis_status_line CUR Strings[23]
251
+ #define down_half_line CUR Strings[24]
252
+ #define enter_alt_charset_mode CUR Strings[25]
253
+ #define enter_blink_mode CUR Strings[26]
254
+ #define enter_bold_mode CUR Strings[27]
255
+ #define enter_ca_mode CUR Strings[28]
256
+ #define enter_delete_mode CUR Strings[29]
257
+ #define enter_dim_mode CUR Strings[30]
258
+ #define enter_insert_mode CUR Strings[31]
259
+ #define enter_secure_mode CUR Strings[32]
260
+ #define enter_protected_mode CUR Strings[33]
261
+ #define enter_reverse_mode CUR Strings[34]
262
+ #define enter_standout_mode CUR Strings[35]
263
+ #define enter_underline_mode CUR Strings[36]
264
+ #define erase_chars CUR Strings[37]
265
+ #define exit_alt_charset_mode CUR Strings[38]
266
+ #define exit_attribute_mode CUR Strings[39]
267
+ #define exit_ca_mode CUR Strings[40]
268
+ #define exit_delete_mode CUR Strings[41]
269
+ #define exit_insert_mode CUR Strings[42]
270
+ #define exit_standout_mode CUR Strings[43]
271
+ #define exit_underline_mode CUR Strings[44]
272
+ #define flash_screen CUR Strings[45]
273
+ #define form_feed CUR Strings[46]
274
+ #define from_status_line CUR Strings[47]
275
+ #define init_1string CUR Strings[48]
276
+ #define init_2string CUR Strings[49]
277
+ #define init_3string CUR Strings[50]
278
+ #define init_file CUR Strings[51]
279
+ #define insert_character CUR Strings[52]
280
+ #define insert_line CUR Strings[53]
281
+ #define insert_padding CUR Strings[54]
282
+ #define key_backspace CUR Strings[55]
283
+ #define key_catab CUR Strings[56]
284
+ #define key_clear CUR Strings[57]
285
+ #define key_ctab CUR Strings[58]
286
+ #define key_dc CUR Strings[59]
287
+ #define key_dl CUR Strings[60]
288
+ #define key_down CUR Strings[61]
289
+ #define key_eic CUR Strings[62]
290
+ #define key_eol CUR Strings[63]
291
+ #define key_eos CUR Strings[64]
292
+ #define key_f0 CUR Strings[65]
293
+ #define key_f1 CUR Strings[66]
294
+ #define key_f10 CUR Strings[67]
295
+ #define key_f2 CUR Strings[68]
296
+ #define key_f3 CUR Strings[69]
297
+ #define key_f4 CUR Strings[70]
298
+ #define key_f5 CUR Strings[71]
299
+ #define key_f6 CUR Strings[72]
300
+ #define key_f7 CUR Strings[73]
301
+ #define key_f8 CUR Strings[74]
302
+ #define key_f9 CUR Strings[75]
303
+ #define key_home CUR Strings[76]
304
+ #define key_ic CUR Strings[77]
305
+ #define key_il CUR Strings[78]
306
+ #define key_left CUR Strings[79]
307
+ #define key_ll CUR Strings[80]
308
+ #define key_npage CUR Strings[81]
309
+ #define key_ppage CUR Strings[82]
310
+ #define key_right CUR Strings[83]
311
+ #define key_sf CUR Strings[84]
312
+ #define key_sr CUR Strings[85]
313
+ #define key_stab CUR Strings[86]
314
+ #define key_up CUR Strings[87]
315
+ #define keypad_local CUR Strings[88]
316
+ #define keypad_xmit CUR Strings[89]
317
+ #define lab_f0 CUR Strings[90]
318
+ #define lab_f1 CUR Strings[91]
319
+ #define lab_f10 CUR Strings[92]
320
+ #define lab_f2 CUR Strings[93]
321
+ #define lab_f3 CUR Strings[94]
322
+ #define lab_f4 CUR Strings[95]
323
+ #define lab_f5 CUR Strings[96]
324
+ #define lab_f6 CUR Strings[97]
325
+ #define lab_f7 CUR Strings[98]
326
+ #define lab_f8 CUR Strings[99]
327
+ #define lab_f9 CUR Strings[100]
328
+ #define meta_off CUR Strings[101]
329
+ #define meta_on CUR Strings[102]
330
+ #define newline CUR Strings[103]
331
+ #define pad_char CUR Strings[104]
332
+ #define parm_dch CUR Strings[105]
333
+ #define parm_delete_line CUR Strings[106]
334
+ #define parm_down_cursor CUR Strings[107]
335
+ #define parm_ich CUR Strings[108]
336
+ #define parm_index CUR Strings[109]
337
+ #define parm_insert_line CUR Strings[110]
338
+ #define parm_left_cursor CUR Strings[111]
339
+ #define parm_right_cursor CUR Strings[112]
340
+ #define parm_rindex CUR Strings[113]
341
+ #define parm_up_cursor CUR Strings[114]
342
+ #define pkey_key CUR Strings[115]
343
+ #define pkey_local CUR Strings[116]
344
+ #define pkey_xmit CUR Strings[117]
345
+ #define print_screen CUR Strings[118]
346
+ #define prtr_off CUR Strings[119]
347
+ #define prtr_on CUR Strings[120]
348
+ #define repeat_char CUR Strings[121]
349
+ #define reset_1string CUR Strings[122]
350
+ #define reset_2string CUR Strings[123]
351
+ #define reset_3string CUR Strings[124]
352
+ #define reset_file CUR Strings[125]
353
+ #define restore_cursor CUR Strings[126]
354
+ #define row_address CUR Strings[127]
355
+ #define save_cursor CUR Strings[128]
356
+ #define scroll_forward CUR Strings[129]
357
+ #define scroll_reverse CUR Strings[130]
358
+ #define set_attributes CUR Strings[131]
359
+ #define set_tab CUR Strings[132]
360
+ #define set_window CUR Strings[133]
361
+ #define tab CUR Strings[134]
362
+ #define to_status_line CUR Strings[135]
363
+ #define underline_char CUR Strings[136]
364
+ #define up_half_line CUR Strings[137]
365
+ #define init_prog CUR Strings[138]
366
+ #define key_a1 CUR Strings[139]
367
+ #define key_a3 CUR Strings[140]
368
+ #define key_b2 CUR Strings[141]
369
+ #define key_c1 CUR Strings[142]
370
+ #define key_c3 CUR Strings[143]
371
+ #define prtr_non CUR Strings[144]
372
+ #define char_padding CUR Strings[145]
373
+ #define acs_chars CUR Strings[146]
374
+ #define plab_norm CUR Strings[147]
375
+ #define key_btab CUR Strings[148]
376
+ #define enter_xon_mode CUR Strings[149]
377
+ #define exit_xon_mode CUR Strings[150]
378
+ #define enter_am_mode CUR Strings[151]
379
+ #define exit_am_mode CUR Strings[152]
380
+ #define xon_character CUR Strings[153]
381
+ #define xoff_character CUR Strings[154]
382
+ #define ena_acs CUR Strings[155]
383
+ #define label_on CUR Strings[156]
384
+ #define label_off CUR Strings[157]
385
+ #define key_beg CUR Strings[158]
386
+ #define key_cancel CUR Strings[159]
387
+ #define key_close CUR Strings[160]
388
+ #define key_command CUR Strings[161]
389
+ #define key_copy CUR Strings[162]
390
+ #define key_create CUR Strings[163]
391
+ #define key_end CUR Strings[164]
392
+ #define key_enter CUR Strings[165]
393
+ #define key_exit CUR Strings[166]
394
+ #define key_find CUR Strings[167]
395
+ #define key_help CUR Strings[168]
396
+ #define key_mark CUR Strings[169]
397
+ #define key_message CUR Strings[170]
398
+ #define key_move CUR Strings[171]
399
+ #define key_next CUR Strings[172]
400
+ #define key_open CUR Strings[173]
401
+ #define key_options CUR Strings[174]
402
+ #define key_previous CUR Strings[175]
403
+ #define key_print CUR Strings[176]
404
+ #define key_redo CUR Strings[177]
405
+ #define key_reference CUR Strings[178]
406
+ #define key_refresh CUR Strings[179]
407
+ #define key_replace CUR Strings[180]
408
+ #define key_restart CUR Strings[181]
409
+ #define key_resume CUR Strings[182]
410
+ #define key_save CUR Strings[183]
411
+ #define key_suspend CUR Strings[184]
412
+ #define key_undo CUR Strings[185]
413
+ #define key_sbeg CUR Strings[186]
414
+ #define key_scancel CUR Strings[187]
415
+ #define key_scommand CUR Strings[188]
416
+ #define key_scopy CUR Strings[189]
417
+ #define key_screate CUR Strings[190]
418
+ #define key_sdc CUR Strings[191]
419
+ #define key_sdl CUR Strings[192]
420
+ #define key_select CUR Strings[193]
421
+ #define key_send CUR Strings[194]
422
+ #define key_seol CUR Strings[195]
423
+ #define key_sexit CUR Strings[196]
424
+ #define key_sfind CUR Strings[197]
425
+ #define key_shelp CUR Strings[198]
426
+ #define key_shome CUR Strings[199]
427
+ #define key_sic CUR Strings[200]
428
+ #define key_sleft CUR Strings[201]
429
+ #define key_smessage CUR Strings[202]
430
+ #define key_smove CUR Strings[203]
431
+ #define key_snext CUR Strings[204]
432
+ #define key_soptions CUR Strings[205]
433
+ #define key_sprevious CUR Strings[206]
434
+ #define key_sprint CUR Strings[207]
435
+ #define key_sredo CUR Strings[208]
436
+ #define key_sreplace CUR Strings[209]
437
+ #define key_sright CUR Strings[210]
438
+ #define key_srsume CUR Strings[211]
439
+ #define key_ssave CUR Strings[212]
440
+ #define key_ssuspend CUR Strings[213]
441
+ #define key_sundo CUR Strings[214]
442
+ #define req_for_input CUR Strings[215]
443
+ #define key_f11 CUR Strings[216]
444
+ #define key_f12 CUR Strings[217]
445
+ #define key_f13 CUR Strings[218]
446
+ #define key_f14 CUR Strings[219]
447
+ #define key_f15 CUR Strings[220]
448
+ #define key_f16 CUR Strings[221]
449
+ #define key_f17 CUR Strings[222]
450
+ #define key_f18 CUR Strings[223]
451
+ #define key_f19 CUR Strings[224]
452
+ #define key_f20 CUR Strings[225]
453
+ #define key_f21 CUR Strings[226]
454
+ #define key_f22 CUR Strings[227]
455
+ #define key_f23 CUR Strings[228]
456
+ #define key_f24 CUR Strings[229]
457
+ #define key_f25 CUR Strings[230]
458
+ #define key_f26 CUR Strings[231]
459
+ #define key_f27 CUR Strings[232]
460
+ #define key_f28 CUR Strings[233]
461
+ #define key_f29 CUR Strings[234]
462
+ #define key_f30 CUR Strings[235]
463
+ #define key_f31 CUR Strings[236]
464
+ #define key_f32 CUR Strings[237]
465
+ #define key_f33 CUR Strings[238]
466
+ #define key_f34 CUR Strings[239]
467
+ #define key_f35 CUR Strings[240]
468
+ #define key_f36 CUR Strings[241]
469
+ #define key_f37 CUR Strings[242]
470
+ #define key_f38 CUR Strings[243]
471
+ #define key_f39 CUR Strings[244]
472
+ #define key_f40 CUR Strings[245]
473
+ #define key_f41 CUR Strings[246]
474
+ #define key_f42 CUR Strings[247]
475
+ #define key_f43 CUR Strings[248]
476
+ #define key_f44 CUR Strings[249]
477
+ #define key_f45 CUR Strings[250]
478
+ #define key_f46 CUR Strings[251]
479
+ #define key_f47 CUR Strings[252]
480
+ #define key_f48 CUR Strings[253]
481
+ #define key_f49 CUR Strings[254]
482
+ #define key_f50 CUR Strings[255]
483
+ #define key_f51 CUR Strings[256]
484
+ #define key_f52 CUR Strings[257]
485
+ #define key_f53 CUR Strings[258]
486
+ #define key_f54 CUR Strings[259]
487
+ #define key_f55 CUR Strings[260]
488
+ #define key_f56 CUR Strings[261]
489
+ #define key_f57 CUR Strings[262]
490
+ #define key_f58 CUR Strings[263]
491
+ #define key_f59 CUR Strings[264]
492
+ #define key_f60 CUR Strings[265]
493
+ #define key_f61 CUR Strings[266]
494
+ #define key_f62 CUR Strings[267]
495
+ #define key_f63 CUR Strings[268]
496
+ #define clr_bol CUR Strings[269]
497
+ #define clear_margins CUR Strings[270]
498
+ #define set_left_margin CUR Strings[271]
499
+ #define set_right_margin CUR Strings[272]
500
+ #define label_format CUR Strings[273]
501
+ #define set_clock CUR Strings[274]
502
+ #define display_clock CUR Strings[275]
503
+ #define remove_clock CUR Strings[276]
504
+ #define create_window CUR Strings[277]
505
+ #define goto_window CUR Strings[278]
506
+ #define hangup CUR Strings[279]
507
+ #define dial_phone CUR Strings[280]
508
+ #define quick_dial CUR Strings[281]
509
+ #define tone CUR Strings[282]
510
+ #define pulse CUR Strings[283]
511
+ #define flash_hook CUR Strings[284]
512
+ #define fixed_pause CUR Strings[285]
513
+ #define wait_tone CUR Strings[286]
514
+ #define user0 CUR Strings[287]
515
+ #define user1 CUR Strings[288]
516
+ #define user2 CUR Strings[289]
517
+ #define user3 CUR Strings[290]
518
+ #define user4 CUR Strings[291]
519
+ #define user5 CUR Strings[292]
520
+ #define user6 CUR Strings[293]
521
+ #define user7 CUR Strings[294]
522
+ #define user8 CUR Strings[295]
523
+ #define user9 CUR Strings[296]
524
+ #define orig_pair CUR Strings[297]
525
+ #define orig_colors CUR Strings[298]
526
+ #define initialize_color CUR Strings[299]
527
+ #define initialize_pair CUR Strings[300]
528
+ #define set_color_pair CUR Strings[301]
529
+ #define set_foreground CUR Strings[302]
530
+ #define set_background CUR Strings[303]
531
+ #define change_char_pitch CUR Strings[304]
532
+ #define change_line_pitch CUR Strings[305]
533
+ #define change_res_horz CUR Strings[306]
534
+ #define change_res_vert CUR Strings[307]
535
+ #define define_char CUR Strings[308]
536
+ #define enter_doublewide_mode CUR Strings[309]
537
+ #define enter_draft_quality CUR Strings[310]
538
+ #define enter_italics_mode CUR Strings[311]
539
+ #define enter_leftward_mode CUR Strings[312]
540
+ #define enter_micro_mode CUR Strings[313]
541
+ #define enter_near_letter_quality CUR Strings[314]
542
+ #define enter_normal_quality CUR Strings[315]
543
+ #define enter_shadow_mode CUR Strings[316]
544
+ #define enter_subscript_mode CUR Strings[317]
545
+ #define enter_superscript_mode CUR Strings[318]
546
+ #define enter_upward_mode CUR Strings[319]
547
+ #define exit_doublewide_mode CUR Strings[320]
548
+ #define exit_italics_mode CUR Strings[321]
549
+ #define exit_leftward_mode CUR Strings[322]
550
+ #define exit_micro_mode CUR Strings[323]
551
+ #define exit_shadow_mode CUR Strings[324]
552
+ #define exit_subscript_mode CUR Strings[325]
553
+ #define exit_superscript_mode CUR Strings[326]
554
+ #define exit_upward_mode CUR Strings[327]
555
+ #define micro_column_address CUR Strings[328]
556
+ #define micro_down CUR Strings[329]
557
+ #define micro_left CUR Strings[330]
558
+ #define micro_right CUR Strings[331]
559
+ #define micro_row_address CUR Strings[332]
560
+ #define micro_up CUR Strings[333]
561
+ #define order_of_pins CUR Strings[334]
562
+ #define parm_down_micro CUR Strings[335]
563
+ #define parm_left_micro CUR Strings[336]
564
+ #define parm_right_micro CUR Strings[337]
565
+ #define parm_up_micro CUR Strings[338]
566
+ #define select_char_set CUR Strings[339]
567
+ #define set_bottom_margin CUR Strings[340]
568
+ #define set_bottom_margin_parm CUR Strings[341]
569
+ #define set_left_margin_parm CUR Strings[342]
570
+ #define set_right_margin_parm CUR Strings[343]
571
+ #define set_top_margin CUR Strings[344]
572
+ #define set_top_margin_parm CUR Strings[345]
573
+ #define start_bit_image CUR Strings[346]
574
+ #define start_char_set_def CUR Strings[347]
575
+ #define stop_bit_image CUR Strings[348]
576
+ #define stop_char_set_def CUR Strings[349]
577
+ #define subscript_characters CUR Strings[350]
578
+ #define superscript_characters CUR Strings[351]
579
+ #define these_cause_cr CUR Strings[352]
580
+ #define zero_motion CUR Strings[353]
581
+ #define char_set_names CUR Strings[354]
582
+ #define key_mouse CUR Strings[355]
583
+ #define mouse_info CUR Strings[356]
584
+ #define req_mouse_pos CUR Strings[357]
585
+ #define get_mouse CUR Strings[358]
586
+ #define set_a_foreground CUR Strings[359]
587
+ #define set_a_background CUR Strings[360]
588
+ #define pkey_plab CUR Strings[361]
589
+ #define device_type CUR Strings[362]
590
+ #define code_set_init CUR Strings[363]
591
+ #define set0_des_seq CUR Strings[364]
592
+ #define set1_des_seq CUR Strings[365]
593
+ #define set2_des_seq CUR Strings[366]
594
+ #define set3_des_seq CUR Strings[367]
595
+ #define set_lr_margin CUR Strings[368]
596
+ #define set_tb_margin CUR Strings[369]
597
+ #define bit_image_repeat CUR Strings[370]
598
+ #define bit_image_newline CUR Strings[371]
599
+ #define bit_image_carriage_return CUR Strings[372]
600
+ #define color_names CUR Strings[373]
601
+ #define define_bit_image_region CUR Strings[374]
602
+ #define end_bit_image_region CUR Strings[375]
603
+ #define set_color_band CUR Strings[376]
604
+ #define set_page_length CUR Strings[377]
605
+ #define display_pc_char CUR Strings[378]
606
+ #define enter_pc_charset_mode CUR Strings[379]
607
+ #define exit_pc_charset_mode CUR Strings[380]
608
+ #define enter_scancode_mode CUR Strings[381]
609
+ #define exit_scancode_mode CUR Strings[382]
610
+ #define pc_term_options CUR Strings[383]
611
+ #define scancode_escape CUR Strings[384]
612
+ #define alt_scancode_esc CUR Strings[385]
613
+ #define enter_horizontal_hl_mode CUR Strings[386]
614
+ #define enter_left_hl_mode CUR Strings[387]
615
+ #define enter_low_hl_mode CUR Strings[388]
616
+ #define enter_right_hl_mode CUR Strings[389]
617
+ #define enter_top_hl_mode CUR Strings[390]
618
+ #define enter_vertical_hl_mode CUR Strings[391]
619
+ #define set_a_attributes CUR Strings[392]
620
+ #define set_pglen_inch CUR Strings[393]
621
+
622
+ #define BOOLWRITE 37
623
+ #define NUMWRITE 33
624
+ #define STRWRITE 394
625
+
626
+ /* older synonyms for some capabilities */
627
+ #define beehive_glitch no_esc_ctlc
628
+ #define teleray_glitch dest_tabs_magic_smso
629
+
630
+ /* HPUX-11 uses this name rather than the standard one */
631
+ #ifndef micro_char_size
632
+ #define micro_char_size micro_col_size
633
+ #endif
634
+
635
+ #ifdef __INTERNAL_CAPS_VISIBLE
636
+ #define termcap_init2 CUR Strings[394]
637
+ #define termcap_reset CUR Strings[395]
638
+ #define magic_cookie_glitch_ul CUR Numbers[33]
639
+ #define backspaces_with_bs CUR Booleans[37]
640
+ #define crt_no_scrolling CUR Booleans[38]
641
+ #define no_correctly_working_cr CUR Booleans[39]
642
+ #define carriage_return_delay CUR Numbers[34]
643
+ #define new_line_delay CUR Numbers[35]
644
+ #define linefeed_if_not_lf CUR Strings[396]
645
+ #define backspace_if_not_bs CUR Strings[397]
646
+ #define gnu_has_meta_key CUR Booleans[40]
647
+ #define linefeed_is_newline CUR Booleans[41]
648
+ #define backspace_delay CUR Numbers[36]
649
+ #define horizontal_tab_delay CUR Numbers[37]
650
+ #define number_of_function_keys CUR Numbers[38]
651
+ #define other_non_function_keys CUR Strings[398]
652
+ #define arrow_key_map CUR Strings[399]
653
+ #define has_hardware_tabs CUR Booleans[42]
654
+ #define return_does_clr_eol CUR Booleans[43]
655
+ #define acs_ulcorner CUR Strings[400]
656
+ #define acs_llcorner CUR Strings[401]
657
+ #define acs_urcorner CUR Strings[402]
658
+ #define acs_lrcorner CUR Strings[403]
659
+ #define acs_ltee CUR Strings[404]
660
+ #define acs_rtee CUR Strings[405]
661
+ #define acs_btee CUR Strings[406]
662
+ #define acs_ttee CUR Strings[407]
663
+ #define acs_hline CUR Strings[408]
664
+ #define acs_vline CUR Strings[409]
665
+ #define acs_plus CUR Strings[410]
666
+ #define memory_lock CUR Strings[411]
667
+ #define memory_unlock CUR Strings[412]
668
+ #define box_chars_1 CUR Strings[413]
669
+ #endif /* __INTERNAL_CAPS_VISIBLE */
670
+
671
+
672
+ /*
673
+ * Predefined terminfo array sizes
674
+ */
675
+ #define BOOLCOUNT 44
676
+ #define NUMCOUNT 39
677
+ #define STRCOUNT 414
678
+
679
+ /* used by code for comparing entries */
680
+ #define acs_chars_index 146
681
+
682
+ typedef struct termtype { /* in-core form of terminfo data */
683
+ char *term_names; /* str_table offset of term names */
684
+ char *str_table; /* pointer to string table */
685
+ NCURSES_SBOOL *Booleans; /* array of boolean values */
686
+ short *Numbers; /* array of integer values */
687
+ char **Strings; /* array of string offsets */
688
+
689
+ #if NCURSES_XNAMES
690
+ char *ext_str_table; /* pointer to extended string table */
691
+ char **ext_Names; /* corresponding names */
692
+
693
+ unsigned short num_Booleans;/* count total Booleans */
694
+ unsigned short num_Numbers; /* count total Numbers */
695
+ unsigned short num_Strings; /* count total Strings */
696
+
697
+ unsigned short ext_Booleans;/* count extensions to Booleans */
698
+ unsigned short ext_Numbers; /* count extensions to Numbers */
699
+ unsigned short ext_Strings; /* count extensions to Strings */
700
+ #endif /* NCURSES_XNAMES */
701
+
702
+ } TERMTYPE;
703
+
704
+ /*
705
+ * The only reason these structures are visible is for read-only use.
706
+ * Programs which modify the data are not, never were, portable across
707
+ * curses implementations.
708
+ *
709
+ * The first field in TERMINAL is used in macros.
710
+ * The remaining fields are private.
711
+ */
712
+ #ifdef NCURSES_INTERNALS
713
+
714
+ #undef TERMINAL
715
+ #define TERMINAL struct term
716
+ TERMINAL;
717
+
718
+ /* configured with --enable-ext-colors */
719
+ typedef struct termtype2 { /* in-core form of terminfo data */
720
+ char *term_names; /* str_table offset of term names */
721
+ char *str_table; /* pointer to string table */
722
+ NCURSES_SBOOL *Booleans; /* array of boolean values */
723
+ int *Numbers; /* array of integer values */
724
+ char **Strings; /* array of string offsets */
725
+
726
+ #if NCURSES_XNAMES
727
+ char *ext_str_table; /* pointer to extended string table */
728
+ char **ext_Names; /* corresponding names */
729
+
730
+ unsigned short num_Booleans;/* count total Booleans */
731
+ unsigned short num_Numbers; /* count total Numbers */
732
+ unsigned short num_Strings; /* count total Strings */
733
+
734
+ unsigned short ext_Booleans;/* count extensions to Booleans */
735
+ unsigned short ext_Numbers; /* count extensions to Numbers */
736
+ unsigned short ext_Strings; /* count extensions to Strings */
737
+ #endif /* NCURSES_XNAMES */
738
+
739
+ } TERMTYPE2;
740
+ #else
741
+
742
+ typedef struct term { /* describe an actual terminal */
743
+ TERMTYPE type; /* terminal type description */
744
+ } TERMINAL;
745
+
746
+ #endif /* NCURSES_INTERNALS */
747
+
748
+ /* configured with --enable-broken_linker and reentrancy disabled */
749
+ #if 0 && !0
750
+ extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
751
+ /* reentrancy enabled */
752
+ #elif 0
753
+ NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);
754
+ #define cur_term NCURSES_PUBLIC_VAR(cur_term())
755
+ #else
756
+ extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
757
+ #endif
758
+
759
+ /* configured with --enable-broken_linker or reentrancy enabled */
760
+ #if 0 || 0
761
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);
762
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);
763
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);
764
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);
765
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);
766
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);
767
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);
768
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);
769
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);
770
+
771
+ #define boolnames NCURSES_PUBLIC_VAR(boolnames())
772
+ #define boolcodes NCURSES_PUBLIC_VAR(boolcodes())
773
+ #define boolfnames NCURSES_PUBLIC_VAR(boolfnames())
774
+ #define numnames NCURSES_PUBLIC_VAR(numnames())
775
+ #define numcodes NCURSES_PUBLIC_VAR(numcodes())
776
+ #define numfnames NCURSES_PUBLIC_VAR(numfnames())
777
+ #define strnames NCURSES_PUBLIC_VAR(strnames())
778
+ #define strcodes NCURSES_PUBLIC_VAR(strcodes())
779
+ #define strfnames NCURSES_PUBLIC_VAR(strfnames())
780
+
781
+ #else
782
+
783
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];
784
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
785
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];
786
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];
787
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];
788
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];
789
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];
790
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];
791
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
792
+
793
+ #endif
794
+
795
+ /*
796
+ * These entrypoints are used only by the ncurses utilities such as tic.
797
+ */
798
+ #ifdef NCURSES_INTERNALS
799
+
800
+ extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);
801
+ extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);
802
+ extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);
803
+ extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);
804
+ extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);
805
+ extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);
806
+ extern NCURSES_EXPORT(char *) _nc_tiparm(int, const char *, ...);
807
+ extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);
808
+ extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);
809
+
810
+ #endif /* NCURSES_INTERNALS */
811
+
812
+ /*
813
+ * Normal entry points
814
+ */
815
+ extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);
816
+ extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);
817
+
818
+ /* miscellaneous entry points */
819
+ extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);
820
+ extern NCURSES_EXPORT(int) setupterm (const char *,int,int *);
821
+
822
+ /* terminfo entry points, also declared in curses.h */
823
+ #if !defined(__NCURSES_H)
824
+ extern NCURSES_EXPORT(char *) tigetstr (const char *);
825
+ extern NCURSES_EXPORT_VAR(char) ttytype[];
826
+ extern NCURSES_EXPORT(int) putp (const char *);
827
+ extern NCURSES_EXPORT(int) tigetflag (const char *);
828
+ extern NCURSES_EXPORT(int) tigetnum (const char *);
829
+
830
+ /* configured without --disable-tparm-varargs? */
831
+ #if 1 /* NCURSES_TPARM_VARARGS */
832
+ extern NCURSES_EXPORT(char *) tparm (const char *, ...); /* special */
833
+ #else
834
+ extern NCURSES_EXPORT(char *) tparm (const char *, long,long,long,long,long,long,long,long,long); /* special */
835
+ #endif
836
+
837
+ extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */
838
+ extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...); /* special */
839
+ extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *); /* special */
840
+
841
+ #endif /* __NCURSES_H */
842
+
843
+ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
844
+ #if !defined(NCURSES_TERMCAP_H_incl)
845
+ extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);
846
+ extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
847
+ extern NCURSES_EXPORT(int) tgetent (char *, const char *);
848
+ extern NCURSES_EXPORT(int) tgetflag (const char *);
849
+ extern NCURSES_EXPORT(int) tgetnum (const char *);
850
+ extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
851
+ #endif /* NCURSES_TERMCAP_H_incl */
852
+
853
+ /*
854
+ * Include curses.h before term.h to enable these extensions.
855
+ */
856
+ #if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)
857
+
858
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tigetstr) (SCREEN*, const char *);
859
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(putp) (SCREEN*, const char *);
860
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag) (SCREEN*, const char *);
861
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum) (SCREEN*, const char *);
862
+
863
+ /* configured without --disable-tparm-varargs? */
864
+ #if 1 /* NCURSES_TPARM_VARARGS */
865
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...); /* special */
866
+ #else
867
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, long,long,long,long,long,long,long,long,long); /* special */
868
+ #endif
869
+
870
+ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
871
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgetstr) (SCREEN*, const char *, char **);
872
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);
873
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);
874
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetflag) (SCREEN*, const char *);
875
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetnum) (SCREEN*, const char *);
876
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);
877
+
878
+ extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);
879
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);
880
+
881
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);
882
+ #endif /* NCURSES_SP_FUNCS */
883
+
884
+ /*
885
+ * Debugging features.
886
+ */
887
+ extern GCC_NORETURN NCURSES_EXPORT(void) exit_terminfo(int);
888
+
889
+ #ifdef __cplusplus
890
+ }
891
+ #endif
892
+
893
+ #endif /* NCURSES_TERM_H_incl */