ZTWHHH commited on
Commit
2741c3f
·
verified ·
1 Parent(s): 004a145

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. janus/include/bzlib.h +282 -0
  2. janus/include/curses.h +0 -0
  3. janus/include/cursesm.h +674 -0
  4. janus/include/cursesw.h +1581 -0
  5. janus/include/cursslk.h +240 -0
  6. janus/include/eti.h +55 -0
  7. janus/include/etip.h +406 -0
  8. janus/include/fakemysql.h +335 -0
  9. janus/include/fakesql.h +283 -0
  10. janus/include/ffitarget.h +164 -0
  11. janus/include/form.h +460 -0
  12. janus/include/itcl2TclOO.h +33 -0
  13. janus/include/itclDecls.h +206 -0
  14. janus/include/itclInt.h +854 -0
  15. janus/include/ks_names.h +1712 -0
  16. janus/include/menu.h +281 -0
  17. janus/include/nc_tparm.h +92 -0
  18. janus/include/ncurses.h +0 -0
  19. janus/include/panel.h +100 -0
  20. janus/include/python3.10/bltinmodule.h +14 -0
  21. janus/include/python3.10/boolobject.h +43 -0
  22. janus/include/python3.10/ceval.h +158 -0
  23. janus/include/python3.10/complexobject.h +69 -0
  24. janus/include/python3.10/enumobject.h +17 -0
  25. janus/include/python3.10/floatobject.h +118 -0
  26. janus/include/python3.10/frameobject.h +20 -0
  27. janus/include/python3.10/interpreteridobject.h +17 -0
  28. janus/include/python3.10/intrcheck.h +30 -0
  29. janus/include/python3.10/longintrepr.h +99 -0
  30. janus/include/python3.10/longobject.h +220 -0
  31. janus/include/python3.10/methodobject.h +116 -0
  32. janus/include/python3.10/namespaceobject.h +19 -0
  33. janus/include/python3.10/objimpl.h +215 -0
  34. janus/include/python3.10/pyconfig.h +1703 -0
  35. janus/include/python3.10/pyexpat.h +57 -0
  36. janus/include/python3.10/pyframe.h +22 -0
  37. janus/include/python3.10/pyhash.h +144 -0
  38. janus/include/python3.10/pymacconfig.h +102 -0
  39. janus/include/python3.10/pymacro.h +132 -0
  40. janus/include/python3.10/pymem.h +104 -0
  41. janus/include/python3.10/pyport.h +889 -0
  42. janus/include/python3.10/pystrhex.h +22 -0
  43. janus/include/python3.10/pystrtod.h +45 -0
  44. janus/include/python3.10/sliceobject.h +65 -0
  45. janus/include/python3.10/traceback.h +26 -0
  46. janus/include/python3.10/unicodeobject.h +1053 -0
  47. janus/include/python3.10/weakrefobject.h +86 -0
  48. janus/include/tcl.h +2642 -0
  49. janus/include/tclInt.h +0 -0
  50. janus/include/tclOO.h +147 -0
janus/include/bzlib.h ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*-------------------------------------------------------------*/
3
+ /*--- Public header file for the library. ---*/
4
+ /*--- bzlib.h ---*/
5
+ /*-------------------------------------------------------------*/
6
+
7
+ /* ------------------------------------------------------------------
8
+ This file is part of bzip2/libbzip2, a program and library for
9
+ lossless, block-sorting data compression.
10
+
11
+ bzip2/libbzip2 version 1.0.8 of 13 July 2019
12
+ Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
13
+
14
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
15
+ README file.
16
+
17
+ This program is released under the terms of the license contained
18
+ in the file LICENSE.
19
+ ------------------------------------------------------------------ */
20
+
21
+
22
+ #ifndef _BZLIB_H
23
+ #define _BZLIB_H
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #define BZ_RUN 0
30
+ #define BZ_FLUSH 1
31
+ #define BZ_FINISH 2
32
+
33
+ #define BZ_OK 0
34
+ #define BZ_RUN_OK 1
35
+ #define BZ_FLUSH_OK 2
36
+ #define BZ_FINISH_OK 3
37
+ #define BZ_STREAM_END 4
38
+ #define BZ_SEQUENCE_ERROR (-1)
39
+ #define BZ_PARAM_ERROR (-2)
40
+ #define BZ_MEM_ERROR (-3)
41
+ #define BZ_DATA_ERROR (-4)
42
+ #define BZ_DATA_ERROR_MAGIC (-5)
43
+ #define BZ_IO_ERROR (-6)
44
+ #define BZ_UNEXPECTED_EOF (-7)
45
+ #define BZ_OUTBUFF_FULL (-8)
46
+ #define BZ_CONFIG_ERROR (-9)
47
+
48
+ typedef
49
+ struct {
50
+ char *next_in;
51
+ unsigned int avail_in;
52
+ unsigned int total_in_lo32;
53
+ unsigned int total_in_hi32;
54
+
55
+ char *next_out;
56
+ unsigned int avail_out;
57
+ unsigned int total_out_lo32;
58
+ unsigned int total_out_hi32;
59
+
60
+ void *state;
61
+
62
+ void *(*bzalloc)(void *,int,int);
63
+ void (*bzfree)(void *,void *);
64
+ void *opaque;
65
+ }
66
+ bz_stream;
67
+
68
+
69
+ #ifndef BZ_IMPORT
70
+ #define BZ_EXPORT
71
+ #endif
72
+
73
+ #ifndef BZ_NO_STDIO
74
+ /* Need a definitition for FILE */
75
+ #include <stdio.h>
76
+ #endif
77
+
78
+ #ifdef _WIN32
79
+ # include <windows.h>
80
+ # ifdef small
81
+ /* windows.h define small to char */
82
+ # undef small
83
+ # endif
84
+ # ifdef BZ_EXPORT
85
+ # define BZ_API(func) WINAPI func
86
+ # define BZ_EXTERN extern
87
+ # else
88
+ /* import windows dll dynamically */
89
+ # define BZ_API(func) (WINAPI * func)
90
+ # define BZ_EXTERN
91
+ # endif
92
+ #else
93
+ # define BZ_API(func) func
94
+ # define BZ_EXTERN extern
95
+ #endif
96
+
97
+
98
+ /*-- Core (low-level) library functions --*/
99
+
100
+ BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
101
+ bz_stream* strm,
102
+ int blockSize100k,
103
+ int verbosity,
104
+ int workFactor
105
+ );
106
+
107
+ BZ_EXTERN int BZ_API(BZ2_bzCompress) (
108
+ bz_stream* strm,
109
+ int action
110
+ );
111
+
112
+ BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
113
+ bz_stream* strm
114
+ );
115
+
116
+ BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
117
+ bz_stream *strm,
118
+ int verbosity,
119
+ int small
120
+ );
121
+
122
+ BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
123
+ bz_stream* strm
124
+ );
125
+
126
+ BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
127
+ bz_stream *strm
128
+ );
129
+
130
+
131
+
132
+ /*-- High(er) level library functions --*/
133
+
134
+ #ifndef BZ_NO_STDIO
135
+ #define BZ_MAX_UNUSED 5000
136
+
137
+ typedef void BZFILE;
138
+
139
+ BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
140
+ int* bzerror,
141
+ FILE* f,
142
+ int verbosity,
143
+ int small,
144
+ void* unused,
145
+ int nUnused
146
+ );
147
+
148
+ BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
149
+ int* bzerror,
150
+ BZFILE* b
151
+ );
152
+
153
+ BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
154
+ int* bzerror,
155
+ BZFILE* b,
156
+ void** unused,
157
+ int* nUnused
158
+ );
159
+
160
+ BZ_EXTERN int BZ_API(BZ2_bzRead) (
161
+ int* bzerror,
162
+ BZFILE* b,
163
+ void* buf,
164
+ int len
165
+ );
166
+
167
+ BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
168
+ int* bzerror,
169
+ FILE* f,
170
+ int blockSize100k,
171
+ int verbosity,
172
+ int workFactor
173
+ );
174
+
175
+ BZ_EXTERN void BZ_API(BZ2_bzWrite) (
176
+ int* bzerror,
177
+ BZFILE* b,
178
+ void* buf,
179
+ int len
180
+ );
181
+
182
+ BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
183
+ int* bzerror,
184
+ BZFILE* b,
185
+ int abandon,
186
+ unsigned int* nbytes_in,
187
+ unsigned int* nbytes_out
188
+ );
189
+
190
+ BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
191
+ int* bzerror,
192
+ BZFILE* b,
193
+ int abandon,
194
+ unsigned int* nbytes_in_lo32,
195
+ unsigned int* nbytes_in_hi32,
196
+ unsigned int* nbytes_out_lo32,
197
+ unsigned int* nbytes_out_hi32
198
+ );
199
+ #endif
200
+
201
+
202
+ /*-- Utility functions --*/
203
+
204
+ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
205
+ char* dest,
206
+ unsigned int* destLen,
207
+ char* source,
208
+ unsigned int sourceLen,
209
+ int blockSize100k,
210
+ int verbosity,
211
+ int workFactor
212
+ );
213
+
214
+ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
215
+ char* dest,
216
+ unsigned int* destLen,
217
+ char* source,
218
+ unsigned int sourceLen,
219
+ int small,
220
+ int verbosity
221
+ );
222
+
223
+
224
+ /*--
225
+ Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
226
+ to support better zlib compatibility.
227
+ This code is not _officially_ part of libbzip2 (yet);
228
+ I haven't tested it, documented it, or considered the
229
+ threading-safeness of it.
230
+ If this code breaks, please contact both Yoshioka and me.
231
+ --*/
232
+
233
+ BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
234
+ void
235
+ );
236
+
237
+ #ifndef BZ_NO_STDIO
238
+ BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
239
+ const char *path,
240
+ const char *mode
241
+ );
242
+
243
+ BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
244
+ int fd,
245
+ const char *mode
246
+ );
247
+
248
+ BZ_EXTERN int BZ_API(BZ2_bzread) (
249
+ BZFILE* b,
250
+ void* buf,
251
+ int len
252
+ );
253
+
254
+ BZ_EXTERN int BZ_API(BZ2_bzwrite) (
255
+ BZFILE* b,
256
+ void* buf,
257
+ int len
258
+ );
259
+
260
+ BZ_EXTERN int BZ_API(BZ2_bzflush) (
261
+ BZFILE* b
262
+ );
263
+
264
+ BZ_EXTERN void BZ_API(BZ2_bzclose) (
265
+ BZFILE* b
266
+ );
267
+
268
+ BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
269
+ BZFILE *b,
270
+ int *errnum
271
+ );
272
+ #endif
273
+
274
+ #ifdef __cplusplus
275
+ }
276
+ #endif
277
+
278
+ #endif
279
+
280
+ /*-------------------------------------------------------------*/
281
+ /*--- end bzlib.h ---*/
282
+ /*-------------------------------------------------------------*/
janus/include/curses.h ADDED
The diff for this file is too large to render. See raw diff
 
janus/include/cursesm.h ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // * This makes emacs happy -*-Mode: C++;-*-
2
+ /****************************************************************************
3
+ * Copyright 2019-2020,2022 Thomas E. Dickey *
4
+ * Copyright 1998-2012,2014 Free Software Foundation, Inc. *
5
+ * *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a *
7
+ * copy of this software and associated documentation files (the *
8
+ * "Software"), to deal in the Software without restriction, including *
9
+ * without limitation the rights to use, copy, modify, merge, publish, *
10
+ * distribute, distribute with modifications, sublicense, and/or sell *
11
+ * copies of the Software, and to permit persons to whom the Software is *
12
+ * furnished to do so, subject to the following conditions: *
13
+ * *
14
+ * The above copyright notice and this permission notice shall be included *
15
+ * in all copies or substantial portions of the Software. *
16
+ * *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24
+ * *
25
+ * Except as contained in this notice, the name(s) of the above copyright *
26
+ * holders shall not be used in advertising or otherwise to promote the *
27
+ * sale, use or other dealings in this Software without prior written *
28
+ * authorization. *
29
+ ****************************************************************************/
30
+
31
+ /****************************************************************************
32
+ * Author: Juergen Pfeifer, 1997 *
33
+ ****************************************************************************/
34
+
35
+ // $Id: cursesm.h,v 1.35 2022/08/20 20:52:15 tom Exp $
36
+
37
+ #ifndef NCURSES_CURSESM_H_incl
38
+ #define NCURSES_CURSESM_H_incl 1
39
+
40
+ #include <ncursesw/cursesp.h>
41
+
42
+ extern "C" {
43
+ # include <ncursesw/menu.h>
44
+ }
45
+ //
46
+ // -------------------------------------------------------------------------
47
+ // This wraps the ITEM type of <ncursesw/menu.h>
48
+ // -------------------------------------------------------------------------
49
+ //
50
+ class NCURSES_CXX_IMPEXP NCursesMenuItem
51
+ {
52
+ friend class NCursesMenu;
53
+
54
+ protected:
55
+ ITEM *item;
56
+
57
+ inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
58
+ if (err != E_OK)
59
+ THROW(new NCursesMenuException (err));
60
+ }
61
+
62
+ public:
63
+ NCursesMenuItem (const char* p_name = NULL,
64
+ const char* p_descript = NULL)
65
+ : item(0)
66
+ {
67
+ item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0);
68
+ if (p_name && !item)
69
+ OnError (E_SYSTEM_ERROR);
70
+ }
71
+ // Create an item. If you pass both parameters as NULL, a delimiting
72
+ // item is constructed which can be used to terminate a list of
73
+ // NCursesMenu objects.
74
+
75
+ NCursesMenuItem& operator=(const NCursesMenuItem& rhs)
76
+ {
77
+ if (this != &rhs) {
78
+ *this = rhs;
79
+ }
80
+ return *this;
81
+ }
82
+
83
+ NCursesMenuItem(const NCursesMenuItem& rhs)
84
+ : item(0)
85
+ {
86
+ (void) rhs;
87
+ }
88
+
89
+ virtual ~NCursesMenuItem () THROWS(NCursesException);
90
+ // Release the items memory
91
+
92
+ inline const char* name () const {
93
+ return ::item_name (item);
94
+ }
95
+ // Name of the item
96
+
97
+ inline const char* description () const {
98
+ return ::item_description (item);
99
+ }
100
+ // Description of the item
101
+
102
+ inline int (index) (void) const {
103
+ return ::item_index (item);
104
+ }
105
+ // Index of the item in an item array (or -1)
106
+
107
+ inline void options_on (Item_Options opts) {
108
+ OnError (::item_opts_on (item, opts));
109
+ }
110
+ // Switch on the items options
111
+
112
+ inline void options_off (Item_Options opts) {
113
+ OnError (::item_opts_off (item, opts));
114
+ }
115
+ // Switch off the item's option
116
+
117
+ inline Item_Options options () const {
118
+ return ::item_opts (item);
119
+ }
120
+ // Retrieve the items options
121
+
122
+ inline void set_options (Item_Options opts) {
123
+ OnError (::set_item_opts (item, opts));
124
+ }
125
+ // Set the items options
126
+
127
+ inline void set_value (bool f) {
128
+ OnError (::set_item_value (item,f));
129
+ }
130
+ // Set/Reset the items selection state
131
+
132
+ inline bool value () const {
133
+ return ::item_value (item);
134
+ }
135
+ // Retrieve the items selection state
136
+
137
+ inline bool visible () const {
138
+ return ::item_visible (item);
139
+ }
140
+ // Retrieve visibility of the item
141
+
142
+ virtual bool action();
143
+ // Perform an action associated with this item; you may use this in an
144
+ // user supplied driver for a menu; you may derive from this class and
145
+ // overload action() to supply items with different actions.
146
+ // If an action returns true, the menu will be exited. The default action
147
+ // is to do nothing.
148
+ };
149
+
150
+ // Prototype for an items callback function.
151
+ typedef bool ITEMCALLBACK(NCursesMenuItem&);
152
+
153
+ // If you don't like to create a child class for individual items to
154
+ // overload action(), you may use this class and provide a callback
155
+ // function pointer for items.
156
+ class NCURSES_CXX_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem
157
+ {
158
+ private:
159
+ ITEMCALLBACK* p_fct;
160
+
161
+ public:
162
+ NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL,
163
+ const char* p_name = NULL,
164
+ const char* p_descript = NULL )
165
+ : NCursesMenuItem (p_name, p_descript),
166
+ p_fct (fct) {
167
+ }
168
+
169
+ NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs)
170
+ {
171
+ if (this != &rhs) {
172
+ *this = rhs;
173
+ }
174
+ return *this;
175
+ }
176
+
177
+ NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs)
178
+ : NCursesMenuItem(rhs),
179
+ p_fct(0)
180
+ {
181
+ }
182
+
183
+ virtual ~NCursesMenuCallbackItem() THROWS(NCursesException);
184
+
185
+ bool action() NCURSES_OVERRIDE;
186
+ };
187
+
188
+ // This are the built-in hook functions in this C++ binding. In C++ we use
189
+ // virtual member functions (see below On_..._Init and On_..._Termination)
190
+ // to provide this functionality in an object oriented manner.
191
+ extern "C" {
192
+ void _nc_xx_mnu_init(MENU *);
193
+ void _nc_xx_mnu_term(MENU *);
194
+ void _nc_xx_itm_init(MENU *);
195
+ void _nc_xx_itm_term(MENU *);
196
+ }
197
+
198
+ //
199
+ // -------------------------------------------------------------------------
200
+ // This wraps the MENU type of <ncursesw/menu.h>
201
+ // -------------------------------------------------------------------------
202
+ //
203
+ class NCURSES_CXX_IMPEXP NCursesMenu : public NCursesPanel
204
+ {
205
+ protected:
206
+ MENU *menu;
207
+
208
+ private:
209
+ NCursesWindow* sub; // the subwindow object
210
+ bool b_sub_owner; // is this our own subwindow?
211
+ bool b_framed; // has the menu a border?
212
+ bool b_autoDelete; // Delete items when deleting menu?
213
+
214
+ NCursesMenuItem** my_items; // The array of items for this menu
215
+
216
+ // This structure is used for the menu's user data field to link the
217
+ // MENU* to the C++ object and to provide extra space for a user pointer.
218
+ typedef struct {
219
+ void* m_user; // the pointer for the user's data
220
+ const NCursesMenu* m_back; // backward pointer to C++ object
221
+ const MENU* m_owner;
222
+ } UserHook;
223
+
224
+ // Get the backward pointer to the C++ object from a MENU
225
+ static inline NCursesMenu* getHook(const MENU *m) {
226
+ UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m));
227
+ assert(hook != 0 && hook->m_owner==m);
228
+ return const_cast<NCursesMenu*>(hook->m_back);
229
+ }
230
+
231
+ friend void _nc_xx_mnu_init(MENU *);
232
+ friend void _nc_xx_mnu_term(MENU *);
233
+ friend void _nc_xx_itm_init(MENU *);
234
+ friend void _nc_xx_itm_term(MENU *);
235
+
236
+ // Calculate ITEM* array for the menu
237
+ ITEM** mapItems(NCursesMenuItem* nitems[]);
238
+
239
+ protected:
240
+ // internal routines
241
+ inline void set_user(void *user) {
242
+ UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
243
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
244
+ uptr->m_user = user;
245
+ }
246
+
247
+ inline void *get_user() {
248
+ UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
249
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
250
+ return uptr->m_user;
251
+ }
252
+
253
+ void InitMenu (NCursesMenuItem* menu[],
254
+ bool with_frame,
255
+ bool autoDeleteItems);
256
+
257
+ inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
258
+ if (err != E_OK)
259
+ THROW(new NCursesMenuException (this, err));
260
+ }
261
+
262
+ // this wraps the menu_driver call.
263
+ virtual int driver (int c) ;
264
+
265
+ // 'Internal' constructor to create a menu without association to
266
+ // an array of items.
267
+ NCursesMenu( int nlines,
268
+ int ncols,
269
+ int begin_y = 0,
270
+ int begin_x = 0)
271
+ : NCursesPanel(nlines,ncols,begin_y,begin_x),
272
+ menu (STATIC_CAST(MENU*)(0)),
273
+ sub(0),
274
+ b_sub_owner(0),
275
+ b_framed(0),
276
+ b_autoDelete(0),
277
+ my_items(0)
278
+ {
279
+ }
280
+
281
+ public:
282
+ // Make a full window size menu
283
+ NCursesMenu (NCursesMenuItem* Items[],
284
+ bool with_frame=FALSE, // Reserve space for a frame?
285
+ bool autoDelete_Items=FALSE) // Autocleanup of Items?
286
+ : NCursesPanel(),
287
+ menu(0),
288
+ sub(0),
289
+ b_sub_owner(0),
290
+ b_framed(0),
291
+ b_autoDelete(0),
292
+ my_items(0)
293
+ {
294
+ InitMenu(Items, with_frame, autoDelete_Items);
295
+ }
296
+
297
+ // Make a menu with a window of this size.
298
+ NCursesMenu (NCursesMenuItem* Items[],
299
+ int nlines,
300
+ int ncols,
301
+ int begin_y = 0,
302
+ int begin_x = 0,
303
+ bool with_frame=FALSE, // Reserve space for a frame?
304
+ bool autoDelete_Items=FALSE) // Autocleanup of Items?
305
+ : NCursesPanel(nlines, ncols, begin_y, begin_x),
306
+ menu(0),
307
+ sub(0),
308
+ b_sub_owner(0),
309
+ b_framed(0),
310
+ b_autoDelete(0),
311
+ my_items(0)
312
+ {
313
+ InitMenu(Items, with_frame, autoDelete_Items);
314
+ }
315
+
316
+ NCursesMenu& operator=(const NCursesMenu& rhs)
317
+ {
318
+ if (this != &rhs) {
319
+ *this = rhs;
320
+ NCursesPanel::operator=(rhs);
321
+ }
322
+ return *this;
323
+ }
324
+
325
+ NCursesMenu(const NCursesMenu& rhs)
326
+ : NCursesPanel(rhs),
327
+ menu(rhs.menu),
328
+ sub(rhs.sub),
329
+ b_sub_owner(rhs.b_sub_owner),
330
+ b_framed(rhs.b_framed),
331
+ b_autoDelete(rhs.b_autoDelete),
332
+ my_items(rhs.my_items)
333
+ {
334
+ }
335
+
336
+ virtual ~NCursesMenu () THROWS(NCursesException);
337
+
338
+ // Retrieve the menus subwindow
339
+ inline NCursesWindow& subWindow() const {
340
+ assert(sub!=NULL);
341
+ return *sub;
342
+ }
343
+
344
+ // Set the menus subwindow
345
+ void setSubWindow(NCursesWindow& sub);
346
+
347
+ // Set these items for the menu
348
+ inline void setItems(NCursesMenuItem* Items[]) {
349
+ OnError(::set_menu_items(menu,mapItems(Items)));
350
+ }
351
+
352
+ // Remove the menu from the screen
353
+ inline void unpost (void) {
354
+ OnError (::unpost_menu (menu));
355
+ }
356
+
357
+ // Post the menu to the screen if flag is true, unpost it otherwise
358
+ inline void post(bool flag = TRUE) {
359
+ flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu));
360
+ }
361
+
362
+ // Get the number of rows and columns for this menu
363
+ inline void scale (int& mrows, int& mcols) const {
364
+ OnError (::scale_menu (menu, &mrows, &mcols));
365
+ }
366
+
367
+ // Set the format of this menu
368
+ inline void set_format(int mrows, int mcols) {
369
+ OnError (::set_menu_format(menu, mrows, mcols));
370
+ }
371
+
372
+ // Get the format of this menu
373
+ inline void menu_format(int& rows,int& ncols) {
374
+ ::menu_format(menu,&rows,&ncols);
375
+ }
376
+
377
+ // Items of the menu
378
+ inline NCursesMenuItem* items() const {
379
+ return *my_items;
380
+ }
381
+
382
+ // Get the number of items in this menu
383
+ inline int count() const {
384
+ return ::item_count(menu);
385
+ }
386
+
387
+ // Get the current item (i.e. the one the cursor is located)
388
+ inline NCursesMenuItem* current_item() const {
389
+ return my_items[::item_index(::current_item(menu))];
390
+ }
391
+
392
+ // Get the marker string
393
+ inline const char* mark() const {
394
+ return ::menu_mark(menu);
395
+ }
396
+
397
+ // Set the marker string
398
+ inline void set_mark(const char *marker) {
399
+ OnError (::set_menu_mark (menu, marker));
400
+ }
401
+
402
+ // Get the name of the request code c
403
+ inline static const char* request_name(int c) {
404
+ return ::menu_request_name(c);
405
+ }
406
+
407
+ // Get the current pattern
408
+ inline char* pattern() const {
409
+ return ::menu_pattern(menu);
410
+ }
411
+
412
+ // true if there is a pattern match, false otherwise.
413
+ bool set_pattern (const char *pat);
414
+
415
+ // set the default attributes for the menu
416
+ // i.e. set fore, back and grey attribute
417
+ virtual void setDefaultAttributes();
418
+
419
+ // Get the menus background attributes
420
+ inline chtype back() const {
421
+ return ::menu_back(menu);
422
+ }
423
+
424
+ // Get the menus foreground attributes
425
+ inline chtype fore() const {
426
+ return ::menu_fore(menu);
427
+ }
428
+
429
+ // Get the menus grey attributes (used for unselectable items)
430
+ inline chtype grey() const {
431
+ return ::menu_grey(menu);
432
+ }
433
+
434
+ // Set the menus background attributes
435
+ inline chtype set_background(chtype a) {
436
+ return ::set_menu_back(menu,a);
437
+ }
438
+
439
+ // Set the menus foreground attributes
440
+ inline chtype set_foreground(chtype a) {
441
+ return ::set_menu_fore(menu,a);
442
+ }
443
+
444
+ // Set the menus grey attributes (used for unselectable items)
445
+ inline chtype set_grey(chtype a) {
446
+ return ::set_menu_grey(menu,a);
447
+ }
448
+
449
+ inline void options_on (Menu_Options opts) {
450
+ OnError (::menu_opts_on (menu,opts));
451
+ }
452
+
453
+ inline void options_off(Menu_Options opts) {
454
+ OnError (::menu_opts_off(menu,opts));
455
+ }
456
+
457
+ inline Menu_Options options() const {
458
+ return ::menu_opts(menu);
459
+ }
460
+
461
+ inline void set_options (Menu_Options opts) {
462
+ OnError (::set_menu_opts (menu,opts));
463
+ }
464
+
465
+ inline int pad() const {
466
+ return ::menu_pad(menu);
467
+ }
468
+
469
+ inline void set_pad (int padch) {
470
+ OnError (::set_menu_pad (menu, padch));
471
+ }
472
+
473
+ // Position the cursor to the current item
474
+ inline void position_cursor () const {
475
+ OnError (::pos_menu_cursor (menu));
476
+ }
477
+
478
+ // Set the current item
479
+ inline void set_current(NCursesMenuItem& I) {
480
+ OnError (::set_current_item(menu, I.item));
481
+ }
482
+
483
+ // Get the current top row of the menu
484
+ inline int top_row (void) const {
485
+ return ::top_row (menu);
486
+ }
487
+
488
+ // Set the current top row of the menu
489
+ inline void set_top_row (int row) {
490
+ OnError (::set_top_row (menu, row));
491
+ }
492
+
493
+ // spacing control
494
+ // Set the spacing for the menu
495
+ inline void setSpacing(int spc_description,
496
+ int spc_rows,
497
+ int spc_columns) {
498
+ OnError(::set_menu_spacing(menu,
499
+ spc_description,
500
+ spc_rows,
501
+ spc_columns));
502
+ }
503
+
504
+ // Get the spacing info for the menu
505
+ inline void Spacing(int& spc_description,
506
+ int& spc_rows,
507
+ int& spc_columns) const {
508
+ OnError(::menu_spacing(menu,
509
+ &spc_description,
510
+ &spc_rows,
511
+ &spc_columns));
512
+ }
513
+
514
+ // Decorations
515
+ inline void frame(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
516
+ if (b_framed)
517
+ NCursesPanel::frame(title,btitle);
518
+ else
519
+ OnError(E_SYSTEM_ERROR);
520
+ }
521
+
522
+ inline void boldframe(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
523
+ if (b_framed)
524
+ NCursesPanel::boldframe(title,btitle);
525
+ else
526
+ OnError(E_SYSTEM_ERROR);
527
+ }
528
+
529
+ inline void label(const char *topLabel, const char *bottomLabel) NCURSES_OVERRIDE {
530
+ if (b_framed)
531
+ NCursesPanel::label(topLabel,bottomLabel);
532
+ else
533
+ OnError(E_SYSTEM_ERROR);
534
+ }
535
+
536
+ // -----
537
+ // Hooks
538
+ // -----
539
+
540
+ // Called after the menu gets repositioned in its window.
541
+ // This is especially true if the menu is posted.
542
+ virtual void On_Menu_Init();
543
+
544
+ // Called before the menu gets repositioned in its window.
545
+ // This is especially true if the menu is unposted.
546
+ virtual void On_Menu_Termination();
547
+
548
+ // Called after the item became the current item
549
+ virtual void On_Item_Init(NCursesMenuItem& item);
550
+
551
+ // Called before this item is left as current item.
552
+ virtual void On_Item_Termination(NCursesMenuItem& item);
553
+
554
+ // Provide a default key virtualization. Translate the keyboard
555
+ // code c into a menu request code.
556
+ // The default implementation provides a hopefully straightforward
557
+ // mapping for the most common keystrokes and menu requests.
558
+ virtual int virtualize(int c);
559
+
560
+
561
+ // Operators
562
+ inline NCursesMenuItem* operator[](int i) const {
563
+ if ( (i < 0) || (i >= ::item_count (menu)) )
564
+ OnError (E_BAD_ARGUMENT);
565
+ return (my_items[i]);
566
+ }
567
+
568
+ // Perform the menu's operation
569
+ // Return the item where you left the selection mark for a single
570
+ // selection menu, or NULL for a multivalued menu.
571
+ virtual NCursesMenuItem* operator()(void);
572
+
573
+ // --------------------
574
+ // Exception handlers
575
+ // Called by operator()
576
+ // --------------------
577
+
578
+ // Called if the request is denied
579
+ virtual void On_Request_Denied(int c) const;
580
+
581
+ // Called if the item is not selectable
582
+ virtual void On_Not_Selectable(int c) const;
583
+
584
+ // Called if pattern doesn't match
585
+ virtual void On_No_Match(int c) const;
586
+
587
+ // Called if the command is unknown
588
+ virtual void On_Unknown_Command(int c) const;
589
+
590
+ };
591
+ //
592
+ // -------------------------------------------------------------------------
593
+ // This is the typical C++ typesafe way to allow to attach
594
+ // user data to an item of a menu. Its assumed that the user
595
+ // data belongs to some class T. Use T as template argument
596
+ // to create a UserItem.
597
+ // -------------------------------------------------------------------------
598
+ //
599
+ template<class T> class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuItem
600
+ {
601
+ public:
602
+ NCursesUserItem (const char* p_name,
603
+ const char* p_descript = NULL,
604
+ const T* p_UserData = STATIC_CAST(T*)(0))
605
+ : NCursesMenuItem (p_name, p_descript) {
606
+ if (item)
607
+ OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData))));
608
+ }
609
+
610
+ virtual ~NCursesUserItem() THROWS(NCursesException) {}
611
+
612
+ inline const T* UserData (void) const {
613
+ return reinterpret_cast<const T*>(::item_userptr (item));
614
+ };
615
+
616
+ inline virtual void setUserData(const T* p_UserData) {
617
+ if (item)
618
+ OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void *>(p_UserData))));
619
+ }
620
+ };
621
+ //
622
+ // -------------------------------------------------------------------------
623
+ // The same mechanism is used to attach user data to a menu
624
+ // -------------------------------------------------------------------------
625
+ //
626
+ template<class T> class NCURSES_CXX_IMPEXP NCursesUserMenu : public NCursesMenu
627
+ {
628
+ protected:
629
+ NCursesUserMenu( int nlines,
630
+ int ncols,
631
+ int begin_y = 0,
632
+ int begin_x = 0,
633
+ const T* p_UserData = STATIC_CAST(T*)(0))
634
+ : NCursesMenu(nlines,ncols,begin_y,begin_x) {
635
+ if (menu)
636
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
637
+ }
638
+
639
+ public:
640
+ NCursesUserMenu (NCursesMenuItem* Items[],
641
+ const T* p_UserData = STATIC_CAST(T*)(0),
642
+ bool with_frame=FALSE,
643
+ bool autoDelete_Items=FALSE)
644
+ : NCursesMenu (&Items, with_frame, autoDelete_Items) {
645
+ if (menu)
646
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
647
+ };
648
+
649
+ NCursesUserMenu (NCursesMenuItem* Items[],
650
+ int nlines,
651
+ int ncols,
652
+ int begin_y = 0,
653
+ int begin_x = 0,
654
+ const T* p_UserData = STATIC_CAST(T*)(0),
655
+ bool with_frame=FALSE)
656
+ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
657
+ if (menu)
658
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
659
+ };
660
+
661
+ virtual ~NCursesUserMenu() THROWS(NCursesException) {
662
+ };
663
+
664
+ inline T* UserData (void) {
665
+ return reinterpret_cast<T*>(get_user ());
666
+ };
667
+
668
+ inline virtual void setUserData (const T* p_UserData) {
669
+ if (menu)
670
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
671
+ }
672
+ };
673
+
674
+ #endif /* NCURSES_CURSESM_H_incl */
janus/include/cursesw.h ADDED
@@ -0,0 +1,1581 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // * This makes emacs happy -*-Mode: C++;-*-
2
+ // vile:cppmode
3
+ /****************************************************************************
4
+ * Copyright 2019-2021,2022 Thomas E. Dickey *
5
+ * Copyright 1998-2014,2017 Free Software Foundation, Inc. *
6
+ * *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a *
8
+ * copy of this software and associated documentation files (the *
9
+ * "Software"), to deal in the Software without restriction, including *
10
+ * without limitation the rights to use, copy, modify, merge, publish, *
11
+ * distribute, distribute with modifications, sublicense, and/or sell *
12
+ * copies of the Software, and to permit persons to whom the Software is *
13
+ * furnished to do so, subject to the following conditions: *
14
+ * *
15
+ * The above copyright notice and this permission notice shall be included *
16
+ * in all copies or substantial portions of the Software. *
17
+ * *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25
+ * *
26
+ * Except as contained in this notice, the name(s) of the above copyright *
27
+ * holders shall not be used in advertising or otherwise to promote the *
28
+ * sale, use or other dealings in this Software without prior written *
29
+ * authorization. *
30
+ ****************************************************************************/
31
+
32
+ #ifndef NCURSES_CURSESW_H_incl
33
+ #define NCURSES_CURSESW_H_incl 1
34
+
35
+ // $Id: cursesw.h,v 1.59 2022/08/20 20:52:15 tom Exp $
36
+
37
+ extern "C" {
38
+ # include <ncursesw/curses.h>
39
+ }
40
+
41
+ #if defined(BUILDING_NCURSES_CXX)
42
+ # define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
43
+ #else
44
+ # define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
45
+ #endif
46
+
47
+ #define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
48
+
49
+ #define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API
50
+ #define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type
51
+
52
+ #include <ncursesw/etip.h>
53
+
54
+ /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
55
+ Undefine it here, because NCursesWindow uses lines as a method. */
56
+ #undef lines
57
+
58
+ /* "Convert" macros to inlines. We'll define it as another symbol to avoid
59
+ * conflict with library symbols.
60
+ */
61
+ #undef UNDEF
62
+ #define UNDEF(name) CUR_ ##name
63
+
64
+ #ifdef addch
65
+ inline int UNDEF(addch)(chtype ch) { return addch(ch); }
66
+ #undef addch
67
+ #define addch UNDEF(addch)
68
+ #endif
69
+
70
+ #ifdef addchstr
71
+ inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); }
72
+ #undef addchstr
73
+ #define addchstr UNDEF(addchstr)
74
+ #endif
75
+
76
+ #ifdef addnstr
77
+ inline int UNDEF(addnstr)(const char *str, int n)
78
+ { return addnstr(str, n); }
79
+ #undef addnstr
80
+ #define addnstr UNDEF(addnstr)
81
+ #endif
82
+
83
+ #ifdef addstr
84
+ inline int UNDEF(addstr)(const char * str) { return addstr(str); }
85
+ #undef addstr
86
+ #define addstr UNDEF(addstr)
87
+ #endif
88
+
89
+ #ifdef attroff
90
+ inline int UNDEF(attroff)(chtype at) { return attroff(at); }
91
+ #undef attroff
92
+ #define attroff UNDEF(attroff)
93
+ #endif
94
+
95
+ #ifdef attron
96
+ inline int UNDEF(attron)(chtype at) { return attron(at); }
97
+ #undef attron
98
+ #define attron UNDEF(attron)
99
+ #endif
100
+
101
+ #ifdef attrset
102
+ inline chtype UNDEF(attrset)(chtype at) { return attrset(at); }
103
+ #undef attrset
104
+ #define attrset UNDEF(attrset)
105
+ #endif
106
+
107
+ #ifdef bkgd
108
+ inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); }
109
+ #undef bkgd
110
+ #define bkgd UNDEF(bkgd)
111
+ #endif
112
+
113
+ #ifdef bkgdset
114
+ inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); }
115
+ #undef bkgdset
116
+ #define bkgdset UNDEF(bkgdset)
117
+ #endif
118
+
119
+ #ifdef border
120
+ inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
121
+ { return border(ls, rs, ts, bs, tl, tr, bl, br); }
122
+ #undef border
123
+ #define border UNDEF(border)
124
+ #endif
125
+
126
+ #ifdef box
127
+ inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); }
128
+ #undef box
129
+ #define box UNDEF(box)
130
+ #endif
131
+
132
+ #ifdef chgat
133
+ inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
134
+ return chgat(n, attr, color, opts); }
135
+ #undef chgat
136
+ #define chgat UNDEF(chgat)
137
+ #endif
138
+
139
+ #ifdef clear
140
+ inline int UNDEF(clear)() { return clear(); }
141
+ #undef clear
142
+ #define clear UNDEF(clear)
143
+ #endif
144
+
145
+ #ifdef clearok
146
+ inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); }
147
+ #undef clearok
148
+ #define clearok UNDEF(clearok)
149
+ #else
150
+ extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool);
151
+ #endif
152
+
153
+ #ifdef clrtobot
154
+ inline int UNDEF(clrtobot)() { return clrtobot(); }
155
+ #undef clrtobot
156
+ #define clrtobot UNDEF(clrtobot)
157
+ #endif
158
+
159
+ #ifdef clrtoeol
160
+ inline int UNDEF(clrtoeol)() { return clrtoeol(); }
161
+ #undef clrtoeol
162
+ #define clrtoeol UNDEF(clrtoeol)
163
+ #endif
164
+
165
+ #ifdef color_set
166
+ inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); }
167
+ #undef color_set
168
+ #define color_set UNDEF(color_set)
169
+ #endif
170
+
171
+ #ifdef crmode
172
+ inline int UNDEF(crmode)(void) { return crmode(); }
173
+ #undef crmode
174
+ #define crmode UNDEF(crmode)
175
+ #endif
176
+
177
+ #ifdef delch
178
+ inline int UNDEF(delch)() { return delch(); }
179
+ #undef delch
180
+ #define delch UNDEF(delch)
181
+ #endif
182
+
183
+ #ifdef deleteln
184
+ inline int UNDEF(deleteln)() { return deleteln(); }
185
+ #undef deleteln
186
+ #define deleteln UNDEF(deleteln)
187
+ #endif
188
+
189
+ #ifdef echochar
190
+ inline int UNDEF(echochar)(chtype ch) { return echochar(ch); }
191
+ #undef echochar
192
+ #define echochar UNDEF(echochar)
193
+ #endif
194
+
195
+ #ifdef erase
196
+ inline int UNDEF(erase)() { return erase(); }
197
+ #undef erase
198
+ #define erase UNDEF(erase)
199
+ #endif
200
+
201
+ #ifdef fixterm
202
+ inline int UNDEF(fixterm)(void) { return fixterm(); }
203
+ #undef fixterm
204
+ #define fixterm UNDEF(fixterm)
205
+ #endif
206
+
207
+ #ifdef flushok
208
+ inline int UNDEF(flushok)(WINDOW* _win, bool _bf) {
209
+ return flushok(_win, _bf); }
210
+ #undef flushok
211
+ #define flushok UNDEF(flushok)
212
+ #else
213
+ #define _no_flushok
214
+ #endif
215
+
216
+ #ifdef getattrs
217
+ inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); }
218
+ #undef getattrs
219
+ #define getattrs UNDEF(getattrs)
220
+ #endif
221
+
222
+ #ifdef getbegyx
223
+ inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); }
224
+ #undef getbegyx
225
+ #define getbegyx UNDEF(getbegyx)
226
+ #endif
227
+
228
+ #ifdef getbkgd
229
+ inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); }
230
+ #undef getbkgd
231
+ #define getbkgd UNDEF(getbkgd)
232
+ #endif
233
+
234
+ #ifdef getch
235
+ inline int UNDEF(getch)() { return getch(); }
236
+ #undef getch
237
+ #define getch UNDEF(getch)
238
+ #endif
239
+
240
+ #ifdef getmaxyx
241
+ inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); }
242
+ #undef getmaxyx
243
+ #define getmaxyx UNDEF(getmaxyx)
244
+ #endif
245
+
246
+ #ifdef getnstr
247
+ inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); }
248
+ #undef getnstr
249
+ #define getnstr UNDEF(getnstr)
250
+ #endif
251
+
252
+ #ifdef getparyx
253
+ inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); }
254
+ #undef getparyx
255
+ #define getparyx UNDEF(getparyx)
256
+ #endif
257
+
258
+ #ifdef getstr
259
+ inline int UNDEF(getstr)(char *_str) { return getstr(_str); }
260
+ #undef getstr
261
+ #define getstr UNDEF(getstr)
262
+ #endif
263
+
264
+ #ifdef getyx
265
+ inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) {
266
+ getyx(win, y, x); }
267
+ #undef getyx
268
+ #define getyx UNDEF(getyx)
269
+ #endif
270
+
271
+ #ifdef hline
272
+ inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); }
273
+ #undef hline
274
+ #define hline UNDEF(hline)
275
+ #endif
276
+
277
+ #ifdef inch
278
+ inline chtype UNDEF(inch)() { return inch(); }
279
+ #undef inch
280
+ #define inch UNDEF(inch)
281
+ #endif
282
+
283
+ #ifdef inchstr
284
+ inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); }
285
+ #undef inchstr
286
+ #define inchstr UNDEF(inchstr)
287
+ #endif
288
+
289
+ #ifdef innstr
290
+ inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); }
291
+ #undef innstr
292
+ #define innstr UNDEF(innstr)
293
+ #endif
294
+
295
+ #ifdef insch
296
+ inline int UNDEF(insch)(chtype c) { return insch(c); }
297
+ #undef insch
298
+ #define insch UNDEF(insch)
299
+ #endif
300
+
301
+ #ifdef insdelln
302
+ inline int UNDEF(insdelln)(int n) { return insdelln(n); }
303
+ #undef insdelln
304
+ #define insdelln UNDEF(insdelln)
305
+ #endif
306
+
307
+ #ifdef insertln
308
+ inline int UNDEF(insertln)() { return insertln(); }
309
+ #undef insertln
310
+ #define insertln UNDEF(insertln)
311
+ #endif
312
+
313
+ #ifdef insnstr
314
+ inline int UNDEF(insnstr)(const char *_str, int n) {
315
+ return insnstr(_str, n); }
316
+ #undef insnstr
317
+ #define insnstr UNDEF(insnstr)
318
+ #endif
319
+
320
+ #ifdef insstr
321
+ inline int UNDEF(insstr)(const char *_str) {
322
+ return insstr(_str); }
323
+ #undef insstr
324
+ #define insstr UNDEF(insstr)
325
+ #endif
326
+
327
+ #ifdef instr
328
+ inline int UNDEF(instr)(char *_str) { return instr(_str); }
329
+ #undef instr
330
+ #define instr UNDEF(instr)
331
+ #endif
332
+
333
+ #ifdef intrflush
334
+ inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); }
335
+ #undef intrflush
336
+ #define intrflush UNDEF(intrflush)
337
+ #endif
338
+
339
+ #ifdef is_linetouched
340
+ inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); }
341
+ #undef is_linetouched
342
+ #define is_linetouched UNDEF(is_linetouched)
343
+ #endif
344
+
345
+ #ifdef leaveok
346
+ inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); }
347
+ #undef leaveok
348
+ #define leaveok UNDEF(leaveok)
349
+ #else
350
+ extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf);
351
+ #endif
352
+
353
+ #ifdef move
354
+ inline int UNDEF(move)(int x, int y) { return move(x, y); }
355
+ #undef move
356
+ #define move UNDEF(move)
357
+ #endif
358
+
359
+ #ifdef mvaddch
360
+ inline int UNDEF(mvaddch)(int y, int x, chtype ch)
361
+ { return mvaddch(y, x, ch); }
362
+ #undef mvaddch
363
+ #define mvaddch UNDEF(mvaddch)
364
+ #endif
365
+
366
+ #ifdef mvaddnstr
367
+ inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n)
368
+ { return mvaddnstr(y, x, str, n); }
369
+ #undef mvaddnstr
370
+ #define mvaddnstr UNDEF(mvaddnstr)
371
+ #endif
372
+
373
+ #ifdef mvaddstr
374
+ inline int UNDEF(mvaddstr)(int y, int x, const char * str)
375
+ { return mvaddstr(y, x, str); }
376
+ #undef mvaddstr
377
+ #define mvaddstr UNDEF(mvaddstr)
378
+ #endif
379
+
380
+ #ifdef mvchgat
381
+ inline int UNDEF(mvchgat)(int y, int x, int n,
382
+ attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
383
+ return mvchgat(y, x, n, attr, color, opts); }
384
+ #undef mvchgat
385
+ #define mvchgat UNDEF(mvchgat)
386
+ #endif
387
+
388
+ #ifdef mvdelch
389
+ inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);}
390
+ #undef mvdelch
391
+ #define mvdelch UNDEF(mvdelch)
392
+ #endif
393
+
394
+ #ifdef mvgetch
395
+ inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);}
396
+ #undef mvgetch
397
+ #define mvgetch UNDEF(mvgetch)
398
+ #endif
399
+
400
+ #ifdef mvgetnstr
401
+ inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) {
402
+ return mvgetnstr(y, x, str, n);}
403
+ #undef mvgetnstr
404
+ #define mvgetnstr UNDEF(mvgetnstr)
405
+ #endif
406
+
407
+ #ifdef mvgetstr
408
+ inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);}
409
+ #undef mvgetstr
410
+ #define mvgetstr UNDEF(mvgetstr)
411
+ #endif
412
+
413
+ #ifdef mvinch
414
+ inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);}
415
+ #undef mvinch
416
+ #define mvinch UNDEF(mvinch)
417
+ #endif
418
+
419
+ #ifdef mvinnstr
420
+ inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) {
421
+ return mvinnstr(y, x, _str, n); }
422
+ #undef mvinnstr
423
+ #define mvinnstr UNDEF(mvinnstr)
424
+ #endif
425
+
426
+ #ifdef mvinsch
427
+ inline int UNDEF(mvinsch)(int y, int x, chtype c)
428
+ { return mvinsch(y, x, c); }
429
+ #undef mvinsch
430
+ #define mvinsch UNDEF(mvinsch)
431
+ #endif
432
+
433
+ #ifdef mvinsnstr
434
+ inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) {
435
+ return mvinsnstr(y, x, _str, n); }
436
+ #undef mvinsnstr
437
+ #define mvinsnstr UNDEF(mvinsnstr)
438
+ #endif
439
+
440
+ #ifdef mvinsstr
441
+ inline int UNDEF(mvinsstr)(int y, int x, const char *_str) {
442
+ return mvinsstr(y, x, _str); }
443
+ #undef mvinsstr
444
+ #define mvinsstr UNDEF(mvinsstr)
445
+ #endif
446
+
447
+ #ifdef mvwaddch
448
+ inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch)
449
+ { return mvwaddch(win, y, x, ch); }
450
+ #undef mvwaddch
451
+ #define mvwaddch UNDEF(mvwaddch)
452
+ #endif
453
+
454
+ #ifdef mvwaddchnstr
455
+ inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n)
456
+ { return mvwaddchnstr(win, y, x, str, n); }
457
+ #undef mvwaddchnstr
458
+ #define mvwaddchnstr UNDEF(mvwaddchnstr)
459
+ #endif
460
+
461
+ #ifdef mvwaddchstr
462
+ inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str)
463
+ { return mvwaddchstr(win, y, x, str); }
464
+ #undef mvwaddchstr
465
+ #define mvwaddchstr UNDEF(mvwaddchstr)
466
+ #endif
467
+
468
+ #ifdef mvwaddnstr
469
+ inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n)
470
+ { return mvwaddnstr(win, y, x, str, n); }
471
+ #undef mvwaddnstr
472
+ #define mvwaddnstr UNDEF(mvwaddnstr)
473
+ #endif
474
+
475
+ #ifdef mvwaddstr
476
+ inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str)
477
+ { return mvwaddstr(win, y, x, str); }
478
+ #undef mvwaddstr
479
+ #define mvwaddstr UNDEF(mvwaddstr)
480
+ #endif
481
+
482
+ #ifdef mvwchgat
483
+ inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n,
484
+ attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
485
+ return mvwchgat(win, y, x, n, attr, color, opts); }
486
+ #undef mvwchgat
487
+ #define mvwchgat UNDEF(mvwchgat)
488
+ #endif
489
+
490
+ #ifdef mvwdelch
491
+ inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x)
492
+ { return mvwdelch(win, y, x); }
493
+ #undef mvwdelch
494
+ #define mvwdelch UNDEF(mvwdelch)
495
+ #endif
496
+
497
+ #ifdef mvwgetch
498
+ inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);}
499
+ #undef mvwgetch
500
+ #define mvwgetch UNDEF(mvwgetch)
501
+ #endif
502
+
503
+ #ifdef mvwgetnstr
504
+ inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n)
505
+ {return mvwgetnstr(win, y, x, str, n);}
506
+ #undef mvwgetnstr
507
+ #define mvwgetnstr UNDEF(mvwgetnstr)
508
+ #endif
509
+
510
+ #ifdef mvwgetstr
511
+ inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str)
512
+ {return mvwgetstr(win, y, x, str);}
513
+ #undef mvwgetstr
514
+ #define mvwgetstr UNDEF(mvwgetstr)
515
+ #endif
516
+
517
+ #ifdef mvwhline
518
+ inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) {
519
+ return mvwhline(win, y, x, c, n); }
520
+ #undef mvwhline
521
+ #define mvwhline UNDEF(mvwhline)
522
+ #endif
523
+
524
+ #ifdef mvwinch
525
+ inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) {
526
+ return mvwinch(win, y, x);}
527
+ #undef mvwinch
528
+ #define mvwinch UNDEF(mvwinch)
529
+ #endif
530
+
531
+ #ifdef mvwinchnstr
532
+ inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); }
533
+ #undef mvwinchnstr
534
+ #define mvwinchnstr UNDEF(mvwinchnstr)
535
+ #endif
536
+
537
+ #ifdef mvwinchstr
538
+ inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); }
539
+ #undef mvwinchstr
540
+ #define mvwinchstr UNDEF(mvwinchstr)
541
+ #endif
542
+
543
+ #ifdef mvwinnstr
544
+ inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) {
545
+ return mvwinnstr(win, y, x, _str, n); }
546
+ #undef mvwinnstr
547
+ #define mvwinnstr UNDEF(mvwinnstr)
548
+ #endif
549
+
550
+ #ifdef mvwinsch
551
+ inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c)
552
+ { return mvwinsch(win, y, x, c); }
553
+ #undef mvwinsch
554
+ #define mvwinsch UNDEF(mvwinsch)
555
+ #endif
556
+
557
+ #ifdef mvwinsnstr
558
+ inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) {
559
+ return mvwinsnstr(w, y, x, _str, n); }
560
+ #undef mvwinsnstr
561
+ #define mvwinsnstr UNDEF(mvwinsnstr)
562
+ #endif
563
+
564
+ #ifdef mvwinsstr
565
+ inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) {
566
+ return mvwinsstr(w, y, x, _str); }
567
+ #undef mvwinsstr
568
+ #define mvwinsstr UNDEF(mvwinsstr)
569
+ #endif
570
+
571
+ #ifdef mvwvline
572
+ inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) {
573
+ return mvwvline(win, y, x, c, n); }
574
+ #undef mvwvline
575
+ #define mvwvline UNDEF(mvwvline)
576
+ #endif
577
+
578
+ #ifdef napms
579
+ inline void UNDEF(napms)(unsigned long x) { napms(x); }
580
+ #undef napms
581
+ #define napms UNDEF(napms)
582
+ #endif
583
+
584
+ #ifdef nocrmode
585
+ inline int UNDEF(nocrmode)(void) { return nocrmode(); }
586
+ #undef nocrmode
587
+ #define nocrmode UNDEF(nocrmode)
588
+ #endif
589
+
590
+ #ifdef nodelay
591
+ inline void UNDEF(nodelay)() { nodelay(); }
592
+ #undef nodelay
593
+ #define nodelay UNDEF(nodelay)
594
+ #endif
595
+
596
+ #ifdef redrawwin
597
+ inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); }
598
+ #undef redrawwin
599
+ #define redrawwin UNDEF(redrawwin)
600
+ #endif
601
+
602
+ #ifdef refresh
603
+ inline int UNDEF(refresh)() { return refresh(); }
604
+ #undef refresh
605
+ #define refresh UNDEF(refresh)
606
+ #endif
607
+
608
+ #ifdef resetterm
609
+ inline int UNDEF(resetterm)(void) { return resetterm(); }
610
+ #undef resetterm
611
+ #define resetterm UNDEF(resetterm)
612
+ #endif
613
+
614
+ #ifdef saveterm
615
+ inline int UNDEF(saveterm)(void) { return saveterm(); }
616
+ #undef saveterm
617
+ #define saveterm UNDEF(saveterm)
618
+ #endif
619
+
620
+ #ifdef scrl
621
+ inline int UNDEF(scrl)(int l) { return scrl(l); }
622
+ #undef scrl
623
+ #define scrl UNDEF(scrl)
624
+ #endif
625
+
626
+ #ifdef scroll
627
+ inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); }
628
+ #undef scroll
629
+ #define scroll UNDEF(scroll)
630
+ #endif
631
+
632
+ #ifdef scrollok
633
+ inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); }
634
+ #undef scrollok
635
+ #define scrollok UNDEF(scrollok)
636
+ #else
637
+ #if defined(__NCURSES_H)
638
+ extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool);
639
+ #else
640
+ extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char);
641
+ #endif
642
+ #endif
643
+
644
+ #ifdef setscrreg
645
+ inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); }
646
+ #undef setscrreg
647
+ #define setscrreg UNDEF(setscrreg)
648
+ #endif
649
+
650
+ #ifdef standend
651
+ inline int UNDEF(standend)() { return standend(); }
652
+ #undef standend
653
+ #define standend UNDEF(standend)
654
+ #endif
655
+
656
+ #ifdef standout
657
+ inline int UNDEF(standout)() { return standout(); }
658
+ #undef standout
659
+ #define standout UNDEF(standout)
660
+ #endif
661
+
662
+ #ifdef subpad
663
+ inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x)
664
+ { return derwin(p, l, c, y, x); }
665
+ #undef subpad
666
+ #define subpad UNDEF(subpad)
667
+ #endif
668
+
669
+ #ifdef timeout
670
+ inline void UNDEF(timeout)(int delay) { timeout(delay); }
671
+ #undef timeout
672
+ #define timeout UNDEF(timeout)
673
+ #endif
674
+
675
+ #ifdef touchline
676
+ inline int UNDEF(touchline)(WINDOW *win, int s, int c)
677
+ { return touchline(win, s, c); }
678
+ #undef touchline
679
+ #define touchline UNDEF(touchline)
680
+ #endif
681
+
682
+ #ifdef touchwin
683
+ inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); }
684
+ #undef touchwin
685
+ #define touchwin UNDEF(touchwin)
686
+ #endif
687
+
688
+ #ifdef untouchwin
689
+ inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); }
690
+ #undef untouchwin
691
+ #define untouchwin UNDEF(untouchwin)
692
+ #endif
693
+
694
+ #ifdef vline
695
+ inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); }
696
+ #undef vline
697
+ #define vline UNDEF(vline)
698
+ #endif
699
+
700
+ #ifdef waddchstr
701
+ inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); }
702
+ #undef waddchstr
703
+ #define waddchstr UNDEF(waddchstr)
704
+ #endif
705
+
706
+ #ifdef waddstr
707
+ inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); }
708
+ #undef waddstr
709
+ #define waddstr UNDEF(waddstr)
710
+ #endif
711
+
712
+ #ifdef wattroff
713
+ inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); }
714
+ #undef wattroff
715
+ #define wattroff UNDEF(wattroff)
716
+ #endif
717
+
718
+ #ifdef wattrset
719
+ inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); }
720
+ #undef wattrset
721
+ #define wattrset UNDEF(wattrset)
722
+ #endif
723
+
724
+ #ifdef winch
725
+ inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); }
726
+ #undef winch
727
+ #define winch UNDEF(winch)
728
+ #endif
729
+
730
+ #ifdef winchnstr
731
+ inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); }
732
+ #undef winchnstr
733
+ #define winchnstr UNDEF(winchnstr)
734
+ #endif
735
+
736
+ #ifdef winchstr
737
+ inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); }
738
+ #undef winchstr
739
+ #define winchstr UNDEF(winchstr)
740
+ #endif
741
+
742
+ #ifdef winsstr
743
+ inline int UNDEF(winsstr)(WINDOW *w, const char *_str) {
744
+ return winsstr(w, _str); }
745
+ #undef winsstr
746
+ #define winsstr UNDEF(winsstr)
747
+ #endif
748
+
749
+ #ifdef wstandend
750
+ inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); }
751
+ #undef wstandend
752
+ #define wstandend UNDEF(wstandend)
753
+ #endif
754
+
755
+ #ifdef wstandout
756
+ inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); }
757
+ #undef wstandout
758
+ #define wstandout UNDEF(wstandout)
759
+ #endif
760
+
761
+ /*
762
+ *
763
+ * C++ class for windows.
764
+ *
765
+ */
766
+
767
+ extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int));
768
+ extern "C" int _nc_xx_ripoff_init(WINDOW *, int);
769
+ extern "C" int _nc_has_mouse(void);
770
+
771
+ class NCURSES_CXX_IMPEXP NCursesWindow
772
+ {
773
+ friend class NCursesMenu;
774
+ friend class NCursesForm;
775
+
776
+ private:
777
+ static bool b_initialized;
778
+ static void initialize();
779
+ void constructing();
780
+ friend int _nc_xx_ripoff_init(WINDOW *, int);
781
+
782
+ void set_keyboard();
783
+
784
+ NCURSES_COLOR_T getcolor(int getback) const;
785
+ NCURSES_PAIRS_T getPair() const;
786
+
787
+ static int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair);
788
+ static int colorInitialized;
789
+
790
+ // This private constructor is only used during the initialization
791
+ // of windows generated by ripoffline() calls.
792
+ NCursesWindow(WINDOW* win, int ncols);
793
+
794
+ protected:
795
+ virtual void err_handler(const char *) const THROWS(NCursesException);
796
+ // Signal an error with the given message text.
797
+
798
+ static long count; // count of all active windows:
799
+ // We rely on the c++ promise that
800
+ // all otherwise uninitialized
801
+ // static class vars are set to 0
802
+
803
+ WINDOW* w; // the curses WINDOW
804
+
805
+ bool alloced; // TRUE if we own the WINDOW
806
+
807
+ NCursesWindow* par; // parent, if subwindow
808
+ NCursesWindow* subwins; // head of subwindows list
809
+ NCursesWindow* sib; // next subwindow of parent
810
+
811
+ void kill_subwindows(); // disable all subwindows
812
+ // Destroy all subwindows.
813
+
814
+ /* Only for use by derived classes. They are then in charge to
815
+ fill the member variables correctly. */
816
+ NCursesWindow();
817
+
818
+ public:
819
+ explicit NCursesWindow(WINDOW* window); // useful only for stdscr
820
+
821
+ NCursesWindow(int nlines, // number of lines
822
+ int ncols, // number of columns
823
+ int begin_y, // line origin
824
+ int begin_x); // col origin
825
+
826
+ NCursesWindow(NCursesWindow& par,// parent window
827
+ int nlines, // number of lines
828
+ int ncols, // number of columns
829
+ int begin_y, // absolute or relative
830
+ int begin_x, // origins:
831
+ char absrel = 'a');// if `a', begin_y & begin_x are
832
+ // absolute screen pos, else if `r', they are relative to par origin
833
+
834
+ NCursesWindow(NCursesWindow& par,// parent window
835
+ bool do_box = TRUE);
836
+ // this is the very common case that we want to create the subwindow that
837
+ // is two lines and two columns smaller and begins at (1,1).
838
+ // We may automatically request the box around it.
839
+
840
+ NCursesWindow& operator=(const NCursesWindow& rhs)
841
+ {
842
+ if (this != &rhs)
843
+ *this = rhs;
844
+ return *this;
845
+ }
846
+
847
+ NCursesWindow(const NCursesWindow& rhs)
848
+ : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib)
849
+ {
850
+ }
851
+
852
+ virtual ~NCursesWindow() THROWS(NCursesException);
853
+
854
+ NCursesWindow Clone();
855
+ // Make an exact copy of the window.
856
+
857
+ // Initialization.
858
+ static void useColors(void);
859
+ // Call this routine very early if you want to have colors.
860
+
861
+ static int ripoffline(int ripoff_lines,
862
+ int (*init)(NCursesWindow& win));
863
+ // This function is used to generate a window of ripped-of lines.
864
+ // If the argument is positive, lines are removed from the top, if it
865
+ // is negative lines are removed from the bottom. This enhances the
866
+ // lowlevel ripoffline() function because it uses the internal
867
+ // implementation that allows to remove more than just a single line.
868
+ // This function must be called before any other ncurses function. The
869
+ // creation of the window is deferred until ncurses gets initialized.
870
+ // The initialization function is then called.
871
+
872
+ // -------------------------------------------------------------------------
873
+ // terminal status
874
+ // -------------------------------------------------------------------------
875
+ int lines() const { initialize(); return LINES; }
876
+ // Number of lines on terminal, *not* window
877
+
878
+ int cols() const { initialize(); return COLS; }
879
+ // Number of cols on terminal, *not* window
880
+
881
+ int tabsize() const { initialize(); return TABSIZE; }
882
+ // Size of a tab on terminal, *not* window
883
+
884
+ static int NumberOfColors();
885
+ // Number of available colors
886
+
887
+ int colors() const { return NumberOfColors(); }
888
+ // Number of available colors
889
+
890
+ // -------------------------------------------------------------------------
891
+ // window status
892
+ // -------------------------------------------------------------------------
893
+ int height() const { return maxy() + 1; }
894
+ // Number of lines in this window
895
+
896
+ int width() const { return maxx() + 1; }
897
+ // Number of columns in this window
898
+
899
+ int begx() const { return getbegx(w); }
900
+ // Column of top left corner relative to stdscr
901
+
902
+ int begy() const { return getbegy(w); }
903
+ // Line of top left corner relative to stdscr
904
+
905
+ int curx() const { return getcurx(w); }
906
+ // Column of top left corner relative to stdscr
907
+
908
+ int cury() const { return getcury(w); }
909
+ // Line of top left corner relative to stdscr
910
+
911
+ int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; }
912
+ // Largest x coord in window
913
+
914
+ int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
915
+ // Largest y coord in window
916
+
917
+ NCURSES_PAIRS_T getcolor() const;
918
+ // Actual color pair
919
+
920
+ NCURSES_COLOR_T foreground() const { return getcolor(0); }
921
+ // Actual foreground color
922
+
923
+ NCURSES_COLOR_T background() const { return getcolor(1); }
924
+ // Actual background color
925
+
926
+ int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back);
927
+ // Set color palette entry
928
+
929
+ int setcolor(NCURSES_PAIRS_T pair);
930
+ // Set actually used palette entry
931
+
932
+ // -------------------------------------------------------------------------
933
+ // window positioning
934
+ // -------------------------------------------------------------------------
935
+ virtual int mvwin(int begin_y, int begin_x) {
936
+ return ::mvwin(w, begin_y, begin_x); }
937
+ // Move window to new position with the new position as top left corner.
938
+ // This is virtual because it is redefined in NCursesPanel.
939
+
940
+ // -------------------------------------------------------------------------
941
+ // coordinate positioning
942
+ // -------------------------------------------------------------------------
943
+ int move(int y, int x) { return ::wmove(w, y, x); }
944
+ // Move cursor the this position
945
+
946
+ void getyx(int& y, int& x) const { ::getyx(w, y, x); }
947
+ // Get current position of the cursor
948
+
949
+ void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); }
950
+ // Get beginning of the window
951
+
952
+ void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); }
953
+ // Get size of the window
954
+
955
+ void getparyx(int& y, int& x) const { ::getparyx(w, y, x); }
956
+ // Get parent's beginning of the window
957
+
958
+ int mvcur(int oldrow, int oldcol, int newrow, int newcol) const {
959
+ return ::mvcur(oldrow, oldcol, newrow, newcol); }
960
+ // Perform lowlevel cursor motion that takes effect immediately.
961
+
962
+ // -------------------------------------------------------------------------
963
+ // input
964
+ // -------------------------------------------------------------------------
965
+ int getch() { return ::wgetch(w); }
966
+ // Get a keystroke from the window.
967
+
968
+ int getch(int y, int x) { return ::mvwgetch(w, y, x); }
969
+ // Move cursor to position and get a keystroke from the window
970
+
971
+ int getstr(char* str, int n=-1) {
972
+ return ::wgetnstr(w, str, n); }
973
+ // Read a series of characters into str until a newline or carriage return
974
+ // is received. Read at most n characters. If n is negative, the limit is
975
+ // ignored.
976
+
977
+ int getstr(int y, int x, char* str, int n=-1) {
978
+ return ::mvwgetnstr(w, y, x, str, n); }
979
+ // Move the cursor to the requested position and then perform the getstr()
980
+ // as described above.
981
+
982
+ int instr(char *s, int n=-1) { return ::winnstr(w, s, n); }
983
+ // Get a string of characters from the window into the buffer s. Retrieve
984
+ // at most n characters, if n is negative retrieve all characters up to the
985
+ // end of the current line. Attributes are stripped from the characters.
986
+
987
+ int instr(int y, int x, char *s, int n=-1) {
988
+ return ::mvwinnstr(w, y, x, s, n); }
989
+ // Move the cursor to the requested position and then perform the instr()
990
+ // as described above.
991
+
992
+ int scanw(const char* fmt, ...)
993
+ // Perform a scanw function from the window.
994
+ #if __GNUG__ >= 2
995
+ __attribute__ ((format (scanf, 2, 3)));
996
+ #else
997
+ ;
998
+ #endif
999
+
1000
+ int scanw(const char*, va_list);
1001
+ // Perform a scanw function from the window.
1002
+
1003
+ int scanw(int y, int x, const char* fmt, ...)
1004
+ // Move the cursor to the requested position and then perform a scanw
1005
+ // from the window.
1006
+ #if __GNUG__ >= 2
1007
+ __attribute__ ((format (scanf, 4, 5)));
1008
+ #else
1009
+ ;
1010
+ #endif
1011
+
1012
+ int scanw(int y, int x, const char* fmt, va_list);
1013
+ // Move the cursor to the requested position and then perform a scanw
1014
+ // from the window.
1015
+
1016
+ // -------------------------------------------------------------------------
1017
+ // output
1018
+ // -------------------------------------------------------------------------
1019
+ int addch(const chtype ch) { return ::waddch(w, ch); }
1020
+ // Put attributed character to the window.
1021
+
1022
+ int addch(int y, int x, const chtype ch) {
1023
+ return ::mvwaddch(w, y, x, ch); }
1024
+ // Move cursor to the requested position and then put attributed character
1025
+ // to the window.
1026
+
1027
+ int echochar(const chtype ch) { return ::wechochar(w, ch); }
1028
+ // Put attributed character to the window and refresh it immediately.
1029
+
1030
+ int addstr(const char* str, int n=-1) {
1031
+ return ::waddnstr(w, str, n); }
1032
+ // Write the string str to the window, stop writing if the terminating
1033
+ // NUL or the limit n is reached. If n is negative, it is ignored.
1034
+
1035
+ int addstr(int y, int x, const char * str, int n=-1) {
1036
+ return ::mvwaddnstr(w, y, x, str, n); }
1037
+ // Move the cursor to the requested position and then perform the addchstr
1038
+ // as described above.
1039
+
1040
+ int addchstr(const chtype* str, int n=-1) {
1041
+ return ::waddchnstr(w, str, n); }
1042
+ // Write the string str to the window, stop writing if the terminating
1043
+ // NUL or the limit n is reached. If n is negative, it is ignored.
1044
+
1045
+ int addchstr(int y, int x, const chtype * str, int n=-1) {
1046
+ return ::mvwaddchnstr(w, y, x, str, n); }
1047
+ // Move the cursor to the requested position and then perform the addchstr
1048
+ // as described above.
1049
+
1050
+ int printw(const char* fmt, ...)
1051
+ // Do a formatted print to the window.
1052
+ #if (__GNUG__ >= 2) && !defined(printf)
1053
+ __attribute__ ((format (printf, 2, 3)));
1054
+ #else
1055
+ ;
1056
+ #endif
1057
+
1058
+ int printw(int y, int x, const char * fmt, ...)
1059
+ // Move the cursor and then do a formatted print to the window.
1060
+ #if (__GNUG__ >= 2) && !defined(printf)
1061
+ __attribute__ ((format (printf, 4, 5)));
1062
+ #else
1063
+ ;
1064
+ #endif
1065
+
1066
+ int printw(const char* fmt, va_list args);
1067
+ // Do a formatted print to the window.
1068
+
1069
+ int printw(int y, int x, const char * fmt, va_list args);
1070
+ // Move the cursor and then do a formatted print to the window.
1071
+
1072
+ chtype inch() const { return ::winch(w); }
1073
+ // Retrieve attributed character under the current cursor position.
1074
+
1075
+ chtype inch(int y, int x) { return ::mvwinch(w, y, x); }
1076
+ // Move cursor to requested position and then retrieve attributed character
1077
+ // at this position.
1078
+
1079
+ int inchstr(chtype* str, int n=-1) {
1080
+ return ::winchnstr(w, str, n); }
1081
+ // Read the string str from the window, stop reading if the terminating
1082
+ // NUL or the limit n is reached. If n is negative, it is ignored.
1083
+
1084
+ int inchstr(int y, int x, chtype * str, int n=-1) {
1085
+ return ::mvwinchnstr(w, y, x, str, n); }
1086
+ // Move the cursor to the requested position and then perform the inchstr
1087
+ // as described above.
1088
+
1089
+ int insch(chtype ch) { return ::winsch(w, ch); }
1090
+ // Insert attributed character into the window before current cursor
1091
+ // position.
1092
+
1093
+ int insch(int y, int x, chtype ch) {
1094
+ return ::mvwinsch(w, y, x, ch); }
1095
+ // Move cursor to requested position and then insert the attributed
1096
+ // character before that position.
1097
+
1098
+ int insertln() { return ::winsdelln(w, 1); }
1099
+ // Insert an empty line above the current line.
1100
+
1101
+ int insdelln(int n=1) { return ::winsdelln(w, n); }
1102
+ // If n>0 insert that many lines above the current line. If n<0 delete
1103
+ // that many lines beginning with the current line.
1104
+
1105
+ int insstr(const char *s, int n=-1) {
1106
+ return ::winsnstr(w, s, n); }
1107
+ // Insert the string into the window before the current cursor position.
1108
+ // Insert stops at end of string or when the limit n is reached. If n is
1109
+ // negative, it is ignored.
1110
+
1111
+ int insstr(int y, int x, const char *s, int n=-1) {
1112
+ return ::mvwinsnstr(w, y, x, s, n); }
1113
+ // Move the cursor to the requested position and then perform the insstr()
1114
+ // as described above.
1115
+
1116
+ int attron (chtype at) { return ::wattron (w, at); }
1117
+ // Switch on the window attributes;
1118
+
1119
+ int attroff(chtype at) { return ::wattroff(w, static_cast<int>(at)); }
1120
+ // Switch off the window attributes;
1121
+
1122
+ int attrset(chtype at) { return ::wattrset(w, static_cast<int>(at)); }
1123
+ // Set the window attributes;
1124
+
1125
+ chtype attrget() { return ::getattrs(w); }
1126
+ // Get the window attributes;
1127
+
1128
+ int color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) {
1129
+ return ::wcolor_set(w, color_pair_number, opts); }
1130
+ // Set the window color attribute;
1131
+
1132
+ int chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
1133
+ return ::wchgat(w, n, attr, color, opts); }
1134
+ // Change the attributes of the next n characters in the current line. If
1135
+ // n is negative or greater than the number of remaining characters in the
1136
+ // line, the attributes will be changed up to the end of the line.
1137
+
1138
+ int chgat(int y, int x,
1139
+ int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
1140
+ return ::mvwchgat(w, y, x, n, attr, color, opts); }
1141
+ // Move the cursor to the requested position and then perform chgat() as
1142
+ // described above.
1143
+
1144
+ // -------------------------------------------------------------------------
1145
+ // background
1146
+ // -------------------------------------------------------------------------
1147
+ chtype getbkgd() const { return ::getbkgd(w); }
1148
+ // Get current background setting.
1149
+
1150
+ int bkgd(const chtype ch) { return ::wbkgd(w, ch); }
1151
+ // Set the background property and apply it to the window.
1152
+
1153
+ void bkgdset(chtype ch) { ::wbkgdset(w, ch); }
1154
+ // Set the background property.
1155
+
1156
+ // -------------------------------------------------------------------------
1157
+ // borders
1158
+ // -------------------------------------------------------------------------
1159
+ int box(chtype vert=0, chtype hor=0) {
1160
+ return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); }
1161
+ // Draw a box around the window with the given vertical and horizontal
1162
+ // drawing characters. If you specify a zero as character, curses will try
1163
+ // to find a "nice" character.
1164
+
1165
+ int border(chtype left=0, chtype right=0,
1166
+ chtype top =0, chtype bottom=0,
1167
+ chtype top_left =0, chtype top_right=0,
1168
+ chtype bottom_left =0, chtype bottom_right=0) {
1169
+ return ::wborder(w, left, right, top, bottom, top_left, top_right,
1170
+ bottom_left, bottom_right); }
1171
+ // Draw a border around the window with the given characters for the
1172
+ // various parts of the border. If you pass zero for a character, curses
1173
+ // will try to find "nice" characters.
1174
+
1175
+ // -------------------------------------------------------------------------
1176
+ // lines and boxes
1177
+ // -------------------------------------------------------------------------
1178
+ int hline(int len, chtype ch=0) { return ::whline(w, ch, len); }
1179
+ // Draw a horizontal line of len characters with the given character. If
1180
+ // you pass zero for the character, curses will try to find a "nice" one.
1181
+
1182
+ int hline(int y, int x, int len, chtype ch=0) {
1183
+ return ::mvwhline(w, y, x, ch, len); }
1184
+ // Move the cursor to the requested position and then draw a horizontal line.
1185
+
1186
+ int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); }
1187
+ // Draw a vertical line of len characters with the given character. If
1188
+ // you pass zero for the character, curses will try to find a "nice" one.
1189
+
1190
+ int vline(int y, int x, int len, chtype ch=0) {
1191
+ return ::mvwvline(w, y, x, ch, len); }
1192
+ // Move the cursor to the requested position and then draw a vertical line.
1193
+
1194
+ // -------------------------------------------------------------------------
1195
+ // erasure
1196
+ // -------------------------------------------------------------------------
1197
+ int erase() { return ::werase(w); }
1198
+ // Erase the window.
1199
+
1200
+ int clear() { return ::wclear(w); }
1201
+ // Clear the window.
1202
+
1203
+ int clearok(bool bf) { return ::clearok(w, bf); }
1204
+ // Set/Reset the clear flag. If set, the next refresh() will clear the
1205
+ // screen.
1206
+
1207
+ int clrtobot() { return ::wclrtobot(w); }
1208
+ // Clear to the end of the window.
1209
+
1210
+ int clrtoeol() { return ::wclrtoeol(w); }
1211
+ // Clear to the end of the line.
1212
+
1213
+ int delch() { return ::wdelch(w); }
1214
+ // Delete character under the cursor.
1215
+
1216
+ int delch(int y, int x) { return ::mvwdelch(w, y, x); }
1217
+ // Move cursor to requested position and delete the character under the
1218
+ // cursor.
1219
+
1220
+ int deleteln() { return ::winsdelln(w, -1); }
1221
+ // Delete the current line.
1222
+
1223
+ // -------------------------------------------------------------------------
1224
+ // screen control
1225
+ // -------------------------------------------------------------------------
1226
+ int scroll(int amount=1) { return ::wscrl(w, amount); }
1227
+ // Scroll amount lines. If amount is positive, scroll up, otherwise
1228
+ // scroll down.
1229
+
1230
+ int scrollok(bool bf) { return ::scrollok(w, bf); }
1231
+ // If bf is TRUE, window scrolls if cursor is moved off the bottom
1232
+ // edge of the window or a scrolling region, otherwise the cursor is left
1233
+ // at the bottom line.
1234
+
1235
+ int setscrreg(int from, int to) {
1236
+ return ::wsetscrreg(w, from, to); }
1237
+ // Define a soft scrolling region.
1238
+
1239
+ int idlok(bool bf) { return ::idlok(w, bf); }
1240
+ // If bf is TRUE, use insert/delete line hardware support if possible.
1241
+ // Otherwise do it in software.
1242
+
1243
+ void idcok(bool bf) { ::idcok(w, bf); }
1244
+ // If bf is TRUE, use insert/delete character hardware support if possible.
1245
+ // Otherwise do it in software.
1246
+
1247
+ int touchline(int s, int c) { return ::touchline(w, s, c); }
1248
+ // Mark the given lines as modified.
1249
+
1250
+ int touchwin() { return ::wtouchln(w, 0, height(), 1); }
1251
+ // Mark the whole window as modified.
1252
+
1253
+ int untouchwin() { return ::wtouchln(w, 0, height(), 0); }
1254
+ // Mark the whole window as unmodified.
1255
+
1256
+ int touchln(int s, int cnt, bool changed=TRUE) {
1257
+ return ::wtouchln(w, s, cnt, static_cast<int>(changed ? 1 : 0)); }
1258
+ // Mark cnt lines beginning from line s as changed or unchanged, depending
1259
+ // on the value of the changed flag.
1260
+
1261
+ bool is_linetouched(int line) const {
1262
+ return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); }
1263
+ // Return TRUE if line is marked as changed, FALSE otherwise
1264
+
1265
+ bool is_wintouched() const {
1266
+ return (::is_wintouched(w) ? TRUE:FALSE); }
1267
+ // Return TRUE if window is marked as changed, FALSE otherwise
1268
+
1269
+ int leaveok(bool bf) { return ::leaveok(w, bf); }
1270
+ // If bf is TRUE, curses will leave the cursor after an update wherever
1271
+ // it is after the update.
1272
+
1273
+ int redrawln(int from, int n) { return ::wredrawln(w, from, n); }
1274
+ // Redraw n lines starting from the requested line
1275
+
1276
+ int redrawwin() { return ::wredrawln(w, 0, height()); }
1277
+ // Redraw the whole window
1278
+
1279
+ int doupdate() { return ::doupdate(); }
1280
+ // Do all outputs to make the physical screen looking like the virtual one
1281
+
1282
+ void syncdown() { ::wsyncdown(w); }
1283
+ // Propagate the changes down to all descendant windows
1284
+
1285
+ void syncup() { ::wsyncup(w); }
1286
+ // Propagate the changes up in the hierarchy
1287
+
1288
+ void cursyncup() { ::wcursyncup(w); }
1289
+ // Position the cursor in all ancestor windows corresponding to our setting
1290
+
1291
+ int syncok(bool bf) { return ::syncok(w, bf); }
1292
+ // If called with bf=TRUE, syncup() is called whenever the window is changed
1293
+
1294
+ #ifndef _no_flushok
1295
+ int flushok(bool bf) { return ::flushok(w, bf); }
1296
+ #endif
1297
+
1298
+ void immedok(bool bf) { ::immedok(w, bf); }
1299
+ // If called with bf=TRUE, any change in the window will cause an
1300
+ // automatic immediate refresh()
1301
+
1302
+ int intrflush(bool bf) { return ::intrflush(w, bf); }
1303
+
1304
+ int keypad(bool bf) { return ::keypad(w, bf); }
1305
+ // If called with bf=TRUE, the application will interpret function keys.
1306
+
1307
+ int nodelay(bool bf) { return ::nodelay(w, bf); }
1308
+
1309
+ int meta(bool bf) { return ::meta(w, bf); }
1310
+ // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise
1311
+ // 7-Bit characters are generated.
1312
+
1313
+ int standout() { return ::wstandout(w); }
1314
+ // Enable "standout" attributes
1315
+
1316
+ int standend() { return ::wstandend(w); }
1317
+ // Disable "standout" attributes
1318
+
1319
+ // -------------------------------------------------------------------------
1320
+ // The next two are virtual, because we redefine them in the
1321
+ // NCursesPanel class.
1322
+ // -------------------------------------------------------------------------
1323
+ virtual int refresh() { return ::wrefresh(w); }
1324
+ // Propagate the changes in this window to the virtual screen and call
1325
+ // doupdate(). This is redefined in NCursesPanel.
1326
+
1327
+ virtual int noutrefresh() { return ::wnoutrefresh(w); }
1328
+ // Propagate the changes in this window to the virtual screen. This is
1329
+ // redefined in NCursesPanel.
1330
+
1331
+ // -------------------------------------------------------------------------
1332
+ // multiple window control
1333
+ // -------------------------------------------------------------------------
1334
+ int overlay(NCursesWindow& win) {
1335
+ return ::overlay(w, win.w); }
1336
+ // Overlay this window over win.
1337
+
1338
+ int overwrite(NCursesWindow& win) {
1339
+ return ::overwrite(w, win.w); }
1340
+ // Overwrite win with this window.
1341
+
1342
+ int copywin(NCursesWindow& win,
1343
+ int sminrow, int smincol,
1344
+ int dminrow, int dmincol,
1345
+ int dmaxrow, int dmaxcol, bool overlaywin=TRUE) {
1346
+ return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol,
1347
+ dmaxrow, dmaxcol, static_cast<int>(overlaywin ? 1 : 0)); }
1348
+ // Overlay or overwrite the rectangle in win given by dminrow,dmincol,
1349
+ // dmaxrow,dmaxcol with the rectangle in this window beginning at
1350
+ // sminrow,smincol.
1351
+
1352
+ // -------------------------------------------------------------------------
1353
+ // Extended functions
1354
+ // -------------------------------------------------------------------------
1355
+ #if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0)
1356
+ int wresize(int newLines, int newColumns) {
1357
+ return ::wresize(w, newLines, newColumns); }
1358
+ #endif
1359
+
1360
+ // -------------------------------------------------------------------------
1361
+ // Mouse related
1362
+ // -------------------------------------------------------------------------
1363
+ bool has_mouse() const;
1364
+ // Return TRUE if terminal supports a mouse, FALSE otherwise
1365
+
1366
+ // -------------------------------------------------------------------------
1367
+ // traversal support
1368
+ // -------------------------------------------------------------------------
1369
+ NCursesWindow* child() { return subwins; }
1370
+ // Get the first child window.
1371
+
1372
+ NCursesWindow* sibling() { return sib; }
1373
+ // Get the next child of my parent.
1374
+
1375
+ NCursesWindow* parent() { return par; }
1376
+ // Get my parent.
1377
+
1378
+ bool isDescendant(NCursesWindow& win);
1379
+ // Return TRUE if win is a descendant of this.
1380
+ };
1381
+
1382
+ // -------------------------------------------------------------------------
1383
+ // We leave this here for compatibility reasons.
1384
+ // -------------------------------------------------------------------------
1385
+ class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow
1386
+ {
1387
+ public:
1388
+ explicit NCursesColorWindow(WINDOW* &window) // useful only for stdscr
1389
+ : NCursesWindow(window) {
1390
+ useColors(); }
1391
+
1392
+ NCursesColorWindow(int nlines, // number of lines
1393
+ int ncols, // number of columns
1394
+ int begin_y, // line origin
1395
+ int begin_x) // col origin
1396
+ : NCursesWindow(nlines, ncols, begin_y, begin_x) {
1397
+ useColors(); }
1398
+
1399
+ NCursesColorWindow(NCursesWindow& parentWin,// parent window
1400
+ int nlines, // number of lines
1401
+ int ncols, // number of columns
1402
+ int begin_y, // absolute or relative
1403
+ int begin_x, // origins:
1404
+ char absrel = 'a') // if `a', by & bx are
1405
+ : NCursesWindow(parentWin,
1406
+ nlines, ncols, // absolute screen pos,
1407
+ begin_y, begin_x, // else if `r', they are
1408
+ absrel ) { // relative to par origin
1409
+ useColors(); }
1410
+ };
1411
+
1412
+ // These enum definitions really belong inside the NCursesPad class, but only
1413
+ // recent compilers support that feature.
1414
+
1415
+ typedef enum {
1416
+ REQ_PAD_REFRESH = KEY_MAX + 1,
1417
+ REQ_PAD_UP,
1418
+ REQ_PAD_DOWN,
1419
+ REQ_PAD_LEFT,
1420
+ REQ_PAD_RIGHT,
1421
+ REQ_PAD_EXIT
1422
+ } Pad_Request;
1423
+
1424
+ const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code
1425
+ const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code
1426
+
1427
+ // -------------------------------------------------------------------------
1428
+ // Pad Support. We allow an association of a pad with a "real" window
1429
+ // through which the pad may be viewed.
1430
+ // -------------------------------------------------------------------------
1431
+ class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow
1432
+ {
1433
+ private:
1434
+ NCursesWindow* viewWin; // the "viewport" window
1435
+ NCursesWindow* viewSub; // the "viewport" subwindow
1436
+
1437
+ int h_gridsize, v_gridsize;
1438
+
1439
+ protected:
1440
+ int min_row, min_col; // top left row/col of the pads display area
1441
+
1442
+ NCursesWindow* Win(void) const {
1443
+ // Get the window into which the pad should be copied (if any)
1444
+ return (viewSub?viewSub:(viewWin?viewWin:0));
1445
+ }
1446
+
1447
+ NCursesWindow* getWindow(void) const {
1448
+ return viewWin;
1449
+ }
1450
+
1451
+ NCursesWindow* getSubWindow(void) const {
1452
+ return viewSub;
1453
+ }
1454
+
1455
+ virtual int driver (int key); // Virtualize keystroke key
1456
+ // The driver translates the keystroke c into an Pad_Request
1457
+
1458
+ virtual void OnUnknownOperation(int pad_req) {
1459
+ (void) pad_req;
1460
+ ::beep();
1461
+ }
1462
+ // This is called if the driver returns an unknown op-code
1463
+
1464
+ virtual void OnNavigationError(int pad_req) {
1465
+ (void) pad_req;
1466
+ ::beep();
1467
+ }
1468
+ // This is called if a navigation request couldn't be satisfied
1469
+
1470
+ virtual void OnOperation(int pad_req) {
1471
+ (void) pad_req;
1472
+ };
1473
+ // OnOperation is called if a Pad_Operation was executed and just before
1474
+ // the refresh() operation is done.
1475
+
1476
+ public:
1477
+ NCursesPad(int nlines, int ncols);
1478
+ // create a pad with the given size
1479
+
1480
+ NCursesPad& operator=(const NCursesPad& rhs)
1481
+ {
1482
+ if (this != &rhs) {
1483
+ *this = rhs;
1484
+ NCursesWindow::operator=(rhs);
1485
+ }
1486
+ return *this;
1487
+ }
1488
+
1489
+ NCursesPad(const NCursesPad& rhs)
1490
+ : NCursesWindow(rhs),
1491
+ viewWin(rhs.viewWin),
1492
+ viewSub(rhs.viewSub),
1493
+ h_gridsize(rhs.h_gridsize),
1494
+ v_gridsize(rhs.v_gridsize),
1495
+ min_row(rhs.min_row),
1496
+ min_col(rhs.min_col)
1497
+ {
1498
+ }
1499
+
1500
+ virtual ~NCursesPad() THROWS(NCursesException) {}
1501
+
1502
+ int echochar(const chtype ch) { return ::pechochar(w, ch); }
1503
+ // Put the attributed character onto the pad and immediately do a
1504
+ // prefresh().
1505
+
1506
+ int refresh() NCURSES_OVERRIDE;
1507
+ // If a viewport is defined the pad is displayed in this window, otherwise
1508
+ // this is a noop.
1509
+
1510
+ int refresh(int pminrow, int pmincol,
1511
+ int sminrow, int smincol,
1512
+ int smaxrow, int smaxcol) {
1513
+ return ::prefresh(w, pminrow, pmincol,
1514
+ sminrow, smincol, smaxrow, smaxcol);
1515
+ }
1516
+ // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle
1517
+ // on the screen. <b>refresh</b> copies a rectangle of this size beginning
1518
+ // with top left corner pminrow,pmincol onto the screen and calls doupdate().
1519
+
1520
+ int noutrefresh() NCURSES_OVERRIDE;
1521
+ // If a viewport is defined the pad is displayed in this window, otherwise
1522
+ // this is a noop.
1523
+
1524
+ int noutrefresh(int pminrow, int pmincol,
1525
+ int sminrow, int smincol,
1526
+ int smaxrow, int smaxcol) {
1527
+ return ::pnoutrefresh(w, pminrow, pmincol,
1528
+ sminrow, smincol, smaxrow, smaxcol);
1529
+ }
1530
+ // Does the same as refresh() but without calling doupdate().
1531
+
1532
+ virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1);
1533
+ // Add the window "view" as viewing window to the pad.
1534
+
1535
+ virtual void setSubWindow(NCursesWindow& sub);
1536
+ // Use the subwindow "sub" of the viewport window for the actual viewing.
1537
+ // The full viewport window is usually used to provide some decorations
1538
+ // like frames, titles etc.
1539
+
1540
+ virtual void operator() (void);
1541
+ // Perform Pad's operation
1542
+ };
1543
+
1544
+ // A FramedPad is constructed always with a viewport window. This viewport
1545
+ // will be framed (by a box() command) and the interior of the box is the
1546
+ // viewport subwindow. On the frame we display scrollbar sliders.
1547
+ class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad
1548
+ {
1549
+ protected:
1550
+ virtual void OnOperation(int pad_req) NCURSES_OVERRIDE;
1551
+
1552
+ public:
1553
+ NCursesFramedPad(NCursesWindow& win, int nlines, int ncols,
1554
+ int v_grid = 1, int h_grid = 1)
1555
+ : NCursesPad(nlines, ncols) {
1556
+ NCursesPad::setWindow(win, v_grid, h_grid);
1557
+ NCursesPad::setSubWindow(*(new NCursesWindow(win)));
1558
+ }
1559
+ // Construct the FramedPad with the given Window win as viewport.
1560
+
1561
+ virtual ~NCursesFramedPad() THROWS(NCursesException) {
1562
+ delete getSubWindow();
1563
+ }
1564
+
1565
+ void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) NCURSES_OVERRIDE {
1566
+ (void) view;
1567
+ (void) v_grid;
1568
+ (void) h_grid;
1569
+ err_handler("Operation not allowed");
1570
+ }
1571
+ // Disable this call; the viewport is already defined
1572
+
1573
+ void setSubWindow(NCursesWindow& sub) NCURSES_OVERRIDE {
1574
+ (void) sub;
1575
+ err_handler("Operation not allowed");
1576
+ }
1577
+ // Disable this call; the viewport subwindow is already defined
1578
+
1579
+ };
1580
+
1581
+ #endif /* NCURSES_CURSESW_H_incl */
janus/include/cursslk.h ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // * this is for making emacs happy: -*-Mode: C++;-*-
2
+ // vile:cppmode
3
+ /****************************************************************************
4
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
5
+ * Copyright 1998-2003,2005 Free Software Foundation, Inc. *
6
+ * *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a *
8
+ * copy of this software and associated documentation files (the *
9
+ * "Software"), to deal in the Software without restriction, including *
10
+ * without limitation the rights to use, copy, modify, merge, publish, *
11
+ * distribute, distribute with modifications, sublicense, and/or sell *
12
+ * copies of the Software, and to permit persons to whom the Software is *
13
+ * furnished to do so, subject to the following conditions: *
14
+ * *
15
+ * The above copyright notice and this permission notice shall be included *
16
+ * in all copies or substantial portions of the Software. *
17
+ * *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25
+ * *
26
+ * Except as contained in this notice, the name(s) of the above copyright *
27
+ * holders shall not be used in advertising or otherwise to promote the *
28
+ * sale, use or other dealings in this Software without prior written *
29
+ * authorization. *
30
+ ****************************************************************************/
31
+
32
+ /****************************************************************************
33
+ * Author: Juergen Pfeifer, 1997 *
34
+ ****************************************************************************/
35
+
36
+ // $Id: cursslk.h,v 1.19 2021/04/17 18:11:08 tom Exp $
37
+
38
+ #ifndef NCURSES_CURSSLK_H_incl
39
+ #define NCURSES_CURSSLK_H_incl
40
+
41
+ #include <ncursesw/cursesw.h>
42
+
43
+ class NCURSES_CXX_IMPEXP Soft_Label_Key_Set {
44
+ public:
45
+ // This inner class represents the attributes of a Soft Label Key (SLK)
46
+ class NCURSES_CXX_IMPEXP Soft_Label_Key {
47
+ friend class Soft_Label_Key_Set;
48
+ public:
49
+ typedef enum { Left=0, Center=1, Right=2 } Justification;
50
+
51
+ private:
52
+ char *label; // The Text of the Label
53
+ Justification format; // The Justification
54
+ int num; // The number of the Label
55
+
56
+ Soft_Label_Key() : label(NULL), format(Left), num(-1) {
57
+ }
58
+
59
+ virtual ~Soft_Label_Key() {
60
+ delete[] label;
61
+ };
62
+
63
+ public:
64
+ // Set the text of the Label
65
+ Soft_Label_Key& operator=(char *text);
66
+
67
+ // Set the Justification of the Label
68
+ Soft_Label_Key& operator=(Justification just) {
69
+ format = just;
70
+ return *this;
71
+ }
72
+
73
+ // Retrieve the text of the label
74
+ inline char* operator()(void) const {
75
+ return label;
76
+ }
77
+
78
+ Soft_Label_Key& operator=(const Soft_Label_Key& rhs)
79
+ {
80
+ if (this != &rhs) {
81
+ *this = rhs;
82
+ }
83
+ return *this;
84
+ }
85
+
86
+ Soft_Label_Key(const Soft_Label_Key& rhs)
87
+ : label(NULL),
88
+ format(rhs.format),
89
+ num(rhs.num)
90
+ {
91
+ *this = rhs.label;
92
+ }
93
+ };
94
+
95
+ public:
96
+ typedef enum {
97
+ None = -1,
98
+ Three_Two_Three = 0,
99
+ Four_Four = 1,
100
+ PC_Style = 2,
101
+ PC_Style_With_Index = 3
102
+ } Label_Layout;
103
+
104
+ private:
105
+ static long count; // Number of Key Sets
106
+ static Label_Layout format; // Layout of the Key Sets
107
+ static int num_labels; // Number Of Labels in Key Sets
108
+ bool b_attrInit; // Are attributes initialized
109
+
110
+ Soft_Label_Key *slk_array; // The array of SLK's
111
+
112
+ // Init the Key Set
113
+ void init();
114
+
115
+ // Activate or Deactivate Label# i, Label counting starts with 1!
116
+ void activate_label(int i, bool bf=TRUE);
117
+
118
+ // Activate of Deactivate all Labels
119
+ void activate_labels(bool bf);
120
+
121
+ protected:
122
+ inline void Error (const char* msg) const THROWS(NCursesException) {
123
+ THROW(new NCursesException (msg));
124
+ }
125
+
126
+ // Remove SLK's from screen
127
+ void clear() {
128
+ if (ERR==::slk_clear())
129
+ Error("slk_clear");
130
+ }
131
+
132
+ // Restore them
133
+ void restore() {
134
+ if (ERR==::slk_restore())
135
+ Error("slk_restore");
136
+ }
137
+
138
+ public:
139
+
140
+ // Construct a Key Set, use the most comfortable layout as default.
141
+ // You must create a Soft_Label_Key_Set before you create any object of
142
+ // the NCursesWindow, NCursesPanel or derived classes. (Actually before
143
+ // ::initscr() is called).
144
+ explicit Soft_Label_Key_Set(Label_Layout fmt);
145
+
146
+ // This constructor assumes, that you already constructed a Key Set
147
+ // with a layout by the constructor above. This layout will be reused.
148
+ Soft_Label_Key_Set();
149
+
150
+ Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs)
151
+ {
152
+ if (this != &rhs) {
153
+ *this = rhs;
154
+ init(); // allocate a new slk_array[]
155
+ }
156
+ return *this;
157
+ }
158
+
159
+ Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs)
160
+ : b_attrInit(rhs.b_attrInit),
161
+ slk_array(NULL)
162
+ {
163
+ init(); // allocate a new slk_array[]
164
+ }
165
+
166
+ virtual ~Soft_Label_Key_Set() THROWS(NCursesException);
167
+
168
+ // Get Label# i. Label counting starts with 1!
169
+ Soft_Label_Key& operator[](int i);
170
+
171
+ // Retrieve number of Labels
172
+ int labels() const;
173
+
174
+ // Refresh the SLK portion of the screen
175
+ inline void refresh() {
176
+ if (ERR==::slk_refresh())
177
+ Error("slk_refresh");
178
+ }
179
+
180
+ // Mark the SLK portion of the screen for refresh, defer actual refresh
181
+ // until next update call.
182
+ inline void noutrefresh() {
183
+ if (ERR==::slk_noutrefresh())
184
+ Error("slk_noutrefresh");
185
+ }
186
+
187
+ // Mark the whole SLK portion of the screen as modified
188
+ inline void touch() {
189
+ if (ERR==::slk_touch())
190
+ Error("slk_touch");
191
+ }
192
+
193
+ // Activate Label# i
194
+ inline void show(int i) {
195
+ activate_label(i,FALSE);
196
+ activate_label(i,TRUE);
197
+ }
198
+
199
+ // Hide Label# i
200
+ inline void hide(int i) {
201
+ activate_label(i,FALSE);
202
+ }
203
+
204
+ // Show all Labels
205
+ inline void show() {
206
+ activate_labels(FALSE);
207
+ activate_labels(TRUE);
208
+ }
209
+
210
+ // Hide all Labels
211
+ inline void hide() {
212
+ activate_labels(FALSE);
213
+ }
214
+
215
+ inline void attron(attr_t attrs) {
216
+ if (ERR==::slk_attron(attrs))
217
+ Error("slk_attron");
218
+ }
219
+
220
+ inline void attroff(attr_t attrs) {
221
+ if (ERR==::slk_attroff(attrs))
222
+ Error("slk_attroff");
223
+ }
224
+
225
+ inline void attrset(attr_t attrs) {
226
+ if (ERR==::slk_attrset(attrs))
227
+ Error("slk_attrset");
228
+ }
229
+
230
+ inline void color(short color_pair_number) {
231
+ if (ERR==::slk_color(color_pair_number))
232
+ Error("slk_color");
233
+ }
234
+
235
+ inline attr_t attr() const {
236
+ return ::slk_attr();
237
+ }
238
+ };
239
+
240
+ #endif /* NCURSES_CURSSLK_H_incl */
janus/include/eti.h ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2020 Thomas E. Dickey *
3
+ * Copyright 1998-2002,2003 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: Juergen Pfeifer, 1995,1997 *
32
+ ****************************************************************************/
33
+
34
+ /* $Id: eti.h,v 1.9 2020/02/02 23:34:34 tom Exp $ */
35
+
36
+ #ifndef NCURSES_ETI_H_incl
37
+ #define NCURSES_ETI_H_incl 1
38
+
39
+ #define E_OK (0)
40
+ #define E_SYSTEM_ERROR (-1)
41
+ #define E_BAD_ARGUMENT (-2)
42
+ #define E_POSTED (-3)
43
+ #define E_CONNECTED (-4)
44
+ #define E_BAD_STATE (-5)
45
+ #define E_NO_ROOM (-6)
46
+ #define E_NOT_POSTED (-7)
47
+ #define E_UNKNOWN_COMMAND (-8)
48
+ #define E_NO_MATCH (-9)
49
+ #define E_NOT_SELECTABLE (-10)
50
+ #define E_NOT_CONNECTED (-11)
51
+ #define E_REQUEST_DENIED (-12)
52
+ #define E_INVALID_FIELD (-13)
53
+ #define E_CURRENT (-14)
54
+
55
+ #endif
janus/include/etip.h ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // * This makes emacs happy -*-Mode: C++;-*-
2
+ /****************************************************************************
3
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
4
+ * Copyright 1998-2012,2017 Free Software Foundation, Inc. *
5
+ * *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a *
7
+ * copy of this software and associated documentation files (the *
8
+ * "Software"), to deal in the Software without restriction, including *
9
+ * without limitation the rights to use, copy, modify, merge, publish, *
10
+ * distribute, distribute with modifications, sublicense, and/or sell *
11
+ * copies of the Software, and to permit persons to whom the Software is *
12
+ * furnished to do so, subject to the following conditions: *
13
+ * *
14
+ * The above copyright notice and this permission notice shall be included *
15
+ * in all copies or substantial portions of the Software. *
16
+ * *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24
+ * *
25
+ * Except as contained in this notice, the name(s) of the above copyright *
26
+ * holders shall not be used in advertising or otherwise to promote the *
27
+ * sale, use or other dealings in this Software without prior written *
28
+ * authorization. *
29
+ ****************************************************************************/
30
+
31
+ /****************************************************************************
32
+ * Author: Juergen Pfeifer, 1997 *
33
+ ****************************************************************************/
34
+
35
+ // $Id: etip.h.in,v 1.50 2022/08/20 20:50:00 tom Exp $
36
+
37
+ #ifndef NCURSES_ETIP_H_incl
38
+ #define NCURSES_ETIP_H_incl 1
39
+
40
+ // These are substituted at configure/build time
41
+ #ifndef HAVE_BUILTIN_H
42
+ #define HAVE_BUILTIN_H 0
43
+ #endif
44
+
45
+ #ifndef HAVE_GXX_BUILTIN_H
46
+ #define HAVE_GXX_BUILTIN_H 0
47
+ #endif
48
+
49
+ #ifndef HAVE_GPP_BUILTIN_H
50
+ #define HAVE_GPP_BUILTIN_H 0
51
+ #endif
52
+
53
+ #ifndef HAVE_IOSTREAM
54
+ #define HAVE_IOSTREAM 1
55
+ #endif
56
+
57
+ #ifndef HAVE_TYPEINFO
58
+ #define HAVE_TYPEINFO 1
59
+ #endif
60
+
61
+ #ifndef HAVE_VALUES_H
62
+ #define HAVE_VALUES_H 0
63
+ #endif
64
+
65
+ #ifndef ETIP_NEEDS_MATH_H
66
+ #define ETIP_NEEDS_MATH_H 0
67
+ #endif
68
+
69
+ #ifndef ETIP_NEEDS_MATH_EXCEPTION
70
+ #define ETIP_NEEDS_MATH_EXCEPTION 0
71
+ #endif
72
+
73
+ #ifndef CPP_HAS_OVERRIDE
74
+ #define CPP_HAS_OVERRIDE 0
75
+ #endif
76
+
77
+ #ifndef CPP_HAS_PARAM_INIT
78
+ #define CPP_HAS_PARAM_INIT 0
79
+ #endif
80
+
81
+ #ifndef CPP_HAS_STATIC_CAST
82
+ #define CPP_HAS_STATIC_CAST 1
83
+ #endif
84
+
85
+ #ifndef IOSTREAM_NAMESPACE
86
+ #define IOSTREAM_NAMESPACE 1
87
+ #endif
88
+
89
+ #ifdef __GNUG__
90
+ # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
91
+ # if HAVE_TYPEINFO
92
+ # include <typeinfo>
93
+ # endif
94
+ # endif
95
+ #endif
96
+
97
+ #if defined(__GNUG__)
98
+ # if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
99
+ # if ETIP_NEEDS_MATH_H
100
+ # if ETIP_NEEDS_MATH_EXCEPTION
101
+ # undef exception
102
+ # define exception math_exception
103
+ # endif
104
+ # include <math.h>
105
+ # endif
106
+ # undef exception
107
+ # define exception builtin_exception
108
+ # if HAVE_GPP_BUILTIN_H
109
+ # include <gpp/builtin.h>
110
+ # elif HAVE_GXX_BUILTIN_H
111
+ # include <g++/builtin.h>
112
+ # else
113
+ # include <builtin.h>
114
+ # endif
115
+ # undef exception
116
+ # endif
117
+ #elif defined (__SUNPRO_CC)
118
+ # include <generic.h>
119
+ #endif
120
+
121
+ #include <ncursesw/curses.h>
122
+
123
+ extern "C" {
124
+ #if HAVE_VALUES_H
125
+ # include <values.h>
126
+ #endif
127
+
128
+ #include <assert.h>
129
+ #include <ncursesw/eti.h>
130
+ #include <errno.h>
131
+ }
132
+
133
+ // Language features
134
+ #if CPP_HAS_OVERRIDE
135
+ #define NCURSES_OVERRIDE override
136
+ #else
137
+ #define NCURSES_OVERRIDE /*nothing*/
138
+ #endif
139
+
140
+ #if CPP_HAS_PARAM_INIT
141
+ #define NCURSES_PARAM_INIT(value) = value
142
+ #else
143
+ #define NCURSES_PARAM_INIT(value) /*nothing*/
144
+ #endif
145
+
146
+ #if CPP_HAS_STATIC_CAST
147
+ #define STATIC_CAST(s) static_cast<s>
148
+ #else
149
+ #define STATIC_CAST(s) (s)
150
+ #endif
151
+
152
+ #ifndef NCURSES_CXX_IMPEXP
153
+ #define NCURSES_CXX_IMPEXP /* nothing */
154
+ #endif
155
+
156
+ // Forward Declarations
157
+ class NCURSES_CXX_IMPEXP NCursesPanel;
158
+ class NCURSES_CXX_IMPEXP NCursesMenu;
159
+ class NCURSES_CXX_IMPEXP NCursesForm;
160
+
161
+ class NCURSES_CXX_IMPEXP NCursesException
162
+ {
163
+ public:
164
+ const char *message;
165
+ int errorno;
166
+
167
+ NCursesException (const char* msg, int err)
168
+ : message(msg), errorno (err)
169
+ {};
170
+
171
+ explicit NCursesException (const char* msg)
172
+ : message(msg), errorno (E_SYSTEM_ERROR)
173
+ {};
174
+
175
+ NCursesException& operator=(const NCursesException& rhs)
176
+ {
177
+ message = rhs.message;
178
+ errorno = rhs.errorno;
179
+ return *this;
180
+ }
181
+
182
+ NCursesException(const NCursesException& rhs)
183
+ : message(rhs.message), errorno(rhs.errorno)
184
+ {
185
+ }
186
+
187
+ virtual const char *classname() const {
188
+ return "NCursesWindow";
189
+ }
190
+
191
+ virtual ~NCursesException()
192
+ {
193
+ }
194
+ };
195
+
196
+ class NCURSES_CXX_IMPEXP NCursesPanelException : public NCursesException
197
+ {
198
+ public:
199
+ const NCursesPanel* p;
200
+
201
+ NCursesPanelException (const char *msg, int err) :
202
+ NCursesException (msg, err),
203
+ p (0)
204
+ {};
205
+
206
+ NCursesPanelException (const NCursesPanel* panel,
207
+ const char *msg,
208
+ int err) :
209
+ NCursesException (msg, err),
210
+ p (panel)
211
+ {};
212
+
213
+ explicit NCursesPanelException (int err) :
214
+ NCursesException ("panel library error", err),
215
+ p (0)
216
+ {};
217
+
218
+ NCursesPanelException (const NCursesPanel* panel,
219
+ int err) :
220
+ NCursesException ("panel library error", err),
221
+ p (panel)
222
+ {};
223
+
224
+ NCursesPanelException& operator=(const NCursesPanelException& rhs)
225
+ {
226
+ if (this != &rhs) {
227
+ NCursesException::operator=(rhs);
228
+ p = rhs.p;
229
+ }
230
+ return *this;
231
+ }
232
+
233
+ NCursesPanelException(const NCursesPanelException& rhs)
234
+ : NCursesException(rhs), p(rhs.p)
235
+ {
236
+ }
237
+
238
+ virtual const char *classname() const NCURSES_OVERRIDE {
239
+ return "NCursesPanel";
240
+ }
241
+
242
+ virtual ~NCursesPanelException()
243
+ {
244
+ }
245
+ };
246
+
247
+ class NCURSES_CXX_IMPEXP NCursesMenuException : public NCursesException
248
+ {
249
+ public:
250
+ const NCursesMenu* m;
251
+
252
+ NCursesMenuException (const char *msg, int err) :
253
+ NCursesException (msg, err),
254
+ m (0)
255
+ {};
256
+
257
+ NCursesMenuException (const NCursesMenu* menu,
258
+ const char *msg,
259
+ int err) :
260
+ NCursesException (msg, err),
261
+ m (menu)
262
+ {};
263
+
264
+ explicit NCursesMenuException (int err) :
265
+ NCursesException ("menu library error", err),
266
+ m (0)
267
+ {};
268
+
269
+ NCursesMenuException (const NCursesMenu* menu,
270
+ int err) :
271
+ NCursesException ("menu library error", err),
272
+ m (menu)
273
+ {};
274
+
275
+ NCursesMenuException& operator=(const NCursesMenuException& rhs)
276
+ {
277
+ if (this != &rhs) {
278
+ NCursesException::operator=(rhs);
279
+ m = rhs.m;
280
+ }
281
+ return *this;
282
+ }
283
+
284
+ NCursesMenuException(const NCursesMenuException& rhs)
285
+ : NCursesException(rhs), m(rhs.m)
286
+ {
287
+ }
288
+
289
+ virtual const char *classname() const NCURSES_OVERRIDE {
290
+ return "NCursesMenu";
291
+ }
292
+
293
+ virtual ~NCursesMenuException()
294
+ {
295
+ }
296
+ };
297
+
298
+ class NCURSES_CXX_IMPEXP NCursesFormException : public NCursesException
299
+ {
300
+ public:
301
+ const NCursesForm* f;
302
+
303
+ NCursesFormException (const char *msg, int err) :
304
+ NCursesException (msg, err),
305
+ f (0)
306
+ {};
307
+
308
+ NCursesFormException (const NCursesForm* form,
309
+ const char *msg,
310
+ int err) :
311
+ NCursesException (msg, err),
312
+ f (form)
313
+ {};
314
+
315
+ explicit NCursesFormException (int err) :
316
+ NCursesException ("form library error", err),
317
+ f (0)
318
+ {};
319
+
320
+ NCursesFormException (const NCursesForm* form,
321
+ int err) :
322
+ NCursesException ("form library error", err),
323
+ f (form)
324
+ {};
325
+
326
+ NCursesFormException& operator=(const NCursesFormException& rhs)
327
+ {
328
+ if (this != &rhs) {
329
+ NCursesException::operator=(rhs);
330
+ f = rhs.f;
331
+ }
332
+ return *this;
333
+ }
334
+
335
+ NCursesFormException(const NCursesFormException& rhs)
336
+ : NCursesException(rhs), f(rhs.f)
337
+ {
338
+ }
339
+
340
+ virtual const char *classname() const NCURSES_OVERRIDE {
341
+ return "NCursesForm";
342
+ }
343
+
344
+ virtual ~NCursesFormException()
345
+ {
346
+ }
347
+ };
348
+
349
+ #if !((defined(__GNUG__) && defined(__EXCEPTIONS) && (__GNUG__ < 7)) || defined(__SUNPRO_CC))
350
+ # if HAVE_IOSTREAM
351
+ # include <iostream>
352
+ # if IOSTREAM_NAMESPACE
353
+ using std::cerr;
354
+ using std::endl;
355
+ # endif
356
+ # else
357
+ # include <iostream.h>
358
+ # endif
359
+ #endif
360
+
361
+ inline void THROW(const NCursesException *e) {
362
+ #if defined(__GNUG__) && defined(__EXCEPTIONS)
363
+ # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
364
+ (*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
365
+ # elif (__GNUG__ >= 7)
366
+ // g++ 7.0 warns about deprecation, but lacks the predefined symbols
367
+ ::endwin();
368
+ std::cerr << "Found a problem - goodbye" << std::endl;
369
+ exit(EXIT_FAILURE);
370
+ # else
371
+ # define CPP_HAS_TRY_CATCH 1
372
+ # endif
373
+ #elif defined(__SUNPRO_CC)
374
+ # if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
375
+ genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
376
+ # else
377
+ # define CPP_HAS_TRY_CATCH 1
378
+ # endif
379
+ #else
380
+ if (e)
381
+ cerr << e->message << endl;
382
+ exit(0);
383
+ #endif
384
+
385
+ #ifndef CPP_HAS_TRY_CATCH
386
+ #define CPP_HAS_TRY_CATCH 0
387
+ #define NCURSES_CPP_TRY /* nothing */
388
+ #define NCURSES_CPP_CATCH(e) if (false)
389
+ #define THROWS(s) /* nothing */
390
+ #define THROW2(s,t) /* nothing */
391
+ #elif CPP_HAS_TRY_CATCH
392
+ throw *e;
393
+ #define NCURSES_CPP_TRY try
394
+ #define NCURSES_CPP_CATCH(e) catch(e)
395
+ #if defined(__cpp_noexcept_function_type) && (__cpp_noexcept_function_type >= 201510)
396
+ // C++17 deprecates the usage of throw().
397
+ #define THROWS(s) /* nothing */
398
+ #define THROW2(s,t) /* nothing */
399
+ #else
400
+ #define THROWS(s) throw(s)
401
+ #define THROW2(s,t) throw(s,t)
402
+ #endif
403
+ #endif
404
+ }
405
+
406
+ #endif /* NCURSES_ETIP_H_incl */
janus/include/fakemysql.h ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fakemysql.h --
3
+ *
4
+ * Fake definitions of the MySQL API sufficient to build tdbc::mysql
5
+ * without having an MySQL installation on the build system. This file
6
+ * comprises only data type, constant and function definitions.
7
+ *
8
+ * The programmers of this file believe that it contains material not
9
+ * subject to copyright under the doctrines of scenes a faire and
10
+ * of merger of idea and expression. Accordingly, this file is in the
11
+ * public domain.
12
+ *
13
+ *-----------------------------------------------------------------------------
14
+ */
15
+
16
+ #ifndef FAKEMYSQL_H_INCLUDED
17
+ #define FAKEMYSQL_H_INCLUDED
18
+
19
+ #include <stddef.h>
20
+
21
+ #ifndef MODULE_SCOPE
22
+ #define MODULE_SCOPE extern
23
+ #endif
24
+
25
+ MODULE_SCOPE Tcl_LoadHandle MysqlInitStubs(Tcl_Interp*);
26
+
27
+ #ifdef _WIN32
28
+ #define STDCALL __stdcall
29
+ #else
30
+ #define STDCALL /* nothing */
31
+ #endif
32
+
33
+ enum enum_field_types {
34
+ MYSQL_TYPE_DECIMAL=0,
35
+ MYSQL_TYPE_TINY=1,
36
+ MYSQL_TYPE_SHORT=2,
37
+ MYSQL_TYPE_LONG=3,
38
+ MYSQL_TYPE_FLOAT=4,
39
+ MYSQL_TYPE_DOUBLE=5,
40
+ MYSQL_TYPE_NULL=6,
41
+ MYSQL_TYPE_TIMESTAMP=7,
42
+ MYSQL_TYPE_LONGLONG=8,
43
+ MYSQL_TYPE_INT24=9,
44
+ MYSQL_TYPE_DATE=10,
45
+ MYSQL_TYPE_TIME=11,
46
+ MYSQL_TYPE_DATETIME=12,
47
+ MYSQL_TYPE_YEAR=13,
48
+ MYSQL_TYPE_NEWDATE=14,
49
+ MYSQL_TYPE_VARCHAR=15,
50
+ MYSQL_TYPE_BIT=16,
51
+ MYSQL_TYPE_NEWDECIMAL=246,
52
+ MYSQL_TYPE_ENUM=247,
53
+ MYSQL_TYPE_SET=248,
54
+ MYSQL_TYPE_TINY_BLOB=249,
55
+ MYSQL_TYPE_MEDIUM_BLOB=250,
56
+ MYSQL_TYPE_LONG_BLOB=251,
57
+ MYSQL_TYPE_BLOB=252,
58
+ MYSQL_TYPE_VAR_STRING=253,
59
+ MYSQL_TYPE_STRING=254,
60
+ MYSQL_TYPE_GEOMETRY=255
61
+ };
62
+
63
+ enum mysql_option {
64
+ MYSQL_SET_CHARSET_NAME=7,
65
+ };
66
+
67
+ enum mysql_status {
68
+ MYSQL_STATUS_READY=0,
69
+ };
70
+
71
+ #define CLIENT_COMPRESS 32
72
+ #define CLIENT_INTERACTIVE 1024
73
+ #define MYSQL_DATA_TRUNCATED 101
74
+ #define MYSQL_ERRMSG_SIZE 512
75
+ #define MYSQL_NO_DATA 100
76
+ #define SCRAMBLE_LENGTH 20
77
+ #define SQLSTATE_LENGTH 5
78
+
79
+ typedef struct st_list LIST;
80
+ typedef struct st_mem_root MEM_ROOT;
81
+ typedef struct st_mysql MYSQL;
82
+ typedef struct st_mysql_bind MYSQL_BIND;
83
+ typedef struct st_mysql_field MYSQL_FIELD;
84
+ typedef struct st_mysql_res MYSQL_RES;
85
+ typedef char** MYSQL_ROW;
86
+ typedef struct st_mysql_stmt MYSQL_STMT;
87
+ typedef char my_bool;
88
+ #ifndef Socket_defined
89
+ typedef int my_socket;
90
+ #define INVALID_SOCKET -1
91
+ #endif
92
+ typedef Tcl_WideUInt my_ulonglong;
93
+ typedef struct st_net NET;
94
+ typedef struct st_used_mem USED_MEM;
95
+ typedef struct st_vio Vio;
96
+
97
+ struct st_mem_root {
98
+ USED_MEM *free;
99
+ USED_MEM *used;
100
+ USED_MEM *pre_alloc;
101
+ size_t min_malloc;
102
+ size_t block_size;
103
+ unsigned int block_num;
104
+ unsigned int first_block_usage;
105
+ void (*error_handler)(void);
106
+ };
107
+
108
+ struct st_mysql_options {
109
+ unsigned int connect_timeout;
110
+ unsigned int read_timeout;
111
+ unsigned int write_timeout;
112
+ unsigned int port;
113
+ unsigned int protocol;
114
+ unsigned long client_flag;
115
+ char *host;
116
+ char *user;
117
+ char *password;
118
+ char *unix_socket;
119
+ char *db;
120
+ struct st_dynamic_array *init_commands;
121
+ char *my_cnf_file;
122
+ char *my_cnf_group;
123
+ char *charset_dir;
124
+ char *charset_name;
125
+ char *ssl_key;
126
+ char *ssl_cert;
127
+ char *ssl_ca;
128
+ char *ssl_capath;
129
+ char *ssl_cipher;
130
+ char *shared_memory_base_name;
131
+ unsigned long max_allowed_packet;
132
+ my_bool use_ssl;
133
+ my_bool compress,named_pipe;
134
+ my_bool rpl_probe;
135
+ my_bool rpl_parse;
136
+ my_bool no_master_reads;
137
+ #if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
138
+ my_bool separate_thread;
139
+ #endif
140
+ enum mysql_option methods_to_use;
141
+ char *client_ip;
142
+ my_bool secure_auth;
143
+ my_bool report_data_truncation;
144
+ int (*local_infile_init)(void **, const char *, void *);
145
+ int (*local_infile_read)(void *, char *, unsigned int);
146
+ void (*local_infile_end)(void *);
147
+ int (*local_infile_error)(void *, char *, unsigned int);
148
+ void *local_infile_userdata;
149
+ void *extension;
150
+ };
151
+
152
+ struct st_net {
153
+ #if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
154
+ Vio *vio;
155
+ unsigned char *buff;
156
+ unsigned char *buff_end;
157
+ unsigned char *write_pos;
158
+ unsigned char *read_pos;
159
+ my_socket fd;
160
+ unsigned long remain_in_buf;
161
+ unsigned long length;
162
+ unsigned long buf_length;
163
+ unsigned long where_b;
164
+ unsigned long max_packet;
165
+ unsigned long max_packet_size;
166
+ unsigned int pkt_nr;
167
+ unsigned int compress_pkt_nr;
168
+ unsigned int write_timeout;
169
+ unsigned int read_timeout;
170
+ unsigned int retry_count;
171
+ int fcntl;
172
+ unsigned int *return_status;
173
+ unsigned char reading_or_writing;
174
+ char save_char;
175
+ my_bool unused0;
176
+ my_bool unused;
177
+ my_bool compress;
178
+ my_bool unused1;
179
+ #endif
180
+ unsigned char *query_cache_query;
181
+ unsigned int last_errno;
182
+ unsigned char error;
183
+ my_bool unused2;
184
+ my_bool return_errno;
185
+ char last_error[MYSQL_ERRMSG_SIZE];
186
+ char sqlstate[SQLSTATE_LENGTH+1];
187
+ void *extension;
188
+ #if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
189
+ my_bool skip_big_packet;
190
+ #endif
191
+ };
192
+
193
+ /*
194
+ * st_mysql differs between 5.0 and 5.1, but the 5.0 version is a
195
+ * strict subset, we don't use any of the 5.1 fields, and we don't
196
+ * ever allocate the structure ourselves.
197
+ */
198
+
199
+ struct st_mysql {
200
+ NET net;
201
+ unsigned char *connector_fd;
202
+ char *host;
203
+ char *user;
204
+ char *passwd;
205
+ char *unix_socket;
206
+ char *server_version;
207
+ char *host_info;
208
+ char *info;
209
+ char *db;
210
+ struct charset_info_st *charset;
211
+ MYSQL_FIELD *fields;
212
+ MEM_ROOT field_alloc;
213
+ my_ulonglong affected_rows;
214
+ my_ulonglong insert_id;
215
+ my_ulonglong extra_info;
216
+ unsigned long thread_id;
217
+ unsigned long packet_length;
218
+ unsigned int port;
219
+ unsigned long client_flag;
220
+ unsigned long server_capabilities;
221
+ unsigned int protocol_version;
222
+ unsigned int field_count;
223
+ unsigned int server_status;
224
+ unsigned int server_language;
225
+ unsigned int warning_count;
226
+ struct st_mysql_options options;
227
+ enum mysql_status status;
228
+ my_bool free_me;
229
+ my_bool reconnect;
230
+ char scramble[SCRAMBLE_LENGTH+1];
231
+ my_bool rpl_pivot;
232
+ struct st_mysql *master;
233
+ struct st_mysql *next_slave;
234
+ struct st_mysql* last_used_slave;
235
+ struct st_mysql* last_used_con;
236
+ LIST *stmts;
237
+ const struct st_mysql_methods *methods;
238
+ void *thd;
239
+ my_bool *unbuffered_fetch_owner;
240
+ char *info_buffer;
241
+ };
242
+
243
+ /*
244
+ * There are different version of the MYSQL_BIND structure before and after
245
+ * MySQL 5.1. We go after the fields of the structure using accessor functions
246
+ * so that the code in this file is compatible with both versions.
247
+ */
248
+
249
+ struct st_mysql_bind_51 { /* Post-5.1 */
250
+ unsigned long* length;
251
+ my_bool* is_null;
252
+ void* buffer;
253
+ my_bool* error;
254
+ unsigned char* row_ptr;
255
+ void (*store_param_func)(NET* net, MYSQL_BIND* param);
256
+ void (*fetch_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
257
+ void (*skip_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
258
+ unsigned long buffer_length;
259
+ unsigned long offset;
260
+ unsigned long length_value;
261
+ unsigned int param_number;
262
+ unsigned int pack_length;
263
+ enum enum_field_types buffer_type;
264
+ my_bool error_value;
265
+ my_bool is_unsigned;
266
+ my_bool long_data_used;
267
+ my_bool is_null_value;
268
+ void* extension;
269
+ };
270
+
271
+ struct st_mysql_bind_50 { /* Pre-5.1 */
272
+ unsigned long* length;
273
+ my_bool* is_null;
274
+ void* buffer;
275
+ my_bool* error;
276
+ enum enum_field_types buffer_type;
277
+ unsigned long buffer_length;
278
+ unsigned char* row_ptr;
279
+ unsigned long offset;
280
+ unsigned long length_value;
281
+ unsigned int param_number;
282
+ unsigned int pack_length;
283
+ my_bool error_value;
284
+ my_bool is_unsigned;
285
+ my_bool long_data_used;
286
+ my_bool is_null_value;
287
+ void (*store_param_func)(NET* net, MYSQL_BIND* param);
288
+ void (*fetch_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
289
+ void (*skip_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
290
+ };
291
+
292
+ /*
293
+ * There are also different versions of the MYSQL_FIELD structure; fortunately,
294
+ * the 5.1 version is a strict extension of the 5.0 version.
295
+ */
296
+
297
+ struct st_mysql_field {
298
+ char* name;
299
+ char *org_name;
300
+ char* table;
301
+ char* org_table;
302
+ char* db;
303
+ char* catalog;
304
+ char* def;
305
+ unsigned long length;
306
+ unsigned long max_length;
307
+ unsigned int name_length;
308
+ unsigned int org_name_length;
309
+ unsigned int table_length;
310
+ unsigned int org_table_length;
311
+ unsigned int db_length;
312
+ unsigned int catalog_length;
313
+ unsigned int def_length;
314
+ unsigned int flags;
315
+ unsigned int decimals;
316
+ unsigned int charsetnr;
317
+ enum enum_field_types type;
318
+ };
319
+ struct st_mysql_field_50 {
320
+ struct st_mysql_field field;
321
+ };
322
+ struct st_mysql_field_51 {
323
+ struct st_mysql_field field;
324
+ void* extension;
325
+ };
326
+ #define NOT_NULL_FLAG 1
327
+
328
+ #define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
329
+
330
+ #define mysql_library_init mysql_server_init
331
+ #define mysql_library_end mysql_server_end
332
+
333
+ #include "mysqlStubs.h"
334
+
335
+ #endif /* not FAKEMYSQL_H_INCLUDED */
janus/include/fakesql.h ADDED
@@ -0,0 +1,283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fakesql.h --
3
+ *
4
+ * Include file that defines the subset of SQL/CLI that TDBC
5
+ * uses, so that tdbc::odbc can build without an explicit ODBC
6
+ * dependency. It comprises only data type, constant and
7
+ * function declarations.
8
+ *
9
+ * The programmers of this file believe that it contains material not
10
+ * subject to copyright under the doctrines of scenes a faire and
11
+ * of merger of idea and expression. Accordingly, this file is in the
12
+ * public domain.
13
+ *
14
+ *-----------------------------------------------------------------------------
15
+ */
16
+
17
+ #ifndef FAKESQL_H_INCLUDED
18
+ #define FAKESQL_H_INCLUDED
19
+
20
+ #include <stddef.h>
21
+
22
+ #ifndef MODULE_SCOPE
23
+ #define MODULE_SCOPE extern
24
+ #endif
25
+
26
+ /* Limits */
27
+
28
+ #define SQL_MAX_DSN_LENGTH 32
29
+ #define SQL_MAX_MESSAGE_LENGTH 512
30
+
31
+ /* Fundamental data types */
32
+
33
+ #ifndef _WIN32
34
+ typedef int BOOL;
35
+ typedef unsigned int DWORD;
36
+ typedef void* HANDLE;
37
+ typedef HANDLE HWND;
38
+ typedef unsigned short WCHAR;
39
+ typedef char* LPSTR;
40
+ typedef WCHAR* LPWSTR;
41
+ typedef const char* LPCSTR;
42
+ typedef const WCHAR* LPCWSTR;
43
+ typedef unsigned short WORD;
44
+ #endif
45
+ typedef void* PVOID;
46
+ typedef short RETCODE;
47
+ typedef long SDWORD;
48
+ typedef short SWORD;
49
+ typedef unsigned short USHORT;
50
+ typedef USHORT UWORD;
51
+
52
+ /* ODBC data types */
53
+
54
+ typedef Tcl_WideInt SQLBIGINT;
55
+ typedef unsigned char SQLCHAR;
56
+ typedef double SQLDOUBLE;
57
+ typedef void* SQLHANDLE;
58
+ typedef SDWORD SQLINTEGER;
59
+ typedef PVOID SQLPOINTER;
60
+ typedef SWORD SQLSMALLINT;
61
+ typedef Tcl_WideUInt SQLUBIGINT;
62
+ typedef unsigned char SQLUCHAR;
63
+ typedef unsigned int SQLUINTEGER;
64
+ typedef UWORD SQLUSMALLINT;
65
+ typedef WCHAR SQLWCHAR;
66
+
67
+ typedef SQLSMALLINT SQLRETURN;
68
+
69
+ /* TODO - Check how the SQLLEN and SQLULEN types are handled on
70
+ * 64-bit Unix. */
71
+
72
+ #if defined(_WIN64)
73
+ typedef Tcl_WideInt SQLLEN;
74
+ typedef Tcl_WideUInt SQLULEN;
75
+ #else
76
+ typedef SQLINTEGER SQLLEN;
77
+ typedef SQLUINTEGER SQLULEN;
78
+ #endif
79
+
80
+ /* Handle types */
81
+
82
+ typedef SQLHANDLE SQLHENV;
83
+ typedef SQLHANDLE SQLHDBC;
84
+ typedef SQLHANDLE SQLHSTMT;
85
+ typedef HWND SQLHWND;
86
+
87
+ #define SQL_HANDLE_DBC 2
88
+ #define SQL_HANDLE_ENV 1
89
+ #define SQL_HANDLE_STMT 3
90
+
91
+ /* Null handles */
92
+
93
+ #define SQL_NULL_HANDLE ((SQLHANDLE) 0)
94
+ #define SQL_NULL_HENV ((SQLHENV) 0)
95
+ #define SQL_NULL_HDBC ((SQLHDBC) 0)
96
+ #define SQL_NULL_HSTMT ((SQLHSTMT) 0)
97
+
98
+ /* SQL data types */
99
+
100
+ enum _SQL_DATATYPE {
101
+ SQL_BIGINT = -5,
102
+ SQL_BINARY = -2,
103
+ SQL_BIT = -7,
104
+ SQL_CHAR = 1,
105
+ SQL_DATE = 9,
106
+ SQL_DECIMAL = 3,
107
+ SQL_DOUBLE = 8,
108
+ SQL_FLOAT = 6,
109
+ SQL_INTEGER = 4,
110
+ SQL_LONGVARBINARY = -4,
111
+ SQL_LONGVARCHAR = -1,
112
+ SQL_NUMERIC = 2,
113
+ SQL_REAL = 7,
114
+ SQL_SMALLINT = 5,
115
+ SQL_TIME = 10,
116
+ SQL_TIMESTAMP = 11,
117
+ SQL_TINYINT = -6,
118
+ SQL_VARBINARY = -3,
119
+ SQL_VARCHAR = 12,
120
+ SQL_WCHAR = -8,
121
+ SQL_WVARCHAR = -9,
122
+ SQL_WLONGVARCHAR = -10,
123
+ };
124
+
125
+ /* C data types */
126
+
127
+ #define SQL_SIGNED_OFFSET (-20)
128
+
129
+ #define SQL_C_BINARY SQL_BINARY
130
+ #define SQL_C_CHAR SQL_CHAR
131
+ #define SQL_C_DOUBLE SQL_DOUBLE
132
+ #define SQL_C_LONG SQL_INTEGER
133
+ #define SQL_C_SBIGINT SQL_BIGINT + SQL_SIGNED_OFFSET
134
+ #define SQL_C_SLONG SQL_INTEGER + SQL_SIGNED_OFFSET
135
+ #define SQL_C_WCHAR SQL_WCHAR
136
+
137
+ /* Parameter transmission diretions */
138
+
139
+ #define SQL_PARAM_INPUT 1
140
+
141
+ /* Status returns */
142
+
143
+ #define SQL_ERROR (-1)
144
+ #define SQL_NO_DATA 100
145
+ #define SQL_NO_TOTAL (-4)
146
+ #define SQL_SUCCESS 0
147
+ #define SQL_SUCCESS_WITH_INFO 1
148
+ #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
149
+
150
+ /* Diagnostic fields */
151
+
152
+ enum _SQL_DIAG {
153
+ SQL_DIAG_NUMBER = 2,
154
+ SQL_DIAG_SQLSTATE = 4
155
+ };
156
+
157
+ /* Transaction isolation levels */
158
+
159
+ #define SQL_TXN_READ_COMMITTED 2
160
+ #define SQL_TXN_READ_UNCOMMITTED 1
161
+ #define SQL_TXN_REPEATABLE_READ 4
162
+ #define SQL_TXN_SERIALIZABLE 8
163
+
164
+ /* Access modes */
165
+
166
+ #define SQL_MODE_READ_ONLY 1UL
167
+ #define SQL_MODE_READ_WRITE 0UL
168
+
169
+ /* ODBC properties */
170
+
171
+ #define SQL_ACCESS_MODE 101
172
+ #define SQL_AUTOCOMMIT 102
173
+ #define SQL_TXN_ISOLATION 108
174
+
175
+ /* ODBC attributes */
176
+
177
+ #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
178
+ #define SQL_ATTR_CONNECTION_TIMEOUT 113
179
+ #define SQL_ATTR_ODBC_VERSION 200
180
+ #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
181
+ #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
182
+
183
+ /* Nullable? */
184
+
185
+ #define SQL_NULLABLE_UNKNOWN 2
186
+
187
+ /* Placeholder for length of missing data */
188
+
189
+ #define SQL_NULL_DATA (-1)
190
+
191
+ /* ODBC versions */
192
+
193
+ #define SQL_OV_ODBC3 3UL
194
+ #define SQL_ODBC_VER 10
195
+
196
+ /* SQLDriverConnect flags */
197
+
198
+ #define SQL_DRIVER_COMPLETE_REQUIRED 3
199
+ #define SQL_DRIVER_NOPROMPT 0
200
+
201
+ /* SQLGetTypeInfo flags */
202
+
203
+ #define SQL_ALL_TYPES 0
204
+
205
+ /* Transaction actions */
206
+
207
+ #define SQL_COMMIT 0
208
+ #define SQL_ROLLBACK 1
209
+
210
+ /* Data source fetch flags */
211
+
212
+ #define SQL_FETCH_FIRST 2
213
+ #define SQL_FETCH_FIRST_SYSTEM 32
214
+ #define SQL_FETCH_FIRST_USER 31
215
+ #define SQL_FETCH_NEXT 1
216
+
217
+ /* ODBCINST actions */
218
+
219
+ #define ODBC_ADD_DSN 1
220
+ #define ODBC_CONFIG_DSN 2
221
+ #define ODBC_REMOVE_DSN 3
222
+ #define ODBC_ADD_SYS_DSN 4
223
+ #define ODBC_CONFIG_SYS_DSN 5
224
+ #define ODBC_REMOVE_SYS_DSN 6
225
+
226
+ /* ODBCINST errors */
227
+
228
+ #define ODBC_ERROR_GENERAL_ERR 1
229
+ #define ODBC_ERROR_INVALID_BUFF_LEN 2
230
+ #define ODBC_ERROR_INVALID_HWND 3
231
+ #define ODBC_ERROR_INVALID_STR 4
232
+ #define ODBC_ERROR_INVALID_REQUEST_TYPE 5
233
+ #define ODBC_ERROR_COMPONENT_NOT_FOUND 6
234
+ #define ODBC_ERROR_INVALID_NAME 7
235
+ #define ODBC_ERROR_INVALID_KEYWORD_VALUE 8
236
+ #define ODBC_ERROR_INVALID_DSN 9
237
+ #define ODBC_ERROR_INVALID_INF 10
238
+ #define ODBC_ERROR_REQUEST_FAILED 11
239
+ #define ODBC_ERROR_INVALID_PATH 12
240
+ #define ODBC_ERROR_LOAD_LIB_FAILED 13
241
+ #define ODBC_ERROR_INVALID_PARAM_SEQUENCE 14
242
+ #define ODBC_ERROR_INVALID_LOG_FILE 15
243
+ #define ODBC_ERROR_USER_CANCELED 16
244
+ #define ODBC_ERROR_USAGE_UPDATE_FAILED 17
245
+ #define ODBC_ERROR_CREATE_DSN_FAILED 18
246
+ #define ODBC_ERROR_WRITING_SYSINFO_FAILED 19
247
+ #define ODBC_ERROR_REMOVE_DSN_FAILED 20
248
+ #define ODBC_ERROR_OUT_OF_MEM 21
249
+ #define ODBC_ERROR_OUTPUT_STRING_TRUNCATED 22
250
+
251
+ /* ODBC client library entry points */
252
+
253
+ #ifdef _WIN32
254
+ #define SQL_API __stdcall
255
+ #define INSTAPI __stdcall
256
+ #else
257
+ #define SQL_API /* nothing */
258
+ #define INSTAPI /* nothing */
259
+ #endif
260
+
261
+ #include "odbcStubs.h"
262
+ MODULE_SCOPE const odbcStubDefs* odbcStubs;
263
+
264
+ /*
265
+ * Additional entry points in ODBCINST - all of these are optional
266
+ * and resolved with Tcl_FindSymbol, not directly in Tcl_LoadLibrary.
267
+ */
268
+
269
+ MODULE_SCOPE BOOL (INSTAPI* SQLConfigDataSourceW)(HWND, WORD, LPCWSTR,
270
+ LPCWSTR);
271
+ MODULE_SCOPE BOOL (INSTAPI* SQLConfigDataSource)(HWND, WORD, LPCSTR, LPCSTR);
272
+ MODULE_SCOPE BOOL (INSTAPI* SQLInstallerErrorW)(WORD, DWORD*, LPWSTR, WORD,
273
+ WORD*);
274
+ MODULE_SCOPE BOOL (INSTAPI* SQLInstallerError)(WORD, DWORD*, LPSTR, WORD,
275
+ WORD*);
276
+
277
+ /*
278
+ * Function that initialises the stubs
279
+ */
280
+
281
+ MODULE_SCOPE Tcl_LoadHandle OdbcInitStubs(Tcl_Interp*, Tcl_LoadHandle*);
282
+
283
+ #endif
janus/include/ffitarget.h ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* -----------------------------------------------------------------*-C-*-
2
+ ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green
3
+ Copyright (c) 1996-2003, 2010 Red Hat, Inc.
4
+ Copyright (C) 2008 Free Software Foundation, Inc.
5
+
6
+ Target configuration macros for x86 and x86-64.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining
9
+ a copy of this software and associated documentation files (the
10
+ ``Software''), to deal in the Software without restriction, including
11
+ without limitation the rights to use, copy, modify, merge, publish,
12
+ distribute, sublicense, and/or sell copies of the Software, and to
13
+ permit persons to whom the Software is furnished to do so, subject to
14
+ the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included
17
+ in all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
20
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
+ DEALINGS IN THE SOFTWARE.
27
+
28
+ ----------------------------------------------------------------------- */
29
+
30
+ #ifndef LIBFFI_TARGET_H
31
+ #define LIBFFI_TARGET_H
32
+
33
+ #ifndef LIBFFI_H
34
+ #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
35
+ #endif
36
+
37
+ /* ---- System specific configurations ----------------------------------- */
38
+
39
+ /* For code common to all platforms on x86 and x86_64. */
40
+ #define X86_ANY
41
+
42
+ #if defined (X86_64) && defined (__i386__)
43
+ #undef X86_64
44
+ #warning ******************************************************
45
+ #warning ********** X86 IS DEFINED ****************************
46
+ #warning ******************************************************
47
+ #define X86
48
+ #endif
49
+
50
+ #ifdef X86_WIN64
51
+ #define FFI_SIZEOF_ARG 8
52
+ #define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */
53
+ #endif
54
+
55
+ #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
56
+ #ifndef _MSC_VER
57
+ #define FFI_TARGET_HAS_COMPLEX_TYPE
58
+ #endif
59
+
60
+ /* ---- Generic type definitions ----------------------------------------- */
61
+
62
+ #ifndef LIBFFI_ASM
63
+ #ifdef X86_WIN64
64
+ #ifdef _MSC_VER
65
+ typedef unsigned __int64 ffi_arg;
66
+ typedef __int64 ffi_sarg;
67
+ #else
68
+ typedef unsigned long long ffi_arg;
69
+ typedef long long ffi_sarg;
70
+ #endif
71
+ #else
72
+ #if defined __x86_64__ && defined __ILP32__
73
+ #define FFI_SIZEOF_ARG 8
74
+ #define FFI_SIZEOF_JAVA_RAW 4
75
+ typedef unsigned long long ffi_arg;
76
+ typedef long long ffi_sarg;
77
+ #else
78
+ typedef unsigned long ffi_arg;
79
+ typedef signed long ffi_sarg;
80
+ #endif
81
+ #endif
82
+
83
+ typedef enum ffi_abi {
84
+ #if defined(X86_WIN64)
85
+ FFI_FIRST_ABI = 0,
86
+ FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */
87
+ FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */
88
+ FFI_LAST_ABI,
89
+ #ifdef __GNUC__
90
+ FFI_DEFAULT_ABI = FFI_GNUW64
91
+ #else
92
+ FFI_DEFAULT_ABI = FFI_WIN64
93
+ #endif
94
+
95
+ #elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
96
+ FFI_FIRST_ABI = 1,
97
+ FFI_UNIX64,
98
+ FFI_WIN64,
99
+ FFI_EFI64 = FFI_WIN64,
100
+ FFI_GNUW64,
101
+ FFI_LAST_ABI,
102
+ FFI_DEFAULT_ABI = FFI_UNIX64
103
+
104
+ #elif defined(X86_WIN32)
105
+ FFI_FIRST_ABI = 0,
106
+ FFI_SYSV = 1,
107
+ FFI_STDCALL = 2,
108
+ FFI_THISCALL = 3,
109
+ FFI_FASTCALL = 4,
110
+ FFI_MS_CDECL = 5,
111
+ FFI_PASCAL = 6,
112
+ FFI_REGISTER = 7,
113
+ FFI_LAST_ABI,
114
+ FFI_DEFAULT_ABI = FFI_MS_CDECL
115
+ #else
116
+ FFI_FIRST_ABI = 0,
117
+ FFI_SYSV = 1,
118
+ FFI_THISCALL = 3,
119
+ FFI_FASTCALL = 4,
120
+ FFI_STDCALL = 5,
121
+ FFI_PASCAL = 6,
122
+ FFI_REGISTER = 7,
123
+ FFI_MS_CDECL = 8,
124
+ FFI_LAST_ABI,
125
+ FFI_DEFAULT_ABI = FFI_SYSV
126
+ #endif
127
+ } ffi_abi;
128
+ #endif
129
+
130
+ /* ---- Definitions for closures ----------------------------------------- */
131
+
132
+ #define FFI_CLOSURES 1
133
+ #define FFI_GO_CLOSURES 1
134
+
135
+ #define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
136
+ #define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
137
+ #define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
138
+ #define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4)
139
+
140
+ #if defined (X86_64) || defined(X86_WIN64) \
141
+ || (defined (__x86_64__) && defined (X86_DARWIN))
142
+ /* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP
143
+ + 8 bytes of pointer. */
144
+ # define FFI_TRAMPOLINE_SIZE 32
145
+ # define FFI_NATIVE_RAW_API 0
146
+ #else
147
+ /* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused
148
+ bytes. */
149
+ # define FFI_TRAMPOLINE_SIZE 16
150
+ # define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
151
+ #endif
152
+
153
+ #if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__)
154
+ # include <cet.h>
155
+ # if (__CET__ & 1) != 0
156
+ # define ENDBR_PRESENT
157
+ # endif
158
+ # define _CET_NOTRACK notrack
159
+ #else
160
+ # define _CET_ENDBR
161
+ # define _CET_NOTRACK
162
+ #endif
163
+
164
+ #endif
janus/include/form.h ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2018-2019-2020,2021 Thomas E. Dickey *
3
+ * Copyright 1998-2016,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: Juergen Pfeifer, 1995,1997 *
32
+ ****************************************************************************/
33
+
34
+ /* $Id: form.h,v 0.32 2021/06/17 21:26:02 tom Exp $ */
35
+
36
+ #ifndef FORM_H
37
+ #define FORM_H
38
+ /* *INDENT-OFF*/
39
+
40
+ #include <ncursesw/curses.h>
41
+ #include <ncursesw/eti.h>
42
+
43
+ #ifdef __cplusplus
44
+ extern "C" {
45
+ #endif
46
+
47
+ #if defined(BUILDING_FORM)
48
+ # define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
49
+ #else
50
+ # define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
51
+ #endif
52
+
53
+ #define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
54
+
55
+ #define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API
56
+ #define FORM_EXPORT_VAR(type) FORM_IMPEXP type
57
+
58
+ #ifndef FORM_PRIV_H
59
+ typedef void *FIELD_CELL;
60
+ #endif
61
+
62
+ #ifndef NCURSES_FIELD_INTERNALS
63
+ #define NCURSES_FIELD_INTERNALS /* nothing */
64
+ #endif
65
+
66
+ typedef int Form_Options;
67
+ typedef int Field_Options;
68
+
69
+ /**********
70
+ * _PAGE *
71
+ **********/
72
+
73
+ typedef struct pagenode
74
+ #if !NCURSES_OPAQUE_FORM
75
+ {
76
+ short pmin; /* index of first field on page */
77
+ short pmax; /* index of last field on page */
78
+ short smin; /* index of top leftmost field on page */
79
+ short smax; /* index of bottom rightmost field on page */
80
+ }
81
+ #endif /* !NCURSES_OPAQUE_FORM */
82
+ _PAGE;
83
+
84
+ /**********
85
+ * FIELD *
86
+ **********/
87
+
88
+ typedef struct fieldnode
89
+ #if 1 /* not yet: !NCURSES_OPAQUE_FORM */
90
+ {
91
+ unsigned short status; /* flags */
92
+ short rows; /* size in rows */
93
+ short cols; /* size in cols */
94
+ short frow; /* first row */
95
+ short fcol; /* first col */
96
+ int drows; /* dynamic rows */
97
+ int dcols; /* dynamic cols */
98
+ int maxgrow; /* maximum field growth */
99
+ int nrow; /* off-screen rows */
100
+ short nbuf; /* additional buffers */
101
+ short just; /* justification */
102
+ short page; /* page on form */
103
+ short index; /* into form -> field */
104
+ int pad; /* pad character */
105
+ chtype fore; /* foreground attribute */
106
+ chtype back; /* background attribute */
107
+ Field_Options opts; /* options */
108
+ struct fieldnode * snext; /* sorted order pointer */
109
+ struct fieldnode * sprev; /* sorted order pointer */
110
+ struct fieldnode * link; /* linked field chain */
111
+ struct formnode * form; /* containing form */
112
+ struct typenode * type; /* field type */
113
+ void * arg; /* argument for type */
114
+ FIELD_CELL * buf; /* field buffers */
115
+ void * usrptr; /* user pointer */
116
+ /*
117
+ * The wide-character configuration requires extra information. Because
118
+ * there are existing applications that manipulate the members of FIELD
119
+ * directly, we cannot make the struct opaque, except by changing the ABI.
120
+ * Offsets of members up to this point are the same in the narrow- and
121
+ * wide-character configuration. But note that the type of buf depends on
122
+ * the configuration, and is made opaque for that reason.
123
+ */
124
+ NCURSES_FIELD_INTERNALS
125
+ }
126
+ #endif /* NCURSES_OPAQUE_FORM */
127
+ FIELD;
128
+
129
+
130
+ /*********
131
+ * FORM *
132
+ *********/
133
+
134
+ typedef struct formnode
135
+ #if 1 /* not yet: !NCURSES_OPAQUE_FORM */
136
+ {
137
+ unsigned short status; /* flags */
138
+ short rows; /* size in rows */
139
+ short cols; /* size in cols */
140
+ int currow; /* current row in field window */
141
+ int curcol; /* current col in field window */
142
+ int toprow; /* in scrollable field window */
143
+ int begincol; /* in horiz. scrollable field */
144
+ short maxfield; /* number of fields */
145
+ short maxpage; /* number of pages */
146
+ short curpage; /* index into page */
147
+ Form_Options opts; /* options */
148
+ WINDOW * win; /* window */
149
+ WINDOW * sub; /* subwindow */
150
+ WINDOW * w; /* window for current field */
151
+ FIELD ** field; /* field [maxfield] */
152
+ FIELD * current; /* current field */
153
+ _PAGE * page; /* page [maxpage] */
154
+ void * usrptr; /* user pointer */
155
+
156
+ void (*forminit)(struct formnode *);
157
+ void (*formterm)(struct formnode *);
158
+ void (*fieldinit)(struct formnode *);
159
+ void (*fieldterm)(struct formnode *);
160
+
161
+ }
162
+ #endif /* !NCURSES_OPAQUE_FORM */
163
+ FORM;
164
+
165
+
166
+ /**************
167
+ * FIELDTYPE *
168
+ **************/
169
+
170
+ typedef struct typenode
171
+ #if !NCURSES_OPAQUE_FORM
172
+ {
173
+ unsigned short status; /* flags */
174
+ long ref; /* reference count */
175
+ struct typenode * left; /* ptr to operand for | */
176
+ struct typenode * right; /* ptr to operand for | */
177
+
178
+ void* (*makearg)(va_list *); /* make fieldtype arg */
179
+ void* (*copyarg)(const void *); /* copy fieldtype arg */
180
+ void (*freearg)(void *); /* free fieldtype arg */
181
+
182
+ #if NCURSES_INTEROP_FUNCS
183
+ union {
184
+ bool (*ofcheck)(FIELD *,const void *); /* field validation */
185
+ bool (*gfcheck)(FORM*,FIELD *,const void*); /* generic field validation */
186
+ } fieldcheck;
187
+ union {
188
+ bool (*occheck)(int,const void *); /* character validation */
189
+ bool (*gccheck)(int,FORM*,
190
+ FIELD*,const void*); /* generic char validation */
191
+ } charcheck;
192
+ union {
193
+ bool (*onext)(FIELD *,const void *); /* enumerate next value */
194
+ bool (*gnext)(FORM*,FIELD*,const void*); /* generic enumerate next */
195
+ } enum_next;
196
+ union {
197
+ bool (*oprev)(FIELD *,const void *); /* enumerate prev value */
198
+ bool (*gprev)(FORM*,FIELD*,const void*); /* generic enumerate prev */
199
+ } enum_prev;
200
+ void* (*genericarg)(void*); /* Alternate Arg method */
201
+ #else
202
+ bool (*fcheck)(FIELD *,const void *); /* field validation */
203
+ bool (*ccheck)(int,const void *); /* character validation */
204
+
205
+ bool (*next)(FIELD *,const void *); /* enumerate next value */
206
+ bool (*prev)(FIELD *,const void *); /* enumerate prev value */
207
+ #endif
208
+ }
209
+ #endif /* !NCURSES_OPAQUE_FORM */
210
+ FIELDTYPE;
211
+
212
+ typedef void (*Form_Hook)(FORM *);
213
+
214
+ /***************************
215
+ * miscellaneous #defines *
216
+ ***************************/
217
+
218
+ /* field justification */
219
+ #define NO_JUSTIFICATION (0)
220
+ #define JUSTIFY_LEFT (1)
221
+ #define JUSTIFY_CENTER (2)
222
+ #define JUSTIFY_RIGHT (3)
223
+
224
+ /* field options */
225
+ #define O_VISIBLE (0x0001U)
226
+ #define O_ACTIVE (0x0002U)
227
+ #define O_PUBLIC (0x0004U)
228
+ #define O_EDIT (0x0008U)
229
+ #define O_WRAP (0x0010U)
230
+ #define O_BLANK (0x0020U)
231
+ #define O_AUTOSKIP (0x0040U)
232
+ #define O_NULLOK (0x0080U)
233
+ #define O_PASSOK (0x0100U)
234
+ #define O_STATIC (0x0200U)
235
+ #define O_DYNAMIC_JUSTIFY (0x0400U) /* ncurses extension */
236
+ #define O_NO_LEFT_STRIP (0x0800U) /* ncurses extension */
237
+ #define O_EDGE_INSERT_STAY (0x1000U) /* ncurses extension */
238
+ #define O_INPUT_LIMIT (0x2000U) /* ncurses extension */
239
+
240
+ /* form options */
241
+ #define O_NL_OVERLOAD (0x0001U)
242
+ #define O_BS_OVERLOAD (0x0002U)
243
+
244
+ /* form driver commands */
245
+ #define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
246
+ #define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */
247
+ #define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */
248
+ #define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */
249
+
250
+ #define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */
251
+ #define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */
252
+ #define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */
253
+ #define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */
254
+ #define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */
255
+ #define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */
256
+ #define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */
257
+ #define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */
258
+ #define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */
259
+ #define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */
260
+ #define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */
261
+ #define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */
262
+
263
+ #define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */
264
+ #define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */
265
+ #define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */
266
+ #define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */
267
+ #define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */
268
+ #define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */
269
+ #define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */
270
+ #define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */
271
+ #define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */
272
+ #define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */
273
+ #define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */
274
+ #define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */
275
+ #define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */
276
+ #define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */
277
+
278
+ #define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */
279
+ #define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */
280
+ #define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */
281
+ #define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
282
+ #define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
283
+ #define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
284
+ #define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */
285
+ #define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
286
+ #define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
287
+ #define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
288
+ #define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */
289
+ #define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */
290
+ #define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */
291
+ #define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
292
+ #define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
293
+ #define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
294
+ #define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
295
+ #define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
296
+ #define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
297
+ #define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
298
+ #define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
299
+ #define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
300
+ #define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
301
+ #define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
302
+
303
+ #define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
304
+ #define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
305
+ #define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */
306
+
307
+ #define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */
308
+ #define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */
309
+
310
+ #if defined(MAX_COMMAND)
311
+ # if (MAX_FORM_COMMAND > MAX_COMMAND)
312
+ # error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
313
+ # elif (MAX_COMMAND != (KEY_MAX + 128))
314
+ # error Something is wrong -- MAX_COMMAND is already inconsistently defined.
315
+ # endif
316
+ #else
317
+ # define MAX_COMMAND (KEY_MAX + 128)
318
+ #endif
319
+
320
+ /*************************
321
+ * standard field types *
322
+ *************************/
323
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
324
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
325
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
326
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
327
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
328
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
329
+
330
+ /************************************
331
+ * built-in additional field types *
332
+ * They are not defined in SVr4 *
333
+ ************************************/
334
+ extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
335
+
336
+ /***********************
337
+ * FIELDTYPE routines *
338
+ ***********************/
339
+ extern FORM_EXPORT(FIELDTYPE *) new_fieldtype (
340
+ bool (* const field_check)(FIELD *,const void *),
341
+ bool (* const char_check)(int,const void *));
342
+ extern FORM_EXPORT(FIELDTYPE *) link_fieldtype(
343
+ FIELDTYPE *, FIELDTYPE *);
344
+
345
+ extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *);
346
+ extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
347
+ void * (* const make_arg)(va_list *),
348
+ void * (* const copy_arg)(const void *),
349
+ void (* const free_arg)(void *));
350
+ extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
351
+ bool (* const next_choice)(FIELD *,const void *),
352
+ bool (* const prev_choice)(FIELD *,const void *));
353
+
354
+ /*******************
355
+ * FIELD routines *
356
+ *******************/
357
+ extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int);
358
+ extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int);
359
+ extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int);
360
+
361
+ extern FORM_EXPORT(int) free_field (FIELD *);
362
+ extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
363
+ extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *);
364
+ extern FORM_EXPORT(int) set_max_field ( FIELD *,int);
365
+ extern FORM_EXPORT(int) move_field (FIELD *,int,int);
366
+ extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...);
367
+ extern FORM_EXPORT(int) set_new_page (FIELD *,bool);
368
+ extern FORM_EXPORT(int) set_field_just (FIELD *,int);
369
+ extern FORM_EXPORT(int) field_just (const FIELD *);
370
+ extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype);
371
+ extern FORM_EXPORT(int) set_field_back (FIELD *,chtype);
372
+ extern FORM_EXPORT(int) set_field_pad (FIELD *,int);
373
+ extern FORM_EXPORT(int) field_pad (const FIELD *);
374
+ extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *);
375
+ extern FORM_EXPORT(int) set_field_status (FIELD *,bool);
376
+ extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *);
377
+ extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options);
378
+ extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options);
379
+ extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options);
380
+
381
+ extern FORM_EXPORT(chtype) field_fore (const FIELD *);
382
+ extern FORM_EXPORT(chtype) field_back (const FIELD *);
383
+
384
+ extern FORM_EXPORT(bool) new_page (const FIELD *);
385
+ extern FORM_EXPORT(bool) field_status (const FIELD *);
386
+
387
+ extern FORM_EXPORT(void *) field_arg (const FIELD *);
388
+
389
+ extern FORM_EXPORT(void *) field_userptr (const FIELD *);
390
+
391
+ extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *);
392
+
393
+ extern FORM_EXPORT(char *) field_buffer (const FIELD *,int);
394
+
395
+ extern FORM_EXPORT(Field_Options) field_opts (const FIELD *);
396
+
397
+ /******************
398
+ * FORM routines *
399
+ ******************/
400
+
401
+ extern FORM_EXPORT(FORM *) new_form (FIELD **);
402
+
403
+ extern FORM_EXPORT(FIELD **) form_fields (const FORM *);
404
+ extern FORM_EXPORT(FIELD *) current_field (const FORM *);
405
+
406
+ extern FORM_EXPORT(WINDOW *) form_win (const FORM *);
407
+ extern FORM_EXPORT(WINDOW *) form_sub (const FORM *);
408
+
409
+ extern FORM_EXPORT(Form_Hook) form_init (const FORM *);
410
+ extern FORM_EXPORT(Form_Hook) form_term (const FORM *);
411
+ extern FORM_EXPORT(Form_Hook) field_init (const FORM *);
412
+ extern FORM_EXPORT(Form_Hook) field_term (const FORM *);
413
+
414
+ extern FORM_EXPORT(int) free_form (FORM *);
415
+ extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **);
416
+ extern FORM_EXPORT(int) field_count (const FORM *);
417
+ extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *);
418
+ extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *);
419
+ extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *);
420
+ extern FORM_EXPORT(int) unfocus_current_field (FORM *);
421
+ extern FORM_EXPORT(int) field_index (const FIELD *);
422
+ extern FORM_EXPORT(int) set_form_page (FORM *,int);
423
+ extern FORM_EXPORT(int) form_page (const FORM *);
424
+ extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *);
425
+ extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook);
426
+ extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook);
427
+ extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook);
428
+ extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook);
429
+ extern FORM_EXPORT(int) post_form (FORM *);
430
+ extern FORM_EXPORT(int) unpost_form (FORM *);
431
+ extern FORM_EXPORT(int) pos_form_cursor (FORM *);
432
+ extern FORM_EXPORT(int) form_driver (FORM *,int);
433
+ # if NCURSES_WIDECHAR
434
+ extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t);
435
+ # endif
436
+ extern FORM_EXPORT(int) set_form_userptr (FORM *,void *);
437
+ extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options);
438
+ extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options);
439
+ extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options);
440
+ extern FORM_EXPORT(int) form_request_by_name (const char *);
441
+
442
+ extern FORM_EXPORT(const char *) form_request_name (int);
443
+
444
+ extern FORM_EXPORT(void *) form_userptr (const FORM *);
445
+
446
+ extern FORM_EXPORT(Form_Options) form_opts (const FORM *);
447
+
448
+ extern FORM_EXPORT(bool) data_ahead (const FORM *);
449
+ extern FORM_EXPORT(bool) data_behind (const FORM *);
450
+
451
+ #if NCURSES_SP_FUNCS
452
+ extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
453
+ #endif
454
+
455
+ #ifdef __cplusplus
456
+ }
457
+ #endif
458
+ /* *INDENT-ON*/
459
+
460
+ #endif /* FORM_H */
janus/include/itcl2TclOO.h ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #ifndef _TCLINT
3
+ typedef void (ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj);
4
+ #endif
5
+
6
+ #ifndef TCL_OO_INTERNAL_H
7
+ typedef int (TclOO_PreCallProc)(void *clientData, Tcl_Interp *interp,
8
+ Tcl_ObjectContext context, Tcl_CallFrame *framePtr, int *isFinished);
9
+ typedef int (TclOO_PostCallProc)(void *clientData, Tcl_Interp *interp,
10
+ Tcl_ObjectContext context, Tcl_Namespace *namespacePtr, int result);
11
+ #endif
12
+
13
+ MODULE_SCOPE int Itcl_NRRunCallbacks(Tcl_Interp *interp, void *rootPtr);
14
+ MODULE_SCOPE void * Itcl_GetCurrentCallbackPtr(Tcl_Interp *interp);
15
+ MODULE_SCOPE Tcl_Method Itcl_NewProcClassMethod(Tcl_Interp *interp, Tcl_Class clsPtr,
16
+ TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr,
17
+ ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj,
18
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj, void **clientData2);
19
+ MODULE_SCOPE Tcl_Method Itcl_NewProcMethod(Tcl_Interp *interp, Tcl_Object oPtr,
20
+ TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr,
21
+ ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj,
22
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj, void **clientData2);
23
+ MODULE_SCOPE int Itcl_PublicObjectCmd(void *clientData, Tcl_Interp *interp,
24
+ Tcl_Class clsPtr, Tcl_Size objc, Tcl_Obj *const *objv);
25
+ MODULE_SCOPE Tcl_Method Itcl_NewForwardClassMethod(Tcl_Interp *interp,
26
+ Tcl_Class clsPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *prefixObj);
27
+ MODULE_SCOPE int Itcl_SelfCmd(void *clientData, Tcl_Interp *interp,
28
+ int objc, Tcl_Obj *const *objv);
29
+ MODULE_SCOPE int Itcl_IsMethodCallFrame(Tcl_Interp *interp);
30
+ MODULE_SCOPE int Itcl_InvokeEnsembleMethod(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
31
+ Tcl_Obj *namePtr, Tcl_Proc *procPtr, Tcl_Size objc, Tcl_Obj *const *objv);
32
+ MODULE_SCOPE int Itcl_InvokeProcedureMethod(void *clientData, Tcl_Interp *interp,
33
+ int objc, Tcl_Obj *const *objv);
janus/include/itclDecls.h ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file is (mostly) automatically generated from itcl.decls.
3
+ */
4
+
5
+ #ifndef _ITCLDECLS
6
+ #define _ITCLDECLS
7
+
8
+ #if defined(USE_ITCL_STUBS)
9
+
10
+ ITCLAPI const char *Itcl_InitStubs(
11
+ Tcl_Interp *, const char *version, int exact);
12
+ #else
13
+
14
+ #define Itcl_InitStubs(interp, version, exact) Tcl_PkgRequireEx(interp,"itcl",version,exact,NULL)
15
+
16
+ #endif
17
+
18
+
19
+ /* !BEGIN!: Do not edit below this line. */
20
+
21
+ #define ITCL_STUBS_EPOCH 0
22
+ #define ITCL_STUBS_REVISION 152
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ /*
29
+ * Exported function declarations:
30
+ */
31
+
32
+ /* Slot 0 is reserved */
33
+ /* Slot 1 is reserved */
34
+ /* 2 */
35
+ ITCLAPI int Itcl_RegisterC(Tcl_Interp *interp, const char *name,
36
+ Tcl_CmdProc *proc, void *clientData,
37
+ Tcl_CmdDeleteProc *deleteProc);
38
+ /* 3 */
39
+ ITCLAPI int Itcl_RegisterObjC(Tcl_Interp *interp,
40
+ const char *name, Tcl_ObjCmdProc *proc,
41
+ void *clientData,
42
+ Tcl_CmdDeleteProc *deleteProc);
43
+ /* 4 */
44
+ ITCLAPI int Itcl_FindC(Tcl_Interp *interp, const char *name,
45
+ Tcl_CmdProc **argProcPtr,
46
+ Tcl_ObjCmdProc **objProcPtr, void **cDataPtr);
47
+ /* 5 */
48
+ ITCLAPI void Itcl_InitStack(Itcl_Stack *stack);
49
+ /* 6 */
50
+ ITCLAPI void Itcl_DeleteStack(Itcl_Stack *stack);
51
+ /* 7 */
52
+ ITCLAPI void Itcl_PushStack(void *cdata, Itcl_Stack *stack);
53
+ /* 8 */
54
+ ITCLAPI void * Itcl_PopStack(Itcl_Stack *stack);
55
+ /* 9 */
56
+ ITCLAPI void * Itcl_PeekStack(Itcl_Stack *stack);
57
+ /* 10 */
58
+ ITCLAPI void * Itcl_GetStackValue(Itcl_Stack *stack, Tcl_Size pos);
59
+ /* 11 */
60
+ ITCLAPI void Itcl_InitList(Itcl_List *listPtr);
61
+ /* 12 */
62
+ ITCLAPI void Itcl_DeleteList(Itcl_List *listPtr);
63
+ /* 13 */
64
+ ITCLAPI Itcl_ListElem * Itcl_CreateListElem(Itcl_List *listPtr);
65
+ /* 14 */
66
+ ITCLAPI Itcl_ListElem * Itcl_DeleteListElem(Itcl_ListElem *elemPtr);
67
+ /* 15 */
68
+ ITCLAPI Itcl_ListElem * Itcl_InsertList(Itcl_List *listPtr, void *val);
69
+ /* 16 */
70
+ ITCLAPI Itcl_ListElem * Itcl_InsertListElem(Itcl_ListElem *pos, void *val);
71
+ /* 17 */
72
+ ITCLAPI Itcl_ListElem * Itcl_AppendList(Itcl_List *listPtr, void *val);
73
+ /* 18 */
74
+ ITCLAPI Itcl_ListElem * Itcl_AppendListElem(Itcl_ListElem *pos, void *val);
75
+ /* 19 */
76
+ ITCLAPI void Itcl_SetListValue(Itcl_ListElem *elemPtr, void *val);
77
+ /* 20 */
78
+ ITCLAPI void Itcl_EventuallyFree(void *cdata, Tcl_FreeProc *fproc);
79
+ /* 21 */
80
+ ITCLAPI void Itcl_PreserveData(void *cdata);
81
+ /* 22 */
82
+ ITCLAPI void Itcl_ReleaseData(void *cdata);
83
+ /* 23 */
84
+ ITCLAPI Itcl_InterpState Itcl_SaveInterpState(Tcl_Interp *interp, int status);
85
+ /* 24 */
86
+ ITCLAPI int Itcl_RestoreInterpState(Tcl_Interp *interp,
87
+ Itcl_InterpState state);
88
+ /* 25 */
89
+ ITCLAPI void Itcl_DiscardInterpState(Itcl_InterpState state);
90
+ /* 26 */
91
+ ITCLAPI void * Itcl_Alloc(size_t size);
92
+ /* 27 */
93
+ ITCLAPI void Itcl_Free(void *ptr);
94
+
95
+ typedef struct {
96
+ const struct ItclIntStubs *itclIntStubs;
97
+ } ItclStubHooks;
98
+
99
+ typedef struct ItclStubs {
100
+ int magic;
101
+ int epoch;
102
+ int revision;
103
+ const ItclStubHooks *hooks;
104
+
105
+ void (*reserved0)(void);
106
+ void (*reserved1)(void);
107
+ int (*itcl_RegisterC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 2 */
108
+ int (*itcl_RegisterObjC) (Tcl_Interp *interp, const char *name, Tcl_ObjCmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 3 */
109
+ int (*itcl_FindC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc **argProcPtr, Tcl_ObjCmdProc **objProcPtr, void **cDataPtr); /* 4 */
110
+ void (*itcl_InitStack) (Itcl_Stack *stack); /* 5 */
111
+ void (*itcl_DeleteStack) (Itcl_Stack *stack); /* 6 */
112
+ void (*itcl_PushStack) (void *cdata, Itcl_Stack *stack); /* 7 */
113
+ void * (*itcl_PopStack) (Itcl_Stack *stack); /* 8 */
114
+ void * (*itcl_PeekStack) (Itcl_Stack *stack); /* 9 */
115
+ void * (*itcl_GetStackValue) (Itcl_Stack *stack, Tcl_Size pos); /* 10 */
116
+ void (*itcl_InitList) (Itcl_List *listPtr); /* 11 */
117
+ void (*itcl_DeleteList) (Itcl_List *listPtr); /* 12 */
118
+ Itcl_ListElem * (*itcl_CreateListElem) (Itcl_List *listPtr); /* 13 */
119
+ Itcl_ListElem * (*itcl_DeleteListElem) (Itcl_ListElem *elemPtr); /* 14 */
120
+ Itcl_ListElem * (*itcl_InsertList) (Itcl_List *listPtr, void *val); /* 15 */
121
+ Itcl_ListElem * (*itcl_InsertListElem) (Itcl_ListElem *pos, void *val); /* 16 */
122
+ Itcl_ListElem * (*itcl_AppendList) (Itcl_List *listPtr, void *val); /* 17 */
123
+ Itcl_ListElem * (*itcl_AppendListElem) (Itcl_ListElem *pos, void *val); /* 18 */
124
+ void (*itcl_SetListValue) (Itcl_ListElem *elemPtr, void *val); /* 19 */
125
+ void (*itcl_EventuallyFree) (void *cdata, Tcl_FreeProc *fproc); /* 20 */
126
+ void (*itcl_PreserveData) (void *cdata); /* 21 */
127
+ void (*itcl_ReleaseData) (void *cdata); /* 22 */
128
+ Itcl_InterpState (*itcl_SaveInterpState) (Tcl_Interp *interp, int status); /* 23 */
129
+ int (*itcl_RestoreInterpState) (Tcl_Interp *interp, Itcl_InterpState state); /* 24 */
130
+ void (*itcl_DiscardInterpState) (Itcl_InterpState state); /* 25 */
131
+ void * (*itcl_Alloc) (size_t size); /* 26 */
132
+ void (*itcl_Free) (void *ptr); /* 27 */
133
+ } ItclStubs;
134
+
135
+ extern const ItclStubs *itclStubsPtr;
136
+
137
+ #ifdef __cplusplus
138
+ }
139
+ #endif
140
+
141
+ #if defined(USE_ITCL_STUBS)
142
+
143
+ /*
144
+ * Inline function declarations:
145
+ */
146
+
147
+ /* Slot 0 is reserved */
148
+ /* Slot 1 is reserved */
149
+ #define Itcl_RegisterC \
150
+ (itclStubsPtr->itcl_RegisterC) /* 2 */
151
+ #define Itcl_RegisterObjC \
152
+ (itclStubsPtr->itcl_RegisterObjC) /* 3 */
153
+ #define Itcl_FindC \
154
+ (itclStubsPtr->itcl_FindC) /* 4 */
155
+ #define Itcl_InitStack \
156
+ (itclStubsPtr->itcl_InitStack) /* 5 */
157
+ #define Itcl_DeleteStack \
158
+ (itclStubsPtr->itcl_DeleteStack) /* 6 */
159
+ #define Itcl_PushStack \
160
+ (itclStubsPtr->itcl_PushStack) /* 7 */
161
+ #define Itcl_PopStack \
162
+ (itclStubsPtr->itcl_PopStack) /* 8 */
163
+ #define Itcl_PeekStack \
164
+ (itclStubsPtr->itcl_PeekStack) /* 9 */
165
+ #define Itcl_GetStackValue \
166
+ (itclStubsPtr->itcl_GetStackValue) /* 10 */
167
+ #define Itcl_InitList \
168
+ (itclStubsPtr->itcl_InitList) /* 11 */
169
+ #define Itcl_DeleteList \
170
+ (itclStubsPtr->itcl_DeleteList) /* 12 */
171
+ #define Itcl_CreateListElem \
172
+ (itclStubsPtr->itcl_CreateListElem) /* 13 */
173
+ #define Itcl_DeleteListElem \
174
+ (itclStubsPtr->itcl_DeleteListElem) /* 14 */
175
+ #define Itcl_InsertList \
176
+ (itclStubsPtr->itcl_InsertList) /* 15 */
177
+ #define Itcl_InsertListElem \
178
+ (itclStubsPtr->itcl_InsertListElem) /* 16 */
179
+ #define Itcl_AppendList \
180
+ (itclStubsPtr->itcl_AppendList) /* 17 */
181
+ #define Itcl_AppendListElem \
182
+ (itclStubsPtr->itcl_AppendListElem) /* 18 */
183
+ #define Itcl_SetListValue \
184
+ (itclStubsPtr->itcl_SetListValue) /* 19 */
185
+ #define Itcl_EventuallyFree \
186
+ (itclStubsPtr->itcl_EventuallyFree) /* 20 */
187
+ #define Itcl_PreserveData \
188
+ (itclStubsPtr->itcl_PreserveData) /* 21 */
189
+ #define Itcl_ReleaseData \
190
+ (itclStubsPtr->itcl_ReleaseData) /* 22 */
191
+ #define Itcl_SaveInterpState \
192
+ (itclStubsPtr->itcl_SaveInterpState) /* 23 */
193
+ #define Itcl_RestoreInterpState \
194
+ (itclStubsPtr->itcl_RestoreInterpState) /* 24 */
195
+ #define Itcl_DiscardInterpState \
196
+ (itclStubsPtr->itcl_DiscardInterpState) /* 25 */
197
+ #define Itcl_Alloc \
198
+ (itclStubsPtr->itcl_Alloc) /* 26 */
199
+ #define Itcl_Free \
200
+ (itclStubsPtr->itcl_Free) /* 27 */
201
+
202
+ #endif /* defined(USE_ITCL_STUBS) */
203
+
204
+ /* !END!: Do not edit above this line. */
205
+
206
+ #endif /* _ITCLDECLS */
janus/include/itclInt.h ADDED
@@ -0,0 +1,854 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * itclInt.h --
3
+ *
4
+ * This file contains internal definitions for the C-implemented part of a
5
+ * Itcl
6
+ *
7
+ * Copyright (c) 2007 by Arnulf P. Wiedemann
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
+ #ifdef HAVE_UNISTD_H
14
+ #include <unistd.h>
15
+ #endif
16
+ #ifdef HAVE_STDINT_H
17
+ #include <stdint.h>
18
+ #endif
19
+ #include <stddef.h>
20
+
21
+ /*
22
+ * Used to tag functions that are only to be visible within the module being
23
+ * built and not outside it (where this is supported by the linker).
24
+ */
25
+
26
+ #ifndef MODULE_SCOPE
27
+ # ifdef __cplusplus
28
+ # define MODULE_SCOPE extern "C"
29
+ # else
30
+ # define MODULE_SCOPE extern
31
+ # endif
32
+ #endif
33
+
34
+ #include <string.h>
35
+ #include <ctype.h>
36
+ #include <tclOO.h>
37
+ #include "itcl.h"
38
+ #include "itclMigrate2TclCore.h"
39
+ #include "itclTclIntStubsFcn.h"
40
+
41
+ /*
42
+ * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
43
+ * quotation marks).
44
+ */
45
+
46
+ #ifndef STRINGIFY
47
+ # define STRINGIFY(x) STRINGIFY1(x)
48
+ # define STRINGIFY1(x) #x
49
+ #endif
50
+
51
+ /*
52
+ * MSVC 8.0 started to mark many standard C library functions depreciated
53
+ * including the *printf family and others. Tell it to shut up.
54
+ * (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0)
55
+ */
56
+ #if defined(_MSC_VER)
57
+ # pragma warning(disable:4244)
58
+ # if _MSC_VER >= 1400
59
+ # pragma warning(disable:4267)
60
+ # pragma warning(disable:4996)
61
+ # endif
62
+ #endif
63
+
64
+ #ifndef TCL_INDEX_NONE
65
+ # define TCL_INDEX_NONE (-1)
66
+ #endif
67
+
68
+ #ifndef JOIN
69
+ # define JOIN(a,b) JOIN1(a,b)
70
+ # define JOIN1(a,b) a##b
71
+ #endif
72
+
73
+ #ifndef TCL_UNUSED
74
+ # if defined(__cplusplus)
75
+ # define TCL_UNUSED(T) T
76
+ # elif defined(__GNUC__) && (__GNUC__ > 2)
77
+ # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
78
+ # else
79
+ # define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
80
+ # endif
81
+ #endif
82
+
83
+ #if TCL_MAJOR_VERSION == 8
84
+ # define ITCL_Z_MODIFIER ""
85
+ #else
86
+ # define ITCL_Z_MODIFIER TCL_Z_MODIFIER
87
+ #endif
88
+
89
+ /*
90
+ * Since the Tcl/Tk distribution doesn't perform any asserts,
91
+ * dynamic loading can fail to find the __assert function.
92
+ * As a workaround, we'll include our own.
93
+ */
94
+
95
+ #undef assert
96
+ #if defined(NDEBUG) && !defined(DEBUG)
97
+ #define assert(EX) ((void)0)
98
+ #else /* !NDEBUG || DEBUG */
99
+ #define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0))
100
+ #endif
101
+
102
+ #define ITCL_INTERP_DATA "itcl_data"
103
+ #define ITCL_TK_VERSION "8.6"
104
+
105
+ /*
106
+ * Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
107
+ * sets up the declarations needed for the main macro, FOREACH_HASH, which
108
+ * does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
109
+ * only iterates over values.
110
+ */
111
+
112
+ #define FOREACH_HASH_DECLS \
113
+ Tcl_HashEntry *hPtr;Tcl_HashSearch search
114
+ #define FOREACH_HASH(key,val,tablePtr) \
115
+ for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
116
+ (*(void **)&(key)=Tcl_GetHashKey((tablePtr),hPtr),\
117
+ *(void **)&(val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
118
+ #define FOREACH_HASH_VALUE(val,tablePtr) \
119
+ for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
120
+ (*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
121
+
122
+ /*
123
+ * What sort of size of things we like to allocate.
124
+ */
125
+
126
+ #define ALLOC_CHUNK 8
127
+
128
+ #define ITCL_INT_NAMESPACE ITCL_NAMESPACE"::internal"
129
+ #define ITCL_INTDICTS_NAMESPACE ITCL_INT_NAMESPACE"::dicts"
130
+ #define ITCL_VARIABLES_NAMESPACE ITCL_INT_NAMESPACE"::variables"
131
+ #define ITCL_COMMANDS_NAMESPACE ITCL_INT_NAMESPACE"::commands"
132
+
133
+ typedef struct ItclFoundation {
134
+ Itcl_Stack methodCallStack;
135
+ Tcl_Command dispatchCommand;
136
+ } ItclFoundation;
137
+
138
+ typedef struct ItclArgList {
139
+ struct ItclArgList *nextPtr; /* pointer to next argument */
140
+ Tcl_Obj *namePtr; /* name of the argument */
141
+ Tcl_Obj *defaultValuePtr; /* default value or NULL if none */
142
+ } ItclArgList;
143
+
144
+ /*
145
+ * Common info for managing all known objects.
146
+ * Each interpreter has one of these data structures stored as
147
+ * clientData in the "itcl" namespace. It is also accessible
148
+ * as associated data via the key ITCL_INTERP_DATA.
149
+ */
150
+ struct ItclClass;
151
+ struct ItclObject;
152
+ struct ItclMemberFunc;
153
+ struct EnsembleInfo;
154
+ struct ItclDelegatedOption;
155
+ struct ItclDelegatedFunction;
156
+
157
+ typedef struct ItclObjectInfo {
158
+ Tcl_Interp *interp; /* interpreter that manages this info */
159
+ Tcl_HashTable objects; /* list of all known objects key is
160
+ * ioPtr */
161
+ Tcl_HashTable objectCmds; /* list of known objects using accessCmd */
162
+ Tcl_HashTable unused5; /* list of known objects using namePtr */
163
+ Tcl_HashTable classes; /* list of all known classes,
164
+ * key is iclsPtr */
165
+ Tcl_HashTable nameClasses; /* maps from fullNamePtr to iclsPtr */
166
+ Tcl_HashTable namespaceClasses; /* maps from nsPtr to iclsPtr */
167
+ Tcl_HashTable procMethods; /* maps from procPtr to mFunc */
168
+ Tcl_HashTable instances; /* maps from instanceNumber to ioPtr */
169
+ Tcl_HashTable unused8; /* maps from ioPtr to instanceNumber */
170
+ Tcl_HashTable frameContext; /* maps frame to context stack */
171
+ Tcl_HashTable classTypes; /* maps from class type i.e. "widget"
172
+ * to define value i.e. ITCL_WIDGET */
173
+ int protection; /* protection level currently in effect */
174
+ int useOldResolvers; /* whether to use the "old" style
175
+ * resolvers or the CallFrame resolvers */
176
+ Itcl_Stack clsStack; /* stack of class definitions currently
177
+ * being parsed */
178
+ Itcl_Stack unused; /* Removed */
179
+ Itcl_Stack unused6; /* obsolete field */
180
+ struct ItclObject *currIoPtr; /* object currently being constructed
181
+ * set only during calling of constructors
182
+ * otherwise NULL */
183
+ Tcl_ObjectMetadataType *class_meta_type;
184
+ /* type for getting the Itcl class info
185
+ * from a TclOO Tcl_Object */
186
+ const Tcl_ObjectMetadataType *object_meta_type;
187
+ /* type for getting the Itcl object info
188
+ * from a TclOO Tcl_Object */
189
+ Tcl_Object clazzObjectPtr; /* the root object of Itcl */
190
+ Tcl_Class clazzClassPtr; /* the root class of Itcl */
191
+ struct EnsembleInfo *ensembleInfo;
192
+ struct ItclClass *currContextIclsPtr;
193
+ /* context class for delegated option
194
+ * handling */
195
+ int currClassFlags; /* flags for the class just in creation */
196
+ int buildingWidget; /* set if in construction of a widget */
197
+ Tcl_Size unparsedObjc; /* number options not parsed by
198
+ ItclExtendedConfigure/-Cget function */
199
+ Tcl_Obj **unparsedObjv; /* options not parsed by
200
+ ItclExtendedConfigure/-Cget function */
201
+ int functionFlags; /* used for creating of ItclMemberCode */
202
+ int unused7;
203
+ struct ItclDelegatedOption *currIdoPtr;
204
+ /* the current delegated option info */
205
+ int inOptionHandling; /* used to indicate for type/widget ...
206
+ * that there is an option processing
207
+ * and methods are allowed to be called */
208
+ /* these are the Tcl_Obj Ptrs for the clazz unknown procedure */
209
+ /* need to store them to be able to free them at the end */
210
+ int itclWidgetInitted; /* set to 1 if itclWidget.tcl has already
211
+ * been called
212
+ */
213
+ int itclHullCmdsInitted; /* set to 1 if itclHullCmds.tcl has already
214
+ * been called
215
+ */
216
+ Tcl_Obj *unused2;
217
+ Tcl_Obj *unused3;
218
+ Tcl_Obj *unused4;
219
+ Tcl_Obj *infoVarsPtr;
220
+ Tcl_Obj *unused9;
221
+ Tcl_Obj *infoVars4Ptr;
222
+ Tcl_Obj *typeDestructorArgumentPtr;
223
+ struct ItclObject *lastIoPtr; /* last object constructed */
224
+ Tcl_Command infoCmd;
225
+ } ItclObjectInfo;
226
+
227
+ typedef struct EnsembleInfo {
228
+ Tcl_HashTable ensembles; /* list of all known ensembles */
229
+ Tcl_HashTable subEnsembles; /* list of all known subensembles */
230
+ Tcl_Size numEnsembles;
231
+ Tcl_Namespace *ensembleNsPtr;
232
+ } EnsembleInfo;
233
+ /*
234
+ * Representation for each [incr Tcl] class.
235
+ */
236
+ #define ITCL_CLASS 0x1
237
+ #define ITCL_TYPE 0x2
238
+ #define ITCL_WIDGET 0x4
239
+ #define ITCL_WIDGETADAPTOR 0x8
240
+ #define ITCL_ECLASS 0x10
241
+ #define ITCL_NWIDGET 0x20
242
+ #define ITCL_WIDGET_FRAME 0x40
243
+ #define ITCL_WIDGET_LABEL_FRAME 0x80
244
+ #define ITCL_WIDGET_TOPLEVEL 0x100
245
+ #define ITCL_WIDGET_TTK_FRAME 0x200
246
+ #define ITCL_WIDGET_TTK_LABEL_FRAME 0x400
247
+ #define ITCL_WIDGET_TTK_TOPLEVEL 0x800
248
+ #define ITCL_CLASS_IS_DELETED 0x1000
249
+ #define ITCL_CLASS_IS_DESTROYED 0x2000
250
+ #define ITCL_CLASS_NS_IS_DESTROYED 0x4000
251
+ #define ITCL_CLASS_IS_RENAMED 0x8000 /* unused */
252
+ #define ITCL_CLASS_IS_FREED 0x10000
253
+ #define ITCL_CLASS_DERIVED_RELEASED 0x20000
254
+ #define ITCL_CLASS_NS_TEARDOWN 0x40000
255
+ #define ITCL_CLASS_NO_VARNS_DELETE 0x80000
256
+ #define ITCL_CLASS_SHOULD_VARNS_DELETE 0x100000
257
+ #define ITCL_CLASS_DESTRUCTOR_CALLED 0x400000
258
+
259
+
260
+ typedef struct ItclClass {
261
+ Tcl_Obj *namePtr; /* class name */
262
+ Tcl_Obj *fullNamePtr; /* fully qualified class name */
263
+ Tcl_Interp *interp; /* interpreter that manages this info */
264
+ Tcl_Namespace *nsPtr; /* namespace representing class scope */
265
+ Tcl_Command accessCmd; /* access command for creating instances */
266
+ Tcl_Command thisCmd; /* needed for deletion of class */
267
+
268
+ struct ItclObjectInfo *infoPtr;
269
+ /* info about all known objects
270
+ * and other stuff like stacks */
271
+ Itcl_List bases; /* list of base classes */
272
+ Itcl_List derived; /* list of all derived classes */
273
+ Tcl_HashTable heritage; /* table of all base classes. Look up
274
+ * by pointer to class definition. This
275
+ * provides fast lookup for inheritance
276
+ * tests. */
277
+ Tcl_Obj *initCode; /* initialization code for new objs */
278
+ Tcl_HashTable variables; /* definitions for all data members
279
+ in this class. Look up simple string
280
+ names and get back ItclVariable* ptrs */
281
+ Tcl_HashTable options; /* definitions for all option members
282
+ in this class. Look up simple string
283
+ names and get back ItclOption* ptrs */
284
+ Tcl_HashTable components; /* definitions for all component members
285
+ in this class. Look up simple string
286
+ names and get back ItclComponent* ptrs */
287
+ Tcl_HashTable functions; /* definitions for all member functions
288
+ in this class. Look up simple string
289
+ names and get back ItclMemberFunc* ptrs */
290
+ Tcl_HashTable delegatedOptions; /* definitions for all delegated options
291
+ in this class. Look up simple string
292
+ names and get back
293
+ ItclDelegatedOption * ptrs */
294
+ Tcl_HashTable delegatedFunctions; /* definitions for all delegated methods
295
+ or procs in this class. Look up simple
296
+ string names and get back
297
+ ItclDelegatedFunction * ptrs */
298
+ Tcl_HashTable methodVariables; /* definitions for all methodvariable members
299
+ in this class. Look up simple string
300
+ names and get back
301
+ ItclMethodVariable* ptrs */
302
+ Tcl_Size numInstanceVars; /* number of instance vars in variables
303
+ table */
304
+ Tcl_HashTable classCommons; /* used for storing variable namespace
305
+ * string for Tcl_Resolve */
306
+ Tcl_HashTable resolveVars; /* all possible names for variables in
307
+ * this class (e.g., x, foo::x, etc.) */
308
+ Tcl_HashTable resolveCmds; /* all possible names for functions in
309
+ * this class (e.g., x, foo::x, etc.) */
310
+ Tcl_HashTable contextCache; /* cache for function contexts */
311
+ struct ItclMemberFunc *unused2;
312
+ /* the class constructor or NULL */
313
+ struct ItclMemberFunc *unused3;
314
+ /* the class destructor or NULL */
315
+ struct ItclMemberFunc *unused1;
316
+ Tcl_Resolve *resolvePtr;
317
+ Tcl_Obj *widgetClassPtr; /* class name for widget if class is a
318
+ * ::itcl::widget */
319
+ Tcl_Obj *hullTypePtr; /* hulltype name for widget if class is a
320
+ * ::itcl::widget */
321
+ Tcl_Object oPtr; /* TclOO class object */
322
+ Tcl_Class clsPtr; /* TclOO class */
323
+ Tcl_Size numCommons; /* number of commons in this class */
324
+ Tcl_Size numVariables; /* number of variables in this class */
325
+ Tcl_Size numOptions; /* number of options in this class */
326
+ Tcl_Size unique; /* unique number for #auto generation */
327
+ int flags; /* maintains class status */
328
+ Tcl_Size callRefCount; /* prevent deleting of class if refcount>1 */
329
+ Tcl_Obj *typeConstructorPtr; /* initialization for types */
330
+ int destructorHasBeenCalled; /* prevent multiple invocations of destrcutor */
331
+ Tcl_Size refCount;
332
+ } ItclClass;
333
+
334
+ typedef struct ItclHierIter {
335
+ ItclClass *current; /* current position in hierarchy */
336
+ Itcl_Stack stack; /* stack used for traversal */
337
+ } ItclHierIter;
338
+
339
+ #define ITCL_OBJECT_IS_DELETED 0x01
340
+ #define ITCL_OBJECT_IS_DESTRUCTED 0x02
341
+ #define ITCL_OBJECT_IS_DESTROYED 0x04
342
+ #define ITCL_OBJECT_IS_RENAMED 0x08
343
+ #define ITCL_OBJECT_CLASS_DESTRUCTED 0x10
344
+ #define ITCL_TCLOO_OBJECT_IS_DELETED 0x20
345
+ #define ITCL_OBJECT_DESTRUCT_ERROR 0x40
346
+ #define ITCL_OBJECT_SHOULD_VARNS_DELETE 0x80
347
+ #define ITCL_OBJECT_ROOT_METHOD 0x8000
348
+
349
+ /*
350
+ * Representation for each [incr Tcl] object.
351
+ */
352
+ typedef struct ItclObject {
353
+ ItclClass *iclsPtr; /* most-specific class */
354
+ Tcl_Command accessCmd; /* object access command */
355
+
356
+ Tcl_HashTable *constructed; /* temp storage used during construction */
357
+ Tcl_HashTable *destructed; /* temp storage used during destruction */
358
+ Tcl_HashTable objectVariables;
359
+ /* used for storing Tcl_Var entries for
360
+ * variable resolving, key is ivPtr of
361
+ * variable, value is varPtr */
362
+ Tcl_HashTable objectOptions; /* definitions for all option members
363
+ in this object. Look up option namePtr
364
+ names and get back ItclOption* ptrs */
365
+ Tcl_HashTable objectComponents; /* definitions for all component members
366
+ in this object. Look up component namePtr
367
+ names and get back ItclComponent* ptrs */
368
+ Tcl_HashTable objectMethodVariables;
369
+ /* definitions for all methodvariable members
370
+ in this object. Look up methodvariable
371
+ namePtr names and get back
372
+ ItclMethodVariable* ptrs */
373
+ Tcl_HashTable objectDelegatedOptions;
374
+ /* definitions for all delegated option
375
+ members in this object. Look up option
376
+ namePtr names and get back
377
+ ItclOption* ptrs */
378
+ Tcl_HashTable objectDelegatedFunctions;
379
+ /* definitions for all delegated function
380
+ members in this object. Look up function
381
+ namePtr names and get back
382
+ ItclMemberFunc * ptrs */
383
+ Tcl_HashTable contextCache; /* cache for function contexts */
384
+ Tcl_Obj *namePtr;
385
+ Tcl_Obj *origNamePtr; /* the original name before any rename */
386
+ Tcl_Obj *createNamePtr; /* the temp name before any rename
387
+ * mostly used for widgetadaptor
388
+ * because that hijackes the name
389
+ * often when installing the hull */
390
+ Tcl_Interp *interp;
391
+ ItclObjectInfo *infoPtr;
392
+ Tcl_Obj *varNsNamePtr;
393
+ Tcl_Object oPtr; /* the TclOO object */
394
+ Tcl_Resolve *resolvePtr;
395
+ int flags;
396
+ Tcl_Size callRefCount; /* prevent deleting of object if refcount > 1 */
397
+ Tcl_Obj *hullWindowNamePtr; /* the window path name for the hull
398
+ * (before renaming in installhull) */
399
+ int destructorHasBeenCalled; /* is set when the destructor is called
400
+ * to avoid callin destructor twice */
401
+ int noComponentTrace; /* don't call component traces if
402
+ * setting components in DelegationInstall */
403
+ int hadConstructorError; /* needed for multiple calls of CallItclObjectCmd */
404
+ } ItclObject;
405
+
406
+ #define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */
407
+
408
+ typedef struct ItclResolveInfo {
409
+ int flags;
410
+ ItclClass *iclsPtr;
411
+ ItclObject *ioPtr;
412
+ } ItclResolveInfo;
413
+
414
+ #define ITCL_RESOLVE_CLASS 0x01
415
+ #define ITCL_RESOLVE_OBJECT 0x02
416
+
417
+ /*
418
+ * Implementation for any code body in an [incr Tcl] class.
419
+ */
420
+ typedef struct ItclMemberCode {
421
+ int flags; /* flags describing implementation */
422
+ Tcl_Size argcount; /* number of args in arglist */
423
+ Tcl_Size maxargcount; /* max number of args in arglist */
424
+ Tcl_Obj *usagePtr; /* usage string for error messages */
425
+ Tcl_Obj *argumentPtr; /* the function arguments */
426
+ Tcl_Obj *bodyPtr; /* the function body */
427
+ ItclArgList *argListPtr; /* the parsed arguments */
428
+ union {
429
+ Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */
430
+ Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */
431
+ } cfunc;
432
+ void *clientData; /* client data for C implementations */
433
+ } ItclMemberCode;
434
+
435
+ /*
436
+ * Flag bits for ItclMemberCode:
437
+ */
438
+ #define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */
439
+ #define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */
440
+ #define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */
441
+ #define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */
442
+ #define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */
443
+
444
+ #define Itcl_IsMemberCodeImplemented(mcode) \
445
+ (((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0)
446
+
447
+ /*
448
+ * Flag bits for ItclMember: functions and variables
449
+ */
450
+ #define ITCL_COMMON 0x010 /* non-zero => is a "proc" or common
451
+ * variable */
452
+
453
+ /*
454
+ * Flag bits for ItclMember: functions
455
+ */
456
+ #define ITCL_CONSTRUCTOR 0x020 /* non-zero => is a constructor */
457
+ #define ITCL_DESTRUCTOR 0x040 /* non-zero => is a destructor */
458
+ #define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */
459
+ #define ITCL_BODY_SPEC 0x100 /* non-zero => has an body spec */
460
+ #define ITCL_BUILTIN 0x400 /* non-zero => built-in method */
461
+ #define ITCL_COMPONENT 0x800 /* non-zero => component */
462
+ #define ITCL_TYPE_METHOD 0x1000 /* non-zero => typemethod */
463
+ #define ITCL_METHOD 0x2000 /* non-zero => method */
464
+
465
+ /*
466
+ * Flag bits for ItclMember: variables
467
+ */
468
+ #define ITCL_THIS_VAR 0x20 /* non-zero => built-in "this" variable */
469
+ #define ITCL_OPTIONS_VAR 0x40 /* non-zero => built-in "itcl_options"
470
+ * variable */
471
+ #define ITCL_TYPE_VAR 0x80 /* non-zero => built-in "type" variable */
472
+ /* no longer used ??? */
473
+ #define ITCL_SELF_VAR 0x100 /* non-zero => built-in "self" variable */
474
+ #define ITCL_SELFNS_VAR 0x200 /* non-zero => built-in "selfns"
475
+ * variable */
476
+ #define ITCL_WIN_VAR 0x400 /* non-zero => built-in "win" variable */
477
+ #define ITCL_COMPONENT_VAR 0x800 /* non-zero => component variable */
478
+ #define ITCL_HULL_VAR 0x1000 /* non-zero => built-in "itcl_hull"
479
+ * variable */
480
+ #define ITCL_OPTION_READONLY 0x2000 /* non-zero => readonly */
481
+ #define ITCL_VARIABLE 0x4000 /* non-zero => normal variable */
482
+ #define ITCL_TYPE_VARIABLE 0x8000 /* non-zero => typevariable */
483
+ #define ITCL_OPTION_INITTED 0x10000 /* non-zero => option has been initialized */
484
+ #define ITCL_OPTION_COMP_VAR 0x20000 /* variable to collect option components of extendedclass */
485
+
486
+ /*
487
+ * Instance components.
488
+ */
489
+ struct ItclVariable;
490
+ typedef struct ItclComponent {
491
+ Tcl_Obj *namePtr; /* member name */
492
+ struct ItclVariable *ivPtr; /* variable for this component */
493
+ int flags;
494
+ int haveKeptOptions;
495
+ Tcl_HashTable keptOptions; /* table of options to keep */
496
+ } ItclComponent;
497
+
498
+ #define ITCL_COMPONENT_INHERIT 0x01
499
+ #define ITCL_COMPONENT_PUBLIC 0x02
500
+
501
+ typedef struct ItclDelegatedFunction {
502
+ Tcl_Obj *namePtr;
503
+ ItclComponent *icPtr;
504
+ Tcl_Obj *asPtr;
505
+ Tcl_Obj *usingPtr;
506
+ Tcl_HashTable exceptions;
507
+ int flags;
508
+ } ItclDelegatedFunction;
509
+
510
+ /*
511
+ * Representation of member functions in an [incr Tcl] class.
512
+ */
513
+ typedef struct ItclMemberFunc {
514
+ Tcl_Obj* namePtr; /* member name */
515
+ Tcl_Obj* fullNamePtr; /* member name with "class::" qualifier */
516
+ ItclClass* iclsPtr; /* class containing this member */
517
+ int protection; /* protection level */
518
+ int flags; /* flags describing member (see above) */
519
+ ItclObjectInfo *infoPtr;
520
+ ItclMemberCode *codePtr; /* code associated with member */
521
+ Tcl_Command accessCmd; /* Tcl command installed for this function */
522
+ Tcl_Size argcount; /* number of args in arglist */
523
+ Tcl_Size maxargcount; /* max number of args in arglist */
524
+ Tcl_Obj *usagePtr; /* usage string for error messages */
525
+ Tcl_Obj *argumentPtr; /* the function arguments */
526
+ Tcl_Obj *builtinArgumentPtr; /* the function arguments for builtin functions */
527
+ Tcl_Obj *origArgsPtr; /* the argument string of the original definition */
528
+ Tcl_Obj *bodyPtr; /* the function body */
529
+ ItclArgList *argListPtr; /* the parsed arguments */
530
+ ItclClass *declaringClassPtr; /* the class which declared the method/proc */
531
+ void *tmPtr; /* TclOO methodPtr */
532
+ ItclDelegatedFunction *idmPtr;
533
+ /* if the function is delegated != NULL */
534
+ } ItclMemberFunc;
535
+
536
+ /*
537
+ * Instance variables.
538
+ */
539
+ typedef struct ItclVariable {
540
+ Tcl_Obj *namePtr; /* member name */
541
+ Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
542
+ ItclClass *iclsPtr; /* class containing this member */
543
+ ItclObjectInfo *infoPtr;
544
+ ItclMemberCode *codePtr; /* code associated with member */
545
+ Tcl_Obj *init; /* initial value */
546
+ Tcl_Obj *arrayInitPtr; /* initial value if variable should be array */
547
+ int protection; /* protection level */
548
+ int flags; /* flags describing member (see below) */
549
+ int initted; /* is set when first time initted, to check
550
+ * for example itcl_hull var, which can be only
551
+ * initialized once */
552
+ } ItclVariable;
553
+
554
+
555
+ struct ItclOption;
556
+
557
+ typedef struct ItclDelegatedOption {
558
+ Tcl_Obj *namePtr;
559
+ Tcl_Obj *resourceNamePtr;
560
+ Tcl_Obj *classNamePtr;
561
+ struct ItclOption *ioptPtr; /* the option name or null for "*" */
562
+ ItclComponent *icPtr; /* the component where the delegation goes
563
+ * to */
564
+ Tcl_Obj *asPtr;
565
+ Tcl_HashTable exceptions; /* exceptions from delegation */
566
+ } ItclDelegatedOption;
567
+
568
+ /*
569
+ * Instance options.
570
+ */
571
+ typedef struct ItclOption {
572
+ /* within a class hierarchy there must be only
573
+ * one option with the same name !! */
574
+ Tcl_Obj *namePtr; /* member name */
575
+ Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
576
+ Tcl_Obj *resourceNamePtr;
577
+ Tcl_Obj *classNamePtr;
578
+ ItclClass *iclsPtr; /* class containing this member */
579
+ int protection; /* protection level */
580
+ int flags; /* flags describing member (see below) */
581
+ ItclMemberCode *codePtr; /* code associated with member */
582
+ Tcl_Obj *defaultValuePtr; /* initial value */
583
+ Tcl_Obj *cgetMethodPtr;
584
+ Tcl_Obj *cgetMethodVarPtr;
585
+ Tcl_Obj *configureMethodPtr;
586
+ Tcl_Obj *configureMethodVarPtr;
587
+ Tcl_Obj *validateMethodPtr;
588
+ Tcl_Obj *validateMethodVarPtr;
589
+ ItclDelegatedOption *idoPtr;
590
+ /* if the option is delegated != NULL */
591
+ } ItclOption;
592
+
593
+ /*
594
+ * Instance methodvariables.
595
+ */
596
+ typedef struct ItclMethodVariable {
597
+ Tcl_Obj *namePtr; /* member name */
598
+ Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
599
+ ItclClass *iclsPtr; /* class containing this member */
600
+ int protection; /* protection level */
601
+ int flags; /* flags describing member (see below) */
602
+ Tcl_Obj *defaultValuePtr;
603
+ Tcl_Obj *callbackPtr;
604
+ } ItclMethodVariable;
605
+
606
+ #define VAR_TYPE_VARIABLE 1
607
+ #define VAR_TYPE_COMMON 2
608
+
609
+ #define CMD_TYPE_METHOD 1
610
+ #define CMD_TYPE_PROC 2
611
+
612
+ typedef struct ItclClassCmdInfo {
613
+ int type;
614
+ int protection;
615
+ #if TCL_MAJOR_VERSION == 8
616
+ int cmdNum; /* not actually used */
617
+ #endif
618
+ Tcl_Namespace *nsPtr;
619
+ Tcl_Namespace *declaringNsPtr;
620
+ } ItclClassCmdInfo;
621
+
622
+ /*
623
+ * Instance variable lookup entry.
624
+ */
625
+ typedef struct ItclVarLookup {
626
+ ItclVariable* ivPtr; /* variable definition */
627
+ int usage; /* number of uses for this record */
628
+ int accessible; /* non-zero => accessible from class with
629
+ * this lookup record in its resolveVars */
630
+ char *leastQualName; /* simplist name for this variable, with
631
+ * the fewest qualifiers. This string is
632
+ * taken from the resolveVars table, so
633
+ * it shouldn't be freed. */
634
+ Tcl_Size varNum;
635
+ Tcl_Var varPtr;
636
+ } ItclVarLookup;
637
+
638
+ /*
639
+ * Instance command lookup entry.
640
+ */
641
+ typedef struct ItclCmdLookup {
642
+ ItclMemberFunc* imPtr; /* function definition */
643
+ #if TCL_MAJOR_VERSION == 8
644
+ int cmdNum; /* not actually used */
645
+ #endif
646
+ ItclClassCmdInfo *classCmdInfoPtr;
647
+ Tcl_Command cmdPtr;
648
+ } ItclCmdLookup;
649
+
650
+ typedef struct ItclCallContext {
651
+ int objectFlags;
652
+ Tcl_Namespace *nsPtr;
653
+ ItclObject *ioPtr;
654
+ ItclMemberFunc *imPtr;
655
+ Tcl_Size refCount;
656
+ } ItclCallContext;
657
+
658
+ /*
659
+ * The macro below is used to modify a "char" value (e.g. by casting
660
+ * it to an unsigned character) so that it can be used safely with
661
+ * macros such as isspace.
662
+ */
663
+
664
+ #define UCHAR(c) ((unsigned char) (c))
665
+ /*
666
+ * Macros used to cast between pointers and integers (e.g. when storing an int
667
+ * in ClientData), on 64-bit architectures they avoid gcc warning about "cast
668
+ * to/from pointer from/to integer of different size".
669
+ */
670
+
671
+ #if !defined(INT2PTR)
672
+ # define INT2PTR(p) ((void *)(ptrdiff_t)(p))
673
+ #endif
674
+ #if !defined(PTR2INT)
675
+ # define PTR2INT(p) ((ptrdiff_t)(p))
676
+ #endif
677
+
678
+ #ifdef ITCL_DEBUG
679
+ MODULE_SCOPE int _itcl_debug_level;
680
+ MODULE_SCOPE void ItclShowArgs(int level, const char *str, size_t objc,
681
+ Tcl_Obj *const *objv);
682
+ #else
683
+ #define ItclShowArgs(a,b,c,d) do {(void)(c);(void)(d);} while(0)
684
+ #endif
685
+
686
+ MODULE_SCOPE Tcl_ObjCmdProc ItclCallCCommand;
687
+ MODULE_SCOPE Tcl_ObjCmdProc ItclObjectUnknownCommand;
688
+ MODULE_SCOPE int ItclCheckCallProc(void *clientData, Tcl_Interp *interp,
689
+ Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished);
690
+
691
+ MODULE_SCOPE void ItclPreserveClass(ItclClass *iclsPtr);
692
+ MODULE_SCOPE void ItclReleaseClass(void *iclsPtr);
693
+
694
+ MODULE_SCOPE ItclFoundation *ItclGetFoundation(Tcl_Interp *interp);
695
+ MODULE_SCOPE Tcl_ObjCmdProc ItclClassCommandDispatcher;
696
+ MODULE_SCOPE Tcl_Command Itcl_CmdAliasProc(Tcl_Interp *interp,
697
+ Tcl_Namespace *nsPtr, const char *cmdName, void *clientData);
698
+ MODULE_SCOPE Tcl_Var Itcl_VarAliasProc(Tcl_Interp *interp,
699
+ Tcl_Namespace *nsPtr, const char *VarName, void *clientData);
700
+ MODULE_SCOPE int ItclIsClass(Tcl_Interp *interp, Tcl_Command cmd);
701
+ MODULE_SCOPE int ItclCheckCallMethod(void *clientData, Tcl_Interp *interp,
702
+ Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished);
703
+ MODULE_SCOPE int ItclAfterCallMethod(void *clientData, Tcl_Interp *interp,
704
+ Tcl_ObjectContext contextPtr, Tcl_Namespace *nsPtr, int result);
705
+ MODULE_SCOPE void ItclReportObjectUsage(Tcl_Interp *interp,
706
+ ItclObject *contextIoPtr, Tcl_Namespace *callerNsPtr,
707
+ Tcl_Namespace *contextNsPtr);
708
+ MODULE_SCOPE int ItclMapMethodNameProc(Tcl_Interp *interp, Tcl_Object oPtr,
709
+ Tcl_Class *startClsPtr, Tcl_Obj *methodObj);
710
+ MODULE_SCOPE int ItclCreateArgList(Tcl_Interp *interp, const char *str,
711
+ Tcl_Size *argcPtr, Tcl_Size *maxArgcPtr, Tcl_Obj **usagePtr,
712
+ ItclArgList **arglistPtrPtr, ItclMemberFunc *imPtr,
713
+ const char *commandName);
714
+ MODULE_SCOPE int ItclObjectCmd(void *clientData, Tcl_Interp *interp,
715
+ Tcl_Object oPtr, Tcl_Class clsPtr, size_t objc, Tcl_Obj *const *objv);
716
+ MODULE_SCOPE int ItclCreateObject (Tcl_Interp *interp, const char* name,
717
+ ItclClass *iclsPtr, size_t objc, Tcl_Obj *const objv[]);
718
+ MODULE_SCOPE void ItclDeleteObjectVariablesNamespace(Tcl_Interp *interp,
719
+ ItclObject *ioPtr);
720
+ MODULE_SCOPE void ItclDeleteClassVariablesNamespace(Tcl_Interp *interp,
721
+ ItclClass *iclsPtr);
722
+ MODULE_SCOPE int ItclInfoInit(Tcl_Interp *interp, ItclObjectInfo *infoPtr);
723
+
724
+ MODULE_SCOPE Tcl_HashEntry *ItclResolveVarEntry(
725
+ ItclClass* iclsPtr, const char *varName);
726
+
727
+ struct Tcl_ResolvedVarInfo;
728
+ MODULE_SCOPE int Itcl_ClassCmdResolver(Tcl_Interp *interp, const char* name,
729
+ Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr);
730
+ MODULE_SCOPE int Itcl_ClassVarResolver(Tcl_Interp *interp, const char* name,
731
+ Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr);
732
+ MODULE_SCOPE int Itcl_ClassCompiledVarResolver(Tcl_Interp *interp,
733
+ const char* name, Tcl_Size length, Tcl_Namespace *nsPtr,
734
+ struct Tcl_ResolvedVarInfo **rPtr);
735
+ MODULE_SCOPE int Itcl_ClassCmdResolver2(Tcl_Interp *interp, const char* name,
736
+ Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr);
737
+ MODULE_SCOPE int Itcl_ClassVarResolver2(Tcl_Interp *interp, const char* name,
738
+ Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr);
739
+ MODULE_SCOPE int ItclSetParserResolver(Tcl_Namespace *nsPtr);
740
+ MODULE_SCOPE void ItclProcErrorProc(Tcl_Interp *interp, Tcl_Obj *procNameObj);
741
+ MODULE_SCOPE int Itcl_CreateOption (Tcl_Interp *interp, ItclClass *iclsPtr,
742
+ ItclOption *ioptPtr);
743
+ MODULE_SCOPE int ItclCreateMethodVariable(Tcl_Interp *interp,
744
+ ItclVariable *ivPtr, Tcl_Obj* defaultPtr, Tcl_Obj* callbackPtr,
745
+ ItclMethodVariable** imvPtrPtr);
746
+ MODULE_SCOPE int DelegationInstall(Tcl_Interp *interp, ItclObject *ioPtr,
747
+ ItclClass *iclsPtr);
748
+ MODULE_SCOPE ItclClass *ItclNamespace2Class(Tcl_Namespace *nsPtr);
749
+ MODULE_SCOPE const char* ItclGetCommonInstanceVar(Tcl_Interp *interp,
750
+ const char *name, const char *name2, ItclObject *contextIoPtr,
751
+ ItclClass *contextIclsPtr);
752
+ MODULE_SCOPE int ItclCreateMethod(Tcl_Interp* interp, ItclClass *iclsPtr,
753
+ Tcl_Obj *namePtr, const char* arglist, const char* body,
754
+ ItclMemberFunc **imPtrPtr);
755
+ MODULE_SCOPE int Itcl_WidgetParseInit(Tcl_Interp *interp,
756
+ ItclObjectInfo *infoPtr);
757
+ MODULE_SCOPE void ItclDeleteObjectMetadata(void *clientData);
758
+ MODULE_SCOPE void ItclDeleteClassMetadata(void *clientData);
759
+ MODULE_SCOPE void ItclDeleteArgList(ItclArgList *arglistPtr);
760
+ MODULE_SCOPE int Itcl_ClassOptionCmd(void *clientData, Tcl_Interp *interp,
761
+ int objc, Tcl_Obj *const objv[]);
762
+ MODULE_SCOPE int DelegatedOptionsInstall(Tcl_Interp *interp,
763
+ ItclClass *iclsPtr);
764
+ MODULE_SCOPE int Itcl_HandleDelegateOptionCmd(Tcl_Interp *interp,
765
+ ItclObject *ioPtr, ItclClass *iclsPtr, ItclDelegatedOption **idoPtrPtr,
766
+ Tcl_Size objc, Tcl_Obj *const objv[]);
767
+ MODULE_SCOPE int Itcl_HandleDelegateMethodCmd(Tcl_Interp *interp,
768
+ ItclObject *ioPtr, ItclClass *iclsPtr,
769
+ ItclDelegatedFunction **idmPtrPtr, Tcl_Size objc, Tcl_Obj *const objv[]);
770
+ MODULE_SCOPE int DelegateFunction(Tcl_Interp *interp, ItclObject *ioPtr,
771
+ ItclClass *iclsPtr, Tcl_Obj *componentNamePtr,
772
+ ItclDelegatedFunction *idmPtr);
773
+ MODULE_SCOPE int ItclInitObjectMethodVariables(Tcl_Interp *interp,
774
+ ItclObject *ioPtr, ItclClass *iclsPtr, const char *name);
775
+ MODULE_SCOPE int InitTclOOFunctionPointers(Tcl_Interp *interp);
776
+ MODULE_SCOPE ItclOption* ItclNewOption(Tcl_Interp *interp, ItclObject *ioPtr,
777
+ ItclClass *iclsPtr, Tcl_Obj *namePtr, const char *resourceName,
778
+ const char *className, char *init, ItclMemberCode *mCodePtr);
779
+ MODULE_SCOPE int ItclParseOption(ItclObjectInfo *infoPtr, Tcl_Interp *interp,
780
+ size_t objc, Tcl_Obj *const objv[], ItclClass *iclsPtr,
781
+ ItclObject *ioPtr, ItclOption **ioptPtrPtr);
782
+ MODULE_SCOPE void ItclDestroyClassNamesp(void *cdata);
783
+ MODULE_SCOPE int ExpandDelegateAs(Tcl_Interp *interp, ItclObject *ioPtr,
784
+ ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr,
785
+ const char *funcName, Tcl_Obj *listPtr);
786
+ MODULE_SCOPE int ItclCheckForInitializedComponents(Tcl_Interp *interp,
787
+ ItclClass *iclsPtr, ItclObject *ioPtr);
788
+ MODULE_SCOPE int ItclCreateDelegatedFunction(Tcl_Interp *interp,
789
+ ItclClass *iclsPtr, Tcl_Obj *methodNamePtr, ItclComponent *icPtr,
790
+ Tcl_Obj *targetPtr, Tcl_Obj *usingPtr, Tcl_Obj *exceptionsPtr,
791
+ ItclDelegatedFunction **idmPtrPtr);
792
+ MODULE_SCOPE void ItclDeleteDelegatedOption(char *cdata);
793
+ MODULE_SCOPE void Itcl_FinishList();
794
+ MODULE_SCOPE void ItclDeleteDelegatedFunction(ItclDelegatedFunction *idmPtr);
795
+ MODULE_SCOPE void ItclFinishEnsemble(ItclObjectInfo *infoPtr);
796
+ MODULE_SCOPE int Itcl_EnsembleDeleteCmd(void *clientData,
797
+ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
798
+ MODULE_SCOPE int ItclAddClassesDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr);
799
+ MODULE_SCOPE int ItclDeleteClassesDictInfo(Tcl_Interp *interp,
800
+ ItclClass *iclsPtr);
801
+ MODULE_SCOPE int ItclAddObjectsDictInfo(Tcl_Interp *interp, ItclObject *ioPtr);
802
+ MODULE_SCOPE int ItclDeleteObjectsDictInfo(Tcl_Interp *interp,
803
+ ItclObject *ioPtr);
804
+ MODULE_SCOPE int ItclAddOptionDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr,
805
+ ItclOption *ioptPtr);
806
+ MODULE_SCOPE int ItclAddDelegatedOptionDictInfo(Tcl_Interp *interp,
807
+ ItclClass *iclsPtr, ItclDelegatedOption *idoPtr);
808
+ MODULE_SCOPE int ItclAddClassComponentDictInfo(Tcl_Interp *interp,
809
+ ItclClass *iclsPtr, ItclComponent *icPtr);
810
+ MODULE_SCOPE int ItclAddClassVariableDictInfo(Tcl_Interp *interp,
811
+ ItclClass *iclsPtr, ItclVariable *ivPtr);
812
+ MODULE_SCOPE int ItclAddClassFunctionDictInfo(Tcl_Interp *interp,
813
+ ItclClass *iclsPtr, ItclMemberFunc *imPtr);
814
+ MODULE_SCOPE int ItclAddClassDelegatedFunctionDictInfo(Tcl_Interp *interp,
815
+ ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr);
816
+ MODULE_SCOPE int ItclClassCreateObject(void *clientData, Tcl_Interp *interp,
817
+ Tcl_Size objc, Tcl_Obj *const objv[]);
818
+
819
+ MODULE_SCOPE void ItclRestoreInfoVars(void *clientData);
820
+
821
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyProcCmd;
822
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiInstallComponentCmd;
823
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiCallInstanceCmd;
824
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiGetInstanceVarCmd;
825
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeMethodCmd;
826
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyMethodCmd;
827
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeVarCmd;
828
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyVarCmd;
829
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiItclHullCmd;
830
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_ThisCmd;
831
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_ExtendedClassCmd;
832
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_TypeClassCmd;
833
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddObjectOptionCmd;
834
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedOptionCmd;
835
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedFunctionCmd;
836
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_SetComponentCmd;
837
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassHullTypeCmd;
838
+ MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassWidgetClassCmd;
839
+
840
+ typedef int (ItclRootMethodProc)(ItclObject *ioPtr, Tcl_Interp *interp,
841
+ int objc, Tcl_Obj *const objv[]);
842
+
843
+ MODULE_SCOPE const Tcl_MethodType itclRootMethodType;
844
+ MODULE_SCOPE ItclRootMethodProc ItclUnknownGuts;
845
+ MODULE_SCOPE ItclRootMethodProc ItclConstructGuts;
846
+ MODULE_SCOPE ItclRootMethodProc ItclInfoGuts;
847
+
848
+ #include "itcl2TclOO.h"
849
+
850
+ /*
851
+ * Include all the private API, generated from itcl.decls.
852
+ */
853
+
854
+ #include "itclIntDecls.h"
janus/include/ks_names.h ADDED
@@ -0,0 +1,1712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file should be maintained in sync with xlib/X11/keysymdefs.h
3
+ *
4
+ * Note that this should be done manually only, because in some cases
5
+ * keysymdefs.h defines the same integer for multiple keysyms, e.g.:
6
+ *
7
+ * #define XK_Greek_LAMDA 0x7CB
8
+ * #define XK_Greek_LAMBDA 0x7CB
9
+ *
10
+ * #define XK_Cyrillic_DZHE 0x6BF
11
+ * #define XK_Serbian_DZE 0x6BF (deprecated)
12
+ *
13
+ */
14
+ { "BackSpace", 0xFF08 },
15
+ { "Tab", 0xFF09 },
16
+ { "Linefeed", 0xFF0A },
17
+ { "Clear", 0xFF0B },
18
+ { "Return", 0xFF0D },
19
+ { "Pause", 0xFF13 },
20
+ { "Scroll_Lock", 0xFF14 },
21
+ { "Sys_Req", 0xFF15 },
22
+ { "Escape", 0xFF1B },
23
+ { "Multi_key", 0xFF20 },
24
+ { "Kanji", 0xFF21 },
25
+ { "Muhenkan", 0xFF22 },
26
+ { "Henkan_Mode", 0xFF23 },
27
+ { "Henkan", 0xFF23 },
28
+ { "Romaji", 0xFF24 },
29
+ { "Hiragana", 0xFF25 },
30
+ { "Katakana", 0xFF26 },
31
+ { "Hiragana_Katakana", 0xFF27 },
32
+ { "Zenkaku", 0xFF28 },
33
+ { "Hankaku", 0xFF29 },
34
+ { "Zenkaku_Hankaku", 0xFF2A },
35
+ { "Touroku", 0xFF2B },
36
+ { "Massyo", 0xFF2C },
37
+ { "Kana_Lock", 0xFF2D },
38
+ { "Kana_Shift", 0xFF2E },
39
+ { "Eisu_Shift", 0xFF2F },
40
+ { "Eisu_toggle", 0xFF30 },
41
+ { "Hangul", 0xFF31 },
42
+ { "Hangul_Start", 0xFF32 },
43
+ { "Hangul_End", 0xFF33 },
44
+ { "Hangul_Hanja", 0xFF34 },
45
+ { "Hangul_Jamo", 0xFF35 },
46
+ { "Hangul_Romaja", 0xFF36 },
47
+ { "Codeinput", 0xFF37 },
48
+ { "Hangul_Jeonja", 0xFF38 },
49
+ { "Hangul_Banja", 0xFF39 },
50
+ { "Hangul_PreHanja", 0xFF3A },
51
+ { "Hangul_PostHanja", 0xFF3B },
52
+ { "SingleCandidate", 0xFF3C },
53
+ { "MultipleCandidate", 0xFF3D },
54
+ { "PreviousCandidate", 0xFF3E },
55
+ { "Hangul_Special", 0xFF3F },
56
+ { "Home", 0xFF50 },
57
+ { "Left", 0xFF51 },
58
+ { "Up", 0xFF52 },
59
+ { "Right", 0xFF53 },
60
+ { "Down", 0xFF54 },
61
+ { "Prior", 0xFF55 },
62
+ { "Page_Up", 0xFF55 },
63
+ { "Next", 0xFF56 },
64
+ { "Page_Down", 0xFF56 },
65
+ { "End", 0xFF57 },
66
+ { "Begin", 0xFF58 },
67
+ { "Win_L", 0xFF5B },
68
+ { "Win_R", 0xFF5C },
69
+ { "App", 0xFF5D },
70
+ { "Select", 0xFF60 },
71
+ { "Print", 0xFF61 },
72
+ { "Execute", 0xFF62 },
73
+ { "Insert", 0xFF63 },
74
+ { "Undo", 0xFF65 },
75
+ { "Redo", 0xFF66 },
76
+ { "Menu", 0xFF67 },
77
+ { "Find", 0xFF68 },
78
+ { "Cancel", 0xFF69 },
79
+ { "Help", 0xFF6A },
80
+ { "Break", 0xFF6B },
81
+ { "Mode_switch", 0xFF7E },
82
+ { "script_switch", 0xFF7E },
83
+ { "kana_switch", 0xFF7E },
84
+ { "Arabic_switch", 0xFF7E },
85
+ { "Greek_switch", 0xFF7E },
86
+ { "Hebrew_switch", 0xFF7E },
87
+ { "Num_Lock", 0xFF7F },
88
+ { "KP_Space", 0xFF80 },
89
+ { "KP_Tab", 0xFF89 },
90
+ { "KP_Enter", 0xFF8D },
91
+ { "KP_F1", 0xFF91 },
92
+ { "KP_F2", 0xFF92 },
93
+ { "KP_F3", 0xFF93 },
94
+ { "KP_F4", 0xFF94 },
95
+ { "KP_Home", 0xFF95 },
96
+ { "KP_Left", 0xFF96 },
97
+ { "KP_Up", 0xFF97 },
98
+ { "KP_Right", 0xFF98 },
99
+ { "KP_Down", 0xFF99 },
100
+ { "KP_Prior", 0xFF9A },
101
+ { "KP_Page_Up", 0xFF9A },
102
+ { "KP_Next", 0xFF9B },
103
+ { "KP_Page_Down", 0xFF9B },
104
+ { "KP_End", 0xFF9C },
105
+ { "KP_Begin", 0xFF9D },
106
+ { "KP_Insert", 0xFF9E },
107
+ { "KP_Delete", 0xFF9F },
108
+ { "KP_Multiply", 0xFFAA },
109
+ { "KP_Add", 0xFFAB },
110
+ { "KP_Separator", 0xFFAC },
111
+ { "KP_Subtract", 0xFFAD },
112
+ { "KP_Decimal", 0xFFAE },
113
+ { "KP_Divide", 0xFFAF },
114
+ { "KP_0", 0xFFB0 },
115
+ { "KP_1", 0xFFB1 },
116
+ { "KP_2", 0xFFB2 },
117
+ { "KP_3", 0xFFB3 },
118
+ { "KP_4", 0xFFB4 },
119
+ { "KP_5", 0xFFB5 },
120
+ { "KP_6", 0xFFB6 },
121
+ { "KP_7", 0xFFB7 },
122
+ { "KP_8", 0xFFB8 },
123
+ { "KP_9", 0xFFB9 },
124
+ { "KP_Equal", 0xFFBD },
125
+ { "F1", 0xFFBE },
126
+ { "F2", 0xFFBF },
127
+ { "F3", 0xFFC0 },
128
+ { "F4", 0xFFC1 },
129
+ { "F5", 0xFFC2 },
130
+ { "F6", 0xFFC3 },
131
+ { "F7", 0xFFC4 },
132
+ { "F8", 0xFFC5 },
133
+ { "F9", 0xFFC6 },
134
+ { "F10", 0xFFC7 },
135
+ { "F11", 0xFFC8 },
136
+ { "L1", 0xFFC8 },
137
+ { "F12", 0xFFC9 },
138
+ { "L2", 0xFFC9 },
139
+ { "F13", 0xFFCA },
140
+ { "L3", 0xFFCA },
141
+ { "F14", 0xFFCB },
142
+ { "L4", 0xFFCB },
143
+ { "F15", 0xFFCC },
144
+ { "L5", 0xFFCC },
145
+ { "F16", 0xFFCD },
146
+ { "L6", 0xFFCD },
147
+ { "F17", 0xFFCE },
148
+ { "L7", 0xFFCE },
149
+ { "F18", 0xFFCF },
150
+ { "L8", 0xFFCF },
151
+ { "F19", 0xFFD0 },
152
+ { "L9", 0xFFD0 },
153
+ { "F20", 0xFFD1 },
154
+ { "L10", 0xFFD1 },
155
+ { "F21", 0xFFD2 },
156
+ { "R1", 0xFFD2 },
157
+ { "F22", 0xFFD3 },
158
+ { "R2", 0xFFD3 },
159
+ { "F23", 0xFFD4 },
160
+ { "R3", 0xFFD4 },
161
+ { "F24", 0xFFD5 },
162
+ { "R4", 0xFFD5 },
163
+ { "F25", 0xFFD6 },
164
+ { "R5", 0xFFD6 },
165
+ { "F26", 0xFFD7 },
166
+ { "R6", 0xFFD7 },
167
+ { "F27", 0xFFD8 },
168
+ { "R7", 0xFFD8 },
169
+ { "F28", 0xFFD9 },
170
+ { "R8", 0xFFD9 },
171
+ { "F29", 0xFFDA },
172
+ { "R9", 0xFFDA },
173
+ { "F30", 0xFFDB },
174
+ { "R10", 0xFFDB },
175
+ { "F31", 0xFFDC },
176
+ { "R11", 0xFFDC },
177
+ { "F32", 0xFFDD },
178
+ { "R12", 0xFFDD },
179
+ { "F33", 0xFFDE },
180
+ { "R13", 0xFFDE },
181
+ { "F34", 0xFFDF },
182
+ { "R14", 0xFFDF },
183
+ { "F35", 0xFFE0 },
184
+ { "R15", 0xFFE0 },
185
+ { "Shift_L", 0xFFE1 },
186
+ { "Shift_R", 0xFFE2 },
187
+ { "Control_L", 0xFFE3 },
188
+ { "Control_R", 0xFFE4 },
189
+ { "Caps_Lock", 0xFFE5 },
190
+ { "Shift_Lock", 0xFFE6 },
191
+ { "Meta_L", 0xFFE7 },
192
+ { "Meta_R", 0xFFE8 },
193
+ { "Alt_L", 0xFFE9 },
194
+ { "Alt_R", 0xFFEA },
195
+ { "Super_L", 0xFFEB },
196
+ { "Super_R", 0xFFEC },
197
+ { "Hyper_L", 0xFFED },
198
+ { "Hyper_R", 0xFFEE },
199
+ { "braille_dot_1", 0xFFF1 },
200
+ { "braille_dot_2", 0xFFF2 },
201
+ { "braille_dot_3", 0xFFF3 },
202
+ { "braille_dot_4", 0xFFF4 },
203
+ { "braille_dot_5", 0xFFF5 },
204
+ { "braille_dot_6", 0xFFF6 },
205
+ { "braille_dot_7", 0xFFF7 },
206
+ { "braille_dot_8", 0xFFF8 },
207
+ { "braille_dot_9", 0xFFF9 },
208
+ { "braille_dot_10", 0xFFFA },
209
+ { "Delete", 0xFFFF },
210
+ { "ISO_Lock", 0xFE01 },
211
+ { "ISO_Level2_Latch", 0xFE02 },
212
+ { "ISO_Level3_Shift", 0xFE03 },
213
+ { "ISO_Level3_Latch", 0xFE04 },
214
+ { "ISO_Level3_Lock", 0xFE05 },
215
+ { "ISO_Group_Latch", 0xFE06 },
216
+ { "ISO_Group_Lock", 0xFE07 },
217
+ { "ISO_Next_Group", 0xFE08 },
218
+ { "ISO_Next_Group_Lock", 0xFE09 },
219
+ { "ISO_Prev_Group", 0xFE0A },
220
+ { "ISO_Prev_Group_Lock", 0xFE0B },
221
+ { "ISO_First_Group", 0xFE0C },
222
+ { "ISO_First_Group_Lock", 0xFE0D },
223
+ { "ISO_Last_Group", 0xFE0E },
224
+ { "ISO_Last_Group_Lock", 0xFE0F },
225
+ { "ISO_Level5_Shift", 0xFE11 },
226
+ { "ISO_Level5_Latch", 0xFE12 },
227
+ { "ISO_Level5_Lock", 0xFE13 },
228
+ { "ISO_Left_Tab", 0xFE20 },
229
+ { "ISO_Move_Line_Up", 0xFE21 },
230
+ { "ISO_Move_Line_Down", 0xFE22 },
231
+ { "ISO_Partial_Line_Up", 0xFE23 },
232
+ { "ISO_Partial_Line_Down", 0xFE24 },
233
+ { "ISO_Partial_Space_Left", 0xFE25 },
234
+ { "ISO_Partial_Space_Right", 0xFE26 },
235
+ { "ISO_Set_Margin_Left", 0xFE27 },
236
+ { "ISO_Set_Margin_Right", 0xFE28 },
237
+ { "ISO_Release_Margin_Left", 0xFE29 },
238
+ { "ISO_Release_Margin_Right", 0xFE2A },
239
+ { "ISO_Release_Both_Margins", 0xFE2B },
240
+ { "ISO_Fast_Cursor_Left", 0xFE2C },
241
+ { "ISO_Fast_Cursor_Right", 0xFE2D },
242
+ { "ISO_Fast_Cursor_Up", 0xFE2E },
243
+ { "ISO_Fast_Cursor_Down", 0xFE2F },
244
+ { "ISO_Continuous_Underline", 0xFE30 },
245
+ { "ISO_Discontinuous_Underline", 0xFE31 },
246
+ { "ISO_Emphasize", 0xFE32 },
247
+ { "ISO_Center_Object", 0xFE33 },
248
+ { "ISO_Enter", 0xFE34 },
249
+ { "dead_grave", 0xFE50 },
250
+ { "dead_acute", 0xFE51 },
251
+ { "dead_circumflex", 0xFE52 },
252
+ { "dead_tilde", 0xFE53 },
253
+ { "dead_perispomeni", 0xFE53 },
254
+ { "dead_macron", 0xFE54 },
255
+ { "dead_breve", 0xFE55 },
256
+ { "dead_abovedot", 0xFE56 },
257
+ { "dead_diaeresis", 0xFE57 },
258
+ { "dead_abovering", 0xFE58 },
259
+ { "dead_doubleacute", 0xFE59 },
260
+ { "dead_caron", 0xFE5A },
261
+ { "dead_cedilla", 0xFE5B },
262
+ { "dead_ogonek", 0xFE5C },
263
+ { "dead_iota", 0xFE5D },
264
+ { "dead_voiced_sound", 0xFE5E },
265
+ { "dead_semivoiced_sound", 0xFE5F },
266
+ { "dead_belowdot", 0xFE60 },
267
+ { "dead_hook", 0xFE61 },
268
+ { "dead_horn", 0xFE62 },
269
+ { "dead_stroke", 0xFE63 },
270
+ { "dead_abovecomma", 0xFE64 },
271
+ { "dead_psili", 0xFE64 },
272
+ { "dead_abovereversedcomma", 0xFE65 },
273
+ { "dead_dasia", 0xFE65 },
274
+ { "dead_doublegrave", 0xFE66 },
275
+ { "dead_belowring", 0xFE67 },
276
+ { "dead_belowmacron", 0xFE68 },
277
+ { "dead_belowcircumflex", 0xFE69 },
278
+ { "dead_belowtilde", 0xFE6A },
279
+ { "dead_belowbreve", 0xFE6B },
280
+ { "dead_belowdiaeresis", 0xFE6C },
281
+ { "dead_invertedbreve", 0xFE6D },
282
+ { "dead_belowcomma", 0xFE6E },
283
+ { "dead_currency", 0xFE6F },
284
+ { "AccessX_Enable", 0xFE70 },
285
+ { "AccessX_Feedback_Enable", 0xFE71 },
286
+ { "RepeatKeys_Enable", 0xFE72 },
287
+ { "SlowKeys_Enable", 0xFE73 },
288
+ { "BounceKeys_Enable", 0xFE74 },
289
+ { "StickyKeys_Enable", 0xFE75 },
290
+ { "MouseKeys_Enable", 0xFE76 },
291
+ { "MouseKeys_Accel_Enable", 0xFE77 },
292
+ { "Overlay1_Enable", 0xFE78 },
293
+ { "Overlay2_Enable", 0xFE79 },
294
+ { "AudibleBell_Enable", 0xFE7A },
295
+ { "dead_a", 0xFE80 },
296
+ { "dead_A", 0xFE81 },
297
+ { "dead_e", 0xFE82 },
298
+ { "dead_E", 0xFE83 },
299
+ { "dead_i", 0xFE84 },
300
+ { "dead_I", 0xFE85 },
301
+ { "dead_o", 0xFE86 },
302
+ { "dead_O", 0xFE87 },
303
+ { "dead_u", 0xFE88 },
304
+ { "dead_U", 0xFE89 },
305
+ { "dead_schwa", 0xFE8A },
306
+ { "dead_small_schwa", 0xFE8A },
307
+ { "dead_SCHWA", 0xFE8B },
308
+ { "dead_capital_schwa", 0xFE8B },
309
+ { "dead_greek", 0xFE8C },
310
+ { "dead_lowline", 0xFE90 },
311
+ { "dead_aboveverticalline", 0xFE91 },
312
+ { "dead_belowverticalline", 0xFE92 },
313
+ { "dead_longsolidusoverlay", 0xFE93 },
314
+ { "ch", 0xFEA0 },
315
+ { "Ch", 0xFEA1 },
316
+ { "CH", 0xFEA2 },
317
+ { "c_h", 0xFEA3 },
318
+ { "C_h", 0xFEA4 },
319
+ { "C_H", 0xFEA5 },
320
+ { "First_Virtual_Screen", 0xFED0 },
321
+ { "Prev_Virtual_Screen", 0xFED1 },
322
+ { "Next_Virtual_Screen", 0xFED2 },
323
+ { "Last_Virtual_Screen", 0xFED4 },
324
+ { "Terminate_Server", 0xFED5 },
325
+ { "Pointer_Left", 0xFEE0 },
326
+ { "Pointer_Right", 0xFEE1 },
327
+ { "Pointer_Up", 0xFEE2 },
328
+ { "Pointer_Down", 0xFEE3 },
329
+ { "Pointer_UpLeft", 0xFEE4 },
330
+ { "Pointer_UpRight", 0xFEE5 },
331
+ { "Pointer_DownLeft", 0xFEE6 },
332
+ { "Pointer_DownRight", 0xFEE7 },
333
+ { "Pointer_Button_Dflt", 0xFEE8 },
334
+ { "Pointer_Button1", 0xFEE9 },
335
+ { "Pointer_Button2", 0xFEEA },
336
+ { "Pointer_Button3", 0xFEEB },
337
+ { "Pointer_Button4", 0xFEEC },
338
+ { "Pointer_Button5", 0xFEED },
339
+ { "Pointer_DblClick_Dflt", 0xFEEE },
340
+ { "Pointer_DblClick1", 0xFEEF },
341
+ { "Pointer_DblClick2", 0xFEF0 },
342
+ { "Pointer_DblClick3", 0xFEF1 },
343
+ { "Pointer_DblClick4", 0xFEF2 },
344
+ { "Pointer_DblClick5", 0xFEF3 },
345
+ { "Pointer_Drag_Dflt", 0xFEF4 },
346
+ { "Pointer_Drag1", 0xFEF5 },
347
+ { "Pointer_Drag2", 0xFEF6 },
348
+ { "Pointer_Drag3", 0xFEF7 },
349
+ { "Pointer_Drag4", 0xFEF8 },
350
+ { "Pointer_EnableKeys", 0xFEF9 },
351
+ { "Pointer_Accelerate", 0xFEFA },
352
+ { "Pointer_DfltBtnNext", 0xFEFB },
353
+ { "Pointer_DfltBtnPrev", 0xFEFC },
354
+ { "Pointer_Drag5", 0xFEFD },
355
+ { "space", 0x20 },
356
+ { "exclam", 0x21 },
357
+ { "quotedbl", 0x22 },
358
+ { "numbersign", 0x23 },
359
+ { "dollar", 0x24 },
360
+ { "percent", 0x25 },
361
+ { "ampersand", 0x26 },
362
+ { "apostrophe", 0x27 },
363
+ { "quoteright", 0x27 },
364
+ { "parenleft", 0x28 },
365
+ { "parenright", 0x29 },
366
+ { "asterisk", 0x2A },
367
+ { "plus", 0x2B },
368
+ { "comma", 0x2C },
369
+ { "minus", 0x2D },
370
+ { "period", 0x2E },
371
+ { "slash", 0x2F },
372
+ { "0", 0x30 },
373
+ { "1", 0x31 },
374
+ { "2", 0x32 },
375
+ { "3", 0x33 },
376
+ { "4", 0x34 },
377
+ { "5", 0x35 },
378
+ { "6", 0x36 },
379
+ { "7", 0x37 },
380
+ { "8", 0x38 },
381
+ { "9", 0x39 },
382
+ { "colon", 0x3A },
383
+ { "semicolon", 0x3B },
384
+ { "less", 0x3C },
385
+ { "equal", 0x3D },
386
+ { "greater", 0x3E },
387
+ { "question", 0x3F },
388
+ { "at", 0x40 },
389
+ { "A", 0x41 },
390
+ { "B", 0x42 },
391
+ { "C", 0x43 },
392
+ { "D", 0x44 },
393
+ { "E", 0x45 },
394
+ { "F", 0x46 },
395
+ { "G", 0x47 },
396
+ { "H", 0x48 },
397
+ { "I", 0x49 },
398
+ { "J", 0x4A },
399
+ { "K", 0x4B },
400
+ { "L", 0x4C },
401
+ { "M", 0x4D },
402
+ { "N", 0x4E },
403
+ { "O", 0x4F },
404
+ { "P", 0x50 },
405
+ { "Q", 0x51 },
406
+ { "R", 0x52 },
407
+ { "S", 0x53 },
408
+ { "T", 0x54 },
409
+ { "U", 0x55 },
410
+ { "V", 0x56 },
411
+ { "W", 0x57 },
412
+ { "X", 0x58 },
413
+ { "Y", 0x59 },
414
+ { "Z", 0x5A },
415
+ { "bracketleft", 0x5B },
416
+ { "backslash", 0x5C },
417
+ { "bracketright", 0x5D },
418
+ { "asciicircum", 0x5E },
419
+ { "underscore", 0x5F },
420
+ { "grave", 0x60 },
421
+ { "quoteleft", 0x60 },
422
+ { "a", 0x61 },
423
+ { "b", 0x62 },
424
+ { "c", 0x63 },
425
+ { "d", 0x64 },
426
+ { "e", 0x65 },
427
+ { "f", 0x66 },
428
+ { "g", 0x67 },
429
+ { "h", 0x68 },
430
+ { "i", 0x69 },
431
+ { "j", 0x6A },
432
+ { "k", 0x6B },
433
+ { "l", 0x6C },
434
+ { "m", 0x6D },
435
+ { "n", 0x6E },
436
+ { "o", 0x6F },
437
+ { "p", 0x70 },
438
+ { "q", 0x71 },
439
+ { "r", 0x72 },
440
+ { "s", 0x73 },
441
+ { "t", 0x74 },
442
+ { "u", 0x75 },
443
+ { "v", 0x76 },
444
+ { "w", 0x77 },
445
+ { "x", 0x78 },
446
+ { "y", 0x79 },
447
+ { "z", 0x7A },
448
+ { "braceleft", 0x7B },
449
+ { "bar", 0x7C },
450
+ { "braceright", 0x7D },
451
+ { "asciitilde", 0x7E },
452
+ { "nobreakspace", 0xA0 },
453
+ { "exclamdown", 0xA1 },
454
+ { "cent", 0xA2 },
455
+ { "sterling", 0xA3 },
456
+ { "currency", 0xA4 },
457
+ { "yen", 0xA5 },
458
+ { "brokenbar", 0xA6 },
459
+ { "section", 0xA7 },
460
+ { "diaeresis", 0xA8 },
461
+ { "copyright", 0xA9 },
462
+ { "ordfeminine", 0xAA },
463
+ { "guillemetleft", 0xAB },
464
+ { "guillemotleft", 0xAB },
465
+ { "notsign", 0xAC },
466
+ { "hyphen", 0xAD },
467
+ { "registered", 0xAE },
468
+ { "macron", 0xAF },
469
+ { "degree", 0xB0 },
470
+ { "plusminus", 0xB1 },
471
+ { "twosuperior", 0xB2 },
472
+ { "threesuperior", 0xB3 },
473
+ { "acute", 0xB4 },
474
+ { "mu", 0xB5 },
475
+ { "paragraph", 0xB6 },
476
+ { "periodcentered", 0xB7 },
477
+ { "cedilla", 0xB8 },
478
+ { "onesuperior", 0xB9 },
479
+ { "ordmasculine", 0xBA },
480
+ { "masculine", 0xBA },
481
+ { "guillemetright", 0xBB },
482
+ { "guillemotright", 0xBB },
483
+ { "onequarter", 0xBC },
484
+ { "onehalf", 0xBD },
485
+ { "threequarters", 0xBE },
486
+ { "questiondown", 0xBF },
487
+ { "Agrave", 0xC0 },
488
+ { "Aacute", 0xC1 },
489
+ { "Acircumflex", 0xC2 },
490
+ { "Atilde", 0xC3 },
491
+ { "Adiaeresis", 0xC4 },
492
+ { "Aring", 0xC5 },
493
+ { "AE", 0xC6 },
494
+ { "Ccedilla", 0xC7 },
495
+ { "Egrave", 0xC8 },
496
+ { "Eacute", 0xC9 },
497
+ { "Ecircumflex", 0xCA },
498
+ { "Ediaeresis", 0xCB },
499
+ { "Igrave", 0xCC },
500
+ { "Iacute", 0xCD },
501
+ { "Icircumflex", 0xCE },
502
+ { "Idiaeresis", 0xCF },
503
+ { "ETH", 0xD0 },
504
+ { "Eth", 0xD0 },
505
+ { "Ntilde", 0xD1 },
506
+ { "Ograve", 0xD2 },
507
+ { "Oacute", 0xD3 },
508
+ { "Ocircumflex", 0xD4 },
509
+ { "Otilde", 0xD5 },
510
+ { "Odiaeresis", 0xD6 },
511
+ { "multiply", 0xD7 },
512
+ { "Oslash", 0xD8 },
513
+ { "Ooblique", 0xD8 },
514
+ { "Ugrave", 0xD9 },
515
+ { "Uacute", 0xDA },
516
+ { "Ucircumflex", 0xDB },
517
+ { "Udiaeresis", 0xDC },
518
+ { "Yacute", 0xDD },
519
+ { "THORN", 0xDE },
520
+ { "Thorn", 0xDE },
521
+ { "ssharp", 0xDF },
522
+ { "agrave", 0xE0 },
523
+ { "aacute", 0xE1 },
524
+ { "acircumflex", 0xE2 },
525
+ { "atilde", 0xE3 },
526
+ { "adiaeresis", 0xE4 },
527
+ { "aring", 0xE5 },
528
+ { "ae", 0xE6 },
529
+ { "ccedilla", 0xE7 },
530
+ { "egrave", 0xE8 },
531
+ { "eacute", 0xE9 },
532
+ { "ecircumflex", 0xEA },
533
+ { "ediaeresis", 0xEB },
534
+ { "igrave", 0xEC },
535
+ { "iacute", 0xED },
536
+ { "icircumflex", 0xEE },
537
+ { "idiaeresis", 0xEF },
538
+ { "eth", 0xF0 },
539
+ { "ntilde", 0xF1 },
540
+ { "ograve", 0xF2 },
541
+ { "oacute", 0xF3 },
542
+ { "ocircumflex", 0xF4 },
543
+ { "otilde", 0xF5 },
544
+ { "odiaeresis", 0xF6 },
545
+ { "division", 0xF7 },
546
+ { "oslash", 0xF8 },
547
+ { "ooblique", 0xF8 },
548
+ { "ugrave", 0xF9 },
549
+ { "uacute", 0xFA },
550
+ { "ucircumflex", 0xFB },
551
+ { "udiaeresis", 0xFC },
552
+ { "yacute", 0xFD },
553
+ { "thorn", 0xFE },
554
+ { "ydiaeresis", 0xFF },
555
+ { "Aogonek", 0x1A1 },
556
+ { "breve", 0x1A2 },
557
+ { "Lstroke", 0x1A3 },
558
+ { "Lcaron", 0x1A5 },
559
+ { "Sacute", 0x1A6 },
560
+ { "Scaron", 0x1A9 },
561
+ { "Scedilla", 0x1AA },
562
+ { "Tcaron", 0x1AB },
563
+ { "Zacute", 0x1AC },
564
+ { "Zcaron", 0x1AE },
565
+ { "Zabovedot", 0x1AF },
566
+ { "aogonek", 0x1B1 },
567
+ { "ogonek", 0x1B2 },
568
+ { "lstroke", 0x1B3 },
569
+ { "lcaron", 0x1B5 },
570
+ { "sacute", 0x1B6 },
571
+ { "caron", 0x1B7 },
572
+ { "scaron", 0x1B9 },
573
+ { "scedilla", 0x1BA },
574
+ { "tcaron", 0x1BB },
575
+ { "zacute", 0x1BC },
576
+ { "doubleacute", 0x1BD },
577
+ { "zcaron", 0x1BE },
578
+ { "zabovedot", 0x1BF },
579
+ { "Racute", 0x1C0 },
580
+ { "Abreve", 0x1C3 },
581
+ { "Lacute", 0x1C5 },
582
+ { "Cacute", 0x1C6 },
583
+ { "Ccaron", 0x1C8 },
584
+ { "Eogonek", 0x1CA },
585
+ { "Ecaron", 0x1CC },
586
+ { "Dcaron", 0x1CF },
587
+ { "Dstroke", 0x1D0 },
588
+ { "Nacute", 0x1D1 },
589
+ { "Ncaron", 0x1D2 },
590
+ { "Odoubleacute", 0x1D5 },
591
+ { "Rcaron", 0x1D8 },
592
+ { "Uring", 0x1D9 },
593
+ { "Udoubleacute", 0x1DB },
594
+ { "Tcedilla", 0x1DE },
595
+ { "racute", 0x1E0 },
596
+ { "abreve", 0x1E3 },
597
+ { "lacute", 0x1E5 },
598
+ { "cacute", 0x1E6 },
599
+ { "ccaron", 0x1E8 },
600
+ { "eogonek", 0x1EA },
601
+ { "ecaron", 0x1EC },
602
+ { "dcaron", 0x1EF },
603
+ { "dstroke", 0x1F0 },
604
+ { "nacute", 0x1F1 },
605
+ { "ncaron", 0x1F2 },
606
+ { "odoubleacute", 0x1F5 },
607
+ { "rcaron", 0x1F8 },
608
+ { "uring", 0x1F9 },
609
+ { "udoubleacute", 0x1FB },
610
+ { "tcedilla", 0x1FE },
611
+ { "abovedot", 0x1FF },
612
+ { "Hstroke", 0x2A1 },
613
+ { "Hcircumflex", 0x2A6 },
614
+ { "Iabovedot", 0x2A9 },
615
+ { "Gbreve", 0x2AB },
616
+ { "Jcircumflex", 0x2AC },
617
+ { "hstroke", 0x2B1 },
618
+ { "hcircumflex", 0x2B6 },
619
+ { "idotless", 0x2B9 },
620
+ { "gbreve", 0x2BB },
621
+ { "jcircumflex", 0x2BC },
622
+ { "Cabovedot", 0x2C5 },
623
+ { "Ccircumflex", 0x2C6 },
624
+ { "Gabovedot", 0x2D5 },
625
+ { "Gcircumflex", 0x2D8 },
626
+ { "Ubreve", 0x2DD },
627
+ { "Scircumflex", 0x2DE },
628
+ { "cabovedot", 0x2E5 },
629
+ { "ccircumflex", 0x2E6 },
630
+ { "gabovedot", 0x2F5 },
631
+ { "gcircumflex", 0x2F8 },
632
+ { "ubreve", 0x2FD },
633
+ { "scircumflex", 0x2FE },
634
+ { "kra", 0x3A2 },
635
+ { "kappa", 0x3A2 },
636
+ { "Rcedilla", 0x3A3 },
637
+ { "Itilde", 0x3A5 },
638
+ { "Lcedilla", 0x3A6 },
639
+ { "Emacron", 0x3AA },
640
+ { "Gcedilla", 0x3AB },
641
+ { "Tslash", 0x3AC },
642
+ { "rcedilla", 0x3B3 },
643
+ { "itilde", 0x3B5 },
644
+ { "lcedilla", 0x3B6 },
645
+ { "emacron", 0x3BA },
646
+ { "gcedilla", 0x3BB },
647
+ { "gacute", 0x3BB },
648
+ { "tslash", 0x3BC },
649
+ { "ENG", 0x3BD },
650
+ { "eng", 0x3BF },
651
+ { "Amacron", 0x3C0 },
652
+ { "Iogonek", 0x3C7 },
653
+ { "Eabovedot", 0x3CC },
654
+ { "Imacron", 0x3CF },
655
+ { "Ncedilla", 0x3D1 },
656
+ { "Omacron", 0x3D2 },
657
+ { "Kcedilla", 0x3D3 },
658
+ { "Uogonek", 0x3D9 },
659
+ { "Utilde", 0x3DD },
660
+ { "Umacron", 0x3DE },
661
+ { "amacron", 0x3E0 },
662
+ { "iogonek", 0x3E7 },
663
+ { "eabovedot", 0x3EC },
664
+ { "imacron", 0x3EF },
665
+ { "ncedilla", 0x3F1 },
666
+ { "omacron", 0x3F2 },
667
+ { "kcedilla", 0x3F3 },
668
+ { "uogonek", 0x3F9 },
669
+ { "utilde", 0x3FD },
670
+ { "umacron", 0x3FE },
671
+ { "OE", 0x13BC },
672
+ { "oe", 0x13BD },
673
+ { "Ydiaeresis", 0x13BE },
674
+ { "overline", 0x47E },
675
+ { "kana_fullstop", 0x4A1 },
676
+ { "kana_openingbracket", 0x4A2 },
677
+ { "kana_closingbracket", 0x4A3 },
678
+ { "kana_comma", 0x4A4 },
679
+ { "kana_conjunctive", 0x4A5 },
680
+ { "kana_middledot", 0x4A5 },
681
+ { "kana_WO", 0x4A6 },
682
+ { "kana_a", 0x4A7 },
683
+ { "kana_i", 0x4A8 },
684
+ { "kana_u", 0x4A9 },
685
+ { "kana_e", 0x4AA },
686
+ { "kana_o", 0x4AB },
687
+ { "kana_ya", 0x4AC },
688
+ { "kana_yu", 0x4AD },
689
+ { "kana_yo", 0x4AE },
690
+ { "kana_tsu", 0x4AF },
691
+ { "kana_tu", 0x4AF },
692
+ { "prolongedsound", 0x4B0 },
693
+ { "kana_A", 0x4B1 },
694
+ { "kana_I", 0x4B2 },
695
+ { "kana_U", 0x4B3 },
696
+ { "kana_E", 0x4B4 },
697
+ { "kana_O", 0x4B5 },
698
+ { "kana_KA", 0x4B6 },
699
+ { "kana_KI", 0x4B7 },
700
+ { "kana_KU", 0x4B8 },
701
+ { "kana_KE", 0x4B9 },
702
+ { "kana_KO", 0x4BA },
703
+ { "kana_SA", 0x4BB },
704
+ { "kana_SHI", 0x4BC },
705
+ { "kana_SU", 0x4BD },
706
+ { "kana_SE", 0x4BE },
707
+ { "kana_SO", 0x4BF },
708
+ { "kana_TA", 0x4C0 },
709
+ { "kana_CHI", 0x4C1 },
710
+ { "kana_TI", 0x4C1 },
711
+ { "kana_TSU", 0x4C2 },
712
+ { "kana_TU", 0x4C2 },
713
+ { "kana_TE", 0x4C3 },
714
+ { "kana_TO", 0x4C4 },
715
+ { "kana_NA", 0x4C5 },
716
+ { "kana_NI", 0x4C6 },
717
+ { "kana_NU", 0x4C7 },
718
+ { "kana_NE", 0x4C8 },
719
+ { "kana_NO", 0x4C9 },
720
+ { "kana_HA", 0x4CA },
721
+ { "kana_HI", 0x4CB },
722
+ { "kana_FU", 0x4CC },
723
+ { "kana_HU", 0x4CC },
724
+ { "kana_HE", 0x4CD },
725
+ { "kana_HO", 0x4CE },
726
+ { "kana_MA", 0x4CF },
727
+ { "kana_MI", 0x4D0 },
728
+ { "kana_MU", 0x4D1 },
729
+ { "kana_ME", 0x4D2 },
730
+ { "kana_MO", 0x4D3 },
731
+ { "kana_YA", 0x4D4 },
732
+ { "kana_YU", 0x4D5 },
733
+ { "kana_YO", 0x4D6 },
734
+ { "kana_RA", 0x4D7 },
735
+ { "kana_RI", 0x4D8 },
736
+ { "kana_RU", 0x4D9 },
737
+ { "kana_RE", 0x4DA },
738
+ { "kana_RO", 0x4DB },
739
+ { "kana_WA", 0x4DC },
740
+ { "kana_N", 0x4DD },
741
+ { "voicedsound", 0x4DE },
742
+ { "semivoicedsound", 0x4DF },
743
+ { "Arabic_comma", 0x5AC },
744
+ { "Arabic_semicolon", 0x5BB },
745
+ { "Arabic_question_mark", 0x5BF },
746
+ { "Arabic_hamza", 0x5C1 },
747
+ { "Arabic_maddaonalef", 0x5C2 },
748
+ { "Arabic_hamzaonalef", 0x5C3 },
749
+ { "Arabic_hamzaonwaw", 0x5C4 },
750
+ { "Arabic_hamzaunderalef", 0x5C5 },
751
+ { "Arabic_hamzaonyeh", 0x5C6 },
752
+ { "Arabic_alef", 0x5C7 },
753
+ { "Arabic_beh", 0x5C8 },
754
+ { "Arabic_tehmarbuta", 0x5C9 },
755
+ { "Arabic_teh", 0x5CA },
756
+ { "Arabic_theh", 0x5CB },
757
+ { "Arabic_jeem", 0x5CC },
758
+ { "Arabic_hah", 0x5CD },
759
+ { "Arabic_khah", 0x5CE },
760
+ { "Arabic_dal", 0x5CF },
761
+ { "Arabic_thal", 0x5D0 },
762
+ { "Arabic_ra", 0x5D1 },
763
+ { "Arabic_zain", 0x5D2 },
764
+ { "Arabic_seen", 0x5D3 },
765
+ { "Arabic_sheen", 0x5D4 },
766
+ { "Arabic_sad", 0x5D5 },
767
+ { "Arabic_dad", 0x5D6 },
768
+ { "Arabic_tah", 0x5D7 },
769
+ { "Arabic_zah", 0x5D8 },
770
+ { "Arabic_ain", 0x5D9 },
771
+ { "Arabic_ghain", 0x5DA },
772
+ { "Arabic_tatweel", 0x5E0 },
773
+ { "Arabic_feh", 0x5E1 },
774
+ { "Arabic_qaf", 0x5E2 },
775
+ { "Arabic_kaf", 0x5E3 },
776
+ { "Arabic_lam", 0x5E4 },
777
+ { "Arabic_meem", 0x5E5 },
778
+ { "Arabic_noon", 0x5E6 },
779
+ { "Arabic_ha", 0x5E7 },
780
+ { "Arabic_heh", 0x5E7 },
781
+ { "Arabic_waw", 0x5E8 },
782
+ { "Arabic_alefmaksura", 0x5E9 },
783
+ { "Arabic_yeh", 0x5EA },
784
+ { "Arabic_fathatan", 0x5EB },
785
+ { "Arabic_dammatan", 0x5EC },
786
+ { "Arabic_kasratan", 0x5ED },
787
+ { "Arabic_fatha", 0x5EE },
788
+ { "Arabic_damma", 0x5EF },
789
+ { "Arabic_kasra", 0x5F0 },
790
+ { "Arabic_shadda", 0x5F1 },
791
+ { "Arabic_sukun", 0x5F2 },
792
+ { "Serbian_dje", 0x6A1 },
793
+ { "Macedonia_gje", 0x6A2 },
794
+ { "Cyrillic_io", 0x6A3 },
795
+ { "Ukrainian_ie", 0x6A4 },
796
+ { "Ukranian_je", 0x6A4 },
797
+ { "Macedonia_dse", 0x6A5 },
798
+ { "Ukrainian_i", 0x6A6 },
799
+ { "Ukranian_i", 0x6A6 },
800
+ { "Ukrainian_yi", 0x6A7 },
801
+ { "Ukranian_yi", 0x6A7 },
802
+ { "Cyrillic_je", 0x6A8 },
803
+ { "Serbian_je", 0x6A8 },
804
+ { "Cyrillic_lje", 0x6A9 },
805
+ { "Serbian_lje", 0x6A9 },
806
+ { "Cyrillic_nje", 0x6AA },
807
+ { "Serbian_nje", 0x6AA },
808
+ { "Serbian_tshe", 0x6AB },
809
+ { "Macedonia_kje", 0x6AC },
810
+ { "Ukrainian_ghe_with_upturn", 0x6AD },
811
+ { "Byelorussian_shortu", 0x6AE },
812
+ { "Cyrillic_dzhe", 0x6AF },
813
+ { "Serbian_dze", 0x6AF },
814
+ { "numerosign", 0x6B0 },
815
+ { "Serbian_DJE", 0x6B1 },
816
+ { "Macedonia_GJE", 0x6B2 },
817
+ { "Cyrillic_IO", 0x6B3 },
818
+ { "Ukrainian_IE", 0x6B4 },
819
+ { "Ukranian_JE", 0x6B4 },
820
+ { "Macedonia_DSE", 0x6B5 },
821
+ { "Ukrainian_I", 0x6B6 },
822
+ { "Ukranian_I", 0x6B6 },
823
+ { "Ukrainian_YI", 0x6B7 },
824
+ { "Ukranian_YI", 0x6B7 },
825
+ { "Cyrillic_JE", 0x6B8 },
826
+ { "Serbian_JE", 0x6B8 },
827
+ { "Cyrillic_LJE", 0x6B9 },
828
+ { "Serbian_LJE", 0x6B9 },
829
+ { "Cyrillic_NJE", 0x6BA },
830
+ { "Serbian_NJE", 0x6BA },
831
+ { "Serbian_TSHE", 0x6BB },
832
+ { "Macedonia_KJE", 0x6BC },
833
+ { "Ukrainian_GHE_WITH_UPTURN", 0x6BD },
834
+ { "Byelorussian_SHORTU", 0x6BE },
835
+ { "Cyrillic_DZHE", 0x6BF },
836
+ { "Serbian_DZE", 0x6BF },
837
+ { "Cyrillic_yu", 0x6C0 },
838
+ { "Cyrillic_a", 0x6C1 },
839
+ { "Cyrillic_be", 0x6C2 },
840
+ { "Cyrillic_tse", 0x6C3 },
841
+ { "Cyrillic_de", 0x6C4 },
842
+ { "Cyrillic_ie", 0x6C5 },
843
+ { "Cyrillic_ef", 0x6C6 },
844
+ { "Cyrillic_ghe", 0x6C7 },
845
+ { "Cyrillic_ha", 0x6C8 },
846
+ { "Cyrillic_i", 0x6C9 },
847
+ { "Cyrillic_shorti", 0x6CA },
848
+ { "Cyrillic_ka", 0x6CB },
849
+ { "Cyrillic_el", 0x6CC },
850
+ { "Cyrillic_em", 0x6CD },
851
+ { "Cyrillic_en", 0x6CE },
852
+ { "Cyrillic_o", 0x6CF },
853
+ { "Cyrillic_pe", 0x6D0 },
854
+ { "Cyrillic_ya", 0x6D1 },
855
+ { "Cyrillic_er", 0x6D2 },
856
+ { "Cyrillic_es", 0x6D3 },
857
+ { "Cyrillic_te", 0x6D4 },
858
+ { "Cyrillic_u", 0x6D5 },
859
+ { "Cyrillic_zhe", 0x6D6 },
860
+ { "Cyrillic_ve", 0x6D7 },
861
+ { "Cyrillic_softsign", 0x6D8 },
862
+ { "Cyrillic_yeru", 0x6D9 },
863
+ { "Cyrillic_ze", 0x6DA },
864
+ { "Cyrillic_sha", 0x6DB },
865
+ { "Cyrillic_e", 0x6DC },
866
+ { "Cyrillic_shcha", 0x6DD },
867
+ { "Cyrillic_che", 0x6DE },
868
+ { "Cyrillic_hardsign", 0x6DF },
869
+ { "Cyrillic_YU", 0x6E0 },
870
+ { "Cyrillic_A", 0x6E1 },
871
+ { "Cyrillic_BE", 0x6E2 },
872
+ { "Cyrillic_TSE", 0x6E3 },
873
+ { "Cyrillic_DE", 0x6E4 },
874
+ { "Cyrillic_IE", 0x6E5 },
875
+ { "Cyrillic_EF", 0x6E6 },
876
+ { "Cyrillic_GHE", 0x6E7 },
877
+ { "Cyrillic_HA", 0x6E8 },
878
+ { "Cyrillic_I", 0x6E9 },
879
+ { "Cyrillic_SHORTI", 0x6EA },
880
+ { "Cyrillic_KA", 0x6EB },
881
+ { "Cyrillic_EL", 0x6EC },
882
+ { "Cyrillic_EM", 0x6ED },
883
+ { "Cyrillic_EN", 0x6EE },
884
+ { "Cyrillic_O", 0x6EF },
885
+ { "Cyrillic_PE", 0x6F0 },
886
+ { "Cyrillic_YA", 0x6F1 },
887
+ { "Cyrillic_ER", 0x6F2 },
888
+ { "Cyrillic_ES", 0x6F3 },
889
+ { "Cyrillic_TE", 0x6F4 },
890
+ { "Cyrillic_U", 0x6F5 },
891
+ { "Cyrillic_ZHE", 0x6F6 },
892
+ { "Cyrillic_VE", 0x6F7 },
893
+ { "Cyrillic_SOFTSIGN", 0x6F8 },
894
+ { "Cyrillic_YERU", 0x6F9 },
895
+ { "Cyrillic_ZE", 0x6FA },
896
+ { "Cyrillic_SHA", 0x6FB },
897
+ { "Cyrillic_E", 0x6FC },
898
+ { "Cyrillic_SHCHA", 0x6FD },
899
+ { "Cyrillic_CHE", 0x6FE },
900
+ { "Cyrillic_HARDSIGN", 0x6FF },
901
+ { "Greek_ALPHAaccent", 0x7A1 },
902
+ { "Greek_EPSILONaccent", 0x7A2 },
903
+ { "Greek_ETAaccent", 0x7A3 },
904
+ { "Greek_IOTAaccent", 0x7A4 },
905
+ { "Greek_IOTAdieresis", 0x7A5 },
906
+ { "Greek_IOTAdiaeresis", 0x7A5 },
907
+ { "Greek_IOTAaccentdiaeresis", 0x7A6 },
908
+ { "Greek_OMICRONaccent", 0x7A7 },
909
+ { "Greek_UPSILONaccent", 0x7A8 },
910
+ { "Greek_UPSILONdieresis", 0x7A9 },
911
+ { "Greek_UPSILONaccentdieresis", 0x7AA },
912
+ { "Greek_OMEGAaccent", 0x7AB },
913
+ { "Greek_accentdieresis", 0x7AE },
914
+ { "Greek_horizbar", 0x7AF },
915
+ { "Greek_alphaaccent", 0x7B1 },
916
+ { "Greek_epsilonaccent", 0x7B2 },
917
+ { "Greek_etaaccent", 0x7B3 },
918
+ { "Greek_iotaaccent", 0x7B4 },
919
+ { "Greek_iotadieresis", 0x7B5 },
920
+ { "Greek_iotaaccentdieresis", 0x7B6 },
921
+ { "Greek_omicronaccent", 0x7B7 },
922
+ { "Greek_upsilonaccent", 0x7B8 },
923
+ { "Greek_upsilondieresis", 0x7B9 },
924
+ { "Greek_upsilonaccentdieresis", 0x7BA },
925
+ { "Greek_omegaaccent", 0x7BB },
926
+ { "Greek_ALPHA", 0x7C1 },
927
+ { "Greek_BETA", 0x7C2 },
928
+ { "Greek_GAMMA", 0x7C3 },
929
+ { "Greek_DELTA", 0x7C4 },
930
+ { "Greek_EPSILON", 0x7C5 },
931
+ { "Greek_ZETA", 0x7C6 },
932
+ { "Greek_ETA", 0x7C7 },
933
+ { "Greek_THETA", 0x7C8 },
934
+ { "Greek_IOTA", 0x7C9 },
935
+ { "Greek_KAPPA", 0x7CA },
936
+ { "Greek_LAMDA", 0x7CB },
937
+ { "Greek_LAMBDA", 0x7CB },
938
+ { "Greek_MU", 0x7CC },
939
+ { "Greek_NU", 0x7CD },
940
+ { "Greek_XI", 0x7CE },
941
+ { "Greek_OMICRON", 0x7CF },
942
+ { "Greek_PI", 0x7D0 },
943
+ { "Greek_RHO", 0x7D1 },
944
+ { "Greek_SIGMA", 0x7D2 },
945
+ { "Greek_TAU", 0x7D4 },
946
+ { "Greek_UPSILON", 0x7D5 },
947
+ { "Greek_PHI", 0x7D6 },
948
+ { "Greek_CHI", 0x7D7 },
949
+ { "Greek_PSI", 0x7D8 },
950
+ { "Greek_OMEGA", 0x7D9 },
951
+ { "Greek_alpha", 0x7E1 },
952
+ { "Greek_beta", 0x7E2 },
953
+ { "Greek_gamma", 0x7E3 },
954
+ { "Greek_delta", 0x7E4 },
955
+ { "Greek_epsilon", 0x7E5 },
956
+ { "Greek_zeta", 0x7E6 },
957
+ { "Greek_eta", 0x7E7 },
958
+ { "Greek_theta", 0x7E8 },
959
+ { "Greek_iota", 0x7E9 },
960
+ { "Greek_kappa", 0x7EA },
961
+ { "Greek_lamda", 0x7EB },
962
+ { "Greek_lambda", 0x7EB },
963
+ { "Greek_mu", 0x7EC },
964
+ { "Greek_nu", 0x7ED },
965
+ { "Greek_xi", 0x7EE },
966
+ { "Greek_omicron", 0x7EF },
967
+ { "Greek_pi", 0x7F0 },
968
+ { "Greek_rho", 0x7F1 },
969
+ { "Greek_sigma", 0x7F2 },
970
+ { "Greek_finalsmallsigma", 0x7F3 },
971
+ { "Greek_tau", 0x7F4 },
972
+ { "Greek_upsilon", 0x7F5 },
973
+ { "Greek_phi", 0x7F6 },
974
+ { "Greek_chi", 0x7F7 },
975
+ { "Greek_psi", 0x7F8 },
976
+ { "Greek_omega", 0x7F9 },
977
+ { "leftradical", 0x8A1 },
978
+ { "topleftradical", 0x8A2 },
979
+ { "horizconnector", 0x8A3 },
980
+ { "topintegral", 0x8A4 },
981
+ { "botintegral", 0x8A5 },
982
+ { "vertconnector", 0x8A6 },
983
+ { "topleftsqbracket", 0x8A7 },
984
+ { "botleftsqbracket", 0x8A8 },
985
+ { "toprightsqbracket", 0x8A9 },
986
+ { "botrightsqbracket", 0x8AA },
987
+ { "topleftparens", 0x8AB },
988
+ { "botleftparens", 0x8AC },
989
+ { "toprightparens", 0x8AD },
990
+ { "botrightparens", 0x8AE },
991
+ { "leftmiddlecurlybrace", 0x8AF },
992
+ { "rightmiddlecurlybrace", 0x8B0 },
993
+ { "topleftsummation", 0x8B1 },
994
+ { "botleftsummation", 0x8B2 },
995
+ { "topvertsummationconnector", 0x8B3 },
996
+ { "botvertsummationconnector", 0x8B4 },
997
+ { "toprightsummation", 0x8B5 },
998
+ { "botrightsummation", 0x8B6 },
999
+ { "rightmiddlesummation", 0x8B7 },
1000
+ { "lessthanequal", 0x8BC },
1001
+ { "notequal", 0x8BD },
1002
+ { "greaterthanequal", 0x8BE },
1003
+ { "integral", 0x8BF },
1004
+ { "therefore", 0x8C0 },
1005
+ { "variation", 0x8C1 },
1006
+ { "infinity", 0x8C2 },
1007
+ { "nabla", 0x8C5 },
1008
+ { "approximate", 0x8C8 },
1009
+ { "similarequal", 0x8C9 },
1010
+ { "ifonlyif", 0x8CD },
1011
+ { "implies", 0x8CE },
1012
+ { "identical", 0x8CF },
1013
+ { "radical", 0x8D6 },
1014
+ { "includedin", 0x8DA },
1015
+ { "includes", 0x8DB },
1016
+ { "intersection", 0x8DC },
1017
+ { "union", 0x8DD },
1018
+ { "logicaland", 0x8DE },
1019
+ { "logicalor", 0x8DF },
1020
+ { "partialderivative", 0x8EF },
1021
+ { "function", 0x8F6 },
1022
+ { "leftarrow", 0x8FB },
1023
+ { "uparrow", 0x8FC },
1024
+ { "rightarrow", 0x8FD },
1025
+ { "downarrow", 0x8FE },
1026
+ { "blank", 0x9DF },
1027
+ { "soliddiamond", 0x9E0 },
1028
+ { "checkerboard", 0x9E1 },
1029
+ { "ht", 0x9E2 },
1030
+ { "ff", 0x9E3 },
1031
+ { "cr", 0x9E4 },
1032
+ { "lf", 0x9E5 },
1033
+ { "nl", 0x9E8 },
1034
+ { "vt", 0x9E9 },
1035
+ { "lowrightcorner", 0x9EA },
1036
+ { "uprightcorner", 0x9EB },
1037
+ { "upleftcorner", 0x9EC },
1038
+ { "lowleftcorner", 0x9ED },
1039
+ { "crossinglines", 0x9EE },
1040
+ { "horizlinescan1", 0x9EF },
1041
+ { "horizlinescan3", 0x9F0 },
1042
+ { "horizlinescan5", 0x9F1 },
1043
+ { "horizlinescan7", 0x9F2 },
1044
+ { "horizlinescan9", 0x9F3 },
1045
+ { "leftt", 0x9F4 },
1046
+ { "rightt", 0x9F5 },
1047
+ { "bott", 0x9F6 },
1048
+ { "topt", 0x9F7 },
1049
+ { "vertbar", 0x9F8 },
1050
+ { "emspace", 0xAA1 },
1051
+ { "enspace", 0xAA2 },
1052
+ { "em3space", 0xAA3 },
1053
+ { "em4space", 0xAA4 },
1054
+ { "digitspace", 0xAA5 },
1055
+ { "punctspace", 0xAA6 },
1056
+ { "thinspace", 0xAA7 },
1057
+ { "hairspace", 0xAA8 },
1058
+ { "emdash", 0xAA9 },
1059
+ { "endash", 0xAAA },
1060
+ { "signifblank", 0xAAC },
1061
+ { "ellipsis", 0xAAE },
1062
+ { "doubbaselinedot", 0xAAF },
1063
+ { "onethird", 0xAB0 },
1064
+ { "twothirds", 0xAB1 },
1065
+ { "onefifth", 0xAB2 },
1066
+ { "twofifths", 0xAB3 },
1067
+ { "threefifths", 0xAB4 },
1068
+ { "fourfifths", 0xAB5 },
1069
+ { "onesixth", 0xAB6 },
1070
+ { "fivesixths", 0xAB7 },
1071
+ { "careof", 0xAB8 },
1072
+ { "figdash", 0xABB },
1073
+ { "leftanglebracket", 0xABC },
1074
+ { "decimalpoint", 0xABD },
1075
+ { "rightanglebracket", 0xABE },
1076
+ { "marker", 0xABF },
1077
+ { "oneeighth", 0xAC3 },
1078
+ { "threeeighths", 0xAC4 },
1079
+ { "fiveeighths", 0xAC5 },
1080
+ { "seveneighths", 0xAC6 },
1081
+ { "trademark", 0xAC9 },
1082
+ { "signaturemark", 0xACA },
1083
+ { "trademarkincircle", 0xACB },
1084
+ { "leftopentriangle", 0xACC },
1085
+ { "rightopentriangle", 0xACD },
1086
+ { "emopencircle", 0xACE },
1087
+ { "emopenrectangle", 0xACF },
1088
+ { "leftsinglequotemark", 0xAD0 },
1089
+ { "rightsinglequotemark", 0xAD1 },
1090
+ { "leftdoublequotemark", 0xAD2 },
1091
+ { "rightdoublequotemark", 0xAD3 },
1092
+ { "prescription", 0xAD4 },
1093
+ { "permille", 0xAD5 },
1094
+ { "minutes", 0xAD6 },
1095
+ { "seconds", 0xAD7 },
1096
+ { "latincross", 0xAD9 },
1097
+ { "hexagram", 0xADA },
1098
+ { "filledrectbullet", 0xADB },
1099
+ { "filledlefttribullet", 0xADC },
1100
+ { "filledrighttribullet", 0xADD },
1101
+ { "emfilledcircle", 0xADE },
1102
+ { "emfilledrect", 0xADF },
1103
+ { "enopencircbullet", 0xAE0 },
1104
+ { "enopensquarebullet", 0xAE1 },
1105
+ { "openrectbullet", 0xAE2 },
1106
+ { "opentribulletup", 0xAE3 },
1107
+ { "opentribulletdown", 0xAE4 },
1108
+ { "openstar", 0xAE5 },
1109
+ { "enfilledcircbullet", 0xAE6 },
1110
+ { "enfilledsqbullet", 0xAE7 },
1111
+ { "filledtribulletup", 0xAE8 },
1112
+ { "filledtribulletdown", 0xAE9 },
1113
+ { "leftpointer", 0xAEA },
1114
+ { "rightpointer", 0xAEB },
1115
+ { "club", 0xAEC },
1116
+ { "diamond", 0xAED },
1117
+ { "heart", 0xAEE },
1118
+ { "maltesecross", 0xAF0 },
1119
+ { "dagger", 0xAF1 },
1120
+ { "doubledagger", 0xAF2 },
1121
+ { "checkmark", 0xAF3 },
1122
+ { "ballotcross", 0xAF4 },
1123
+ { "musicalsharp", 0xAF5 },
1124
+ { "musicalflat", 0xAF6 },
1125
+ { "malesymbol", 0xAF7 },
1126
+ { "femalesymbol", 0xAF8 },
1127
+ { "telephone", 0xAF9 },
1128
+ { "telephonerecorder", 0xAFA },
1129
+ { "phonographcopyright", 0xAFB },
1130
+ { "caret", 0xAFC },
1131
+ { "singlelowquotemark", 0xAFD },
1132
+ { "doublelowquotemark", 0xAFE },
1133
+ { "cursor", 0xAFF },
1134
+ { "leftcaret", 0xBA3 },
1135
+ { "rightcaret", 0xBA6 },
1136
+ { "downcaret", 0xBA8 },
1137
+ { "upcaret", 0xBA9 },
1138
+ { "overbar", 0xBC0 },
1139
+ { "downtack", 0xBC2 },
1140
+ { "upshoe", 0xBC3 },
1141
+ { "downstile", 0xBC4 },
1142
+ { "underbar", 0xBC6 },
1143
+ { "jot", 0xBCA },
1144
+ { "quad", 0xBCC },
1145
+ { "uptack", 0xBCE },
1146
+ { "circle", 0xBCF },
1147
+ { "upstile", 0xBD3 },
1148
+ { "downshoe", 0xBD6 },
1149
+ { "rightshoe", 0xBD8 },
1150
+ { "leftshoe", 0xBDA },
1151
+ { "lefttack", 0xBDC },
1152
+ { "righttack", 0xBFC },
1153
+ { "hebrew_doublelowline", 0xCDF },
1154
+ { "hebrew_aleph", 0xCE0 },
1155
+ { "hebrew_bet", 0xCE1 },
1156
+ { "hebrew_beth", 0xCE1 },
1157
+ { "hebrew_gimel", 0xCE2 },
1158
+ { "hebrew_gimmel", 0xCE2 },
1159
+ { "hebrew_dalet", 0xCE3 },
1160
+ { "hebrew_daleth", 0xCE3 },
1161
+ { "hebrew_he", 0xCE4 },
1162
+ { "hebrew_waw", 0xCE5 },
1163
+ { "hebrew_zain", 0xCE6 },
1164
+ { "hebrew_zayin", 0xCE6 },
1165
+ { "hebrew_chet", 0xCE7 },
1166
+ { "hebrew_het", 0xCE7 },
1167
+ { "hebrew_tet", 0xCE8 },
1168
+ { "hebrew_teth", 0xCE8 },
1169
+ { "hebrew_yod", 0xCE9 },
1170
+ { "hebrew_finalkaph", 0xCEA },
1171
+ { "hebrew_kaph", 0xCEB },
1172
+ { "hebrew_lamed", 0xCEC },
1173
+ { "hebrew_finalmem", 0xCED },
1174
+ { "hebrew_mem", 0xCEE },
1175
+ { "hebrew_finalnun", 0xCEF },
1176
+ { "hebrew_nun", 0xCF0 },
1177
+ { "hebrew_samech", 0xCF1 },
1178
+ { "hebrew_samekh", 0xCF1 },
1179
+ { "hebrew_ayin", 0xCF2 },
1180
+ { "hebrew_finalpe", 0xCF3 },
1181
+ { "hebrew_pe", 0xCF4 },
1182
+ { "hebrew_finalzade", 0xCF5 },
1183
+ { "hebrew_finalzadi", 0xCF5 },
1184
+ { "hebrew_zade", 0xCF6 },
1185
+ { "hebrew_zadi", 0xCF6 },
1186
+ { "hebrew_qoph", 0xCF7 },
1187
+ { "hebrew_kuf", 0xCF7 },
1188
+ { "hebrew_resh", 0xCF8 },
1189
+ { "hebrew_shin", 0xCF9 },
1190
+ { "hebrew_taw", 0xCFA },
1191
+ { "hebrew_taf", 0xCFA },
1192
+ { "Thai_kokai", 0xDA1 },
1193
+ { "Thai_khokhai", 0xDA2 },
1194
+ { "Thai_khokhuat", 0xDA3 },
1195
+ { "Thai_khokhwai", 0xDA4 },
1196
+ { "Thai_khokhon", 0xDA5 },
1197
+ { "Thai_khorakhang", 0xDA6 },
1198
+ { "Thai_ngongu", 0xDA7 },
1199
+ { "Thai_chochan", 0xDA8 },
1200
+ { "Thai_choching", 0xDA9 },
1201
+ { "Thai_chochang", 0xDAA },
1202
+ { "Thai_soso", 0xDAB },
1203
+ { "Thai_chochoe", 0xDAC },
1204
+ { "Thai_yoying", 0xDAD },
1205
+ { "Thai_dochada", 0xDAE },
1206
+ { "Thai_topatak", 0xDAF },
1207
+ { "Thai_thothan", 0xDB0 },
1208
+ { "Thai_thonangmontho", 0xDB1 },
1209
+ { "Thai_thophuthao", 0xDB2 },
1210
+ { "Thai_nonen", 0xDB3 },
1211
+ { "Thai_dodek", 0xDB4 },
1212
+ { "Thai_totao", 0xDB5 },
1213
+ { "Thai_thothung", 0xDB6 },
1214
+ { "Thai_thothahan", 0xDB7 },
1215
+ { "Thai_thothong", 0xDB8 },
1216
+ { "Thai_nonu", 0xDB9 },
1217
+ { "Thai_bobaimai", 0xDBA },
1218
+ { "Thai_popla", 0xDBB },
1219
+ { "Thai_phophung", 0xDBC },
1220
+ { "Thai_fofa", 0xDBD },
1221
+ { "Thai_phophan", 0xDBE },
1222
+ { "Thai_fofan", 0xDBF },
1223
+ { "Thai_phosamphao", 0xDC0 },
1224
+ { "Thai_moma", 0xDC1 },
1225
+ { "Thai_yoyak", 0xDC2 },
1226
+ { "Thai_rorua", 0xDC3 },
1227
+ { "Thai_ru", 0xDC4 },
1228
+ { "Thai_loling", 0xDC5 },
1229
+ { "Thai_lu", 0xDC6 },
1230
+ { "Thai_wowaen", 0xDC7 },
1231
+ { "Thai_sosala", 0xDC8 },
1232
+ { "Thai_sorusi", 0xDC9 },
1233
+ { "Thai_sosua", 0xDCA },
1234
+ { "Thai_hohip", 0xDCB },
1235
+ { "Thai_lochula", 0xDCC },
1236
+ { "Thai_oang", 0xDCD },
1237
+ { "Thai_honokhuk", 0xDCE },
1238
+ { "Thai_paiyannoi", 0xDCF },
1239
+ { "Thai_saraa", 0xDD0 },
1240
+ { "Thai_maihanakat", 0xDD1 },
1241
+ { "Thai_saraaa", 0xDD2 },
1242
+ { "Thai_saraam", 0xDD3 },
1243
+ { "Thai_sarai", 0xDD4 },
1244
+ { "Thai_saraii", 0xDD5 },
1245
+ { "Thai_saraue", 0xDD6 },
1246
+ { "Thai_sarauee", 0xDD7 },
1247
+ { "Thai_sarau", 0xDD8 },
1248
+ { "Thai_sarauu", 0xDD9 },
1249
+ { "Thai_phinthu", 0xDDA },
1250
+ { "Thai_maihanakat_maitho", 0xDDE },
1251
+ { "Thai_baht", 0xDDF },
1252
+ { "Thai_sarae", 0xDE0 },
1253
+ { "Thai_saraae", 0xDE1 },
1254
+ { "Thai_sarao", 0xDE2 },
1255
+ { "Thai_saraaimaimuan", 0xDE3 },
1256
+ { "Thai_saraaimaimalai", 0xDE4 },
1257
+ { "Thai_lakkhangyao", 0xDE5 },
1258
+ { "Thai_maiyamok", 0xDE6 },
1259
+ { "Thai_maitaikhu", 0xDE7 },
1260
+ { "Thai_maiek", 0xDE8 },
1261
+ { "Thai_maitho", 0xDE9 },
1262
+ { "Thai_maitri", 0xDEA },
1263
+ { "Thai_maichattawa", 0xDEB },
1264
+ { "Thai_thanthakhat", 0xDEC },
1265
+ { "Thai_nikhahit", 0xDED },
1266
+ { "Thai_leksun", 0xDF0 },
1267
+ { "Thai_leknung", 0xDF1 },
1268
+ { "Thai_leksong", 0xDF2 },
1269
+ { "Thai_leksam", 0xDF3 },
1270
+ { "Thai_leksi", 0xDF4 },
1271
+ { "Thai_lekha", 0xDF5 },
1272
+ { "Thai_lekhok", 0xDF6 },
1273
+ { "Thai_lekchet", 0xDF7 },
1274
+ { "Thai_lekpaet", 0xDF8 },
1275
+ { "Thai_lekkao", 0xDF9 },
1276
+ { "Hangul_Kiyeog", 0xEA1 },
1277
+ { "Hangul_SsangKiyeog", 0xEA2 },
1278
+ { "Hangul_KiyeogSios", 0xEA3 },
1279
+ { "Hangul_Nieun", 0xEA4 },
1280
+ { "Hangul_NieunJieuj", 0xEA5 },
1281
+ { "Hangul_NieunHieuh", 0xEA6 },
1282
+ { "Hangul_Dikeud", 0xEA7 },
1283
+ { "Hangul_SsangDikeud", 0xEA8 },
1284
+ { "Hangul_Rieul", 0xEA9 },
1285
+ { "Hangul_RieulKiyeog", 0xEAA },
1286
+ { "Hangul_RieulMieum", 0xEAB },
1287
+ { "Hangul_RieulPieub", 0xEAC },
1288
+ { "Hangul_RieulSios", 0xEAD },
1289
+ { "Hangul_RieulTieut", 0xEAE },
1290
+ { "Hangul_RieulPhieuf", 0xEAF },
1291
+ { "Hangul_RieulHieuh", 0xEB0 },
1292
+ { "Hangul_Mieum", 0xEB1 },
1293
+ { "Hangul_Pieub", 0xEB2 },
1294
+ { "Hangul_SsangPieub", 0xEB3 },
1295
+ { "Hangul_PieubSios", 0xEB4 },
1296
+ { "Hangul_Sios", 0xEB5 },
1297
+ { "Hangul_SsangSios", 0xEB6 },
1298
+ { "Hangul_Ieung", 0xEB7 },
1299
+ { "Hangul_Jieuj", 0xEB8 },
1300
+ { "Hangul_SsangJieuj", 0xEB9 },
1301
+ { "Hangul_Cieuc", 0xEBA },
1302
+ { "Hangul_Khieuq", 0xEBB },
1303
+ { "Hangul_Tieut", 0xEBC },
1304
+ { "Hangul_Phieuf", 0xEBD },
1305
+ { "Hangul_Hieuh", 0xEBE },
1306
+ { "Hangul_A", 0xEBF },
1307
+ { "Hangul_AE", 0xEC0 },
1308
+ { "Hangul_YA", 0xEC1 },
1309
+ { "Hangul_YAE", 0xEC2 },
1310
+ { "Hangul_EO", 0xEC3 },
1311
+ { "Hangul_E", 0xEC4 },
1312
+ { "Hangul_YEO", 0xEC5 },
1313
+ { "Hangul_YE", 0xEC6 },
1314
+ { "Hangul_O", 0xEC7 },
1315
+ { "Hangul_WA", 0xEC8 },
1316
+ { "Hangul_WAE", 0xEC9 },
1317
+ { "Hangul_OE", 0xECA },
1318
+ { "Hangul_YO", 0xECB },
1319
+ { "Hangul_U", 0xECC },
1320
+ { "Hangul_WEO", 0xECD },
1321
+ { "Hangul_WE", 0xECE },
1322
+ { "Hangul_WI", 0xECF },
1323
+ { "Hangul_YU", 0xED0 },
1324
+ { "Hangul_EU", 0xED1 },
1325
+ { "Hangul_YI", 0xED2 },
1326
+ { "Hangul_I", 0xED3 },
1327
+ { "Hangul_J_Kiyeog", 0xED4 },
1328
+ { "Hangul_J_SsangKiyeog", 0xED5 },
1329
+ { "Hangul_J_KiyeogSios", 0xED6 },
1330
+ { "Hangul_J_Nieun", 0xED7 },
1331
+ { "Hangul_J_NieunJieuj", 0xED8 },
1332
+ { "Hangul_J_NieunHieuh", 0xED9 },
1333
+ { "Hangul_J_Dikeud", 0xEDA },
1334
+ { "Hangul_J_Rieul", 0xEDB },
1335
+ { "Hangul_J_RieulKiyeog", 0xEDC },
1336
+ { "Hangul_J_RieulMieum", 0xEDD },
1337
+ { "Hangul_J_RieulPieub", 0xEDE },
1338
+ { "Hangul_J_RieulSios", 0xEDF },
1339
+ { "Hangul_J_RieulTieut", 0xEE0 },
1340
+ { "Hangul_J_RieulPhieuf", 0xEE1 },
1341
+ { "Hangul_J_RieulHieuh", 0xEE2 },
1342
+ { "Hangul_J_Mieum", 0xEE3 },
1343
+ { "Hangul_J_Pieub", 0xEE4 },
1344
+ { "Hangul_J_PieubSios", 0xEE5 },
1345
+ { "Hangul_J_Sios", 0xEE6 },
1346
+ { "Hangul_J_SsangSios", 0xEE7 },
1347
+ { "Hangul_J_Ieung", 0xEE8 },
1348
+ { "Hangul_J_Jieuj", 0xEE9 },
1349
+ { "Hangul_J_Cieuc", 0xEEA },
1350
+ { "Hangul_J_Khieuq", 0xEEB },
1351
+ { "Hangul_J_Tieut", 0xEEC },
1352
+ { "Hangul_J_Phieuf", 0xEED },
1353
+ { "Hangul_J_Hieuh", 0xEEE },
1354
+ { "Hangul_RieulYeorinHieuh", 0xEEF },
1355
+ { "Hangul_SunkyeongeumMieum", 0xEF0 },
1356
+ { "Hangul_SunkyeongeumPieub", 0xEF1 },
1357
+ { "Hangul_PanSios", 0xEF2 },
1358
+ { "Hangul_KkogjiDalrinIeung", 0xEF3 },
1359
+ { "Hangul_SunkyeongeumPhieuf", 0xEF4 },
1360
+ { "Hangul_YeorinHieuh", 0xEF5 },
1361
+ { "Hangul_AraeA", 0xEF6 },
1362
+ { "Hangul_AraeAE", 0xEF7 },
1363
+ { "Hangul_J_PanSios", 0xEF8 },
1364
+ { "Hangul_J_KkogjiDalrinIeung", 0xEF9 },
1365
+ { "Hangul_J_YeorinHieuh", 0xEFA },
1366
+ { "Korean_Won", 0xEFF },
1367
+ { "XF86ModeLock", 0x1008FF01 },
1368
+ { "XF86MonBrightnessUp", 0x1008FF02 },
1369
+ { "XF86MonBrightnessDown", 0x1008FF03 },
1370
+ { "XF86KbdLightOnOff", 0x1008FF04 },
1371
+ { "XF86KbdBrightnessUp", 0x1008FF05 },
1372
+ { "XF86KbdBrightnessDown", 0x1008FF06 },
1373
+ { "XF86MonBrightnessCycle", 0x1008FF07 },
1374
+ { "XF86Standby", 0x1008FF10 },
1375
+ { "XF86AudioLowerVolume", 0x1008FF11 },
1376
+ { "XF86AudioMute", 0x1008FF12 },
1377
+ { "XF86AudioRaiseVolume", 0x1008FF13 },
1378
+ { "XF86AudioPlay", 0x1008FF14 },
1379
+ { "XF86AudioStop", 0x1008FF15 },
1380
+ { "XF86AudioPrev", 0x1008FF16 },
1381
+ { "XF86AudioNext", 0x1008FF17 },
1382
+ { "XF86HomePage", 0x1008FF18 },
1383
+ { "XF86Mail", 0x1008FF19 },
1384
+ { "XF86Start", 0x1008FF1A },
1385
+ { "XF86Search", 0x1008FF1B },
1386
+ { "XF86AudioRecord", 0x1008FF1C },
1387
+ { "XF86Calculator", 0x1008FF1D },
1388
+ { "XF86Memo", 0x1008FF1E },
1389
+ { "XF86ToDoList", 0x1008FF1F },
1390
+ { "XF86Calendar", 0x1008FF20 },
1391
+ { "XF86PowerDown", 0x1008FF21 },
1392
+ { "XF86ContrastAdjust", 0x1008FF22 },
1393
+ { "XF86RockerUp", 0x1008FF23 },
1394
+ { "XF86RockerDown", 0x1008FF24 },
1395
+ { "XF86RockerEnter", 0x1008FF25 },
1396
+ { "XF86Back", 0x1008FF26 },
1397
+ { "XF86Forward", 0x1008FF27 },
1398
+ { "XF86Stop", 0x1008FF28 },
1399
+ { "XF86Refresh", 0x1008FF29 },
1400
+ { "XF86PowerOff", 0x1008FF2A },
1401
+ { "XF86WakeUp", 0x1008FF2B },
1402
+ { "XF86Eject", 0x1008FF2C },
1403
+ { "XF86ScreenSaver", 0x1008FF2D },
1404
+ { "XF86WWW", 0x1008FF2E },
1405
+ { "XF86Sleep", 0x1008FF2F },
1406
+ { "XF86Favorites", 0x1008FF30 },
1407
+ { "XF86AudioPause", 0x1008FF31 },
1408
+ { "XF86AudioMedia", 0x1008FF32 },
1409
+ { "XF86MyComputer", 0x1008FF33 },
1410
+ { "XF86VendorHome", 0x1008FF34 },
1411
+ { "XF86LightBulb", 0x1008FF35 },
1412
+ { "XF86Shop", 0x1008FF36 },
1413
+ { "XF86History", 0x1008FF37 },
1414
+ { "XF86OpenURL", 0x1008FF38 },
1415
+ { "XF86AddFavorite", 0x1008FF39 },
1416
+ { "XF86HotLinks", 0x1008FF3A },
1417
+ { "XF86BrightnessAdjust", 0x1008FF3B },
1418
+ { "XF86Finance", 0x1008FF3C },
1419
+ { "XF86Community", 0x1008FF3D },
1420
+ { "XF86AudioRewind", 0x1008FF3E },
1421
+ { "XF86BackForward", 0x1008FF3F },
1422
+ { "XF86Launch0", 0x1008FF40 },
1423
+ { "XF86Launch1", 0x1008FF41 },
1424
+ { "XF86Launch2", 0x1008FF42 },
1425
+ { "XF86Launch3", 0x1008FF43 },
1426
+ { "XF86Launch4", 0x1008FF44 },
1427
+ { "XF86Launch5", 0x1008FF45 },
1428
+ { "XF86Launch6", 0x1008FF46 },
1429
+ { "XF86Launch7", 0x1008FF47 },
1430
+ { "XF86Launch8", 0x1008FF48 },
1431
+ { "XF86Launch9", 0x1008FF49 },
1432
+ { "XF86LaunchA", 0x1008FF4A },
1433
+ { "XF86LaunchB", 0x1008FF4B },
1434
+ { "XF86LaunchC", 0x1008FF4C },
1435
+ { "XF86LaunchD", 0x1008FF4D },
1436
+ { "XF86LaunchE", 0x1008FF4E },
1437
+ { "XF86LaunchF", 0x1008FF4F },
1438
+ { "XF86ApplicationLeft", 0x1008FF50 },
1439
+ { "XF86ApplicationRight", 0x1008FF51 },
1440
+ { "XF86Book", 0x1008FF52 },
1441
+ { "XF86CD", 0x1008FF53 },
1442
+ { "XF86Calculater", 0x1008FF54 },
1443
+ { "XF86Clear", 0x1008FF55 },
1444
+ { "XF86Close", 0x1008FF56 },
1445
+ { "XF86Copy", 0x1008FF57 },
1446
+ { "XF86Cut", 0x1008FF58 },
1447
+ { "XF86Display", 0x1008FF59 },
1448
+ { "XF86DOS", 0x1008FF5A },
1449
+ { "XF86Documents", 0x1008FF5B },
1450
+ { "XF86Excel", 0x1008FF5C },
1451
+ { "XF86Explorer", 0x1008FF5D },
1452
+ { "XF86Game", 0x1008FF5E },
1453
+ { "XF86Go", 0x1008FF5F },
1454
+ { "XF86iTouch", 0x1008FF60 },
1455
+ { "XF86LogOff", 0x1008FF61 },
1456
+ { "XF86Market", 0x1008FF62 },
1457
+ { "XF86Meeting", 0x1008FF63 },
1458
+ { "XF86MenuKB", 0x1008FF65 },
1459
+ { "XF86MenuPB", 0x1008FF66 },
1460
+ { "XF86MySites", 0x1008FF67 },
1461
+ { "XF86New", 0x1008FF68 },
1462
+ { "XF86News", 0x1008FF69 },
1463
+ { "XF86OfficeHome", 0x1008FF6A },
1464
+ { "XF86Open", 0x1008FF6B },
1465
+ { "XF86Option", 0x1008FF6C },
1466
+ { "XF86Paste", 0x1008FF6D },
1467
+ { "XF86Phone", 0x1008FF6E },
1468
+ { "XF86Q", 0x1008FF70 },
1469
+ { "XF86Reply", 0x1008FF72 },
1470
+ { "XF86Reload", 0x1008FF73 },
1471
+ { "XF86RotateWindows", 0x1008FF74 },
1472
+ { "XF86RotationPB", 0x1008FF75 },
1473
+ { "XF86RotationKB", 0x1008FF76 },
1474
+ { "XF86Save", 0x1008FF77 },
1475
+ { "XF86ScrollUp", 0x1008FF78 },
1476
+ { "XF86ScrollDown", 0x1008FF79 },
1477
+ { "XF86ScrollClick", 0x1008FF7A },
1478
+ { "XF86Send", 0x1008FF7B },
1479
+ { "XF86Spell", 0x1008FF7C },
1480
+ { "XF86SplitScreen", 0x1008FF7D },
1481
+ { "XF86Support", 0x1008FF7E },
1482
+ { "XF86TaskPane", 0x1008FF7F },
1483
+ { "XF86Terminal", 0x1008FF80 },
1484
+ { "XF86Tools", 0x1008FF81 },
1485
+ { "XF86Travel", 0x1008FF82 },
1486
+ { "XF86UserPB", 0x1008FF84 },
1487
+ { "XF86User1KB", 0x1008FF85 },
1488
+ { "XF86User2KB", 0x1008FF86 },
1489
+ { "XF86Video", 0x1008FF87 },
1490
+ { "XF86WheelButton", 0x1008FF88 },
1491
+ { "XF86Word", 0x1008FF89 },
1492
+ { "XF86Xfer", 0x1008FF8A },
1493
+ { "XF86ZoomIn", 0x1008FF8B },
1494
+ { "XF86ZoomOut", 0x1008FF8C },
1495
+ { "XF86Away", 0x1008FF8D },
1496
+ { "XF86Messenger", 0x1008FF8E },
1497
+ { "XF86WebCam", 0x1008FF8F },
1498
+ { "XF86MailForward", 0x1008FF90 },
1499
+ { "XF86Pictures", 0x1008FF91 },
1500
+ { "XF86Music", 0x1008FF92 },
1501
+ { "XF86Battery", 0x1008FF93 },
1502
+ { "XF86Bluetooth", 0x1008FF94 },
1503
+ { "XF86WLAN", 0x1008FF95 },
1504
+ { "XF86UWB", 0x1008FF96 },
1505
+ { "XF86AudioForward", 0x1008FF97 },
1506
+ { "XF86AudioRepeat", 0x1008FF98 },
1507
+ { "XF86AudioRandomPlay", 0x1008FF99 },
1508
+ { "XF86Subtitle", 0x1008FF9A },
1509
+ { "XF86AudioCycleTrack", 0x1008FF9B },
1510
+ { "XF86CycleAngle", 0x1008FF9C },
1511
+ { "XF86FrameBack", 0x1008FF9D },
1512
+ { "XF86FrameForward", 0x1008FF9E },
1513
+ { "XF86Time", 0x1008FF9F },
1514
+ { "XF86Select", 0x1008FFA0 },
1515
+ { "XF86View", 0x1008FFA1 },
1516
+ { "XF86TopMenu", 0x1008FFA2 },
1517
+ { "XF86Red", 0x1008FFA3 },
1518
+ { "XF86Green", 0x1008FFA4 },
1519
+ { "XF86Yellow", 0x1008FFA5 },
1520
+ { "XF86Blue", 0x1008FFA6 },
1521
+ { "XF86Suspend", 0x1008FFA7 },
1522
+ { "XF86Hibernate", 0x1008FFA8 },
1523
+ { "XF86TouchpadToggle", 0x1008FFA9 },
1524
+ { "XF86TouchpadOn", 0x1008FFB0 },
1525
+ { "XF86TouchpadOff", 0x1008FFB1 },
1526
+ { "XF86AudioMicMute", 0x1008FFB2 },
1527
+ { "XF86Keyboard", 0x1008FFB3 },
1528
+ { "XF86WWAN", 0x1008FFB4 },
1529
+ { "XF86RFKill", 0x1008FFB5 },
1530
+ { "XF86AudioPreset", 0x1008FFB6 },
1531
+ { "XF86RotationLockToggle", 0x1008FFB7 },
1532
+ { "XF86FullScreen", 0x1008FFB8 },
1533
+ { "XF86Switch_VT_1", 0x1008FE01 },
1534
+ { "XF86Switch_VT_2", 0x1008FE02 },
1535
+ { "XF86Switch_VT_3", 0x1008FE03 },
1536
+ { "XF86Switch_VT_4", 0x1008FE04 },
1537
+ { "XF86Switch_VT_5", 0x1008FE05 },
1538
+ { "XF86Switch_VT_6", 0x1008FE06 },
1539
+ { "XF86Switch_VT_7", 0x1008FE07 },
1540
+ { "XF86Switch_VT_8", 0x1008FE08 },
1541
+ { "XF86Switch_VT_9", 0x1008FE09 },
1542
+ { "XF86Switch_VT_10", 0x1008FE0A },
1543
+ { "XF86Switch_VT_11", 0x1008FE0B },
1544
+ { "XF86Switch_VT_12", 0x1008FE0C },
1545
+ { "XF86Ungrab", 0x1008FE20 },
1546
+ { "XF86ClearGrab", 0x1008FE21 },
1547
+ { "XF86Next_VMode", 0x1008FE22 },
1548
+ { "XF86Prev_VMode", 0x1008FE23 },
1549
+ { "XF86LogWindowTree", 0x1008FE24 },
1550
+ { "XF86LogGrabInfo", 0x1008FE25 },
1551
+ { "XF86BrightnessAuto", 0x100810F4 },
1552
+ { "XF86DisplayOff", 0x100810F5 },
1553
+ { "XF86Info", 0x10081166 },
1554
+ { "XF86AspectRatio", 0x10081177 },
1555
+ { "XF86DVD", 0x10081185 },
1556
+ { "XF86Audio", 0x10081188 },
1557
+ { "XF86ChannelUp", 0x10081192 },
1558
+ { "XF86ChannelDown", 0x10081193 },
1559
+ { "XF86Break", 0x1008119B },
1560
+ { "XF86VideoPhone", 0x100811A0 },
1561
+ { "XF86ZoomReset", 0x100811A4 },
1562
+ { "XF86Editor", 0x100811A6 },
1563
+ { "XF86GraphicsEditor", 0x100811A8 },
1564
+ { "XF86Presentation", 0x100811A9 },
1565
+ { "XF86Database", 0x100811AA },
1566
+ { "XF86Voicemail", 0x100811AC },
1567
+ { "XF86Addressbook", 0x100811AD },
1568
+ { "XF86DisplayToggle", 0x100811AF },
1569
+ { "XF86SpellCheck", 0x100811B0 },
1570
+ { "XF86ContextMenu", 0x100811B6 },
1571
+ { "XF86MediaRepeat", 0x100811B7 },
1572
+ { "XF8610ChannelsUp", 0x100811B8 },
1573
+ { "XF8610ChannelsDown", 0x100811B9 },
1574
+ { "XF86Images", 0x100811BA },
1575
+ { "XF86NotificationCenter", 0x100811BC },
1576
+ { "XF86PickupPhone", 0x100811BD },
1577
+ { "XF86HangupPhone", 0x100811BE },
1578
+ { "XF86Fn", 0x100811D0 },
1579
+ { "XF86Fn_Esc", 0x100811D1 },
1580
+ { "XF86FnRightShift", 0x100811E5 },
1581
+ { "XF86Numeric0", 0x10081200 },
1582
+ { "XF86Numeric1", 0x10081201 },
1583
+ { "XF86Numeric2", 0x10081202 },
1584
+ { "XF86Numeric3", 0x10081203 },
1585
+ { "XF86Numeric4", 0x10081204 },
1586
+ { "XF86Numeric5", 0x10081205 },
1587
+ { "XF86Numeric6", 0x10081206 },
1588
+ { "XF86Numeric7", 0x10081207 },
1589
+ { "XF86Numeric8", 0x10081208 },
1590
+ { "XF86Numeric9", 0x10081209 },
1591
+ { "XF86NumericStar", 0x1008120A },
1592
+ { "XF86NumericPound", 0x1008120B },
1593
+ { "XF86NumericA", 0x1008120C },
1594
+ { "XF86NumericB", 0x1008120D },
1595
+ { "XF86NumericC", 0x1008120E },
1596
+ { "XF86NumericD", 0x1008120F },
1597
+ { "XF86CameraFocus", 0x10081210 },
1598
+ { "XF86WPSButton", 0x10081211 },
1599
+ { "XF86CameraZoomIn", 0x10081215 },
1600
+ { "XF86CameraZoomOut", 0x10081216 },
1601
+ { "XF86CameraUp", 0x10081217 },
1602
+ { "XF86CameraDown", 0x10081218 },
1603
+ { "XF86CameraLeft", 0x10081219 },
1604
+ { "XF86CameraRight", 0x1008121A },
1605
+ { "XF86AttendantOn", 0x1008121B },
1606
+ { "XF86AttendantOff", 0x1008121C },
1607
+ { "XF86AttendantToggle", 0x1008121D },
1608
+ { "XF86LightsToggle", 0x1008121E },
1609
+ { "XF86ALSToggle", 0x10081230 },
1610
+ { "XF86Buttonconfig", 0x10081240 },
1611
+ { "XF86Taskmanager", 0x10081241 },
1612
+ { "XF86Journal", 0x10081242 },
1613
+ { "XF86ControlPanel", 0x10081243 },
1614
+ { "XF86AppSelect", 0x10081244 },
1615
+ { "XF86Screensaver", 0x10081245 },
1616
+ { "XF86VoiceCommand", 0x10081246 },
1617
+ { "XF86Assistant", 0x10081247 },
1618
+ { "XF86EmojiPicker", 0x10081249 },
1619
+ { "XF86Dictate", 0x1008124A },
1620
+ { "XF86BrightnessMin", 0x10081250 },
1621
+ { "XF86BrightnessMax", 0x10081251 },
1622
+ { "XF86KbdInputAssistPrev", 0x10081260 },
1623
+ { "XF86KbdInputAssistNext", 0x10081261 },
1624
+ { "XF86KbdInputAssistPrevgroup", 0x10081262 },
1625
+ { "XF86KbdInputAssistNextgroup", 0x10081263 },
1626
+ { "XF86KbdInputAssistAccept", 0x10081264 },
1627
+ { "XF86KbdInputAssistCancel", 0x10081265 },
1628
+ { "XF86RightUp", 0x10081266 },
1629
+ { "XF86RightDown", 0x10081267 },
1630
+ { "XF86LeftUp", 0x10081268 },
1631
+ { "XF86LeftDown", 0x10081269 },
1632
+ { "XF86RootMenu", 0x1008126A },
1633
+ { "XF86MediaTopMenu", 0x1008126B },
1634
+ { "XF86Numeric11", 0x1008126C },
1635
+ { "XF86Numeric12", 0x1008126D },
1636
+ { "XF86AudioDesc", 0x1008126E },
1637
+ { "XF863DMode", 0x1008126F },
1638
+ { "XF86NextFavorite", 0x10081270 },
1639
+ { "XF86StopRecord", 0x10081271 },
1640
+ { "XF86PauseRecord", 0x10081272 },
1641
+ { "XF86VOD", 0x10081273 },
1642
+ { "XF86Unmute", 0x10081274 },
1643
+ { "XF86FastReverse", 0x10081275 },
1644
+ { "XF86SlowReverse", 0x10081276 },
1645
+ { "XF86Data", 0x10081277 },
1646
+ { "XF86OnScreenKeyboard", 0x10081278 },
1647
+ { "XF86PrivacyScreenToggle", 0x10081279 },
1648
+ { "XF86SelectiveScreenshot", 0x1008127A },
1649
+ { "XF86Macro1", 0x10081290 },
1650
+ { "XF86Macro2", 0x10081291 },
1651
+ { "XF86Macro3", 0x10081292 },
1652
+ { "XF86Macro4", 0x10081293 },
1653
+ { "XF86Macro5", 0x10081294 },
1654
+ { "XF86Macro6", 0x10081295 },
1655
+ { "XF86Macro7", 0x10081296 },
1656
+ { "XF86Macro8", 0x10081297 },
1657
+ { "XF86Macro9", 0x10081298 },
1658
+ { "XF86Macro10", 0x10081299 },
1659
+ { "XF86Macro11", 0x1008129A },
1660
+ { "XF86Macro12", 0x1008129B },
1661
+ { "XF86Macro13", 0x1008129C },
1662
+ { "XF86Macro14", 0x1008129D },
1663
+ { "XF86Macro15", 0x1008129E },
1664
+ { "XF86Macro16", 0x1008129F },
1665
+ { "XF86Macro17", 0x100812A0 },
1666
+ { "XF86Macro18", 0x100812A1 },
1667
+ { "XF86Macro19", 0x100812A2 },
1668
+ { "XF86Macro20", 0x100812A3 },
1669
+ { "XF86Macro21", 0x100812A4 },
1670
+ { "XF86Macro22", 0x100812A5 },
1671
+ { "XF86Macro23", 0x100812A6 },
1672
+ { "XF86Macro24", 0x100812A7 },
1673
+ { "XF86Macro25", 0x100812A8 },
1674
+ { "XF86Macro26", 0x100812A9 },
1675
+ { "XF86Macro27", 0x100812AA },
1676
+ { "XF86Macro28", 0x100812AB },
1677
+ { "XF86Macro29", 0x100812AC },
1678
+ { "XF86Macro30", 0x100812AD },
1679
+ { "XF86MacroRecordStart", 0x100812B0 },
1680
+ { "XF86MacroRecordStop", 0x100812B1 },
1681
+ { "XF86MacroPresetCycle", 0x100812B2 },
1682
+ { "XF86MacroPreset1", 0x100812B3 },
1683
+ { "XF86MacroPreset2", 0x100812B4 },
1684
+ { "XF86MacroPreset3", 0x100812B5 },
1685
+ { "XF86KbdLcdMenu1", 0x100812B8 },
1686
+ { "XF86KbdLcdMenu2", 0x100812B9 },
1687
+ { "XF86KbdLcdMenu3", 0x100812BA },
1688
+ { "XF86KbdLcdMenu4", 0x100812BB },
1689
+ { "XF86KbdLcdMenu5", 0x100812BC },
1690
+ { "SunFA_Grave", 0x1005FF00 },
1691
+ { "SunFA_Circum", 0x1005FF01 },
1692
+ { "SunFA_Tilde", 0x1005FF02 },
1693
+ { "SunFA_Acute", 0x1005FF03 },
1694
+ { "SunFA_Diaeresis", 0x1005FF04 },
1695
+ { "SunFA_Cedilla", 0x1005FF05 },
1696
+ { "SunF36", 0x1005FF10 },
1697
+ { "SunF37", 0x1005FF11 },
1698
+ { "SunSys_Req", 0x1005FF60 },
1699
+ { "SunProps", 0x1005FF70 },
1700
+ { "SunFront", 0x1005FF71 },
1701
+ { "SunCopy", 0x1005FF72 },
1702
+ { "SunOpen", 0x1005FF73 },
1703
+ { "SunPaste", 0x1005FF74 },
1704
+ { "SunCut", 0x1005FF75 },
1705
+ { "SunPowerSwitch", 0x1005FF76 },
1706
+ { "SunAudioLowerVolume", 0x1005FF77 },
1707
+ { "SunAudioMute", 0x1005FF78 },
1708
+ { "SunAudioRaiseVolume", 0x1005FF79 },
1709
+ { "SunVideoDegauss", 0x1005FF7A },
1710
+ { "SunVideoLowerBrightness", 0x1005FF7B },
1711
+ { "SunVideoRaiseBrightness", 0x1005FF7C },
1712
+ { "SunPowerSwitchShift", 0x1005FF7D },
janus/include/menu.h ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2020 Thomas E. Dickey *
3
+ * Copyright 1998-2016,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: Juergen Pfeifer, 1995,1997 *
32
+ ****************************************************************************/
33
+
34
+ /* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
35
+
36
+ #ifndef ETI_MENU
37
+ #define ETI_MENU
38
+
39
+ #ifdef AMIGA
40
+ #define TEXT TEXT_ncurses
41
+ #endif
42
+
43
+ #include <ncursesw/curses.h>
44
+ #include <ncursesw/eti.h>
45
+
46
+ #ifdef __cplusplus
47
+ extern "C"
48
+ {
49
+ #endif
50
+
51
+ #if defined(BUILDING_MENU)
52
+ # define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
53
+ #else
54
+ # define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
55
+ #endif
56
+
57
+ #define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
58
+
59
+ #define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
60
+ #define MENU_EXPORT_VAR(type) MENU_IMPEXP type
61
+
62
+ typedef int Menu_Options;
63
+ typedef int Item_Options;
64
+
65
+ /* Menu options: */
66
+ #define O_ONEVALUE (0x01)
67
+ #define O_SHOWDESC (0x02)
68
+ #define O_ROWMAJOR (0x04)
69
+ #define O_IGNORECASE (0x08)
70
+ #define O_SHOWMATCH (0x10)
71
+ #define O_NONCYCLIC (0x20)
72
+ #define O_MOUSE_MENU (0x40)
73
+
74
+ /* Item options: */
75
+ #define O_SELECTABLE (0x01)
76
+
77
+ #if !NCURSES_OPAQUE_MENU
78
+ typedef struct
79
+ {
80
+ const char *str;
81
+ unsigned short length;
82
+ }
83
+ TEXT;
84
+ #endif /* !NCURSES_OPAQUE_MENU */
85
+
86
+ struct tagMENU;
87
+
88
+ typedef struct tagITEM
89
+ #if !NCURSES_OPAQUE_MENU
90
+ {
91
+ TEXT name; /* name of menu item */
92
+ TEXT description; /* description of item, optional in display */
93
+ struct tagMENU *imenu; /* Pointer to parent menu */
94
+ void *userptr; /* Pointer to user defined per item data */
95
+ Item_Options opt; /* Item options */
96
+ short index; /* Item number if connected to a menu */
97
+ short y; /* y and x location of item in menu */
98
+ short x;
99
+ bool value; /* Selection value */
100
+
101
+ struct tagITEM *left; /* neighbor items */
102
+ struct tagITEM *right;
103
+ struct tagITEM *up;
104
+ struct tagITEM *down;
105
+
106
+ }
107
+ #endif /* !NCURSES_OPAQUE_MENU */
108
+ ITEM;
109
+
110
+ typedef void (*Menu_Hook) (struct tagMENU *);
111
+
112
+ typedef struct tagMENU
113
+ #if 1 /* not yet: !NCURSES_OPAQUE_MENU */
114
+ {
115
+ short height; /* Nr. of chars high */
116
+ short width; /* Nr. of chars wide */
117
+ short rows; /* Nr. of items high */
118
+ short cols; /* Nr. of items wide */
119
+ short frows; /* Nr. of formatted items high */
120
+ short fcols; /* Nr. of formatted items wide */
121
+ short arows; /* Nr. of items high (actual) */
122
+ short namelen; /* Max. name length */
123
+ short desclen; /* Max. description length */
124
+ short marklen; /* Length of mark, if any */
125
+ short itemlen; /* Length of one item */
126
+ short spc_desc; /* Spacing for descriptor */
127
+ short spc_cols; /* Spacing for columns */
128
+ short spc_rows; /* Spacing for rows */
129
+ char *pattern; /* Buffer to store match chars */
130
+ short pindex; /* Index into pattern buffer */
131
+ WINDOW *win; /* Window containing menu */
132
+ WINDOW *sub; /* Subwindow for menu display */
133
+ WINDOW *userwin; /* User's window */
134
+ WINDOW *usersub; /* User's subwindow */
135
+ ITEM **items; /* array of items */
136
+ short nitems; /* Nr. of items in menu */
137
+ ITEM *curitem; /* Current item */
138
+ short toprow; /* Top row of menu */
139
+ chtype fore; /* Selection attribute */
140
+ chtype back; /* Nonselection attribute */
141
+ chtype grey; /* Inactive attribute */
142
+ unsigned char pad; /* Pad character */
143
+
144
+ Menu_Hook menuinit; /* User hooks */
145
+ Menu_Hook menuterm;
146
+ Menu_Hook iteminit;
147
+ Menu_Hook itemterm;
148
+
149
+ void *userptr; /* Pointer to menus user data */
150
+ char *mark; /* Pointer to marker string */
151
+
152
+ Menu_Options opt; /* Menu options */
153
+ unsigned short status; /* Internal state of menu */
154
+ }
155
+ #endif /* !NCURSES_OPAQUE_MENU */
156
+ MENU;
157
+
158
+ /* Define keys */
159
+
160
+ #define REQ_LEFT_ITEM (KEY_MAX + 1)
161
+ #define REQ_RIGHT_ITEM (KEY_MAX + 2)
162
+ #define REQ_UP_ITEM (KEY_MAX + 3)
163
+ #define REQ_DOWN_ITEM (KEY_MAX + 4)
164
+ #define REQ_SCR_ULINE (KEY_MAX + 5)
165
+ #define REQ_SCR_DLINE (KEY_MAX + 6)
166
+ #define REQ_SCR_DPAGE (KEY_MAX + 7)
167
+ #define REQ_SCR_UPAGE (KEY_MAX + 8)
168
+ #define REQ_FIRST_ITEM (KEY_MAX + 9)
169
+ #define REQ_LAST_ITEM (KEY_MAX + 10)
170
+ #define REQ_NEXT_ITEM (KEY_MAX + 11)
171
+ #define REQ_PREV_ITEM (KEY_MAX + 12)
172
+ #define REQ_TOGGLE_ITEM (KEY_MAX + 13)
173
+ #define REQ_CLEAR_PATTERN (KEY_MAX + 14)
174
+ #define REQ_BACK_PATTERN (KEY_MAX + 15)
175
+ #define REQ_NEXT_MATCH (KEY_MAX + 16)
176
+ #define REQ_PREV_MATCH (KEY_MAX + 17)
177
+
178
+ #define MIN_MENU_COMMAND (KEY_MAX + 1)
179
+ #define MAX_MENU_COMMAND (KEY_MAX + 17)
180
+
181
+ /*
182
+ * Some AT&T code expects MAX_COMMAND to be out-of-band not
183
+ * just for menu commands but for forms ones as well.
184
+ */
185
+ #if defined(MAX_COMMAND)
186
+ # if (MAX_MENU_COMMAND > MAX_COMMAND)
187
+ # error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND
188
+ # elif (MAX_COMMAND != (KEY_MAX + 128))
189
+ # error Something is wrong -- MAX_COMMAND is already inconsistently defined.
190
+ # endif
191
+ #else
192
+ # define MAX_COMMAND (KEY_MAX + 128)
193
+ #endif
194
+
195
+ /* --------- prototypes for libmenu functions ----------------------------- */
196
+
197
+ extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
198
+ extern MENU_EXPORT(ITEM *) current_item(const MENU *);
199
+ extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
200
+
201
+ extern MENU_EXPORT(MENU *) new_menu(ITEM **);
202
+
203
+ extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
204
+ extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
205
+
206
+ extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
207
+ extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
208
+ extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
209
+ extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
210
+
211
+ extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
212
+ extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
213
+
214
+ extern MENU_EXPORT(const char *) item_description(const ITEM *);
215
+ extern MENU_EXPORT(const char *) item_name(const ITEM *);
216
+ extern MENU_EXPORT(const char *) menu_mark(const MENU *);
217
+ extern MENU_EXPORT(const char *) menu_request_name(int);
218
+
219
+ extern MENU_EXPORT(char *) menu_pattern(const MENU *);
220
+
221
+ extern MENU_EXPORT(void *) menu_userptr(const MENU *);
222
+ extern MENU_EXPORT(void *) item_userptr(const ITEM *);
223
+
224
+ extern MENU_EXPORT(chtype) menu_back(const MENU *);
225
+ extern MENU_EXPORT(chtype) menu_fore(const MENU *);
226
+ extern MENU_EXPORT(chtype) menu_grey(const MENU *);
227
+
228
+ extern MENU_EXPORT(int) free_item(ITEM *);
229
+ extern MENU_EXPORT(int) free_menu(MENU *);
230
+ extern MENU_EXPORT(int) item_count(const MENU *);
231
+ extern MENU_EXPORT(int) item_index(const ITEM *);
232
+ extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
233
+ extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
234
+ extern MENU_EXPORT(int) menu_driver(MENU *, int);
235
+ extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
236
+ extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
237
+ extern MENU_EXPORT(int) menu_pad(const MENU *);
238
+ extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
239
+ extern MENU_EXPORT(int) post_menu(MENU *);
240
+ extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
241
+ extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
242
+ extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
243
+ extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
244
+ extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
245
+ extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
246
+ extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
247
+ extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
248
+ extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
249
+ extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
250
+ extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
251
+ extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
252
+ extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
253
+ extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
254
+ extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
255
+ extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
256
+ extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
257
+ extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
258
+ extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
259
+ extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
260
+ extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
261
+ extern MENU_EXPORT(int) set_top_row(MENU *, int);
262
+ extern MENU_EXPORT(int) top_row(const MENU *);
263
+ extern MENU_EXPORT(int) unpost_menu(MENU *);
264
+ extern MENU_EXPORT(int) menu_request_by_name(const char *);
265
+ extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
266
+ extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
267
+
268
+ extern MENU_EXPORT(bool) item_value(const ITEM *);
269
+ extern MENU_EXPORT(bool) item_visible(const ITEM *);
270
+
271
+ extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
272
+
273
+ #if NCURSES_SP_FUNCS
274
+ extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
275
+ #endif
276
+
277
+ #ifdef __cplusplus
278
+ }
279
+ #endif
280
+
281
+ #endif /* ETI_MENU */
janus/include/nc_tparm.h ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2018,2020 Thomas E. Dickey *
3
+ * Copyright 2006-2012,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: Thomas E. Dickey 2006 *
32
+ ****************************************************************************/
33
+
34
+ /* $Id: nc_tparm.h,v 1.11 2020/05/27 23:33:31 tom Exp $ */
35
+
36
+ #ifndef NC_TPARM_included
37
+ #define NC_TPARM_included 1
38
+
39
+ #include <ncurses_cfg.h>
40
+ #include <ncursesw/curses.h>
41
+
42
+ /*
43
+ * Cast parameters past the formatting-string for tparm() to match the
44
+ * assumption of the varargs code.
45
+ */
46
+ #ifndef TPARM_ARG
47
+ #ifdef NCURSES_TPARM_ARG
48
+ #define TPARM_ARG NCURSES_TPARM_ARG
49
+ #else
50
+ #define TPARM_ARG long
51
+ #endif
52
+ #endif /* TPARAM_ARG */
53
+
54
+ #define TPARM_N(n) (TPARM_ARG)(n)
55
+
56
+ #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
57
+
58
+ #if NCURSES_TPARM_VARARGS
59
+ #define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
60
+ #define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
61
+ #define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
62
+ #define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
63
+ #define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
64
+ #define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
65
+ #define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
66
+ #define TPARM_1(a,b) tparm(a,TPARM_N(b))
67
+ #define TPARM_0(a) tparm(a)
68
+ #else
69
+ #define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
70
+ #define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
71
+ #define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
72
+ #define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
73
+ #define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
74
+ #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
75
+ #define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
76
+ #define TPARM_1(a,b) TPARM_2(a,b,0)
77
+ #define TPARM_0(a) TPARM_1(a,0)
78
+ #endif
79
+
80
+ #ifdef NCURSES_INTERNALS
81
+ #define TIPARM_1(s,a) _nc_tiparm(1,s,a)
82
+ #define TIPARM_2(s,a,b) _nc_tiparm(2,s,a,b)
83
+ #define TIPARM_3(s,a,b,c) _nc_tiparm(3,s,a,b,c)
84
+ #define TIPARM_4(s,a,b,c,d) _nc_tiparm(4,s,a,b,c,d)
85
+ #define TIPARM_5(s,a,b,c,d,e) _nc_tiparm(5,s,a,b,c,d,e)
86
+ #define TIPARM_6(s,a,b,c,d,e,f) _nc_tiparm(6,s,a,b,c,d,e,f)
87
+ #define TIPARM_7(s,a,b,c,d,e,f,g) _nc_tiparm(7,s,a,b,c,d,e,f,g)
88
+ #define TIPARM_8(s,a,b,c,d,e,f,g,h) _nc_tiparm(8,s,a,b,c,d,e,f,g,h)
89
+ #define TIPARM_9(s,a,b,c,d,e,f,g,h,i) _nc_tiparm(9,s,a,b,c,d,e,f,g,h,i)
90
+ #endif
91
+
92
+ #endif /* NC_TPARM_included */
janus/include/ncurses.h ADDED
The diff for this file is too large to render. See raw diff
 
janus/include/panel.h ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2020 Thomas E. Dickey *
3
+ * Copyright 1998-2009,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> 1995 *
32
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
33
+ * and: Juergen Pfeifer 1996-1999,2008 *
34
+ ****************************************************************************/
35
+
36
+ /* $Id: panel.h,v 1.14 2020/07/04 20:38:43 tom Exp $ */
37
+
38
+ /* panel.h -- interface file for panels library */
39
+
40
+ #ifndef NCURSES_PANEL_H_incl
41
+ #define NCURSES_PANEL_H_incl 1
42
+
43
+ #include <ncursesw/curses.h>
44
+
45
+ typedef struct panel
46
+ #if !NCURSES_OPAQUE_PANEL
47
+ {
48
+ WINDOW *win;
49
+ struct panel *below;
50
+ struct panel *above;
51
+ NCURSES_CONST void *user;
52
+ }
53
+ #endif /* !NCURSES_OPAQUE_PANEL */
54
+ PANEL;
55
+
56
+ #if defined(__cplusplus)
57
+ extern "C" {
58
+ #endif
59
+
60
+ #if defined(BUILDING_PANEL)
61
+ # define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
62
+ #else
63
+ # define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
64
+ #endif
65
+
66
+ #define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
67
+
68
+ #define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API
69
+ #define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type
70
+
71
+ extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *);
72
+ extern PANEL_EXPORT(void) update_panels (void);
73
+ extern PANEL_EXPORT(int) hide_panel (PANEL *);
74
+ extern PANEL_EXPORT(int) show_panel (PANEL *);
75
+ extern PANEL_EXPORT(int) del_panel (PANEL *);
76
+ extern PANEL_EXPORT(int) top_panel (PANEL *);
77
+ extern PANEL_EXPORT(int) bottom_panel (PANEL *);
78
+ extern PANEL_EXPORT(PANEL*) new_panel (WINDOW *);
79
+ extern PANEL_EXPORT(PANEL*) panel_above (const PANEL *);
80
+ extern PANEL_EXPORT(PANEL*) panel_below (const PANEL *);
81
+ extern PANEL_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *);
82
+ extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *);
83
+ extern PANEL_EXPORT(int) move_panel (PANEL *, int, int);
84
+ extern PANEL_EXPORT(int) replace_panel (PANEL *,WINDOW *);
85
+ extern PANEL_EXPORT(int) panel_hidden (const PANEL *);
86
+
87
+ #if NCURSES_SP_FUNCS
88
+ extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *);
89
+ extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *);
90
+
91
+ extern PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*);
92
+ #endif
93
+
94
+ #if defined(__cplusplus)
95
+ }
96
+ #endif
97
+
98
+ #endif /* NCURSES_PANEL_H_incl */
99
+
100
+ /* end of panel.h */
janus/include/python3.10/bltinmodule.h ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_BLTINMODULE_H
2
+ #define Py_BLTINMODULE_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ PyAPI_DATA(PyTypeObject) PyFilter_Type;
8
+ PyAPI_DATA(PyTypeObject) PyMap_Type;
9
+ PyAPI_DATA(PyTypeObject) PyZip_Type;
10
+
11
+ #ifdef __cplusplus
12
+ }
13
+ #endif
14
+ #endif /* !Py_BLTINMODULE_H */
janus/include/python3.10/boolobject.h ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Boolean object interface */
2
+
3
+ #ifndef Py_BOOLOBJECT_H
4
+ #define Py_BOOLOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+
10
+ PyAPI_DATA(PyTypeObject) PyBool_Type;
11
+
12
+ #define PyBool_Check(x) Py_IS_TYPE(x, &PyBool_Type)
13
+
14
+ /* Py_False and Py_True are the only two bools in existence.
15
+ Don't forget to apply Py_INCREF() when returning either!!! */
16
+
17
+ /* Don't use these directly */
18
+ PyAPI_DATA(struct _longobject) _Py_FalseStruct;
19
+ PyAPI_DATA(struct _longobject) _Py_TrueStruct;
20
+
21
+ /* Use these macros */
22
+ #define Py_False ((PyObject *) &_Py_FalseStruct)
23
+ #define Py_True ((PyObject *) &_Py_TrueStruct)
24
+
25
+ // Test if an object is the True singleton, the same as "x is True" in Python.
26
+ PyAPI_FUNC(int) Py_IsTrue(PyObject *x);
27
+ #define Py_IsTrue(x) Py_Is((x), Py_True)
28
+
29
+ // Test if an object is the False singleton, the same as "x is False" in Python.
30
+ PyAPI_FUNC(int) Py_IsFalse(PyObject *x);
31
+ #define Py_IsFalse(x) Py_Is((x), Py_False)
32
+
33
+ /* Macros for returning Py_True or Py_False, respectively */
34
+ #define Py_RETURN_TRUE return Py_NewRef(Py_True)
35
+ #define Py_RETURN_FALSE return Py_NewRef(Py_False)
36
+
37
+ /* Function to return a bool from a C long */
38
+ PyAPI_FUNC(PyObject *) PyBool_FromLong(long);
39
+
40
+ #ifdef __cplusplus
41
+ }
42
+ #endif
43
+ #endif /* !Py_BOOLOBJECT_H */
janus/include/python3.10/ceval.h ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_CEVAL_H
2
+ #define Py_CEVAL_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+
8
+ /* Interface to random parts in ceval.c */
9
+
10
+ /* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
11
+ * and PyEval_CallMethod are deprecated. Since they are officially part of the
12
+ * stable ABI (PEP 384), they must be kept for backward compatibility.
13
+ * PyObject_Call(), PyObject_CallFunction() and PyObject_CallMethod() are
14
+ * recommended to call a callable object.
15
+ */
16
+
17
+ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
18
+ PyObject *callable,
19
+ PyObject *args,
20
+ PyObject *kwargs);
21
+
22
+ /* Deprecated since PyEval_CallObjectWithKeywords is deprecated */
23
+ #define PyEval_CallObject(callable, arg) \
24
+ PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
25
+
26
+ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallFunction(
27
+ PyObject *callable, const char *format, ...);
28
+ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod(
29
+ PyObject *obj, const char *name, const char *format, ...);
30
+
31
+ PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void);
32
+ PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
33
+ PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
34
+ PyAPI_FUNC(PyFrameObject *) PyEval_GetFrame(void);
35
+
36
+ PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
37
+ PyAPI_FUNC(int) Py_MakePendingCalls(void);
38
+
39
+ /* Protection against deeply nested recursive calls
40
+
41
+ In Python 3.0, this protection has two levels:
42
+ * normal anti-recursion protection is triggered when the recursion level
43
+ exceeds the current recursion limit. It raises a RecursionError, and sets
44
+ the "overflowed" flag in the thread state structure. This flag
45
+ temporarily *disables* the normal protection; this allows cleanup code
46
+ to potentially outgrow the recursion limit while processing the
47
+ RecursionError.
48
+ * "last chance" anti-recursion protection is triggered when the recursion
49
+ level exceeds "current recursion limit + 50". By construction, this
50
+ protection can only be triggered when the "overflowed" flag is set. It
51
+ means the cleanup code has itself gone into an infinite loop, or the
52
+ RecursionError has been mistakingly ignored. When this protection is
53
+ triggered, the interpreter aborts with a Fatal Error.
54
+
55
+ In addition, the "overflowed" flag is automatically reset when the
56
+ recursion level drops below "current recursion limit - 50". This heuristic
57
+ is meant to ensure that the normal anti-recursion protection doesn't get
58
+ disabled too long.
59
+
60
+ Please note: this scheme has its own limitations. See:
61
+ http://mail.python.org/pipermail/python-dev/2008-August/082106.html
62
+ for some observations.
63
+ */
64
+ PyAPI_FUNC(void) Py_SetRecursionLimit(int);
65
+ PyAPI_FUNC(int) Py_GetRecursionLimit(void);
66
+
67
+ PyAPI_FUNC(int) Py_EnterRecursiveCall(const char *where);
68
+ PyAPI_FUNC(void) Py_LeaveRecursiveCall(void);
69
+
70
+ PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
71
+ PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
72
+
73
+ PyAPI_FUNC(PyObject *) PyEval_EvalFrame(PyFrameObject *);
74
+ PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(PyFrameObject *f, int exc);
75
+
76
+ /* Interface for threads.
77
+
78
+ A module that plans to do a blocking system call (or something else
79
+ that lasts a long time and doesn't touch Python data) can allow other
80
+ threads to run as follows:
81
+
82
+ ...preparations here...
83
+ Py_BEGIN_ALLOW_THREADS
84
+ ...blocking system call here...
85
+ Py_END_ALLOW_THREADS
86
+ ...interpret result here...
87
+
88
+ The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a
89
+ {}-surrounded block.
90
+ To leave the block in the middle (e.g., with return), you must insert
91
+ a line containing Py_BLOCK_THREADS before the return, e.g.
92
+
93
+ if (...premature_exit...) {
94
+ Py_BLOCK_THREADS
95
+ PyErr_SetFromErrno(PyExc_OSError);
96
+ return NULL;
97
+ }
98
+
99
+ An alternative is:
100
+
101
+ Py_BLOCK_THREADS
102
+ if (...premature_exit...) {
103
+ PyErr_SetFromErrno(PyExc_OSError);
104
+ return NULL;
105
+ }
106
+ Py_UNBLOCK_THREADS
107
+
108
+ For convenience, that the value of 'errno' is restored across
109
+ Py_END_ALLOW_THREADS and Py_BLOCK_THREADS.
110
+
111
+ WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND
112
+ Py_END_ALLOW_THREADS!!!
113
+
114
+ Note that not yet all candidates have been converted to use this
115
+ mechanism!
116
+ */
117
+
118
+ PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void);
119
+ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
120
+
121
+ Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
122
+ Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
123
+ /* PyEval_AcquireLock() and PyEval_ReleaseLock() are part of stable ABI.
124
+ * They will be removed from this header file in the future version.
125
+ * But they will be remained in ABI until Python 4.0.
126
+ */
127
+ Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void);
128
+ Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_ReleaseLock(void);
129
+ PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
130
+ PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
131
+
132
+ #define Py_BEGIN_ALLOW_THREADS { \
133
+ PyThreadState *_save; \
134
+ _save = PyEval_SaveThread();
135
+ #define Py_BLOCK_THREADS PyEval_RestoreThread(_save);
136
+ #define Py_UNBLOCK_THREADS _save = PyEval_SaveThread();
137
+ #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \
138
+ }
139
+
140
+ /* Masks and values used by FORMAT_VALUE opcode. */
141
+ #define FVC_MASK 0x3
142
+ #define FVC_NONE 0x0
143
+ #define FVC_STR 0x1
144
+ #define FVC_REPR 0x2
145
+ #define FVC_ASCII 0x3
146
+ #define FVS_MASK 0x4
147
+ #define FVS_HAVE_SPEC 0x4
148
+
149
+ #ifndef Py_LIMITED_API
150
+ # define Py_CPYTHON_CEVAL_H
151
+ # include "cpython/ceval.h"
152
+ # undef Py_CPYTHON_CEVAL_H
153
+ #endif
154
+
155
+ #ifdef __cplusplus
156
+ }
157
+ #endif
158
+ #endif /* !Py_CEVAL_H */
janus/include/python3.10/complexobject.h ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Complex number structure */
2
+
3
+ #ifndef Py_COMPLEXOBJECT_H
4
+ #define Py_COMPLEXOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ #ifndef Py_LIMITED_API
10
+ typedef struct {
11
+ double real;
12
+ double imag;
13
+ } Py_complex;
14
+
15
+ /* Operations on complex numbers from complexmodule.c */
16
+
17
+ PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
18
+ PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
19
+ PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
20
+ PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
21
+ PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
22
+ PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
23
+ PyAPI_FUNC(double) _Py_c_abs(Py_complex);
24
+ #endif
25
+
26
+ /* Complex object interface */
27
+
28
+ /*
29
+ PyComplexObject represents a complex number with double-precision
30
+ real and imaginary parts.
31
+ */
32
+ #ifndef Py_LIMITED_API
33
+ typedef struct {
34
+ PyObject_HEAD
35
+ Py_complex cval;
36
+ } PyComplexObject;
37
+ #endif
38
+
39
+ PyAPI_DATA(PyTypeObject) PyComplex_Type;
40
+
41
+ #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
42
+ #define PyComplex_CheckExact(op) Py_IS_TYPE(op, &PyComplex_Type)
43
+
44
+ #ifndef Py_LIMITED_API
45
+ PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
46
+ #endif
47
+ PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
48
+
49
+ PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
50
+ PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
51
+ #ifndef Py_LIMITED_API
52
+ PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
53
+ #endif
54
+
55
+ /* Format the object based on the format_spec, as defined in PEP 3101
56
+ (Advanced String Formatting). */
57
+ #ifndef Py_LIMITED_API
58
+ PyAPI_FUNC(int) _PyComplex_FormatAdvancedWriter(
59
+ _PyUnicodeWriter *writer,
60
+ PyObject *obj,
61
+ PyObject *format_spec,
62
+ Py_ssize_t start,
63
+ Py_ssize_t end);
64
+ #endif
65
+
66
+ #ifdef __cplusplus
67
+ }
68
+ #endif
69
+ #endif /* !Py_COMPLEXOBJECT_H */
janus/include/python3.10/enumobject.h ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_ENUMOBJECT_H
2
+ #define Py_ENUMOBJECT_H
3
+
4
+ /* Enumerate Object */
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ PyAPI_DATA(PyTypeObject) PyEnum_Type;
11
+ PyAPI_DATA(PyTypeObject) PyReversed_Type;
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
17
+ #endif /* !Py_ENUMOBJECT_H */
janus/include/python3.10/floatobject.h ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Float object interface */
3
+
4
+ /*
5
+ PyFloatObject represents a (double precision) floating point number.
6
+ */
7
+
8
+ #ifndef Py_FLOATOBJECT_H
9
+ #define Py_FLOATOBJECT_H
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ #ifndef Py_LIMITED_API
15
+ typedef struct {
16
+ PyObject_HEAD
17
+ double ob_fval;
18
+ } PyFloatObject;
19
+ #endif
20
+
21
+ PyAPI_DATA(PyTypeObject) PyFloat_Type;
22
+
23
+ #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
24
+ #define PyFloat_CheckExact(op) Py_IS_TYPE(op, &PyFloat_Type)
25
+
26
+ #ifdef Py_NAN
27
+ #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
28
+ #endif
29
+
30
+ #define Py_RETURN_INF(sign) do \
31
+ if (copysign(1., sign) == 1.) { \
32
+ return PyFloat_FromDouble(Py_HUGE_VAL); \
33
+ } else { \
34
+ return PyFloat_FromDouble(-Py_HUGE_VAL); \
35
+ } while(0)
36
+
37
+ PyAPI_FUNC(double) PyFloat_GetMax(void);
38
+ PyAPI_FUNC(double) PyFloat_GetMin(void);
39
+ PyAPI_FUNC(PyObject *) PyFloat_GetInfo(void);
40
+
41
+ /* Return Python float from string PyObject. */
42
+ PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*);
43
+
44
+ /* Return Python float from C double. */
45
+ PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
46
+
47
+ /* Extract C double from Python float. The macro version trades safety for
48
+ speed. */
49
+ PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
50
+ #ifndef Py_LIMITED_API
51
+ #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
52
+ #endif
53
+
54
+ #ifndef Py_LIMITED_API
55
+ /* _PyFloat_{Pack,Unpack}{4,8}
56
+ *
57
+ * The struct and pickle (at least) modules need an efficient platform-
58
+ * independent way to store floating-point values as byte strings.
59
+ * The Pack routines produce a string from a C double, and the Unpack
60
+ * routines produce a C double from such a string. The suffix (4 or 8)
61
+ * specifies the number of bytes in the string.
62
+ *
63
+ * On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats
64
+ * these functions work by copying bits. On other platforms, the formats the
65
+ * 4- byte format is identical to the IEEE-754 single precision format, and
66
+ * the 8-byte format to the IEEE-754 double precision format, although the
67
+ * packing of INFs and NaNs (if such things exist on the platform) isn't
68
+ * handled correctly, and attempting to unpack a string containing an IEEE
69
+ * INF or NaN will raise an exception.
70
+ *
71
+ * On non-IEEE platforms with more precision, or larger dynamic range, than
72
+ * 754 supports, not all values can be packed; on non-IEEE platforms with less
73
+ * precision, or smaller dynamic range, not all values can be unpacked. What
74
+ * happens in such cases is partly accidental (alas).
75
+ */
76
+
77
+ /* The pack routines write 2, 4 or 8 bytes, starting at p. le is a bool
78
+ * argument, true if you want the string in little-endian format (exponent
79
+ * last, at p+1, p+3 or p+7), false if you want big-endian format (exponent
80
+ * first, at p).
81
+ * Return value: 0 if all is OK, -1 if error (and an exception is
82
+ * set, most likely OverflowError).
83
+ * There are two problems on non-IEEE platforms:
84
+ * 1): What this does is undefined if x is a NaN or infinity.
85
+ * 2): -0.0 and +0.0 produce the same string.
86
+ */
87
+ PyAPI_FUNC(int) _PyFloat_Pack2(double x, unsigned char *p, int le);
88
+ PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le);
89
+ PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le);
90
+
91
+ /* The unpack routines read 2, 4 or 8 bytes, starting at p. le is a bool
92
+ * argument, true if the string is in little-endian format (exponent
93
+ * last, at p+1, p+3 or p+7), false if big-endian (exponent first, at p).
94
+ * Return value: The unpacked double. On error, this is -1.0 and
95
+ * PyErr_Occurred() is true (and an exception is set, most likely
96
+ * OverflowError). Note that on a non-IEEE platform this will refuse
97
+ * to unpack a string that represents a NaN or infinity.
98
+ */
99
+ PyAPI_FUNC(double) _PyFloat_Unpack2(const unsigned char *p, int le);
100
+ PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le);
101
+ PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le);
102
+
103
+ PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out);
104
+
105
+ /* Format the object based on the format_spec, as defined in PEP 3101
106
+ (Advanced String Formatting). */
107
+ PyAPI_FUNC(int) _PyFloat_FormatAdvancedWriter(
108
+ _PyUnicodeWriter *writer,
109
+ PyObject *obj,
110
+ PyObject *format_spec,
111
+ Py_ssize_t start,
112
+ Py_ssize_t end);
113
+ #endif /* Py_LIMITED_API */
114
+
115
+ #ifdef __cplusplus
116
+ }
117
+ #endif
118
+ #endif /* !Py_FLOATOBJECT_H */
janus/include/python3.10/frameobject.h ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Frame object interface */
2
+
3
+ #ifndef Py_FRAMEOBJECT_H
4
+ #define Py_FRAMEOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ #include "pyframe.h"
10
+
11
+ #ifndef Py_LIMITED_API
12
+ # define Py_CPYTHON_FRAMEOBJECT_H
13
+ # include "cpython/frameobject.h"
14
+ # undef Py_CPYTHON_FRAMEOBJECT_H
15
+ #endif
16
+
17
+ #ifdef __cplusplus
18
+ }
19
+ #endif
20
+ #endif /* !Py_FRAMEOBJECT_H */
janus/include/python3.10/interpreteridobject.h ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_INTERPRETERIDOBJECT_H
2
+ #define Py_INTERPRETERIDOBJECT_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #ifndef Py_LIMITED_API
9
+ # define Py_CPYTHON_INTERPRETERIDOBJECT_H
10
+ # include "cpython/interpreteridobject.h"
11
+ # undef Py_CPYTHON_INTERPRETERIDOBJECT_H
12
+ #endif
13
+
14
+ #ifdef __cplusplus
15
+ }
16
+ #endif
17
+ #endif /* !Py_INTERPRETERIDOBJECT_H */
janus/include/python3.10/intrcheck.h ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_INTRCHECK_H
2
+ #define Py_INTRCHECK_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
8
+ #ifdef HAVE_FORK
9
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
10
+ PyAPI_FUNC(void) PyOS_BeforeFork(void);
11
+ PyAPI_FUNC(void) PyOS_AfterFork_Parent(void);
12
+ PyAPI_FUNC(void) PyOS_AfterFork_Child(void);
13
+ #endif
14
+ #endif
15
+ /* Deprecated, please use PyOS_AfterFork_Child() instead */
16
+ Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void);
17
+
18
+ #ifndef Py_LIMITED_API
19
+ PyAPI_FUNC(int) _PyOS_IsMainThread(void);
20
+
21
+ #ifdef MS_WINDOWS
22
+ /* windows.h is not included by Python.h so use void* instead of HANDLE */
23
+ PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
24
+ #endif
25
+ #endif /* !Py_LIMITED_API */
26
+
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif
30
+ #endif /* !Py_INTRCHECK_H */
janus/include/python3.10/longintrepr.h ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_LIMITED_API
2
+ #ifndef Py_LONGINTREPR_H
3
+ #define Py_LONGINTREPR_H
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+
9
+ /* This is published for the benefit of "friends" marshal.c and _decimal.c. */
10
+
11
+ /* Parameters of the integer representation. There are two different
12
+ sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
13
+ integer type, and one set for 15-bit digits with each digit stored in an
14
+ unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
15
+ configure time or in pyport.h, is used to decide which digit size to use.
16
+
17
+ Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits'
18
+ should be an unsigned integer type able to hold all integers up to
19
+ PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type,
20
+ and that overflow is handled by taking the result modulo 2**N for some N >
21
+ PyLong_SHIFT. The majority of the code doesn't care about the precise
22
+ value of PyLong_SHIFT, but there are some notable exceptions:
23
+
24
+ - long_pow() requires that PyLong_SHIFT be divisible by 5
25
+
26
+ - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8
27
+
28
+ - long_hash() requires that PyLong_SHIFT is *strictly* less than the number
29
+ of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
30
+ conversion functions
31
+
32
+ - the Python int <-> size_t/Py_ssize_t conversion functions expect that
33
+ PyLong_SHIFT is strictly less than the number of bits in a size_t
34
+
35
+ - the marshal code currently expects that PyLong_SHIFT is a multiple of 15
36
+
37
+ - NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single
38
+ digit; with the current values this forces PyLong_SHIFT >= 9
39
+
40
+ The values 15 and 30 should fit all of the above requirements, on any
41
+ platform.
42
+ */
43
+
44
+ #if PYLONG_BITS_IN_DIGIT == 30
45
+ typedef uint32_t digit;
46
+ typedef int32_t sdigit; /* signed variant of digit */
47
+ typedef uint64_t twodigits;
48
+ typedef int64_t stwodigits; /* signed variant of twodigits */
49
+ #define PyLong_SHIFT 30
50
+ #define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
51
+ #define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
52
+ #elif PYLONG_BITS_IN_DIGIT == 15
53
+ typedef unsigned short digit;
54
+ typedef short sdigit; /* signed variant of digit */
55
+ typedef unsigned long twodigits;
56
+ typedef long stwodigits; /* signed variant of twodigits */
57
+ #define PyLong_SHIFT 15
58
+ #define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */
59
+ #define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */
60
+ #else
61
+ #error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
62
+ #endif
63
+ #define PyLong_BASE ((digit)1 << PyLong_SHIFT)
64
+ #define PyLong_MASK ((digit)(PyLong_BASE - 1))
65
+
66
+ #if PyLong_SHIFT % 5 != 0
67
+ #error "longobject.c requires that PyLong_SHIFT be divisible by 5"
68
+ #endif
69
+
70
+ /* Long integer representation.
71
+ The absolute value of a number is equal to
72
+ SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
73
+ Negative numbers are represented with ob_size < 0;
74
+ zero is represented by ob_size == 0.
75
+ In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
76
+ digit) is never zero. Also, in all cases, for all valid i,
77
+ 0 <= ob_digit[i] <= MASK.
78
+ The allocation function takes care of allocating extra memory
79
+ so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
80
+
81
+ CAUTION: Generic code manipulating subtypes of PyVarObject has to
82
+ aware that ints abuse ob_size's sign bit.
83
+ */
84
+
85
+ struct _longobject {
86
+ PyObject_VAR_HEAD
87
+ digit ob_digit[1];
88
+ };
89
+
90
+ PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
91
+
92
+ /* Return a copy of src. */
93
+ PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
94
+
95
+ #ifdef __cplusplus
96
+ }
97
+ #endif
98
+ #endif /* !Py_LONGINTREPR_H */
99
+ #endif /* Py_LIMITED_API */
janus/include/python3.10/longobject.h ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_LONGOBJECT_H
2
+ #define Py_LONGOBJECT_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+
8
+ /* Long (arbitrary precision) integer object interface */
9
+
10
+ typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
11
+
12
+ PyAPI_DATA(PyTypeObject) PyLong_Type;
13
+
14
+ #define PyLong_Check(op) \
15
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
16
+ #define PyLong_CheckExact(op) Py_IS_TYPE(op, &PyLong_Type)
17
+
18
+ PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
19
+ PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
20
+ PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t);
21
+ PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t);
22
+ PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
23
+ PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
24
+ PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *);
25
+ PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
26
+ PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
27
+ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
28
+ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
29
+ #ifndef Py_LIMITED_API
30
+ PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
31
+ #endif
32
+ PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
33
+
34
+ /* It may be useful in the future. I've added it in the PyInt -> PyLong
35
+ cleanup to keep the extra information. [CH] */
36
+ #define PyLong_AS_LONG(op) PyLong_AsLong(op)
37
+
38
+ /* Issue #1983: pid_t can be longer than a C long on some systems */
39
+ #if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
40
+ #define _Py_PARSE_PID "i"
41
+ #define PyLong_FromPid PyLong_FromLong
42
+ #define PyLong_AsPid PyLong_AsLong
43
+ #elif SIZEOF_PID_T == SIZEOF_LONG
44
+ #define _Py_PARSE_PID "l"
45
+ #define PyLong_FromPid PyLong_FromLong
46
+ #define PyLong_AsPid PyLong_AsLong
47
+ #elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG
48
+ #define _Py_PARSE_PID "L"
49
+ #define PyLong_FromPid PyLong_FromLongLong
50
+ #define PyLong_AsPid PyLong_AsLongLong
51
+ #else
52
+ #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
53
+ #endif /* SIZEOF_PID_T */
54
+
55
+ #if SIZEOF_VOID_P == SIZEOF_INT
56
+ # define _Py_PARSE_INTPTR "i"
57
+ # define _Py_PARSE_UINTPTR "I"
58
+ #elif SIZEOF_VOID_P == SIZEOF_LONG
59
+ # define _Py_PARSE_INTPTR "l"
60
+ # define _Py_PARSE_UINTPTR "k"
61
+ #elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
62
+ # define _Py_PARSE_INTPTR "L"
63
+ # define _Py_PARSE_UINTPTR "K"
64
+ #else
65
+ # error "void* different in size from int, long and long long"
66
+ #endif /* SIZEOF_VOID_P */
67
+
68
+ #ifndef Py_LIMITED_API
69
+ PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
70
+ PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
71
+ PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
72
+ PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
73
+ PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
74
+ #endif
75
+
76
+ /* Used by Python/mystrtoul.c, _PyBytes_FromHex(),
77
+ _PyBytes_DecodeEscape(), etc. */
78
+ #ifndef Py_LIMITED_API
79
+ PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
80
+ #endif
81
+
82
+ /* _PyLong_Frexp returns a double x and an exponent e such that the
83
+ true value is approximately equal to x * 2**e. e is >= 0. x is
84
+ 0.0 if and only if the input is 0 (in which case, e and x are both
85
+ zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
86
+ possible if the number of bits doesn't fit into a Py_ssize_t, sets
87
+ OverflowError and returns -1.0 for x, 0 for e. */
88
+ #ifndef Py_LIMITED_API
89
+ PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
90
+ #endif
91
+
92
+ PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
93
+ PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
94
+ PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
95
+
96
+ PyAPI_FUNC(PyObject *) PyLong_FromLongLong(long long);
97
+ PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned long long);
98
+ PyAPI_FUNC(long long) PyLong_AsLongLong(PyObject *);
99
+ PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLong(PyObject *);
100
+ PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLongMask(PyObject *);
101
+ PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *);
102
+
103
+ PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
104
+ #ifndef Py_LIMITED_API
105
+ PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
106
+ PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
107
+ #endif
108
+
109
+ #ifndef Py_LIMITED_API
110
+ /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
111
+ v must not be NULL, and must be a normalized long.
112
+ There are no error cases.
113
+ */
114
+ PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
115
+
116
+
117
+ /* _PyLong_NumBits. Return the number of bits needed to represent the
118
+ absolute value of a long. For example, this returns 1 for 1 and -1, 2
119
+ for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
120
+ v must not be NULL, and must be a normalized long.
121
+ (size_t)-1 is returned and OverflowError set if the true result doesn't
122
+ fit in a size_t.
123
+ */
124
+ PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
125
+
126
+ /* _PyLong_DivmodNear. Given integers a and b, compute the nearest
127
+ integer q to the exact quotient a / b, rounding to the nearest even integer
128
+ in the case of a tie. Return (q, r), where r = a - q*b. The remainder r
129
+ will satisfy abs(r) <= abs(b)/2, with equality possible only if q is
130
+ even.
131
+ */
132
+ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
133
+
134
+ /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
135
+ base 256, and return a Python int with the same numeric value.
136
+ If n is 0, the integer is 0. Else:
137
+ If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
138
+ else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
139
+ LSB.
140
+ If is_signed is 0/false, view the bytes as a non-negative integer.
141
+ If is_signed is 1/true, view the bytes as a 2's-complement integer,
142
+ non-negative if bit 0x80 of the MSB is clear, negative if set.
143
+ Error returns:
144
+ + Return NULL with the appropriate exception set if there's not
145
+ enough memory to create the Python int.
146
+ */
147
+ PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
148
+ const unsigned char* bytes, size_t n,
149
+ int little_endian, int is_signed);
150
+
151
+ /* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
152
+ v to a base-256 integer, stored in array bytes. Normally return 0,
153
+ return -1 on error.
154
+ If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
155
+ bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
156
+ the LSB at bytes[n-1].
157
+ If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
158
+ are filled and there's nothing special about bit 0x80 of the MSB.
159
+ If is_signed is 1/true, bytes is filled with the 2's-complement
160
+ representation of v's value. Bit 0x80 of the MSB is the sign bit.
161
+ Error returns (-1):
162
+ + is_signed is 0 and v < 0. TypeError is set in this case, and bytes
163
+ isn't altered.
164
+ + n isn't big enough to hold the full mathematical value of v. For
165
+ example, if is_signed is 0 and there are more digits in the v than
166
+ fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
167
+ being large enough to hold a sign bit. OverflowError is set in this
168
+ case, but bytes holds the least-significant n bytes of the true value.
169
+ */
170
+ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
171
+ unsigned char* bytes, size_t n,
172
+ int little_endian, int is_signed);
173
+
174
+ /* _PyLong_Format: Convert the long to a string object with given base,
175
+ appending a base prefix of 0[box] if base is 2, 8 or 16. */
176
+ PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base);
177
+
178
+ PyAPI_FUNC(int) _PyLong_FormatWriter(
179
+ _PyUnicodeWriter *writer,
180
+ PyObject *obj,
181
+ int base,
182
+ int alternate);
183
+
184
+ PyAPI_FUNC(char*) _PyLong_FormatBytesWriter(
185
+ _PyBytesWriter *writer,
186
+ char *str,
187
+ PyObject *obj,
188
+ int base,
189
+ int alternate);
190
+
191
+ /* Format the object based on the format_spec, as defined in PEP 3101
192
+ (Advanced String Formatting). */
193
+ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
194
+ _PyUnicodeWriter *writer,
195
+ PyObject *obj,
196
+ PyObject *format_spec,
197
+ Py_ssize_t start,
198
+ Py_ssize_t end);
199
+ #endif /* Py_LIMITED_API */
200
+
201
+ /* These aren't really part of the int object, but they're handy. The
202
+ functions are in Python/mystrtoul.c.
203
+ */
204
+ PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int);
205
+ PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
206
+
207
+ #ifndef Py_LIMITED_API
208
+ /* For use by the gcd function in mathmodule.c */
209
+ PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
210
+ #endif /* !Py_LIMITED_API */
211
+
212
+ #ifndef Py_LIMITED_API
213
+ PyAPI_FUNC(PyObject *) _PyLong_Rshift(PyObject *, size_t);
214
+ PyAPI_FUNC(PyObject *) _PyLong_Lshift(PyObject *, size_t);
215
+ #endif
216
+
217
+ #ifdef __cplusplus
218
+ }
219
+ #endif
220
+ #endif /* !Py_LONGOBJECT_H */
janus/include/python3.10/methodobject.h ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Method object interface */
3
+
4
+ #ifndef Py_METHODOBJECT_H
5
+ #define Py_METHODOBJECT_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ /* This is about the type 'builtin_function_or_method',
11
+ not Python methods in user-defined classes. See classobject.h
12
+ for the latter. */
13
+
14
+ PyAPI_DATA(PyTypeObject) PyCFunction_Type;
15
+
16
+ #define PyCFunction_CheckExact(op) Py_IS_TYPE(op, &PyCFunction_Type)
17
+ #define PyCFunction_Check(op) PyObject_TypeCheck(op, &PyCFunction_Type)
18
+
19
+ typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
20
+ typedef PyObject *(*_PyCFunctionFast) (PyObject *, PyObject *const *, Py_ssize_t);
21
+ typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
22
+ PyObject *);
23
+ typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
24
+ PyObject *const *, Py_ssize_t,
25
+ PyObject *);
26
+ typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *,
27
+ size_t, PyObject *);
28
+
29
+ PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);
30
+ PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
31
+ PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
32
+
33
+ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
34
+
35
+ struct PyMethodDef {
36
+ const char *ml_name; /* The name of the built-in function/method */
37
+ PyCFunction ml_meth; /* The C function that implements it */
38
+ int ml_flags; /* Combination of METH_xxx flags, which mostly
39
+ describe the args expected by the C func */
40
+ const char *ml_doc; /* The __doc__ attribute, or NULL */
41
+ };
42
+ typedef struct PyMethodDef PyMethodDef;
43
+
44
+ /* PyCFunction_New is declared as a function for stable ABI (declaration is
45
+ * needed for e.g. GCC with -fvisibility=hidden), but redefined as a macro
46
+ * that calls PyCFunction_NewEx. */
47
+ PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
48
+ #define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)
49
+
50
+ /* PyCFunction_NewEx is similar: on 3.9+, this calls PyCMethod_New. */
51
+ PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
52
+ PyObject *);
53
+
54
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
55
+ #define PyCFunction_NewEx(ML, SELF, MOD) PyCMethod_New((ML), (SELF), (MOD), NULL)
56
+ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
57
+ PyObject *, PyTypeObject *);
58
+ #endif
59
+
60
+
61
+ /* Flag passed to newmethodobject */
62
+ /* #define METH_OLDARGS 0x0000 -- unsupported now */
63
+ #define METH_VARARGS 0x0001
64
+ #define METH_KEYWORDS 0x0002
65
+ /* METH_NOARGS and METH_O must not be combined with the flags above. */
66
+ #define METH_NOARGS 0x0004
67
+ #define METH_O 0x0008
68
+
69
+ /* METH_CLASS and METH_STATIC are a little different; these control
70
+ the construction of methods for a class. These cannot be used for
71
+ functions in modules. */
72
+ #define METH_CLASS 0x0010
73
+ #define METH_STATIC 0x0020
74
+
75
+ /* METH_COEXIST allows a method to be entered even though a slot has
76
+ already filled the entry. When defined, the flag allows a separate
77
+ method, "__contains__" for example, to coexist with a defined
78
+ slot like sq_contains. */
79
+
80
+ #define METH_COEXIST 0x0040
81
+
82
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
83
+ # define METH_FASTCALL 0x0080
84
+ #endif
85
+
86
+ /* This bit is preserved for Stackless Python */
87
+ #ifdef STACKLESS
88
+ # define METH_STACKLESS 0x0100
89
+ #else
90
+ # define METH_STACKLESS 0x0000
91
+ #endif
92
+
93
+ /* METH_METHOD means the function stores an
94
+ * additional reference to the class that defines it;
95
+ * both self and class are passed to it.
96
+ * It uses PyCMethodObject instead of PyCFunctionObject.
97
+ * May not be combined with METH_NOARGS, METH_O, METH_CLASS or METH_STATIC.
98
+ */
99
+
100
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
101
+ #define METH_METHOD 0x0200
102
+ #endif
103
+
104
+
105
+ #ifndef Py_LIMITED_API
106
+
107
+ #define Py_CPYTHON_METHODOBJECT_H
108
+ #include "cpython/methodobject.h"
109
+ #undef Py_CPYTHON_METHODOBJECT_H
110
+
111
+ #endif
112
+
113
+ #ifdef __cplusplus
114
+ }
115
+ #endif
116
+ #endif /* !Py_METHODOBJECT_H */
janus/include/python3.10/namespaceobject.h ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* simple namespace object interface */
3
+
4
+ #ifndef NAMESPACEOBJECT_H
5
+ #define NAMESPACEOBJECT_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ #ifndef Py_LIMITED_API
11
+ PyAPI_DATA(PyTypeObject) _PyNamespace_Type;
12
+
13
+ PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds);
14
+ #endif /* !Py_LIMITED_API */
15
+
16
+ #ifdef __cplusplus
17
+ }
18
+ #endif
19
+ #endif /* !NAMESPACEOBJECT_H */
janus/include/python3.10/objimpl.h ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* The PyObject_ memory family: high-level object memory interfaces.
2
+ See pymem.h for the low-level PyMem_ family.
3
+ */
4
+
5
+ #ifndef Py_OBJIMPL_H
6
+ #define Py_OBJIMPL_H
7
+
8
+ #include "pymem.h"
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /* BEWARE:
15
+
16
+ Each interface exports both functions and macros. Extension modules should
17
+ use the functions, to ensure binary compatibility across Python versions.
18
+ Because the Python implementation is free to change internal details, and
19
+ the macros may (or may not) expose details for speed, if you do use the
20
+ macros you must recompile your extensions with each Python release.
21
+
22
+ Never mix calls to PyObject_ memory functions with calls to the platform
23
+ malloc/realloc/ calloc/free, or with calls to PyMem_.
24
+ */
25
+
26
+ /*
27
+ Functions and macros for modules that implement new object types.
28
+
29
+ - PyObject_New(type, typeobj) allocates memory for a new object of the given
30
+ type, and initializes part of it. 'type' must be the C structure type used
31
+ to represent the object, and 'typeobj' the address of the corresponding
32
+ type object. Reference count and type pointer are filled in; the rest of
33
+ the bytes of the object are *undefined*! The resulting expression type is
34
+ 'type *'. The size of the object is determined by the tp_basicsize field
35
+ of the type object.
36
+
37
+ - PyObject_NewVar(type, typeobj, n) is similar but allocates a variable-size
38
+ object with room for n items. In addition to the refcount and type pointer
39
+ fields, this also fills in the ob_size field.
40
+
41
+ - PyObject_Free(op) releases the memory allocated for an object. It does not
42
+ run a destructor -- it only frees the memory. PyObject_Free is identical.
43
+
44
+ - PyObject_Init(op, typeobj) and PyObject_InitVar(op, typeobj, n) don't
45
+ allocate memory. Instead of a 'type' parameter, they take a pointer to a
46
+ new object (allocated by an arbitrary allocator), and initialize its object
47
+ header fields.
48
+
49
+ Note that objects created with PyObject_{New, NewVar} are allocated using the
50
+ specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is
51
+ enabled. In addition, a special debugging allocator is used if Py_DEBUG
52
+ macro is also defined.
53
+
54
+ In case a specific form of memory management is needed (for example, if you
55
+ must use the platform malloc heap(s), or shared memory, or C++ local storage or
56
+ operator new), you must first allocate the object with your custom allocator,
57
+ then pass its pointer to PyObject_{Init, InitVar} for filling in its Python-
58
+ specific fields: reference count, type pointer, possibly others. You should
59
+ be aware that Python has no control over these objects because they don't
60
+ cooperate with the Python memory manager. Such objects may not be eligible
61
+ for automatic garbage collection and you have to make sure that they are
62
+ released accordingly whenever their destructor gets called (cf. the specific
63
+ form of memory management you're using).
64
+
65
+ Unless you have specific memory management requirements, use
66
+ PyObject_{New, NewVar, Del}.
67
+ */
68
+
69
+ /*
70
+ * Raw object memory interface
71
+ * ===========================
72
+ */
73
+
74
+ /* Functions to call the same malloc/realloc/free as used by Python's
75
+ object allocator. If WITH_PYMALLOC is enabled, these may differ from
76
+ the platform malloc/realloc/free. The Python object allocator is
77
+ designed for fast, cache-conscious allocation of many "small" objects,
78
+ and with low hidden memory overhead.
79
+
80
+ PyObject_Malloc(0) returns a unique non-NULL pointer if possible.
81
+
82
+ PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n).
83
+ PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory
84
+ at p.
85
+
86
+ Returned pointers must be checked for NULL explicitly; no action is
87
+ performed on failure other than to return NULL (no warning it printed, no
88
+ exception is set, etc).
89
+
90
+ For allocating objects, use PyObject_{New, NewVar} instead whenever
91
+ possible. The PyObject_{Malloc, Realloc, Free} family is exposed
92
+ so that you can exploit Python's small-block allocator for non-object
93
+ uses. If you must use these routines to allocate object memory, make sure
94
+ the object gets initialized via PyObject_{Init, InitVar} after obtaining
95
+ the raw memory.
96
+ */
97
+ PyAPI_FUNC(void *) PyObject_Malloc(size_t size);
98
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
99
+ PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize);
100
+ #endif
101
+ PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size);
102
+ PyAPI_FUNC(void) PyObject_Free(void *ptr);
103
+
104
+
105
+ // Deprecated aliases only kept for backward compatibility.
106
+ // PyObject_Del and PyObject_DEL are defined with no parameter to be able to
107
+ // use them as function pointers (ex: tp_free = PyObject_Del).
108
+ #define PyObject_MALLOC PyObject_Malloc
109
+ #define PyObject_REALLOC PyObject_Realloc
110
+ #define PyObject_FREE PyObject_Free
111
+ #define PyObject_Del PyObject_Free
112
+ #define PyObject_DEL PyObject_Free
113
+
114
+
115
+ /*
116
+ * Generic object allocator interface
117
+ * ==================================
118
+ */
119
+
120
+ /* Functions */
121
+ PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
122
+ PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *,
123
+ PyTypeObject *, Py_ssize_t);
124
+
125
+ #define PyObject_INIT(op, typeobj) \
126
+ PyObject_Init(_PyObject_CAST(op), (typeobj))
127
+ #define PyObject_INIT_VAR(op, typeobj, size) \
128
+ PyObject_InitVar(_PyVarObject_CAST(op), (typeobj), (size))
129
+
130
+
131
+ PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *);
132
+ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
133
+
134
+ #define PyObject_New(type, typeobj) ((type *)_PyObject_New(typeobj))
135
+
136
+ // Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly
137
+ // PyObject_MALLOC() with _PyObject_SIZE().
138
+ #define PyObject_NEW(type, typeobj) PyObject_New(type, typeobj)
139
+
140
+ #define PyObject_NewVar(type, typeobj, n) \
141
+ ( (type *) _PyObject_NewVar((typeobj), (n)) )
142
+
143
+ // Alias to PyObject_NewVar(). In Python 3.8, PyObject_NEW_VAR() called
144
+ // directly PyObject_MALLOC() with _PyObject_VAR_SIZE().
145
+ #define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, typeobj, n)
146
+
147
+
148
+ /*
149
+ * Garbage Collection Support
150
+ * ==========================
151
+ */
152
+
153
+ /* C equivalent of gc.collect(). */
154
+ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void);
155
+ /* C API for controlling the state of the garbage collector */
156
+ PyAPI_FUNC(int) PyGC_Enable(void);
157
+ PyAPI_FUNC(int) PyGC_Disable(void);
158
+ PyAPI_FUNC(int) PyGC_IsEnabled(void);
159
+
160
+ /* Test if a type has a GC head */
161
+ #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
162
+
163
+ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
164
+ #define PyObject_GC_Resize(type, op, n) \
165
+ ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) )
166
+
167
+
168
+
169
+ PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
170
+ PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t);
171
+
172
+ /* Tell the GC to track this object.
173
+ *
174
+ * See also private _PyObject_GC_TRACK() macro. */
175
+ PyAPI_FUNC(void) PyObject_GC_Track(void *);
176
+
177
+ /* Tell the GC to stop tracking this object.
178
+ *
179
+ * See also private _PyObject_GC_UNTRACK() macro. */
180
+ PyAPI_FUNC(void) PyObject_GC_UnTrack(void *);
181
+
182
+ PyAPI_FUNC(void) PyObject_GC_Del(void *);
183
+
184
+ #define PyObject_GC_New(type, typeobj) \
185
+ ( (type *) _PyObject_GC_New(typeobj) )
186
+ #define PyObject_GC_NewVar(type, typeobj, n) \
187
+ ( (type *) _PyObject_GC_NewVar((typeobj), (n)) )
188
+
189
+ PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *);
190
+ PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *);
191
+
192
+ /* Utility macro to help write tp_traverse functions.
193
+ * To use this macro, the tp_traverse function must name its arguments
194
+ * "visit" and "arg". This is intended to keep tp_traverse functions
195
+ * looking as much alike as possible.
196
+ */
197
+ #define Py_VISIT(op) \
198
+ do { \
199
+ if (op) { \
200
+ int vret = visit(_PyObject_CAST(op), arg); \
201
+ if (vret) \
202
+ return vret; \
203
+ } \
204
+ } while (0)
205
+
206
+ #ifndef Py_LIMITED_API
207
+ # define Py_CPYTHON_OBJIMPL_H
208
+ # include "cpython/objimpl.h"
209
+ # undef Py_CPYTHON_OBJIMPL_H
210
+ #endif
211
+
212
+ #ifdef __cplusplus
213
+ }
214
+ #endif
215
+ #endif /* !Py_OBJIMPL_H */
janus/include/python3.10/pyconfig.h ADDED
@@ -0,0 +1,1703 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* pyconfig.h. Generated from pyconfig.h.in by configure. */
2
+ /* pyconfig.h.in. Generated from configure.ac by autoheader. */
3
+
4
+
5
+ #ifndef Py_PYCONFIG_H
6
+ #define Py_PYCONFIG_H
7
+
8
+
9
+ /* Define if building universal (internal helper macro) */
10
+ /* #undef AC_APPLE_UNIVERSAL_BUILD */
11
+
12
+ /* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
13
+ build system. */
14
+ /* #undef AIX_BUILDDATE */
15
+
16
+ /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
17
+ support for AIX C++ shared extension modules. */
18
+ /* #undef AIX_GENUINE_CPLUSPLUS */
19
+
20
+ /* The normal alignment of `long', in bytes. */
21
+ #define ALIGNOF_LONG 8
22
+
23
+ /* The normal alignment of `size_t', in bytes. */
24
+ #define ALIGNOF_SIZE_T 8
25
+
26
+ /* Alternative SOABI used in debug build to load C extensions built in release
27
+ mode */
28
+ /* #undef ALT_SOABI */
29
+
30
+ /* The Android API level. */
31
+ /* #undef ANDROID_API_LEVEL */
32
+
33
+ /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
34
+ mixed-endian order (byte order 45670123) */
35
+ /* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
36
+
37
+ /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
38
+ significant byte first */
39
+ /* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
40
+
41
+ /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
42
+ least significant byte first */
43
+ #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
44
+
45
+ /* Define if --enable-ipv6 is specified */
46
+ #define ENABLE_IPV6 1
47
+
48
+ /* Better isolate subinterpreters, experimental build mode. */
49
+ /* #undef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS */
50
+
51
+ /* Define to 1 if your system stores words within floats with the most
52
+ significant word first */
53
+ /* #undef FLOAT_WORDS_BIGENDIAN */
54
+
55
+ /* Define if flock needs to be linked with bsd library. */
56
+ /* #undef FLOCK_NEEDS_LIBBSD */
57
+
58
+ /* Define if getpgrp() must be called as getpgrp(0). */
59
+ /* #undef GETPGRP_HAVE_ARG */
60
+
61
+ /* Define to 1 if you have the `accept4' function. */
62
+ #define HAVE_ACCEPT4 1
63
+
64
+ /* Define to 1 if you have the `acosh' function. */
65
+ #define HAVE_ACOSH 1
66
+
67
+ /* struct addrinfo (netdb.h) */
68
+ #define HAVE_ADDRINFO 1
69
+
70
+ /* Define to 1 if you have the `alarm' function. */
71
+ #define HAVE_ALARM 1
72
+
73
+ /* Define if aligned memory access is required */
74
+ /* #undef HAVE_ALIGNED_REQUIRED */
75
+
76
+ /* Define to 1 if you have the <alloca.h> header file. */
77
+ #define HAVE_ALLOCA_H 1
78
+
79
+ /* Define this if your time.h defines altzone. */
80
+ /* #undef HAVE_ALTZONE */
81
+
82
+ /* Define to 1 if you have the `asinh' function. */
83
+ #define HAVE_ASINH 1
84
+
85
+ /* Define to 1 if you have the <asm/types.h> header file. */
86
+ #define HAVE_ASM_TYPES_H 1
87
+
88
+ /* Define to 1 if you have the `atanh' function. */
89
+ #define HAVE_ATANH 1
90
+
91
+ /* Define to 1 if you have the `bind_textdomain_codeset' function. */
92
+ #define HAVE_BIND_TEXTDOMAIN_CODESET 1
93
+
94
+ /* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
95
+ /* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
96
+
97
+ /* Define to 1 if you have the <bluetooth.h> header file. */
98
+ /* #undef HAVE_BLUETOOTH_H */
99
+
100
+ /* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
101
+ chars that would be converted. */
102
+ /* #undef HAVE_BROKEN_MBSTOWCS */
103
+
104
+ /* Define if nice() returns success/failure instead of the new priority. */
105
+ /* #undef HAVE_BROKEN_NICE */
106
+
107
+ /* Define if the system reports an invalid PIPE_BUF value. */
108
+ /* #undef HAVE_BROKEN_PIPE_BUF */
109
+
110
+ /* Define if poll() sets errno on invalid file descriptors. */
111
+ /* #undef HAVE_BROKEN_POLL */
112
+
113
+ /* Define if the Posix semaphores do not work on your system */
114
+ /* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
115
+
116
+ /* Define if pthread_sigmask() does not work on your system. */
117
+ /* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
118
+
119
+ /* define to 1 if your sem_getvalue is broken. */
120
+ /* #undef HAVE_BROKEN_SEM_GETVALUE */
121
+
122
+ /* Define if `unsetenv` does not return an int. */
123
+ /* #undef HAVE_BROKEN_UNSETENV */
124
+
125
+ /* Has builtin __atomic_load_n() and __atomic_store_n() functions */
126
+ #define HAVE_BUILTIN_ATOMIC 1
127
+
128
+ /* Define to 1 if you have the 'chflags' function. */
129
+ /* #undef HAVE_CHFLAGS */
130
+
131
+ /* Define to 1 if you have the `chown' function. */
132
+ #define HAVE_CHOWN 1
133
+
134
+ /* Define if you have the 'chroot' function. */
135
+ #define HAVE_CHROOT 1
136
+
137
+ /* Define to 1 if you have the `clock' function. */
138
+ #define HAVE_CLOCK 1
139
+
140
+ /* Define to 1 if you have the `clock_getres' function. */
141
+ #define HAVE_CLOCK_GETRES 1
142
+
143
+ /* Define to 1 if you have the `clock_gettime' function. */
144
+ #define HAVE_CLOCK_GETTIME 1
145
+
146
+ /* Define to 1 if you have the `clock_settime' function. */
147
+ #define HAVE_CLOCK_SETTIME 1
148
+
149
+ /* Define to 1 if you have the `close_range' function. */
150
+ /* #undef HAVE_CLOSE_RANGE */
151
+
152
+ /* Define if the C compiler supports computed gotos. */
153
+ #define HAVE_COMPUTED_GOTOS 1
154
+
155
+ /* Define to 1 if you have the `confstr' function. */
156
+ #define HAVE_CONFSTR 1
157
+
158
+ /* Define to 1 if you have the <conio.h> header file. */
159
+ /* #undef HAVE_CONIO_H */
160
+
161
+ /* Define to 1 if you have the `copysign' function. */
162
+ #define HAVE_COPYSIGN 1
163
+
164
+ /* Define to 1 if you have the `copy_file_range' function. */
165
+ /* #undef HAVE_COPY_FILE_RANGE */
166
+
167
+ /* Define to 1 if you have the <crypt.h> header file. */
168
+ #define HAVE_CRYPT_H 1
169
+
170
+ /* Define if you have the crypt_r() function. */
171
+ #define HAVE_CRYPT_R 1
172
+
173
+ /* Define to 1 if you have the `ctermid' function. */
174
+ #define HAVE_CTERMID 1
175
+
176
+ /* Define if you have the 'ctermid_r' function. */
177
+ /* #undef HAVE_CTERMID_R */
178
+
179
+ /* Define if you have the 'filter' function. */
180
+ #define HAVE_CURSES_FILTER 1
181
+
182
+ /* Define to 1 if you have the <curses.h> header file. */
183
+ #define HAVE_CURSES_H 1
184
+
185
+ /* Define if you have the 'has_key' function. */
186
+ #define HAVE_CURSES_HAS_KEY 1
187
+
188
+ /* Define if you have the 'immedok' function. */
189
+ #define HAVE_CURSES_IMMEDOK 1
190
+
191
+ /* Define if you have the 'is_pad' function or macro. */
192
+ #define HAVE_CURSES_IS_PAD 1
193
+
194
+ /* Define if you have the 'is_term_resized' function. */
195
+ #define HAVE_CURSES_IS_TERM_RESIZED 1
196
+
197
+ /* Define if you have the 'resizeterm' function. */
198
+ #define HAVE_CURSES_RESIZETERM 1
199
+
200
+ /* Define if you have the 'resize_term' function. */
201
+ #define HAVE_CURSES_RESIZE_TERM 1
202
+
203
+ /* Define if you have the 'syncok' function. */
204
+ #define HAVE_CURSES_SYNCOK 1
205
+
206
+ /* Define if you have the 'typeahead' function. */
207
+ #define HAVE_CURSES_TYPEAHEAD 1
208
+
209
+ /* Define if you have the 'use_env' function. */
210
+ #define HAVE_CURSES_USE_ENV 1
211
+
212
+ /* Define if you have the 'wchgat' function. */
213
+ #define HAVE_CURSES_WCHGAT 1
214
+
215
+ /* Define to 1 if you have the declaration of `isfinite', and to 0 if you
216
+ don't. */
217
+ #define HAVE_DECL_ISFINITE 1
218
+
219
+ /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
220
+ */
221
+ #define HAVE_DECL_ISINF 1
222
+
223
+ /* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
224
+ */
225
+ #define HAVE_DECL_ISNAN 1
226
+
227
+ /* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you
228
+ don't. */
229
+ #define HAVE_DECL_RTLD_DEEPBIND 1
230
+
231
+ /* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you
232
+ don't. */
233
+ #define HAVE_DECL_RTLD_GLOBAL 1
234
+
235
+ /* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you
236
+ don't. */
237
+ #define HAVE_DECL_RTLD_LAZY 1
238
+
239
+ /* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you
240
+ don't. */
241
+ #define HAVE_DECL_RTLD_LOCAL 1
242
+
243
+ /* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you
244
+ don't. */
245
+ #define HAVE_DECL_RTLD_MEMBER 0
246
+
247
+ /* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you
248
+ don't. */
249
+ #define HAVE_DECL_RTLD_NODELETE 1
250
+
251
+ /* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you
252
+ don't. */
253
+ #define HAVE_DECL_RTLD_NOLOAD 1
254
+
255
+ /* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you
256
+ don't. */
257
+ #define HAVE_DECL_RTLD_NOW 1
258
+
259
+ /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
260
+ */
261
+ /* #undef HAVE_DECL_TZNAME */
262
+
263
+ /* Define to 1 if you have the device macros. */
264
+ #define HAVE_DEVICE_MACROS 1
265
+
266
+ /* Define to 1 if you have the /dev/ptc device file. */
267
+ /* #undef HAVE_DEV_PTC */
268
+
269
+ /* Define to 1 if you have the /dev/ptmx device file. */
270
+ #define HAVE_DEV_PTMX 1
271
+
272
+ /* Define to 1 if you have the <direct.h> header file. */
273
+ /* #undef HAVE_DIRECT_H */
274
+
275
+ /* Define to 1 if the dirent structure has a d_type field */
276
+ #define HAVE_DIRENT_D_TYPE 1
277
+
278
+ /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
279
+ */
280
+ #define HAVE_DIRENT_H 1
281
+
282
+ /* Define if you have the 'dirfd' function or macro. */
283
+ #define HAVE_DIRFD 1
284
+
285
+ /* Define to 1 if you have the <dlfcn.h> header file. */
286
+ #define HAVE_DLFCN_H 1
287
+
288
+ /* Define to 1 if you have the `dlopen' function. */
289
+ #define HAVE_DLOPEN 1
290
+
291
+ /* Define to 1 if you have the `dup2' function. */
292
+ #define HAVE_DUP2 1
293
+
294
+ /* Define to 1 if you have the `dup3' function. */
295
+ #define HAVE_DUP3 1
296
+
297
+ /* Define if you have the '_dyld_shared_cache_contains_path' function. */
298
+ /* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
299
+
300
+ /* Defined when any dynamic module loading is enabled. */
301
+ #define HAVE_DYNAMIC_LOADING 1
302
+
303
+ /* Define to 1 if you have the <endian.h> header file. */
304
+ #define HAVE_ENDIAN_H 1
305
+
306
+ /* Define if you have the 'epoll' functions. */
307
+ #define HAVE_EPOLL 1
308
+
309
+ /* Define if you have the 'epoll_create1' function. */
310
+ #define HAVE_EPOLL_CREATE1 1
311
+
312
+ /* Define to 1 if you have the `erf' function. */
313
+ #define HAVE_ERF 1
314
+
315
+ /* Define to 1 if you have the `erfc' function. */
316
+ #define HAVE_ERFC 1
317
+
318
+ /* Define to 1 if you have the <errno.h> header file. */
319
+ #define HAVE_ERRNO_H 1
320
+
321
+ /* Define if you have the 'eventfd' function. */
322
+ #define HAVE_EVENTFD 1
323
+
324
+ /* Define to 1 if you have the `execv' function. */
325
+ #define HAVE_EXECV 1
326
+
327
+ /* Define to 1 if you have the `explicit_bzero' function. */
328
+ /* #undef HAVE_EXPLICIT_BZERO */
329
+
330
+ /* Define to 1 if you have the `explicit_memset' function. */
331
+ /* #undef HAVE_EXPLICIT_MEMSET */
332
+
333
+ /* Define to 1 if you have the `expm1' function. */
334
+ #define HAVE_EXPM1 1
335
+
336
+ /* Define to 1 if you have the `faccessat' function. */
337
+ #define HAVE_FACCESSAT 1
338
+
339
+ /* Define if you have the 'fchdir' function. */
340
+ #define HAVE_FCHDIR 1
341
+
342
+ /* Define to 1 if you have the `fchmod' function. */
343
+ #define HAVE_FCHMOD 1
344
+
345
+ /* Define to 1 if you have the `fchmodat' function. */
346
+ #define HAVE_FCHMODAT 1
347
+
348
+ /* Define to 1 if you have the `fchown' function. */
349
+ #define HAVE_FCHOWN 1
350
+
351
+ /* Define to 1 if you have the `fchownat' function. */
352
+ #define HAVE_FCHOWNAT 1
353
+
354
+ /* Define to 1 if you have the <fcntl.h> header file. */
355
+ #define HAVE_FCNTL_H 1
356
+
357
+ /* Define if you have the 'fdatasync' function. */
358
+ #define HAVE_FDATASYNC 1
359
+
360
+ /* Define to 1 if you have the `fdopendir' function. */
361
+ #define HAVE_FDOPENDIR 1
362
+
363
+ /* Define to 1 if you have the `fdwalk' function. */
364
+ /* #undef HAVE_FDWALK */
365
+
366
+ /* Define to 1 if you have the `fexecve' function. */
367
+ #define HAVE_FEXECVE 1
368
+
369
+ /* Define to 1 if you have the `finite' function. */
370
+ #define HAVE_FINITE 1
371
+
372
+ /* Define to 1 if you have the `flock' function. */
373
+ #define HAVE_FLOCK 1
374
+
375
+ /* Define to 1 if you have the `fork' function. */
376
+ #define HAVE_FORK 1
377
+
378
+ /* Define to 1 if you have the `forkpty' function. */
379
+ #define HAVE_FORKPTY 1
380
+
381
+ /* Define to 1 if you have the `fpathconf' function. */
382
+ #define HAVE_FPATHCONF 1
383
+
384
+ /* Define to 1 if you have the `fseek64' function. */
385
+ /* #undef HAVE_FSEEK64 */
386
+
387
+ /* Define to 1 if you have the `fseeko' function. */
388
+ #define HAVE_FSEEKO 1
389
+
390
+ /* Define to 1 if you have the `fstatat' function. */
391
+ #define HAVE_FSTATAT 1
392
+
393
+ /* Define to 1 if you have the `fstatvfs' function. */
394
+ #define HAVE_FSTATVFS 1
395
+
396
+ /* Define if you have the 'fsync' function. */
397
+ #define HAVE_FSYNC 1
398
+
399
+ /* Define to 1 if you have the `ftell64' function. */
400
+ /* #undef HAVE_FTELL64 */
401
+
402
+ /* Define to 1 if you have the `ftello' function. */
403
+ #define HAVE_FTELLO 1
404
+
405
+ /* Define to 1 if you have the `ftime' function. */
406
+ #define HAVE_FTIME 1
407
+
408
+ /* Define to 1 if you have the `ftruncate' function. */
409
+ #define HAVE_FTRUNCATE 1
410
+
411
+ /* Define to 1 if you have the `futimens' function. */
412
+ #define HAVE_FUTIMENS 1
413
+
414
+ /* Define to 1 if you have the `futimes' function. */
415
+ #define HAVE_FUTIMES 1
416
+
417
+ /* Define to 1 if you have the `futimesat' function. */
418
+ #define HAVE_FUTIMESAT 1
419
+
420
+ /* Define to 1 if you have the `gai_strerror' function. */
421
+ #define HAVE_GAI_STRERROR 1
422
+
423
+ /* Define to 1 if you have the `gamma' function. */
424
+ #define HAVE_GAMMA 1
425
+
426
+ /* Define if we can use gcc inline assembler to get and set mc68881 fpcr */
427
+ /* #undef HAVE_GCC_ASM_FOR_MC68881 */
428
+
429
+ /* Define if we can use x64 gcc inline assembler */
430
+ #define HAVE_GCC_ASM_FOR_X64 1
431
+
432
+ /* Define if we can use gcc inline assembler to get and set x87 control word
433
+ */
434
+ #define HAVE_GCC_ASM_FOR_X87 1
435
+
436
+ /* Define if your compiler provides __uint128_t */
437
+ #define HAVE_GCC_UINT128_T 1
438
+
439
+ /* Define if you have the getaddrinfo function. */
440
+ #define HAVE_GETADDRINFO 1
441
+
442
+ /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
443
+ #define HAVE_GETC_UNLOCKED 1
444
+
445
+ /* Define to 1 if you have the `getentropy' function. */
446
+ /* #undef HAVE_GETENTROPY */
447
+
448
+ /* Define to 1 if you have the `getgrgid_r' function. */
449
+ #define HAVE_GETGRGID_R 1
450
+
451
+ /* Define to 1 if you have the `getgrnam_r' function. */
452
+ #define HAVE_GETGRNAM_R 1
453
+
454
+ /* Define to 1 if you have the `getgrouplist' function. */
455
+ #define HAVE_GETGROUPLIST 1
456
+
457
+ /* Define to 1 if you have the `getgroups' function. */
458
+ #define HAVE_GETGROUPS 1
459
+
460
+ /* Define to 1 if you have the `gethostbyname' function. */
461
+ /* #undef HAVE_GETHOSTBYNAME */
462
+
463
+ /* Define this if you have some version of gethostbyname_r() */
464
+ #define HAVE_GETHOSTBYNAME_R 1
465
+
466
+ /* Define this if you have the 3-arg version of gethostbyname_r(). */
467
+ /* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
468
+
469
+ /* Define this if you have the 5-arg version of gethostbyname_r(). */
470
+ /* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
471
+
472
+ /* Define this if you have the 6-arg version of gethostbyname_r(). */
473
+ #define HAVE_GETHOSTBYNAME_R_6_ARG 1
474
+
475
+ /* Define to 1 if you have the `getitimer' function. */
476
+ #define HAVE_GETITIMER 1
477
+
478
+ /* Define to 1 if you have the `getloadavg' function. */
479
+ #define HAVE_GETLOADAVG 1
480
+
481
+ /* Define to 1 if you have the `getlogin' function. */
482
+ #define HAVE_GETLOGIN 1
483
+
484
+ /* Define to 1 if you have the `getnameinfo' function. */
485
+ #define HAVE_GETNAMEINFO 1
486
+
487
+ /* Define if you have the 'getpagesize' function. */
488
+ #define HAVE_GETPAGESIZE 1
489
+
490
+ /* Define to 1 if you have the `getpeername' function. */
491
+ #define HAVE_GETPEERNAME 1
492
+
493
+ /* Define to 1 if you have the `getpgid' function. */
494
+ #define HAVE_GETPGID 1
495
+
496
+ /* Define to 1 if you have the `getpgrp' function. */
497
+ #define HAVE_GETPGRP 1
498
+
499
+ /* Define to 1 if you have the `getpid' function. */
500
+ #define HAVE_GETPID 1
501
+
502
+ /* Define to 1 if you have the `getpriority' function. */
503
+ #define HAVE_GETPRIORITY 1
504
+
505
+ /* Define to 1 if you have the `getpwent' function. */
506
+ #define HAVE_GETPWENT 1
507
+
508
+ /* Define to 1 if you have the `getpwnam_r' function. */
509
+ #define HAVE_GETPWNAM_R 1
510
+
511
+ /* Define to 1 if you have the `getpwuid_r' function. */
512
+ #define HAVE_GETPWUID_R 1
513
+
514
+ /* Define to 1 if the getrandom() function is available */
515
+ /* #undef HAVE_GETRANDOM */
516
+
517
+ /* Define to 1 if the Linux getrandom() syscall is available */
518
+ #define HAVE_GETRANDOM_SYSCALL 1
519
+
520
+ /* Define to 1 if you have the `getresgid' function. */
521
+ #define HAVE_GETRESGID 1
522
+
523
+ /* Define to 1 if you have the `getresuid' function. */
524
+ #define HAVE_GETRESUID 1
525
+
526
+ /* Define to 1 if you have the `getsid' function. */
527
+ #define HAVE_GETSID 1
528
+
529
+ /* Define to 1 if you have the `getspent' function. */
530
+ #define HAVE_GETSPENT 1
531
+
532
+ /* Define to 1 if you have the `getspnam' function. */
533
+ #define HAVE_GETSPNAM 1
534
+
535
+ /* Define to 1 if you have the `getwd' function. */
536
+ #define HAVE_GETWD 1
537
+
538
+ /* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
539
+ bcopy. */
540
+ /* #undef HAVE_GLIBC_MEMMOVE_BUG */
541
+
542
+ /* Define to 1 if you have the <grp.h> header file. */
543
+ #define HAVE_GRP_H 1
544
+
545
+ /* Define if you have the 'hstrerror' function. */
546
+ #define HAVE_HSTRERROR 1
547
+
548
+ /* Define this if you have le64toh() */
549
+ #define HAVE_HTOLE64 1
550
+
551
+ /* Define to 1 if you have the `hypot' function. */
552
+ #define HAVE_HYPOT 1
553
+
554
+ /* Define to 1 if you have the <ieeefp.h> header file. */
555
+ /* #undef HAVE_IEEEFP_H */
556
+
557
+ /* Define to 1 if you have the `if_nameindex' function. */
558
+ #define HAVE_IF_NAMEINDEX 1
559
+
560
+ /* Define if you have the 'inet_aton' function. */
561
+ #define HAVE_INET_ATON 1
562
+
563
+ /* Define if you have the 'inet_pton' function. */
564
+ #define HAVE_INET_PTON 1
565
+
566
+ /* Define to 1 if you have the `initgroups' function. */
567
+ #define HAVE_INITGROUPS 1
568
+
569
+ /* Define to 1 if you have the <inttypes.h> header file. */
570
+ #define HAVE_INTTYPES_H 1
571
+
572
+ /* Define to 1 if you have the <io.h> header file. */
573
+ /* #undef HAVE_IO_H */
574
+
575
+ /* Define if gcc has the ipa-pure-const bug. */
576
+ /* #undef HAVE_IPA_PURE_CONST_BUG */
577
+
578
+ /* Define to 1 if you have the `kill' function. */
579
+ #define HAVE_KILL 1
580
+
581
+ /* Define to 1 if you have the `killpg' function. */
582
+ #define HAVE_KILLPG 1
583
+
584
+ /* Define if you have the 'kqueue' functions. */
585
+ /* #undef HAVE_KQUEUE */
586
+
587
+ /* Define to 1 if you have the <langinfo.h> header file. */
588
+ #define HAVE_LANGINFO_H 1
589
+
590
+ /* Defined to enable large file support when an off_t is bigger than a long
591
+ and long long is at least as big as an off_t. You may need to add some
592
+ flags for configuration and compilation to enable this mode. (For Solaris
593
+ and Linux, the necessary defines are already defined.) */
594
+ /* #undef HAVE_LARGEFILE_SUPPORT */
595
+
596
+ /* Define to 1 if you have the 'lchflags' function. */
597
+ /* #undef HAVE_LCHFLAGS */
598
+
599
+ /* Define to 1 if you have the `lchmod' function. */
600
+ /* #undef HAVE_LCHMOD */
601
+
602
+ /* Define to 1 if you have the `lchown' function. */
603
+ #define HAVE_LCHOWN 1
604
+
605
+ /* Define to 1 if you have the `lgamma' function. */
606
+ #define HAVE_LGAMMA 1
607
+
608
+ /* Define to 1 if you have the `dl' library (-ldl). */
609
+ #define HAVE_LIBDL 1
610
+
611
+ /* Define to 1 if you have the `dld' library (-ldld). */
612
+ /* #undef HAVE_LIBDLD */
613
+
614
+ /* Define to 1 if you have the `ieee' library (-lieee). */
615
+ /* #undef HAVE_LIBIEEE */
616
+
617
+ /* Define to 1 if you have the <libintl.h> header file. */
618
+ #define HAVE_LIBINTL_H 1
619
+
620
+ /* Define to build the readline module. */
621
+ #define HAVE_LIBREADLINE 1
622
+
623
+ /* Define to 1 if you have the `resolv' library (-lresolv). */
624
+ /* #undef HAVE_LIBRESOLV */
625
+
626
+ /* Define to 1 if you have the `sendfile' library (-lsendfile). */
627
+ /* #undef HAVE_LIBSENDFILE */
628
+
629
+ /* Define to 1 if you have the <libutil.h> header file. */
630
+ /* #undef HAVE_LIBUTIL_H */
631
+
632
+ /* Define to 1 if you have the `uuid' library (-luuid). */
633
+ #define HAVE_LIBUUID 1
634
+
635
+ /* Define if you have the 'link' function. */
636
+ #define HAVE_LINK 1
637
+
638
+ /* Define to 1 if you have the `linkat' function. */
639
+ #define HAVE_LINKAT 1
640
+
641
+ /* Define to 1 if you have the <linux/auxvec.h> header file. */
642
+ #define HAVE_LINUX_AUXVEC_H 1
643
+
644
+ /* Define to 1 if you have the <linux/can/bcm.h> header file. */
645
+ #define HAVE_LINUX_CAN_BCM_H 1
646
+
647
+ /* Define to 1 if you have the <linux/can.h> header file. */
648
+ #define HAVE_LINUX_CAN_H 1
649
+
650
+ /* Define to 1 if you have the <linux/can/j1939.h> header file. */
651
+ /* #undef HAVE_LINUX_CAN_J1939_H */
652
+
653
+ /* Define if compiling using Linux 3.6 or later. */
654
+ #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
655
+
656
+ /* Define to 1 if you have the <linux/can/raw.h> header file. */
657
+ #define HAVE_LINUX_CAN_RAW_H 1
658
+
659
+ /* Define if compiling using Linux 4.1 or later. */
660
+ #define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1
661
+
662
+ /* Define to 1 if you have the <linux/memfd.h> header file. */
663
+ #define HAVE_LINUX_MEMFD_H 1
664
+
665
+ /* Define to 1 if you have the <linux/netlink.h> header file. */
666
+ #define HAVE_LINUX_NETLINK_H 1
667
+
668
+ /* Define to 1 if you have the <linux/qrtr.h> header file. */
669
+ /* #undef HAVE_LINUX_QRTR_H */
670
+
671
+ /* Define to 1 if you have the <linux/random.h> header file. */
672
+ #define HAVE_LINUX_RANDOM_H 1
673
+
674
+ /* Define to 1 if you have the <linux/tipc.h> header file. */
675
+ #define HAVE_LINUX_TIPC_H 1
676
+
677
+ /* Define to 1 if you have the <linux/vm_sockets.h> header file. */
678
+ #define HAVE_LINUX_VM_SOCKETS_H 1
679
+
680
+ /* Define to 1 if you have the <linux/wait.h> header file. */
681
+ #define HAVE_LINUX_WAIT_H 1
682
+
683
+ /* Define to 1 if you have the `lockf' function. */
684
+ #define HAVE_LOCKF 1
685
+
686
+ /* Define to 1 if you have the `log1p' function. */
687
+ #define HAVE_LOG1P 1
688
+
689
+ /* Define to 1 if you have the `log2' function. */
690
+ #define HAVE_LOG2 1
691
+
692
+ /* Define to 1 if the system has the type `long double'. */
693
+ #define HAVE_LONG_DOUBLE 1
694
+
695
+ /* Define to 1 if you have the `lstat' function. */
696
+ #define HAVE_LSTAT 1
697
+
698
+ /* Define to 1 if you have the `lutimes' function. */
699
+ #define HAVE_LUTIMES 1
700
+
701
+ /* Define to 1 if you have the `madvise' function. */
702
+ #define HAVE_MADVISE 1
703
+
704
+ /* Define this if you have the makedev macro. */
705
+ #define HAVE_MAKEDEV 1
706
+
707
+ /* Define to 1 if you have the `mbrtowc' function. */
708
+ #define HAVE_MBRTOWC 1
709
+
710
+ /* Define if you have the 'memfd_create' function. */
711
+ /* #undef HAVE_MEMFD_CREATE */
712
+
713
+ /* Define to 1 if you have the <memory.h> header file. */
714
+ #define HAVE_MEMORY_H 1
715
+
716
+ /* Define to 1 if you have the `memrchr' function. */
717
+ #define HAVE_MEMRCHR 1
718
+
719
+ /* Define to 1 if you have the `mkdirat' function. */
720
+ #define HAVE_MKDIRAT 1
721
+
722
+ /* Define to 1 if you have the `mkfifo' function. */
723
+ #define HAVE_MKFIFO 1
724
+
725
+ /* Define to 1 if you have the `mkfifoat' function. */
726
+ #define HAVE_MKFIFOAT 1
727
+
728
+ /* Define to 1 if you have the `mknod' function. */
729
+ #define HAVE_MKNOD 1
730
+
731
+ /* Define to 1 if you have the `mknodat' function. */
732
+ #define HAVE_MKNODAT 1
733
+
734
+ /* Define to 1 if you have the `mktime' function. */
735
+ #define HAVE_MKTIME 1
736
+
737
+ /* Define to 1 if you have the `mmap' function. */
738
+ #define HAVE_MMAP 1
739
+
740
+ /* Define to 1 if you have the `mremap' function. */
741
+ #define HAVE_MREMAP 1
742
+
743
+ /* Define to 1 if you have the <ncurses.h> header file. */
744
+ #define HAVE_NCURSES_H 1
745
+
746
+ /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
747
+ /* #undef HAVE_NDIR_H */
748
+
749
+ /* Define to 1 if you have the <netpacket/packet.h> header file. */
750
+ #define HAVE_NETPACKET_PACKET_H 1
751
+
752
+ /* Define to 1 if you have the <net/if.h> header file. */
753
+ #define HAVE_NET_IF_H 1
754
+
755
+ /* Define to 1 if you have the `nice' function. */
756
+ #define HAVE_NICE 1
757
+
758
+ /* Define if the internal form of wchar_t in non-Unicode locales is not
759
+ Unicode. */
760
+ /* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
761
+
762
+ /* Define to 1 if you have the `openat' function. */
763
+ #define HAVE_OPENAT 1
764
+
765
+ /* Define to 1 if you have the `openpty' function. */
766
+ #define HAVE_OPENPTY 1
767
+
768
+ /* Define to 1 if you have the `pathconf' function. */
769
+ #define HAVE_PATHCONF 1
770
+
771
+ /* Define to 1 if you have the `pause' function. */
772
+ #define HAVE_PAUSE 1
773
+
774
+ /* Define to 1 if you have the `pipe2' function. */
775
+ #define HAVE_PIPE2 1
776
+
777
+ /* Define to 1 if you have the `plock' function. */
778
+ /* #undef HAVE_PLOCK */
779
+
780
+ /* Define to 1 if you have the `poll' function. */
781
+ #define HAVE_POLL 1
782
+
783
+ /* Define to 1 if you have the <poll.h> header file. */
784
+ #define HAVE_POLL_H 1
785
+
786
+ /* Define to 1 if you have the `posix_fadvise' function. */
787
+ #define HAVE_POSIX_FADVISE 1
788
+
789
+ /* Define to 1 if you have the `posix_fallocate' function. */
790
+ #define HAVE_POSIX_FALLOCATE 1
791
+
792
+ /* Define to 1 if you have the `posix_spawn' function. */
793
+ #define HAVE_POSIX_SPAWN 1
794
+
795
+ /* Define to 1 if you have the `posix_spawnp' function. */
796
+ #define HAVE_POSIX_SPAWNP 1
797
+
798
+ /* Define to 1 if you have the `pread' function. */
799
+ #define HAVE_PREAD 1
800
+
801
+ /* Define to 1 if you have the `preadv' function. */
802
+ #define HAVE_PREADV 1
803
+
804
+ /* Define to 1 if you have the `preadv2' function. */
805
+ /* #undef HAVE_PREADV2 */
806
+
807
+ /* Define if you have the 'prlimit' functions. */
808
+ #define HAVE_PRLIMIT 1
809
+
810
+ /* Define to 1 if you have the <process.h> header file. */
811
+ /* #undef HAVE_PROCESS_H */
812
+
813
+ /* Define if your compiler supports function prototype */
814
+ #define HAVE_PROTOTYPES 1
815
+
816
+ /* Define to 1 if you have the `pthread_condattr_setclock' function. */
817
+ #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
818
+
819
+ /* Defined for Solaris 2.6 bug in pthread header. */
820
+ /* #undef HAVE_PTHREAD_DESTRUCTOR */
821
+
822
+ /* Define to 1 if you have the `pthread_getcpuclockid' function. */
823
+ #define HAVE_PTHREAD_GETCPUCLOCKID 1
824
+
825
+ /* Define to 1 if you have the <pthread.h> header file. */
826
+ #define HAVE_PTHREAD_H 1
827
+
828
+ /* Define to 1 if you have the `pthread_init' function. */
829
+ /* #undef HAVE_PTHREAD_INIT */
830
+
831
+ /* Define to 1 if you have the `pthread_kill' function. */
832
+ #define HAVE_PTHREAD_KILL 1
833
+
834
+ /* Define to 1 if you have the `pthread_sigmask' function. */
835
+ #define HAVE_PTHREAD_SIGMASK 1
836
+
837
+ /* Define to 1 if you have the <pty.h> header file. */
838
+ #define HAVE_PTY_H 1
839
+
840
+ /* Define to 1 if you have the `pwrite' function. */
841
+ #define HAVE_PWRITE 1
842
+
843
+ /* Define to 1 if you have the `pwritev' function. */
844
+ #define HAVE_PWRITEV 1
845
+
846
+ /* Define to 1 if you have the `pwritev2' function. */
847
+ /* #undef HAVE_PWRITEV2 */
848
+
849
+ /* Define to 1 if you have the `readlink' function. */
850
+ #define HAVE_READLINK 1
851
+
852
+ /* Define to 1 if you have the `readlinkat' function. */
853
+ #define HAVE_READLINKAT 1
854
+
855
+ /* Define to 1 if you have the `readv' function. */
856
+ #define HAVE_READV 1
857
+
858
+ /* Define to 1 if you have the `realpath' function. */
859
+ #define HAVE_REALPATH 1
860
+
861
+ /* Define to 1 if you have the `renameat' function. */
862
+ #define HAVE_RENAMEAT 1
863
+
864
+ /* Define if readline supports append_history */
865
+ #define HAVE_RL_APPEND_HISTORY 1
866
+
867
+ /* Define if you can turn off readline's signal handling. */
868
+ #define HAVE_RL_CATCH_SIGNAL 1
869
+
870
+ /* Define if you have readline 2.2 */
871
+ #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
872
+
873
+ /* Define if you have readline 4.0 */
874
+ #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
875
+
876
+ /* Define if you have readline 4.2 */
877
+ #define HAVE_RL_COMPLETION_MATCHES 1
878
+
879
+ /* Define if you have rl_completion_suppress_append */
880
+ #define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1
881
+
882
+ /* Define if you have readline 4.0 */
883
+ #define HAVE_RL_PRE_INPUT_HOOK 1
884
+
885
+ /* Define if you have readline 4.0 */
886
+ #define HAVE_RL_RESIZE_TERMINAL 1
887
+
888
+ /* Define to 1 if you have the `round' function. */
889
+ #define HAVE_ROUND 1
890
+
891
+ /* Define to 1 if you have the `rtpSpawn' function. */
892
+ /* #undef HAVE_RTPSPAWN */
893
+
894
+ /* Define to 1 if you have the `sched_get_priority_max' function. */
895
+ #define HAVE_SCHED_GET_PRIORITY_MAX 1
896
+
897
+ /* Define to 1 if you have the <sched.h> header file. */
898
+ #define HAVE_SCHED_H 1
899
+
900
+ /* Define to 1 if you have the `sched_rr_get_interval' function. */
901
+ #define HAVE_SCHED_RR_GET_INTERVAL 1
902
+
903
+ /* Define to 1 if you have the `sched_setaffinity' function. */
904
+ #define HAVE_SCHED_SETAFFINITY 1
905
+
906
+ /* Define to 1 if you have the `sched_setparam' function. */
907
+ #define HAVE_SCHED_SETPARAM 1
908
+
909
+ /* Define to 1 if you have the `sched_setscheduler' function. */
910
+ #define HAVE_SCHED_SETSCHEDULER 1
911
+
912
+ /* Define to 1 if you have the `sem_clockwait' function. */
913
+ /* #undef HAVE_SEM_CLOCKWAIT */
914
+
915
+ /* Define to 1 if you have the `sem_getvalue' function. */
916
+ #define HAVE_SEM_GETVALUE 1
917
+
918
+ /* Define to 1 if you have the `sem_open' function. */
919
+ #define HAVE_SEM_OPEN 1
920
+
921
+ /* Define to 1 if you have the `sem_timedwait' function. */
922
+ #define HAVE_SEM_TIMEDWAIT 1
923
+
924
+ /* Define to 1 if you have the `sem_unlink' function. */
925
+ #define HAVE_SEM_UNLINK 1
926
+
927
+ /* Define to 1 if you have the `sendfile' function. */
928
+ #define HAVE_SENDFILE 1
929
+
930
+ /* Define to 1 if you have the `setegid' function. */
931
+ #define HAVE_SETEGID 1
932
+
933
+ /* Define to 1 if you have the `seteuid' function. */
934
+ #define HAVE_SETEUID 1
935
+
936
+ /* Define to 1 if you have the `setgid' function. */
937
+ #define HAVE_SETGID 1
938
+
939
+ /* Define if you have the 'setgroups' function. */
940
+ #define HAVE_SETGROUPS 1
941
+
942
+ /* Define to 1 if you have the `sethostname' function. */
943
+ #define HAVE_SETHOSTNAME 1
944
+
945
+ /* Define to 1 if you have the `setitimer' function. */
946
+ #define HAVE_SETITIMER 1
947
+
948
+ /* Define to 1 if you have the `setlocale' function. */
949
+ #define HAVE_SETLOCALE 1
950
+
951
+ /* Define to 1 if you have the `setpgid' function. */
952
+ #define HAVE_SETPGID 1
953
+
954
+ /* Define to 1 if you have the `setpgrp' function. */
955
+ #define HAVE_SETPGRP 1
956
+
957
+ /* Define to 1 if you have the `setpriority' function. */
958
+ #define HAVE_SETPRIORITY 1
959
+
960
+ /* Define to 1 if you have the `setregid' function. */
961
+ #define HAVE_SETREGID 1
962
+
963
+ /* Define to 1 if you have the `setresgid' function. */
964
+ #define HAVE_SETRESGID 1
965
+
966
+ /* Define to 1 if you have the `setresuid' function. */
967
+ #define HAVE_SETRESUID 1
968
+
969
+ /* Define to 1 if you have the `setreuid' function. */
970
+ #define HAVE_SETREUID 1
971
+
972
+ /* Define to 1 if you have the `setsid' function. */
973
+ #define HAVE_SETSID 1
974
+
975
+ /* Define to 1 if you have the `setuid' function. */
976
+ #define HAVE_SETUID 1
977
+
978
+ /* Define to 1 if you have the `setvbuf' function. */
979
+ #define HAVE_SETVBUF 1
980
+
981
+ /* Define to 1 if you have the <shadow.h> header file. */
982
+ #define HAVE_SHADOW_H 1
983
+
984
+ /* Define to 1 if you have the `shm_open' function. */
985
+ #define HAVE_SHM_OPEN 1
986
+
987
+ /* Define to 1 if you have the `shm_unlink' function. */
988
+ #define HAVE_SHM_UNLINK 1
989
+
990
+ /* Define to 1 if you have the `sigaction' function. */
991
+ #define HAVE_SIGACTION 1
992
+
993
+ /* Define to 1 if you have the `sigaltstack' function. */
994
+ #define HAVE_SIGALTSTACK 1
995
+
996
+ /* Define to 1 if you have the `sigfillset' function. */
997
+ #define HAVE_SIGFILLSET 1
998
+
999
+ /* Define to 1 if `si_band' is a member of `siginfo_t'. */
1000
+ #define HAVE_SIGINFO_T_SI_BAND 1
1001
+
1002
+ /* Define to 1 if you have the `siginterrupt' function. */
1003
+ #define HAVE_SIGINTERRUPT 1
1004
+
1005
+ /* Define to 1 if you have the <signal.h> header file. */
1006
+ #define HAVE_SIGNAL_H 1
1007
+
1008
+ /* Define to 1 if you have the `sigpending' function. */
1009
+ #define HAVE_SIGPENDING 1
1010
+
1011
+ /* Define to 1 if you have the `sigrelse' function. */
1012
+ #define HAVE_SIGRELSE 1
1013
+
1014
+ /* Define to 1 if you have the `sigtimedwait' function. */
1015
+ #define HAVE_SIGTIMEDWAIT 1
1016
+
1017
+ /* Define to 1 if you have the `sigwait' function. */
1018
+ #define HAVE_SIGWAIT 1
1019
+
1020
+ /* Define to 1 if you have the `sigwaitinfo' function. */
1021
+ #define HAVE_SIGWAITINFO 1
1022
+
1023
+ /* Define to 1 if you have the `snprintf' function. */
1024
+ #define HAVE_SNPRINTF 1
1025
+
1026
+ /* struct sockaddr_alg (linux/if_alg.h) */
1027
+ #define HAVE_SOCKADDR_ALG 1
1028
+
1029
+ /* Define if sockaddr has sa_len member */
1030
+ /* #undef HAVE_SOCKADDR_SA_LEN */
1031
+
1032
+ /* struct sockaddr_storage (sys/socket.h) */
1033
+ #define HAVE_SOCKADDR_STORAGE 1
1034
+
1035
+ /* Define if you have the 'socketpair' function. */
1036
+ #define HAVE_SOCKETPAIR 1
1037
+
1038
+ /* Define to 1 if you have the <spawn.h> header file. */
1039
+ #define HAVE_SPAWN_H 1
1040
+
1041
+ /* Define to 1 if you have the `splice' function. */
1042
+ #define HAVE_SPLICE 1
1043
+
1044
+ /* Define if your compiler provides ssize_t */
1045
+ #define HAVE_SSIZE_T 1
1046
+
1047
+ /* Define to 1 if you have the `statvfs' function. */
1048
+ #define HAVE_STATVFS 1
1049
+
1050
+ /* Define if you have struct stat.st_mtim.tv_nsec */
1051
+ #define HAVE_STAT_TV_NSEC 1
1052
+
1053
+ /* Define if you have struct stat.st_mtimensec */
1054
+ /* #undef HAVE_STAT_TV_NSEC2 */
1055
+
1056
+ /* Define if your compiler supports variable length function prototypes (e.g.
1057
+ void fprintf(FILE *, char *, ...);) *and* <stdarg.h> */
1058
+ #define HAVE_STDARG_PROTOTYPES 1
1059
+
1060
+ /* Define to 1 if you have the <stdint.h> header file. */
1061
+ #define HAVE_STDINT_H 1
1062
+
1063
+ /* Define to 1 if you have the <stdlib.h> header file. */
1064
+ #define HAVE_STDLIB_H 1
1065
+
1066
+ /* Has stdatomic.h with atomic_int and atomic_uintptr_t */
1067
+ #define HAVE_STD_ATOMIC 1
1068
+
1069
+ /* Define to 1 if you have the `strftime' function. */
1070
+ #define HAVE_STRFTIME 1
1071
+
1072
+ /* Define to 1 if you have the <strings.h> header file. */
1073
+ #define HAVE_STRINGS_H 1
1074
+
1075
+ /* Define to 1 if you have the <string.h> header file. */
1076
+ #define HAVE_STRING_H 1
1077
+
1078
+ /* Define to 1 if you have the `strlcpy' function. */
1079
+ /* #undef HAVE_STRLCPY */
1080
+
1081
+ /* Define to 1 if you have the <stropts.h> header file. */
1082
+ /* #undef HAVE_STROPTS_H */
1083
+
1084
+ /* Define to 1 if you have the `strsignal' function. */
1085
+ #define HAVE_STRSIGNAL 1
1086
+
1087
+ /* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
1088
+ #define HAVE_STRUCT_PASSWD_PW_GECOS 1
1089
+
1090
+ /* Define to 1 if `pw_passwd' is a member of `struct passwd'. */
1091
+ #define HAVE_STRUCT_PASSWD_PW_PASSWD 1
1092
+
1093
+ /* Define to 1 if `st_birthtime' is a member of `struct stat'. */
1094
+ /* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
1095
+
1096
+ /* Define to 1 if `st_blksize' is a member of `struct stat'. */
1097
+ #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
1098
+
1099
+ /* Define to 1 if `st_blocks' is a member of `struct stat'. */
1100
+ #define HAVE_STRUCT_STAT_ST_BLOCKS 1
1101
+
1102
+ /* Define to 1 if `st_flags' is a member of `struct stat'. */
1103
+ /* #undef HAVE_STRUCT_STAT_ST_FLAGS */
1104
+
1105
+ /* Define to 1 if `st_gen' is a member of `struct stat'. */
1106
+ /* #undef HAVE_STRUCT_STAT_ST_GEN */
1107
+
1108
+ /* Define to 1 if `st_rdev' is a member of `struct stat'. */
1109
+ #define HAVE_STRUCT_STAT_ST_RDEV 1
1110
+
1111
+ /* Define to 1 if `tm_zone' is a member of `struct tm'. */
1112
+ #define HAVE_STRUCT_TM_TM_ZONE 1
1113
+
1114
+ /* Define if you have the 'symlink' function. */
1115
+ #define HAVE_SYMLINK 1
1116
+
1117
+ /* Define to 1 if you have the `symlinkat' function. */
1118
+ #define HAVE_SYMLINKAT 1
1119
+
1120
+ /* Define to 1 if you have the `sync' function. */
1121
+ #define HAVE_SYNC 1
1122
+
1123
+ /* Define to 1 if you have the `sysconf' function. */
1124
+ #define HAVE_SYSCONF 1
1125
+
1126
+ /* Define to 1 if you have the <sysexits.h> header file. */
1127
+ #define HAVE_SYSEXITS_H 1
1128
+
1129
+ /* Define to 1 if you have the <sys/audioio.h> header file. */
1130
+ /* #undef HAVE_SYS_AUDIOIO_H */
1131
+
1132
+ /* Define to 1 if you have the <sys/auxv.h> header file. */
1133
+ #define HAVE_SYS_AUXV_H 1
1134
+
1135
+ /* Define to 1 if you have the <sys/bsdtty.h> header file. */
1136
+ /* #undef HAVE_SYS_BSDTTY_H */
1137
+
1138
+ /* Define to 1 if you have the <sys/devpoll.h> header file. */
1139
+ /* #undef HAVE_SYS_DEVPOLL_H */
1140
+
1141
+ /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
1142
+ */
1143
+ /* #undef HAVE_SYS_DIR_H */
1144
+
1145
+ /* Define to 1 if you have the <sys/endian.h> header file. */
1146
+ /* #undef HAVE_SYS_ENDIAN_H */
1147
+
1148
+ /* Define to 1 if you have the <sys/epoll.h> header file. */
1149
+ #define HAVE_SYS_EPOLL_H 1
1150
+
1151
+ /* Define to 1 if you have the <sys/eventfd.h> header file. */
1152
+ #define HAVE_SYS_EVENTFD_H 1
1153
+
1154
+ /* Define to 1 if you have the <sys/event.h> header file. */
1155
+ /* #undef HAVE_SYS_EVENT_H */
1156
+
1157
+ /* Define to 1 if you have the <sys/file.h> header file. */
1158
+ #define HAVE_SYS_FILE_H 1
1159
+
1160
+ /* Define to 1 if you have the <sys/ioctl.h> header file. */
1161
+ #define HAVE_SYS_IOCTL_H 1
1162
+
1163
+ /* Define to 1 if you have the <sys/kern_control.h> header file. */
1164
+ /* #undef HAVE_SYS_KERN_CONTROL_H */
1165
+
1166
+ /* Define to 1 if you have the <sys/loadavg.h> header file. */
1167
+ /* #undef HAVE_SYS_LOADAVG_H */
1168
+
1169
+ /* Define to 1 if you have the <sys/lock.h> header file. */
1170
+ /* #undef HAVE_SYS_LOCK_H */
1171
+
1172
+ /* Define to 1 if you have the <sys/memfd.h> header file. */
1173
+ /* #undef HAVE_SYS_MEMFD_H */
1174
+
1175
+ /* Define to 1 if you have the <sys/mkdev.h> header file. */
1176
+ /* #undef HAVE_SYS_MKDEV_H */
1177
+
1178
+ /* Define to 1 if you have the <sys/mman.h> header file. */
1179
+ #define HAVE_SYS_MMAN_H 1
1180
+
1181
+ /* Define to 1 if you have the <sys/modem.h> header file. */
1182
+ /* #undef HAVE_SYS_MODEM_H */
1183
+
1184
+ /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
1185
+ */
1186
+ /* #undef HAVE_SYS_NDIR_H */
1187
+
1188
+ /* Define to 1 if you have the <sys/param.h> header file. */
1189
+ #define HAVE_SYS_PARAM_H 1
1190
+
1191
+ /* Define to 1 if you have the <sys/poll.h> header file. */
1192
+ #define HAVE_SYS_POLL_H 1
1193
+
1194
+ /* Define to 1 if you have the <sys/random.h> header file. */
1195
+ /* #undef HAVE_SYS_RANDOM_H */
1196
+
1197
+ /* Define to 1 if you have the <sys/resource.h> header file. */
1198
+ #define HAVE_SYS_RESOURCE_H 1
1199
+
1200
+ /* Define to 1 if you have the <sys/select.h> header file. */
1201
+ #define HAVE_SYS_SELECT_H 1
1202
+
1203
+ /* Define to 1 if you have the <sys/sendfile.h> header file. */
1204
+ #define HAVE_SYS_SENDFILE_H 1
1205
+
1206
+ /* Define to 1 if you have the <sys/socket.h> header file. */
1207
+ #define HAVE_SYS_SOCKET_H 1
1208
+
1209
+ /* Define to 1 if you have the <sys/statvfs.h> header file. */
1210
+ #define HAVE_SYS_STATVFS_H 1
1211
+
1212
+ /* Define to 1 if you have the <sys/stat.h> header file. */
1213
+ #define HAVE_SYS_STAT_H 1
1214
+
1215
+ /* Define to 1 if you have the <sys/syscall.h> header file. */
1216
+ #define HAVE_SYS_SYSCALL_H 1
1217
+
1218
+ /* Define to 1 if you have the <sys/sysmacros.h> header file. */
1219
+ #define HAVE_SYS_SYSMACROS_H 1
1220
+
1221
+ /* Define to 1 if you have the <sys/sys_domain.h> header file. */
1222
+ /* #undef HAVE_SYS_SYS_DOMAIN_H */
1223
+
1224
+ /* Define to 1 if you have the <sys/termio.h> header file. */
1225
+ /* #undef HAVE_SYS_TERMIO_H */
1226
+
1227
+ /* Define to 1 if you have the <sys/times.h> header file. */
1228
+ #define HAVE_SYS_TIMES_H 1
1229
+
1230
+ /* Define to 1 if you have the <sys/time.h> header file. */
1231
+ #define HAVE_SYS_TIME_H 1
1232
+
1233
+ /* Define to 1 if you have the <sys/types.h> header file. */
1234
+ #define HAVE_SYS_TYPES_H 1
1235
+
1236
+ /* Define to 1 if you have the <sys/uio.h> header file. */
1237
+ #define HAVE_SYS_UIO_H 1
1238
+
1239
+ /* Define to 1 if you have the <sys/un.h> header file. */
1240
+ #define HAVE_SYS_UN_H 1
1241
+
1242
+ /* Define to 1 if you have the <sys/utsname.h> header file. */
1243
+ #define HAVE_SYS_UTSNAME_H 1
1244
+
1245
+ /* Define to 1 if you have the <sys/wait.h> header file. */
1246
+ #define HAVE_SYS_WAIT_H 1
1247
+
1248
+ /* Define to 1 if you have the <sys/xattr.h> header file. */
1249
+ #define HAVE_SYS_XATTR_H 1
1250
+
1251
+ /* Define to 1 if you have the `tcgetpgrp' function. */
1252
+ #define HAVE_TCGETPGRP 1
1253
+
1254
+ /* Define to 1 if you have the `tcsetpgrp' function. */
1255
+ #define HAVE_TCSETPGRP 1
1256
+
1257
+ /* Define to 1 if you have the `tempnam' function. */
1258
+ #define HAVE_TEMPNAM 1
1259
+
1260
+ /* Define to 1 if you have the <termios.h> header file. */
1261
+ #define HAVE_TERMIOS_H 1
1262
+
1263
+ /* Define to 1 if you have the <term.h> header file. */
1264
+ #define HAVE_TERM_H 1
1265
+
1266
+ /* Define to 1 if you have the `tgamma' function. */
1267
+ #define HAVE_TGAMMA 1
1268
+
1269
+ /* Define to 1 if you have the `timegm' function. */
1270
+ #define HAVE_TIMEGM 1
1271
+
1272
+ /* Define to 1 if you have the `times' function. */
1273
+ #define HAVE_TIMES 1
1274
+
1275
+ /* Define to 1 if you have the `tmpfile' function. */
1276
+ #define HAVE_TMPFILE 1
1277
+
1278
+ /* Define to 1 if you have the `tmpnam' function. */
1279
+ #define HAVE_TMPNAM 1
1280
+
1281
+ /* Define to 1 if you have the `tmpnam_r' function. */
1282
+ #define HAVE_TMPNAM_R 1
1283
+
1284
+ /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
1285
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
1286
+ #define HAVE_TM_ZONE 1
1287
+
1288
+ /* Define to 1 if you have the `truncate' function. */
1289
+ #define HAVE_TRUNCATE 1
1290
+
1291
+ /* Define to 1 if you don't have `tm_zone' but do have the external array
1292
+ `tzname'. */
1293
+ /* #undef HAVE_TZNAME */
1294
+
1295
+ /* Define this if you have tcl and TCL_UTF_MAX==6 */
1296
+ /* #undef HAVE_UCS4_TCL */
1297
+
1298
+ /* Define to 1 if you have the `uname' function. */
1299
+ #define HAVE_UNAME 1
1300
+
1301
+ /* Define to 1 if you have the <unistd.h> header file. */
1302
+ #define HAVE_UNISTD_H 1
1303
+
1304
+ /* Define to 1 if you have the `unlinkat' function. */
1305
+ #define HAVE_UNLINKAT 1
1306
+
1307
+ /* Define if you have a useable wchar_t type defined in wchar.h; useable means
1308
+ wchar_t must be an unsigned type with at least 16 bits. (see
1309
+ Include/unicodeobject.h). */
1310
+ /* #undef HAVE_USABLE_WCHAR_T */
1311
+
1312
+ /* Define to 1 if you have the <util.h> header file. */
1313
+ /* #undef HAVE_UTIL_H */
1314
+
1315
+ /* Define to 1 if you have the `utimensat' function. */
1316
+ #define HAVE_UTIMENSAT 1
1317
+
1318
+ /* Define to 1 if you have the `utimes' function. */
1319
+ #define HAVE_UTIMES 1
1320
+
1321
+ /* Define to 1 if you have the <utime.h> header file. */
1322
+ #define HAVE_UTIME_H 1
1323
+
1324
+ /* Define if uuid_create() exists. */
1325
+ /* #undef HAVE_UUID_CREATE */
1326
+
1327
+ /* Define if uuid_enc_be() exists. */
1328
+ /* #undef HAVE_UUID_ENC_BE */
1329
+
1330
+ /* Define if uuid_generate_time_safe() exists. */
1331
+ #define HAVE_UUID_GENERATE_TIME_SAFE 1
1332
+
1333
+ /* Define to 1 if you have the <uuid.h> header file. */
1334
+ #define HAVE_UUID_H 1
1335
+
1336
+ /* Define to 1 if you have the <uuid/uuid.h> header file. */
1337
+ #define HAVE_UUID_UUID_H 1
1338
+
1339
+ /* Define to 1 if you have the `vfork' function. */
1340
+ #define HAVE_VFORK 1
1341
+
1342
+ /* Define to 1 if you have the `wait3' function. */
1343
+ #define HAVE_WAIT3 1
1344
+
1345
+ /* Define to 1 if you have the `wait4' function. */
1346
+ #define HAVE_WAIT4 1
1347
+
1348
+ /* Define to 1 if you have the `waitid' function. */
1349
+ #define HAVE_WAITID 1
1350
+
1351
+ /* Define to 1 if you have the `waitpid' function. */
1352
+ #define HAVE_WAITPID 1
1353
+
1354
+ /* Define if the compiler provides a wchar.h header file. */
1355
+ #define HAVE_WCHAR_H 1
1356
+
1357
+ /* Define to 1 if you have the `wcscoll' function. */
1358
+ #define HAVE_WCSCOLL 1
1359
+
1360
+ /* Define to 1 if you have the `wcsftime' function. */
1361
+ #define HAVE_WCSFTIME 1
1362
+
1363
+ /* Define to 1 if you have the `wcsxfrm' function. */
1364
+ #define HAVE_WCSXFRM 1
1365
+
1366
+ /* Define to 1 if you have the `wmemcmp' function. */
1367
+ #define HAVE_WMEMCMP 1
1368
+
1369
+ /* Define if tzset() actually switches the local timezone in a meaningful way.
1370
+ */
1371
+ #define HAVE_WORKING_TZSET 1
1372
+
1373
+ /* Define to 1 if you have the `writev' function. */
1374
+ #define HAVE_WRITEV 1
1375
+
1376
+ /* Define if the zlib library has inflateCopy */
1377
+ #define HAVE_ZLIB_COPY 1
1378
+
1379
+ /* Define to 1 if you have the `_getpty' function. */
1380
+ /* #undef HAVE__GETPTY */
1381
+
1382
+ /* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
1383
+ */
1384
+ /* #undef MAJOR_IN_MKDEV */
1385
+
1386
+ /* Define to 1 if `major', `minor', and `makedev' are declared in
1387
+ <sysmacros.h>. */
1388
+ /* #undef MAJOR_IN_SYSMACROS */
1389
+
1390
+ /* Define if mvwdelch in curses.h is an expression. */
1391
+ #define MVWDELCH_IS_EXPRESSION 1
1392
+
1393
+ /* Define to the address where bug reports for this package should be sent. */
1394
+ /* #undef PACKAGE_BUGREPORT */
1395
+
1396
+ /* Define to the full name of this package. */
1397
+ /* #undef PACKAGE_NAME */
1398
+
1399
+ /* Define to the full name and version of this package. */
1400
+ /* #undef PACKAGE_STRING */
1401
+
1402
+ /* Define to the one symbol short name of this package. */
1403
+ /* #undef PACKAGE_TARNAME */
1404
+
1405
+ /* Define to the home page for this package. */
1406
+ /* #undef PACKAGE_URL */
1407
+
1408
+ /* Define to the version of this package. */
1409
+ /* #undef PACKAGE_VERSION */
1410
+
1411
+ /* Define if POSIX semaphores aren't enabled on your system */
1412
+ /* #undef POSIX_SEMAPHORES_NOT_ENABLED */
1413
+
1414
+ /* Define if pthread_key_t is compatible with int. */
1415
+ #define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
1416
+
1417
+ /* Defined if PTHREAD_SCOPE_SYSTEM supported. */
1418
+ #define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
1419
+
1420
+ /* Define as the preferred size in bits of long digits */
1421
+ /* #undef PYLONG_BITS_IN_DIGIT */
1422
+
1423
+ /* enabled builtin hash modules */
1424
+ #define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha256,sha512,sha3,blake2"
1425
+
1426
+ /* Define if you want to coerce the C locale to a UTF-8 based locale */
1427
+ #define PY_COERCE_C_LOCALE 1
1428
+
1429
+ /* Define to printf format modifier for Py_ssize_t */
1430
+ #define PY_FORMAT_SIZE_T "z"
1431
+
1432
+ /* Default cipher suites list for ssl module. 1: Python's preferred selection,
1433
+ 2: leave OpenSSL defaults untouched, 0: custom string */
1434
+ #define PY_SSL_DEFAULT_CIPHERS 1
1435
+
1436
+ /* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */
1437
+ /* #undef PY_SSL_DEFAULT_CIPHER_STRING */
1438
+
1439
+ /* Define if you want to build an interpreter with many run-time checks. */
1440
+ /* #undef Py_DEBUG */
1441
+
1442
+ /* Defined if Python is built as a shared library. */
1443
+ /* #undef Py_ENABLE_SHARED */
1444
+
1445
+ /* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
1446
+ externally defined: 0 */
1447
+ /* #undef Py_HASH_ALGORITHM */
1448
+
1449
+ /* Define if you want to enable tracing references for debugging purpose */
1450
+ /* #undef Py_TRACE_REFS */
1451
+
1452
+ /* assume C89 semantics that RETSIGTYPE is always void */
1453
+ #define RETSIGTYPE void
1454
+
1455
+ /* Define if setpgrp() must be called as setpgrp(0, 0). */
1456
+ /* #undef SETPGRP_HAVE_ARG */
1457
+
1458
+ /* Define to 1 if you must link with -lrt for shm_open(). */
1459
+ #define SHM_NEEDS_LIBRT 1
1460
+
1461
+ /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
1462
+ /* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
1463
+
1464
+ /* The size of `double', as computed by sizeof. */
1465
+ #define SIZEOF_DOUBLE 8
1466
+
1467
+ /* The size of `float', as computed by sizeof. */
1468
+ #define SIZEOF_FLOAT 4
1469
+
1470
+ /* The size of `fpos_t', as computed by sizeof. */
1471
+ #define SIZEOF_FPOS_T 16
1472
+
1473
+ /* The size of `int', as computed by sizeof. */
1474
+ #define SIZEOF_INT 4
1475
+
1476
+ /* The size of `long', as computed by sizeof. */
1477
+ #define SIZEOF_LONG 8
1478
+
1479
+ /* The size of `long double', as computed by sizeof. */
1480
+ #define SIZEOF_LONG_DOUBLE 16
1481
+
1482
+ /* The size of `long long', as computed by sizeof. */
1483
+ #define SIZEOF_LONG_LONG 8
1484
+
1485
+ /* The size of `off_t', as computed by sizeof. */
1486
+ #define SIZEOF_OFF_T 8
1487
+
1488
+ /* The size of `pid_t', as computed by sizeof. */
1489
+ #define SIZEOF_PID_T 4
1490
+
1491
+ /* The size of `pthread_key_t', as computed by sizeof. */
1492
+ #define SIZEOF_PTHREAD_KEY_T 4
1493
+
1494
+ /* The size of `pthread_t', as computed by sizeof. */
1495
+ #define SIZEOF_PTHREAD_T 8
1496
+
1497
+ /* The size of `short', as computed by sizeof. */
1498
+ #define SIZEOF_SHORT 2
1499
+
1500
+ /* The size of `size_t', as computed by sizeof. */
1501
+ #define SIZEOF_SIZE_T 8
1502
+
1503
+ /* The size of `time_t', as computed by sizeof. */
1504
+ #define SIZEOF_TIME_T 8
1505
+
1506
+ /* The size of `uintptr_t', as computed by sizeof. */
1507
+ #define SIZEOF_UINTPTR_T 8
1508
+
1509
+ /* The size of `void *', as computed by sizeof. */
1510
+ #define SIZEOF_VOID_P 8
1511
+
1512
+ /* The size of `wchar_t', as computed by sizeof. */
1513
+ #define SIZEOF_WCHAR_T 4
1514
+
1515
+ /* The size of `_Bool', as computed by sizeof. */
1516
+ #define SIZEOF__BOOL 1
1517
+
1518
+ /* Define to 1 if you have the ANSI C header files. */
1519
+ #define STDC_HEADERS 1
1520
+
1521
+ /* Define if you can safely include both <sys/select.h> and <sys/time.h>
1522
+ (which you can't on SCO ODT 3.0). */
1523
+ #define SYS_SELECT_WITH_SYS_TIME 1
1524
+
1525
+ /* Custom thread stack size depending on chosen sanitizer runtimes. */
1526
+ /* #undef THREAD_STACK_SIZE */
1527
+
1528
+ /* Library needed by timemodule.c: librt may be needed for clock_gettime() */
1529
+ /* #undef TIMEMODULE_LIB */
1530
+
1531
+ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
1532
+ #define TIME_WITH_SYS_TIME 1
1533
+
1534
+ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
1535
+ /* #undef TM_IN_SYS_TIME */
1536
+
1537
+ /* Define if you want to use computed gotos in ceval.c. */
1538
+ #define USE_COMPUTED_GOTOS 1
1539
+
1540
+ /* Enable extensions on AIX 3, Interix. */
1541
+ #ifndef _ALL_SOURCE
1542
+ # define _ALL_SOURCE 1
1543
+ #endif
1544
+ /* Enable GNU extensions on systems that have them. */
1545
+ #ifndef _GNU_SOURCE
1546
+ # define _GNU_SOURCE 1
1547
+ #endif
1548
+ /* Enable threading extensions on Solaris. */
1549
+ #ifndef _POSIX_PTHREAD_SEMANTICS
1550
+ # define _POSIX_PTHREAD_SEMANTICS 1
1551
+ #endif
1552
+ /* Enable extensions on HP NonStop. */
1553
+ #ifndef _TANDEM_SOURCE
1554
+ # define _TANDEM_SOURCE 1
1555
+ #endif
1556
+ /* Enable general extensions on Solaris. */
1557
+ #ifndef __EXTENSIONS__
1558
+ # define __EXTENSIONS__ 1
1559
+ #endif
1560
+
1561
+
1562
+ /* Define if WINDOW in curses.h offers a field _flags. */
1563
+ #define WINDOW_HAS_FLAGS 1
1564
+
1565
+ /* Define if you want build the _decimal module using a coroutine-local rather
1566
+ than a thread-local context */
1567
+ #define WITH_DECIMAL_CONTEXTVAR 1
1568
+
1569
+ /* Define if you want documentation strings in extension modules */
1570
+ #define WITH_DOC_STRINGS 1
1571
+
1572
+ /* Define if you want to compile in DTrace support */
1573
+ /* #undef WITH_DTRACE */
1574
+
1575
+ /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
1576
+ linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
1577
+ Dyld is necessary to support frameworks. */
1578
+ /* #undef WITH_DYLD */
1579
+
1580
+ /* Define to build the readline module against Editline. */
1581
+ /* #undef WITH_EDITLINE */
1582
+
1583
+ /* Define to 1 if libintl is needed for locale functions. */
1584
+ /* #undef WITH_LIBINTL */
1585
+
1586
+ /* Define if you want to produce an OpenStep/Rhapsody framework (shared
1587
+ library plus accessory files). */
1588
+ /* #undef WITH_NEXT_FRAMEWORK */
1589
+
1590
+ /* Define if you want to compile in Python-specific mallocs */
1591
+ #define WITH_PYMALLOC 1
1592
+
1593
+ /* Define if you want pymalloc to be disabled when running under valgrind */
1594
+ /* #undef WITH_VALGRIND */
1595
+
1596
+ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
1597
+ significant byte first (like Motorola and SPARC, unlike Intel). */
1598
+ #if defined AC_APPLE_UNIVERSAL_BUILD
1599
+ # if defined __BIG_ENDIAN__
1600
+ # define WORDS_BIGENDIAN 1
1601
+ # endif
1602
+ #else
1603
+ # ifndef WORDS_BIGENDIAN
1604
+ /* # undef WORDS_BIGENDIAN */
1605
+ # endif
1606
+ #endif
1607
+
1608
+ /* Define if arithmetic is subject to x87-style double rounding issue */
1609
+ /* #undef X87_DOUBLE_ROUNDING */
1610
+
1611
+ /* Define on OpenBSD to activate all library features */
1612
+ /* #undef _BSD_SOURCE */
1613
+
1614
+ /* Define on Darwin to activate all library features */
1615
+ #define _DARWIN_C_SOURCE 1
1616
+
1617
+ /* This must be set to 64 on some systems to enable large file support. */
1618
+ #define _FILE_OFFSET_BITS 64
1619
+
1620
+ /* Define on Linux to activate all library features */
1621
+ #define _GNU_SOURCE 1
1622
+
1623
+ /* Define to include mbstate_t for mbrtowc */
1624
+ /* #undef _INCLUDE__STDC_A1_SOURCE */
1625
+
1626
+ /* This must be defined on some systems to enable large file support. */
1627
+ #define _LARGEFILE_SOURCE 1
1628
+
1629
+ /* This must be defined on AIX systems to enable large file support. */
1630
+ /* #undef _LARGE_FILES */
1631
+
1632
+ /* Define to 1 if on MINIX. */
1633
+ /* #undef _MINIX */
1634
+
1635
+ /* Define on NetBSD to activate all library features */
1636
+ #define _NETBSD_SOURCE 1
1637
+
1638
+ /* Define to 2 if the system does not provide POSIX.1 features except with
1639
+ this defined. */
1640
+ /* #undef _POSIX_1_SOURCE */
1641
+
1642
+ /* Define to activate features from IEEE Stds 1003.1-2008 */
1643
+ #define _POSIX_C_SOURCE 200809L
1644
+
1645
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
1646
+ /* #undef _POSIX_SOURCE */
1647
+
1648
+ /* Define if you have POSIX threads, and your system does not define that. */
1649
+ /* #undef _POSIX_THREADS */
1650
+
1651
+ /* framework name */
1652
+ #define _PYTHONFRAMEWORK ""
1653
+
1654
+ /* Define to force use of thread-safe errno, h_errno, and other functions */
1655
+ /* #undef _REENTRANT */
1656
+
1657
+ /* Define to the level of X/Open that your system supports */
1658
+ #define _XOPEN_SOURCE 700
1659
+
1660
+ /* Define to activate Unix95-and-earlier features */
1661
+ #define _XOPEN_SOURCE_EXTENDED 1
1662
+
1663
+ /* Define on FreeBSD to activate all library features */
1664
+ #define __BSD_VISIBLE 1
1665
+
1666
+ /* Define to 'long' if <time.h> doesn't define. */
1667
+ /* #undef clock_t */
1668
+
1669
+ /* Define to empty if `const' does not conform to ANSI C. */
1670
+ /* #undef const */
1671
+
1672
+ /* Define to `int' if <sys/types.h> doesn't define. */
1673
+ /* #undef gid_t */
1674
+
1675
+ /* Define to `int' if <sys/types.h> does not define. */
1676
+ /* #undef mode_t */
1677
+
1678
+ /* Define to `long int' if <sys/types.h> does not define. */
1679
+ /* #undef off_t */
1680
+
1681
+ /* Define to `int' if <sys/types.h> does not define. */
1682
+ /* #undef pid_t */
1683
+
1684
+ /* Define to empty if the keyword does not work. */
1685
+ /* #undef signed */
1686
+
1687
+ /* Define to `unsigned int' if <sys/types.h> does not define. */
1688
+ /* #undef size_t */
1689
+
1690
+ /* Define to `int' if <sys/socket.h> does not define. */
1691
+ /* #undef socklen_t */
1692
+
1693
+ /* Define to `int' if <sys/types.h> doesn't define. */
1694
+ /* #undef uid_t */
1695
+
1696
+
1697
+ /* Define the macros needed if on a UnixWare 7.x system. */
1698
+ #if defined(__USLC__) && defined(__SCO_VERSION__)
1699
+ #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
1700
+ #endif
1701
+
1702
+ #endif /*Py_PYCONFIG_H*/
1703
+
janus/include/python3.10/pyexpat.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Stuff to export relevant 'expat' entry points from pyexpat to other
2
+ * parser modules, such as cElementTree. */
3
+
4
+ /* note: you must import expat.h before importing this module! */
5
+
6
+ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
7
+ #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
8
+
9
+ struct PyExpat_CAPI
10
+ {
11
+ char* magic; /* set to PyExpat_CAPI_MAGIC */
12
+ int size; /* set to sizeof(struct PyExpat_CAPI) */
13
+ int MAJOR_VERSION;
14
+ int MINOR_VERSION;
15
+ int MICRO_VERSION;
16
+ /* pointers to selected expat functions. add new functions at
17
+ the end, if needed */
18
+ const XML_LChar * (*ErrorString)(enum XML_Error code);
19
+ enum XML_Error (*GetErrorCode)(XML_Parser parser);
20
+ XML_Size (*GetErrorColumnNumber)(XML_Parser parser);
21
+ XML_Size (*GetErrorLineNumber)(XML_Parser parser);
22
+ enum XML_Status (*Parse)(
23
+ XML_Parser parser, const char *s, int len, int isFinal);
24
+ XML_Parser (*ParserCreate_MM)(
25
+ const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite,
26
+ const XML_Char *namespaceSeparator);
27
+ void (*ParserFree)(XML_Parser parser);
28
+ void (*SetCharacterDataHandler)(
29
+ XML_Parser parser, XML_CharacterDataHandler handler);
30
+ void (*SetCommentHandler)(
31
+ XML_Parser parser, XML_CommentHandler handler);
32
+ void (*SetDefaultHandlerExpand)(
33
+ XML_Parser parser, XML_DefaultHandler handler);
34
+ void (*SetElementHandler)(
35
+ XML_Parser parser, XML_StartElementHandler start,
36
+ XML_EndElementHandler end);
37
+ void (*SetNamespaceDeclHandler)(
38
+ XML_Parser parser, XML_StartNamespaceDeclHandler start,
39
+ XML_EndNamespaceDeclHandler end);
40
+ void (*SetProcessingInstructionHandler)(
41
+ XML_Parser parser, XML_ProcessingInstructionHandler handler);
42
+ void (*SetUnknownEncodingHandler)(
43
+ XML_Parser parser, XML_UnknownEncodingHandler handler,
44
+ void *encodingHandlerData);
45
+ void (*SetUserData)(XML_Parser parser, void *userData);
46
+ void (*SetStartDoctypeDeclHandler)(XML_Parser parser,
47
+ XML_StartDoctypeDeclHandler start);
48
+ enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding);
49
+ int (*DefaultUnknownEncodingHandler)(
50
+ void *encodingHandlerData, const XML_Char *name, XML_Encoding *info);
51
+ /* might be NULL for expat < 2.1.0 */
52
+ int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
53
+ /* might be NULL for expat < 2.6.0 */
54
+ XML_Bool (*SetReparseDeferralEnabled)(XML_Parser parser, XML_Bool enabled);
55
+ /* always add new stuff to the end! */
56
+ };
57
+
janus/include/python3.10/pyframe.h ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Limited C API of PyFrame API
2
+ *
3
+ * Include "frameobject.h" to get the PyFrameObject structure.
4
+ */
5
+
6
+ #ifndef Py_PYFRAME_H
7
+ #define Py_PYFRAME_H
8
+ #ifdef __cplusplus
9
+ extern "C" {
10
+ #endif
11
+
12
+ typedef struct _frame PyFrameObject;
13
+
14
+ /* Return the line of code the frame is currently executing. */
15
+ PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
16
+
17
+ PyAPI_FUNC(PyCodeObject *) PyFrame_GetCode(PyFrameObject *frame);
18
+
19
+ #ifdef __cplusplus
20
+ }
21
+ #endif
22
+ #endif /* !Py_PYFRAME_H */
janus/include/python3.10/pyhash.h ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_HASH_H
2
+
3
+ #define Py_HASH_H
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ /* Helpers for hash functions */
9
+ #ifndef Py_LIMITED_API
10
+ PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
11
+ PyAPI_FUNC(Py_hash_t) _Py_HashPointer(const void*);
12
+ // Similar to _Py_HashPointer(), but don't replace -1 with -2
13
+ PyAPI_FUNC(Py_hash_t) _Py_HashPointerRaw(const void*);
14
+ PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
15
+ #endif
16
+
17
+ /* Prime multiplier used in string and various other hashes. */
18
+ #define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
19
+
20
+ /* Parameters used for the numeric hash implementation. See notes for
21
+ _Py_HashDouble in Python/pyhash.c. Numeric hashes are based on
22
+ reduction modulo the prime 2**_PyHASH_BITS - 1. */
23
+
24
+ #if SIZEOF_VOID_P >= 8
25
+ # define _PyHASH_BITS 61
26
+ #else
27
+ # define _PyHASH_BITS 31
28
+ #endif
29
+
30
+ #define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
31
+ #define _PyHASH_INF 314159
32
+ #define _PyHASH_IMAG _PyHASH_MULTIPLIER
33
+
34
+
35
+ /* hash secret
36
+ *
37
+ * memory layout on 64 bit systems
38
+ * cccccccc cccccccc cccccccc uc -- unsigned char[24]
39
+ * pppppppp ssssssss ........ fnv -- two Py_hash_t
40
+ * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
41
+ * ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
42
+ * ........ ........ eeeeeeee pyexpat XML hash salt
43
+ *
44
+ * memory layout on 32 bit systems
45
+ * cccccccc cccccccc cccccccc uc
46
+ * ppppssss ........ ........ fnv -- two Py_hash_t
47
+ * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
48
+ * ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
49
+ * ........ ........ eeee.... pyexpat XML hash salt
50
+ *
51
+ * (*) The siphash member may not be available on 32 bit platforms without
52
+ * an unsigned int64 data type.
53
+ */
54
+ #ifndef Py_LIMITED_API
55
+ typedef union {
56
+ /* ensure 24 bytes */
57
+ unsigned char uc[24];
58
+ /* two Py_hash_t for FNV */
59
+ struct {
60
+ Py_hash_t prefix;
61
+ Py_hash_t suffix;
62
+ } fnv;
63
+ /* two uint64 for SipHash24 */
64
+ struct {
65
+ uint64_t k0;
66
+ uint64_t k1;
67
+ } siphash;
68
+ /* a different (!) Py_hash_t for small string optimization */
69
+ struct {
70
+ unsigned char padding[16];
71
+ Py_hash_t suffix;
72
+ } djbx33a;
73
+ struct {
74
+ unsigned char padding[16];
75
+ Py_hash_t hashsalt;
76
+ } expat;
77
+ } _Py_HashSecret_t;
78
+ PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
79
+
80
+ #ifdef Py_DEBUG
81
+ PyAPI_DATA(int) _Py_HashSecret_Initialized;
82
+ #endif
83
+
84
+
85
+ /* hash function definition */
86
+ typedef struct {
87
+ Py_hash_t (*const hash)(const void *, Py_ssize_t);
88
+ const char *name;
89
+ const int hash_bits;
90
+ const int seed_bits;
91
+ } PyHash_FuncDef;
92
+
93
+ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
94
+ #endif
95
+
96
+
97
+ /* cutoff for small string DJBX33A optimization in range [1, cutoff).
98
+ *
99
+ * About 50% of the strings in a typical Python application are smaller than
100
+ * 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks.
101
+ * NEVER use DJBX33A for long strings!
102
+ *
103
+ * A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms
104
+ * should use a smaller cutoff because it is easier to create colliding
105
+ * strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should
106
+ * provide a decent safety margin.
107
+ */
108
+ #ifndef Py_HASH_CUTOFF
109
+ # define Py_HASH_CUTOFF 0
110
+ #elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0)
111
+ # error Py_HASH_CUTOFF must in range 0...7.
112
+ #endif /* Py_HASH_CUTOFF */
113
+
114
+
115
+ /* hash algorithm selection
116
+ *
117
+ * The values for Py_HASH_SIPHASH24 and Py_HASH_FNV are hard-coded in the
118
+ * configure script.
119
+ *
120
+ * - FNV is available on all platforms and architectures.
121
+ * - SIPHASH24 only works on platforms that don't require aligned memory for integers.
122
+ * - With EXTERNAL embedders can provide an alternative implementation with::
123
+ *
124
+ * PyHash_FuncDef PyHash_Func = {...};
125
+ *
126
+ * XXX: Figure out __declspec() for extern PyHash_FuncDef.
127
+ */
128
+ #define Py_HASH_EXTERNAL 0
129
+ #define Py_HASH_SIPHASH24 1
130
+ #define Py_HASH_FNV 2
131
+
132
+ #ifndef Py_HASH_ALGORITHM
133
+ # ifndef HAVE_ALIGNED_REQUIRED
134
+ # define Py_HASH_ALGORITHM Py_HASH_SIPHASH24
135
+ # else
136
+ # define Py_HASH_ALGORITHM Py_HASH_FNV
137
+ # endif /* uint64_t && uint32_t && aligned */
138
+ #endif /* Py_HASH_ALGORITHM */
139
+
140
+ #ifdef __cplusplus
141
+ }
142
+ #endif
143
+
144
+ #endif /* !Py_HASH_H */
janus/include/python3.10/pymacconfig.h ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef PYMACCONFIG_H
2
+ #define PYMACCONFIG_H
3
+ /*
4
+ * This file moves some of the autoconf magic to compile-time
5
+ * when building on MacOSX. This is needed for building 4-way
6
+ * universal binaries and for 64-bit universal binaries because
7
+ * the values redefined below aren't configure-time constant but
8
+ * only compile-time constant in these scenarios.
9
+ */
10
+
11
+ #if defined(__APPLE__)
12
+
13
+ # undef SIZEOF_LONG
14
+ # undef SIZEOF_PTHREAD_T
15
+ # undef SIZEOF_SIZE_T
16
+ # undef SIZEOF_TIME_T
17
+ # undef SIZEOF_VOID_P
18
+ # undef SIZEOF__BOOL
19
+ # undef SIZEOF_UINTPTR_T
20
+ # undef SIZEOF_PTHREAD_T
21
+ # undef WORDS_BIGENDIAN
22
+ # undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
23
+ # undef DOUBLE_IS_BIG_ENDIAN_IEEE754
24
+ # undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
25
+ # undef HAVE_GCC_ASM_FOR_X87
26
+
27
+ # undef VA_LIST_IS_ARRAY
28
+ # if defined(__LP64__) && defined(__x86_64__)
29
+ # define VA_LIST_IS_ARRAY 1
30
+ # endif
31
+
32
+ # undef HAVE_LARGEFILE_SUPPORT
33
+ # ifndef __LP64__
34
+ # define HAVE_LARGEFILE_SUPPORT 1
35
+ # endif
36
+
37
+ # undef SIZEOF_LONG
38
+ # ifdef __LP64__
39
+ # define SIZEOF__BOOL 1
40
+ # define SIZEOF__BOOL 1
41
+ # define SIZEOF_LONG 8
42
+ # define SIZEOF_PTHREAD_T 8
43
+ # define SIZEOF_SIZE_T 8
44
+ # define SIZEOF_TIME_T 8
45
+ # define SIZEOF_VOID_P 8
46
+ # define SIZEOF_UINTPTR_T 8
47
+ # define SIZEOF_PTHREAD_T 8
48
+ # else
49
+ # ifdef __ppc__
50
+ # define SIZEOF__BOOL 4
51
+ # else
52
+ # define SIZEOF__BOOL 1
53
+ # endif
54
+ # define SIZEOF_LONG 4
55
+ # define SIZEOF_PTHREAD_T 4
56
+ # define SIZEOF_SIZE_T 4
57
+ # define SIZEOF_TIME_T 4
58
+ # define SIZEOF_VOID_P 4
59
+ # define SIZEOF_UINTPTR_T 4
60
+ # define SIZEOF_PTHREAD_T 4
61
+ # endif
62
+
63
+ # if defined(__LP64__)
64
+ /* MacOSX 10.4 (the first release to support 64-bit code
65
+ * at all) only supports 64-bit in the UNIX layer.
66
+ * Therefore suppress the toolbox-glue in 64-bit mode.
67
+ */
68
+
69
+ /* In 64-bit mode setpgrp always has no arguments, in 32-bit
70
+ * mode that depends on the compilation environment
71
+ */
72
+ # undef SETPGRP_HAVE_ARG
73
+
74
+ # endif
75
+
76
+ #ifdef __BIG_ENDIAN__
77
+ #define WORDS_BIGENDIAN 1
78
+ #define DOUBLE_IS_BIG_ENDIAN_IEEE754
79
+ #else
80
+ #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
81
+ #endif /* __BIG_ENDIAN */
82
+
83
+ #ifdef __i386__
84
+ # define HAVE_GCC_ASM_FOR_X87
85
+ #endif
86
+
87
+ /*
88
+ * The definition in pyconfig.h is only valid on the OS release
89
+ * where configure ran on and not necessarily for all systems where
90
+ * the executable can be used on.
91
+ *
92
+ * Specifically: OSX 10.4 has limited supported for '%zd', while
93
+ * 10.5 has full support for '%zd'. A binary built on 10.5 won't
94
+ * work properly on 10.4 unless we suppress the definition
95
+ * of PY_FORMAT_SIZE_T
96
+ */
97
+ #undef PY_FORMAT_SIZE_T
98
+
99
+
100
+ #endif /* defined(_APPLE__) */
101
+
102
+ #endif /* PYMACCONFIG_H */
janus/include/python3.10/pymacro.h ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_PYMACRO_H
2
+ #define Py_PYMACRO_H
3
+
4
+ /* Minimum value between x and y */
5
+ #define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))
6
+
7
+ /* Maximum value between x and y */
8
+ #define Py_MAX(x, y) (((x) > (y)) ? (x) : (y))
9
+
10
+ /* Absolute value of the number x */
11
+ #define Py_ABS(x) ((x) < 0 ? -(x) : (x))
12
+
13
+ #define _Py_XSTRINGIFY(x) #x
14
+
15
+ /* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced
16
+ with "123" by the preprocessor. Defines are also replaced by their value.
17
+ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not
18
+ by "__LINE__". */
19
+ #define Py_STRINGIFY(x) _Py_XSTRINGIFY(x)
20
+
21
+ /* Get the size of a structure member in bytes */
22
+ #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
23
+
24
+ /* Argument must be a char or an int in [-128, 127] or [0, 255]. */
25
+ #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
26
+
27
+ /* Assert a build-time dependency, as an expression.
28
+
29
+ Your compile will fail if the condition isn't true, or can't be evaluated
30
+ by the compiler. This can be used in an expression: its value is 0.
31
+
32
+ Example:
33
+
34
+ #define foo_to_char(foo) \
35
+ ((char *)(foo) \
36
+ + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
37
+
38
+ Written by Rusty Russell, public domain, http://ccodearchive.net/ */
39
+ #define Py_BUILD_ASSERT_EXPR(cond) \
40
+ (sizeof(char [1 - 2*!(cond)]) - 1)
41
+
42
+ #define Py_BUILD_ASSERT(cond) do { \
43
+ (void)Py_BUILD_ASSERT_EXPR(cond); \
44
+ } while(0)
45
+
46
+ /* Get the number of elements in a visible array
47
+
48
+ This does not work on pointers, or arrays declared as [], or function
49
+ parameters. With correct compiler support, such usage will cause a build
50
+ error (see Py_BUILD_ASSERT_EXPR).
51
+
52
+ Written by Rusty Russell, public domain, http://ccodearchive.net/
53
+
54
+ Requires at GCC 3.1+ */
55
+ #if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
56
+ (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ >= 4)))
57
+ /* Two gcc extensions.
58
+ &a[0] degrades to a pointer: a different type from an array */
59
+ #define Py_ARRAY_LENGTH(array) \
60
+ (sizeof(array) / sizeof((array)[0]) \
61
+ + Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \
62
+ typeof(&(array)[0]))))
63
+ #else
64
+ #define Py_ARRAY_LENGTH(array) \
65
+ (sizeof(array) / sizeof((array)[0]))
66
+ #endif
67
+
68
+
69
+ /* Define macros for inline documentation. */
70
+ #define PyDoc_VAR(name) static const char name[]
71
+ #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
72
+ #ifdef WITH_DOC_STRINGS
73
+ #define PyDoc_STR(str) str
74
+ #else
75
+ #define PyDoc_STR(str) ""
76
+ #endif
77
+
78
+ /* Below "a" is a power of 2. */
79
+ /* Round down size "n" to be a multiple of "a". */
80
+ #define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1))
81
+ /* Round up size "n" to be a multiple of "a". */
82
+ #define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \
83
+ (size_t)((a) - 1)) & ~(size_t)((a) - 1))
84
+ /* Round pointer "p" down to the closest "a"-aligned address <= "p". */
85
+ #define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1)))
86
+ /* Round pointer "p" up to the closest "a"-aligned address >= "p". */
87
+ #define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \
88
+ (uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1)))
89
+ /* Check if pointer "p" is aligned to "a"-bytes boundary. */
90
+ #define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1)))
91
+
92
+ /* Use this for unused arguments in a function definition to silence compiler
93
+ * warnings. Example:
94
+ *
95
+ * int func(int a, int Py_UNUSED(b)) { return a; }
96
+ */
97
+ #if defined(__GNUC__) || defined(__clang__)
98
+ # define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
99
+ #else
100
+ # define Py_UNUSED(name) _unused_ ## name
101
+ #endif
102
+
103
+ #if defined(RANDALL_WAS_HERE)
104
+ # define Py_UNREACHABLE() \
105
+ Py_FatalError( \
106
+ "If you're seeing this, the code is in what I thought was\n" \
107
+ "an unreachable state.\n\n" \
108
+ "I could give you advice for what to do, but honestly, why\n" \
109
+ "should you trust me? I clearly screwed this up. I'm writing\n" \
110
+ "a message that should never appear, yet I know it will\n" \
111
+ "probably appear someday.\n\n" \
112
+ "On a deep level, I know I'm not up to this task.\n" \
113
+ "I'm so sorry.\n" \
114
+ "https://xkcd.com/2200")
115
+ #elif defined(Py_DEBUG)
116
+ # define Py_UNREACHABLE() \
117
+ Py_FatalError( \
118
+ "We've reached an unreachable state. Anything is possible.\n" \
119
+ "The limits were in our heads all along. Follow your dreams.\n" \
120
+ "https://xkcd.com/2200")
121
+ #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
122
+ # define Py_UNREACHABLE() __builtin_unreachable()
123
+ #elif defined(__clang__) || defined(__INTEL_COMPILER)
124
+ # define Py_UNREACHABLE() __builtin_unreachable()
125
+ #elif defined(_MSC_VER)
126
+ # define Py_UNREACHABLE() __assume(0)
127
+ #else
128
+ # define Py_UNREACHABLE() \
129
+ Py_FatalError("Unreachable C code path reached")
130
+ #endif
131
+
132
+ #endif /* Py_PYMACRO_H */
janus/include/python3.10/pymem.h ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* The PyMem_ family: low-level memory allocation interfaces.
2
+ See objimpl.h for the PyObject_ memory family.
3
+ */
4
+
5
+ #ifndef Py_PYMEM_H
6
+ #define Py_PYMEM_H
7
+
8
+ #include "pyport.h"
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /* BEWARE:
15
+
16
+ Each interface exports both functions and macros. Extension modules should
17
+ use the functions, to ensure binary compatibility across Python versions.
18
+ Because the Python implementation is free to change internal details, and
19
+ the macros may (or may not) expose details for speed, if you do use the
20
+ macros you must recompile your extensions with each Python release.
21
+
22
+ Never mix calls to PyMem_ with calls to the platform malloc/realloc/
23
+ calloc/free. For example, on Windows different DLLs may end up using
24
+ different heaps, and if you use PyMem_Malloc you'll get the memory from the
25
+ heap used by the Python DLL; it could be a disaster if you free()'ed that
26
+ directly in your own extension. Using PyMem_Free instead ensures Python
27
+ can return the memory to the proper heap. As another example, in
28
+ a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and
29
+ PyObject_ memory functions in special debugging wrappers that add additional
30
+ debugging info to dynamic memory blocks. The system routines have no idea
31
+ what to do with that stuff, and the Python wrappers have no idea what to do
32
+ with raw blocks obtained directly by the system routines then.
33
+
34
+ The GIL must be held when using these APIs.
35
+ */
36
+
37
+ /*
38
+ * Raw memory interface
39
+ * ====================
40
+ */
41
+
42
+ /* Functions
43
+
44
+ Functions supplying platform-independent semantics for malloc/realloc/
45
+ free. These functions make sure that allocating 0 bytes returns a distinct
46
+ non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
47
+ may be returned), even if the platform malloc and realloc don't.
48
+ Returned pointers must be checked for NULL explicitly. No action is
49
+ performed on failure (no exception is set, no warning is printed, etc).
50
+ */
51
+
52
+ PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
53
+ PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
54
+ PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
55
+ PyAPI_FUNC(void) PyMem_Free(void *ptr);
56
+
57
+ /*
58
+ * Type-oriented memory interface
59
+ * ==============================
60
+ *
61
+ * Allocate memory for n objects of the given type. Returns a new pointer
62
+ * or NULL if the request was too large or memory allocation failed. Use
63
+ * these macros rather than doing the multiplication yourself so that proper
64
+ * overflow checking is always done.
65
+ */
66
+
67
+ #define PyMem_New(type, n) \
68
+ ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
69
+ ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
70
+
71
+ /*
72
+ * The value of (p) is always clobbered by this macro regardless of success.
73
+ * The caller MUST check if (p) is NULL afterwards and deal with the memory
74
+ * error if so. This means the original value of (p) MUST be saved for the
75
+ * caller's memory error handler to not lose track of it.
76
+ */
77
+ #define PyMem_Resize(p, type, n) \
78
+ ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
79
+ (type *) PyMem_Realloc((p), (n) * sizeof(type)) )
80
+
81
+
82
+ // Deprecated aliases only kept for backward compatibility.
83
+ // PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
84
+ // them as function pointers (ex: dealloc = PyMem_Del).
85
+ #define PyMem_MALLOC(n) PyMem_Malloc(n)
86
+ #define PyMem_NEW(type, n) PyMem_New(type, n)
87
+ #define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
88
+ #define PyMem_RESIZE(p, type, n) PyMem_Resize(p, type, n)
89
+ #define PyMem_FREE(p) PyMem_Free(p)
90
+ #define PyMem_Del PyMem_Free
91
+ #define PyMem_DEL PyMem_Free
92
+
93
+
94
+ #ifndef Py_LIMITED_API
95
+ # define Py_CPYTHON_PYMEM_H
96
+ # include "cpython/pymem.h"
97
+ # undef Py_CPYTHON_PYMEM_H
98
+ #endif
99
+
100
+ #ifdef __cplusplus
101
+ }
102
+ #endif
103
+
104
+ #endif /* !Py_PYMEM_H */
janus/include/python3.10/pyport.h ADDED
@@ -0,0 +1,889 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_PYPORT_H
2
+ #define Py_PYPORT_H
3
+
4
+ #include "pyconfig.h" /* include for defines */
5
+
6
+ #include <inttypes.h>
7
+
8
+
9
+ /* Defines to build Python and its standard library:
10
+ *
11
+ * - Py_BUILD_CORE: Build Python core. Give access to Python internals, but
12
+ * should not be used by third-party modules.
13
+ * - Py_BUILD_CORE_BUILTIN: Build a Python stdlib module as a built-in module.
14
+ * - Py_BUILD_CORE_MODULE: Build a Python stdlib module as a dynamic library.
15
+ *
16
+ * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE imply Py_BUILD_CORE.
17
+ *
18
+ * On Windows, Py_BUILD_CORE_MODULE exports "PyInit_xxx" symbol, whereas
19
+ * Py_BUILD_CORE_BUILTIN does not.
20
+ */
21
+ #if defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE)
22
+ # define Py_BUILD_CORE
23
+ #endif
24
+ #if defined(Py_BUILD_CORE_MODULE) && !defined(Py_BUILD_CORE)
25
+ # define Py_BUILD_CORE
26
+ #endif
27
+
28
+
29
+ /**************************************************************************
30
+ Symbols and macros to supply platform-independent interfaces to basic
31
+ C language & library operations whose spellings vary across platforms.
32
+
33
+ Please try to make documentation here as clear as possible: by definition,
34
+ the stuff here is trying to illuminate C's darkest corners.
35
+
36
+ Config #defines referenced here:
37
+
38
+ SIGNED_RIGHT_SHIFT_ZERO_FILLS
39
+ Meaning: To be defined iff i>>j does not extend the sign bit when i is a
40
+ signed integral type and i < 0.
41
+ Used in: Py_ARITHMETIC_RIGHT_SHIFT
42
+
43
+ Py_DEBUG
44
+ Meaning: Extra checks compiled in for debug mode.
45
+ Used in: Py_SAFE_DOWNCAST
46
+
47
+ **************************************************************************/
48
+
49
+ /* typedefs for some C9X-defined synonyms for integral types.
50
+ *
51
+ * The names in Python are exactly the same as the C9X names, except with a
52
+ * Py_ prefix. Until C9X is universally implemented, this is the only way
53
+ * to ensure that Python gets reliable names that don't conflict with names
54
+ * in non-Python code that are playing their own tricks to define the C9X
55
+ * names.
56
+ *
57
+ * NOTE: don't go nuts here! Python has no use for *most* of the C9X
58
+ * integral synonyms. Only define the ones we actually need.
59
+ */
60
+
61
+ /* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */
62
+ #ifndef HAVE_LONG_LONG
63
+ #define HAVE_LONG_LONG 1
64
+ #endif
65
+ #ifndef PY_LONG_LONG
66
+ #define PY_LONG_LONG long long
67
+ /* If LLONG_MAX is defined in limits.h, use that. */
68
+ #define PY_LLONG_MIN LLONG_MIN
69
+ #define PY_LLONG_MAX LLONG_MAX
70
+ #define PY_ULLONG_MAX ULLONG_MAX
71
+ #endif
72
+
73
+ #define PY_UINT32_T uint32_t
74
+ #define PY_UINT64_T uint64_t
75
+
76
+ /* Signed variants of the above */
77
+ #define PY_INT32_T int32_t
78
+ #define PY_INT64_T int64_t
79
+
80
+ /* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all
81
+ the necessary integer types are available, and we're on a 64-bit platform
82
+ (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */
83
+
84
+ #ifndef PYLONG_BITS_IN_DIGIT
85
+ #if SIZEOF_VOID_P >= 8
86
+ #define PYLONG_BITS_IN_DIGIT 30
87
+ #else
88
+ #define PYLONG_BITS_IN_DIGIT 15
89
+ #endif
90
+ #endif
91
+
92
+ /* uintptr_t is the C9X name for an unsigned integral type such that a
93
+ * legitimate void* can be cast to uintptr_t and then back to void* again
94
+ * without loss of information. Similarly for intptr_t, wrt a signed
95
+ * integral type.
96
+ */
97
+ typedef uintptr_t Py_uintptr_t;
98
+ typedef intptr_t Py_intptr_t;
99
+
100
+ /* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) ==
101
+ * sizeof(size_t). C99 doesn't define such a thing directly (size_t is an
102
+ * unsigned integral type). See PEP 353 for details.
103
+ */
104
+ #ifdef HAVE_PY_SSIZE_T
105
+
106
+ #elif HAVE_SSIZE_T
107
+ typedef ssize_t Py_ssize_t;
108
+ #elif SIZEOF_VOID_P == SIZEOF_SIZE_T
109
+ typedef Py_intptr_t Py_ssize_t;
110
+ #else
111
+ # error "Python needs a typedef for Py_ssize_t in pyport.h."
112
+ #endif
113
+
114
+ /* Py_hash_t is the same size as a pointer. */
115
+ #define SIZEOF_PY_HASH_T SIZEOF_SIZE_T
116
+ typedef Py_ssize_t Py_hash_t;
117
+ /* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */
118
+ #define SIZEOF_PY_UHASH_T SIZEOF_SIZE_T
119
+ typedef size_t Py_uhash_t;
120
+
121
+ /* Only used for compatibility with code that may not be PY_SSIZE_T_CLEAN. */
122
+ #ifdef PY_SSIZE_T_CLEAN
123
+ typedef Py_ssize_t Py_ssize_clean_t;
124
+ #else
125
+ typedef int Py_ssize_clean_t;
126
+ #endif
127
+
128
+ /* Largest possible value of size_t. */
129
+ #define PY_SIZE_MAX SIZE_MAX
130
+
131
+ /* Largest positive value of type Py_ssize_t. */
132
+ #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
133
+ /* Smallest negative value of type Py_ssize_t. */
134
+ #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
135
+
136
+ /* Macro kept for backward compatibility: use "z" in new code.
137
+ *
138
+ * PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
139
+ * format to convert an argument with the width of a size_t or Py_ssize_t.
140
+ * C99 introduced "z" for this purpose, but old MSVCs had not supported it.
141
+ * Since MSVC supports "z" since (at least) 2015, we can just use "z"
142
+ * for new code.
143
+ *
144
+ * These "high level" Python format functions interpret "z" correctly on
145
+ * all platforms (Python interprets the format string itself, and does whatever
146
+ * the platform C requires to convert a size_t/Py_ssize_t argument):
147
+ *
148
+ * PyBytes_FromFormat
149
+ * PyErr_Format
150
+ * PyBytes_FromFormatV
151
+ * PyUnicode_FromFormatV
152
+ *
153
+ * Lower-level uses require that you interpolate the correct format modifier
154
+ * yourself (e.g., calling printf, fprintf, sprintf, PyOS_snprintf); for
155
+ * example,
156
+ *
157
+ * Py_ssize_t index;
158
+ * fprintf(stderr, "index %" PY_FORMAT_SIZE_T "d sucks\n", index);
159
+ *
160
+ * That will expand to %zd or to something else correct for a Py_ssize_t on
161
+ * the platform.
162
+ */
163
+ #ifndef PY_FORMAT_SIZE_T
164
+ # define PY_FORMAT_SIZE_T "z"
165
+ #endif
166
+
167
+ /* Py_LOCAL can be used instead of static to get the fastest possible calling
168
+ * convention for functions that are local to a given module.
169
+ *
170
+ * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
171
+ * for platforms that support that.
172
+ *
173
+ * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more
174
+ * "aggressive" inlining/optimization is enabled for the entire module. This
175
+ * may lead to code bloat, and may slow things down for those reasons. It may
176
+ * also lead to errors, if the code relies on pointer aliasing. Use with
177
+ * care.
178
+ *
179
+ * NOTE: You can only use this for functions that are entirely local to a
180
+ * module; functions that are exported via method tables, callbacks, etc,
181
+ * should keep using static.
182
+ */
183
+
184
+ #if defined(_MSC_VER)
185
+ # if defined(PY_LOCAL_AGGRESSIVE)
186
+ /* enable more aggressive optimization for MSVC */
187
+ /* active in both release and debug builds - see bpo-43271 */
188
+ # pragma optimize("gt", on)
189
+ #endif
190
+ /* ignore warnings if the compiler decides not to inline a function */
191
+ # pragma warning(disable: 4710)
192
+ /* fastest possible local call under MSVC */
193
+ # define Py_LOCAL(type) static type __fastcall
194
+ # define Py_LOCAL_INLINE(type) static __inline type __fastcall
195
+ #else
196
+ # define Py_LOCAL(type) static type
197
+ # define Py_LOCAL_INLINE(type) static inline type
198
+ #endif
199
+
200
+ /* Py_MEMCPY is kept for backwards compatibility,
201
+ * see https://bugs.python.org/issue28126 */
202
+ #define Py_MEMCPY memcpy
203
+
204
+ #include <stdlib.h>
205
+
206
+ #ifdef HAVE_IEEEFP_H
207
+ #include <ieeefp.h> /* needed for 'finite' declaration on some platforms */
208
+ #endif
209
+
210
+ #include <math.h> /* Moved here from the math section, before extern "C" */
211
+
212
+ /********************************************
213
+ * WRAPPER FOR <time.h> and/or <sys/time.h> *
214
+ ********************************************/
215
+
216
+ #ifdef TIME_WITH_SYS_TIME
217
+ #include <sys/time.h>
218
+ #include <time.h>
219
+ #else /* !TIME_WITH_SYS_TIME */
220
+ #ifdef HAVE_SYS_TIME_H
221
+ #include <sys/time.h>
222
+ #else /* !HAVE_SYS_TIME_H */
223
+ #include <time.h>
224
+ #endif /* !HAVE_SYS_TIME_H */
225
+ #endif /* !TIME_WITH_SYS_TIME */
226
+
227
+
228
+ /******************************
229
+ * WRAPPER FOR <sys/select.h> *
230
+ ******************************/
231
+
232
+ /* NB caller must include <sys/types.h> */
233
+
234
+ #ifdef HAVE_SYS_SELECT_H
235
+ #include <sys/select.h>
236
+ #endif /* !HAVE_SYS_SELECT_H */
237
+
238
+ /*******************************
239
+ * stat() and fstat() fiddling *
240
+ *******************************/
241
+
242
+ #ifdef HAVE_SYS_STAT_H
243
+ #include <sys/stat.h>
244
+ #elif defined(HAVE_STAT_H)
245
+ #include <stat.h>
246
+ #endif
247
+
248
+ #ifndef S_IFMT
249
+ /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
250
+ #define S_IFMT 0170000
251
+ #endif
252
+
253
+ #ifndef S_IFLNK
254
+ /* Windows doesn't define S_IFLNK but posixmodule.c maps
255
+ * IO_REPARSE_TAG_SYMLINK to S_IFLNK */
256
+ # define S_IFLNK 0120000
257
+ #endif
258
+
259
+ #ifndef S_ISREG
260
+ #define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
261
+ #endif
262
+
263
+ #ifndef S_ISDIR
264
+ #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
265
+ #endif
266
+
267
+ #ifndef S_ISCHR
268
+ #define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
269
+ #endif
270
+
271
+ #ifdef __cplusplus
272
+ /* Move this down here since some C++ #include's don't like to be included
273
+ inside an extern "C" */
274
+ extern "C" {
275
+ #endif
276
+
277
+
278
+ /* Py_ARITHMETIC_RIGHT_SHIFT
279
+ * C doesn't define whether a right-shift of a signed integer sign-extends
280
+ * or zero-fills. Here a macro to force sign extension:
281
+ * Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J)
282
+ * Return I >> J, forcing sign extension. Arithmetically, return the
283
+ * floor of I/2**J.
284
+ * Requirements:
285
+ * I should have signed integer type. In the terminology of C99, this can
286
+ * be either one of the five standard signed integer types (signed char,
287
+ * short, int, long, long long) or an extended signed integer type.
288
+ * J is an integer >= 0 and strictly less than the number of bits in the
289
+ * type of I (because C doesn't define what happens for J outside that
290
+ * range either).
291
+ * TYPE used to specify the type of I, but is now ignored. It's been left
292
+ * in for backwards compatibility with versions <= 2.6 or 3.0.
293
+ * Caution:
294
+ * I may be evaluated more than once.
295
+ */
296
+ #ifdef SIGNED_RIGHT_SHIFT_ZERO_FILLS
297
+ #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) \
298
+ ((I) < 0 ? -1-((-1-(I)) >> (J)) : (I) >> (J))
299
+ #else
300
+ #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) ((I) >> (J))
301
+ #endif
302
+
303
+ /* Py_FORCE_EXPANSION(X)
304
+ * "Simply" returns its argument. However, macro expansions within the
305
+ * argument are evaluated. This unfortunate trickery is needed to get
306
+ * token-pasting to work as desired in some cases.
307
+ */
308
+ #define Py_FORCE_EXPANSION(X) X
309
+
310
+ /* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW)
311
+ * Cast VALUE to type NARROW from type WIDE. In Py_DEBUG mode, this
312
+ * assert-fails if any information is lost.
313
+ * Caution:
314
+ * VALUE may be evaluated more than once.
315
+ */
316
+ #ifdef Py_DEBUG
317
+ #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \
318
+ (assert((WIDE)(NARROW)(VALUE) == (VALUE)), (NARROW)(VALUE))
319
+ #else
320
+ #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE)
321
+ #endif
322
+
323
+ /* Py_SET_ERRNO_ON_MATH_ERROR(x)
324
+ * If a libm function did not set errno, but it looks like the result
325
+ * overflowed or not-a-number, set errno to ERANGE or EDOM. Set errno
326
+ * to 0 before calling a libm function, and invoke this macro after,
327
+ * passing the function result.
328
+ * Caution:
329
+ * This isn't reliable. See Py_OVERFLOWED comments.
330
+ * X is evaluated more than once.
331
+ */
332
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__hpux) && defined(__ia64))
333
+ #define _Py_SET_EDOM_FOR_NAN(X) if (isnan(X)) errno = EDOM;
334
+ #else
335
+ #define _Py_SET_EDOM_FOR_NAN(X) ;
336
+ #endif
337
+ #define Py_SET_ERRNO_ON_MATH_ERROR(X) \
338
+ do { \
339
+ if (errno == 0) { \
340
+ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \
341
+ errno = ERANGE; \
342
+ else _Py_SET_EDOM_FOR_NAN(X) \
343
+ } \
344
+ } while(0)
345
+
346
+ /* Py_SET_ERANGE_IF_OVERFLOW(x)
347
+ * An alias of Py_SET_ERRNO_ON_MATH_ERROR for backward-compatibility.
348
+ */
349
+ #define Py_SET_ERANGE_IF_OVERFLOW(X) Py_SET_ERRNO_ON_MATH_ERROR(X)
350
+
351
+ /* Py_ADJUST_ERANGE1(x)
352
+ * Py_ADJUST_ERANGE2(x, y)
353
+ * Set errno to 0 before calling a libm function, and invoke one of these
354
+ * macros after, passing the function result(s) (Py_ADJUST_ERANGE2 is useful
355
+ * for functions returning complex results). This makes two kinds of
356
+ * adjustments to errno: (A) If it looks like the platform libm set
357
+ * errno=ERANGE due to underflow, clear errno. (B) If it looks like the
358
+ * platform libm overflowed but didn't set errno, force errno to ERANGE. In
359
+ * effect, we're trying to force a useful implementation of C89 errno
360
+ * behavior.
361
+ * Caution:
362
+ * This isn't reliable. See Py_OVERFLOWED comments.
363
+ * X and Y may be evaluated more than once.
364
+ */
365
+ #define Py_ADJUST_ERANGE1(X) \
366
+ do { \
367
+ if (errno == 0) { \
368
+ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \
369
+ errno = ERANGE; \
370
+ } \
371
+ else if (errno == ERANGE && (X) == 0.0) \
372
+ errno = 0; \
373
+ } while(0)
374
+
375
+ #define Py_ADJUST_ERANGE2(X, Y) \
376
+ do { \
377
+ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL || \
378
+ (Y) == Py_HUGE_VAL || (Y) == -Py_HUGE_VAL) { \
379
+ if (errno == 0) \
380
+ errno = ERANGE; \
381
+ } \
382
+ else if (errno == ERANGE) \
383
+ errno = 0; \
384
+ } while(0)
385
+
386
+ /* The functions _Py_dg_strtod and _Py_dg_dtoa in Python/dtoa.c (which are
387
+ * required to support the short float repr introduced in Python 3.1) require
388
+ * that the floating-point unit that's being used for arithmetic operations
389
+ * on C doubles is set to use 53-bit precision. It also requires that the
390
+ * FPU rounding mode is round-half-to-even, but that's less often an issue.
391
+ *
392
+ * If your FPU isn't already set to 53-bit precision/round-half-to-even, and
393
+ * you want to make use of _Py_dg_strtod and _Py_dg_dtoa, then you should
394
+ *
395
+ * #define HAVE_PY_SET_53BIT_PRECISION 1
396
+ *
397
+ * and also give appropriate definitions for the following three macros:
398
+ *
399
+ * _PY_SET_53BIT_PRECISION_START : store original FPU settings, and
400
+ * set FPU to 53-bit precision/round-half-to-even
401
+ * _PY_SET_53BIT_PRECISION_END : restore original FPU settings
402
+ * _PY_SET_53BIT_PRECISION_HEADER : any variable declarations needed to
403
+ * use the two macros above.
404
+ *
405
+ * The macros are designed to be used within a single C function: see
406
+ * Python/pystrtod.c for an example of their use.
407
+ */
408
+
409
+ /* get and set x87 control word for gcc/x86 */
410
+ #ifdef HAVE_GCC_ASM_FOR_X87
411
+ #define HAVE_PY_SET_53BIT_PRECISION 1
412
+ /* _Py_get/set_387controlword functions are defined in Python/pymath.c */
413
+ #define _Py_SET_53BIT_PRECISION_HEADER \
414
+ unsigned short old_387controlword, new_387controlword
415
+ #define _Py_SET_53BIT_PRECISION_START \
416
+ do { \
417
+ old_387controlword = _Py_get_387controlword(); \
418
+ new_387controlword = (old_387controlword & ~0x0f00) | 0x0200; \
419
+ if (new_387controlword != old_387controlword) \
420
+ _Py_set_387controlword(new_387controlword); \
421
+ } while (0)
422
+ #define _Py_SET_53BIT_PRECISION_END \
423
+ if (new_387controlword != old_387controlword) \
424
+ _Py_set_387controlword(old_387controlword)
425
+ #endif
426
+
427
+ /* get and set x87 control word for VisualStudio/x86 */
428
+ #if defined(_MSC_VER) && !defined(_WIN64) && !defined(_M_ARM) /* x87 not supported in 64-bit or ARM */
429
+ #define HAVE_PY_SET_53BIT_PRECISION 1
430
+ #define _Py_SET_53BIT_PRECISION_HEADER \
431
+ unsigned int old_387controlword, new_387controlword, out_387controlword
432
+ /* We use the __control87_2 function to set only the x87 control word.
433
+ The SSE control word is unaffected. */
434
+ #define _Py_SET_53BIT_PRECISION_START \
435
+ do { \
436
+ __control87_2(0, 0, &old_387controlword, NULL); \
437
+ new_387controlword = \
438
+ (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \
439
+ if (new_387controlword != old_387controlword) \
440
+ __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \
441
+ &out_387controlword, NULL); \
442
+ } while (0)
443
+ #define _Py_SET_53BIT_PRECISION_END \
444
+ do { \
445
+ if (new_387controlword != old_387controlword) \
446
+ __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \
447
+ &out_387controlword, NULL); \
448
+ } while (0)
449
+ #endif
450
+
451
+ #ifdef HAVE_GCC_ASM_FOR_MC68881
452
+ #define HAVE_PY_SET_53BIT_PRECISION 1
453
+ #define _Py_SET_53BIT_PRECISION_HEADER \
454
+ unsigned int old_fpcr, new_fpcr
455
+ #define _Py_SET_53BIT_PRECISION_START \
456
+ do { \
457
+ __asm__ ("fmove.l %%fpcr,%0" : "=g" (old_fpcr)); \
458
+ /* Set double precision / round to nearest. */ \
459
+ new_fpcr = (old_fpcr & ~0xf0) | 0x80; \
460
+ if (new_fpcr != old_fpcr) \
461
+ __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (new_fpcr)); \
462
+ } while (0)
463
+ #define _Py_SET_53BIT_PRECISION_END \
464
+ do { \
465
+ if (new_fpcr != old_fpcr) \
466
+ __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (old_fpcr)); \
467
+ } while (0)
468
+ #endif
469
+
470
+ /* default definitions are empty */
471
+ #ifndef HAVE_PY_SET_53BIT_PRECISION
472
+ #define _Py_SET_53BIT_PRECISION_HEADER
473
+ #define _Py_SET_53BIT_PRECISION_START
474
+ #define _Py_SET_53BIT_PRECISION_END
475
+ #endif
476
+
477
+ /* If we can't guarantee 53-bit precision, don't use the code
478
+ in Python/dtoa.c, but fall back to standard code. This
479
+ means that repr of a float will be long (17 sig digits).
480
+
481
+ Realistically, there are two things that could go wrong:
482
+
483
+ (1) doubles aren't IEEE 754 doubles, or
484
+ (2) we're on x86 with the rounding precision set to 64-bits
485
+ (extended precision), and we don't know how to change
486
+ the rounding precision.
487
+ */
488
+
489
+ #if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \
490
+ !defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \
491
+ !defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754)
492
+ #define PY_NO_SHORT_FLOAT_REPR
493
+ #endif
494
+
495
+ /* double rounding is symptomatic of use of extended precision on x86. If
496
+ we're seeing double rounding, and we don't have any mechanism available for
497
+ changing the FPU rounding precision, then don't use Python/dtoa.c. */
498
+ #if defined(X87_DOUBLE_ROUNDING) && !defined(HAVE_PY_SET_53BIT_PRECISION)
499
+ #define PY_NO_SHORT_FLOAT_REPR
500
+ #endif
501
+
502
+
503
+ /* Py_DEPRECATED(version)
504
+ * Declare a variable, type, or function deprecated.
505
+ * The macro must be placed before the declaration.
506
+ * Usage:
507
+ * Py_DEPRECATED(3.3) extern int old_var;
508
+ * Py_DEPRECATED(3.4) typedef int T1;
509
+ * Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);
510
+ */
511
+ #if defined(__GNUC__) \
512
+ && ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
513
+ #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
514
+ #elif defined(_MSC_VER)
515
+ #define Py_DEPRECATED(VERSION) __declspec(deprecated( \
516
+ "deprecated in " #VERSION))
517
+ #else
518
+ #define Py_DEPRECATED(VERSION_UNUSED)
519
+ #endif
520
+
521
+ #if defined(__clang__)
522
+ #define _Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
523
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
524
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
525
+ #define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
526
+ #elif defined(__GNUC__) \
527
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
528
+ #define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
529
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
530
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
531
+ #define _Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
532
+ #elif defined(_MSC_VER)
533
+ #define _Py_COMP_DIAG_PUSH __pragma(warning(push))
534
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
535
+ #define _Py_COMP_DIAG_POP __pragma(warning(pop))
536
+ #else
537
+ #define _Py_COMP_DIAG_PUSH
538
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
539
+ #define _Py_COMP_DIAG_POP
540
+ #endif
541
+
542
+ /* _Py_HOT_FUNCTION
543
+ * The hot attribute on a function is used to inform the compiler that the
544
+ * function is a hot spot of the compiled program. The function is optimized
545
+ * more aggressively and on many target it is placed into special subsection of
546
+ * the text section so all hot functions appears close together improving
547
+ * locality.
548
+ *
549
+ * Usage:
550
+ * int _Py_HOT_FUNCTION x(void) { return 3; }
551
+ *
552
+ * Issue #28618: This attribute must not be abused, otherwise it can have a
553
+ * negative effect on performance. Only the functions were Python spend most of
554
+ * its time must use it. Use a profiler when running performance benchmark
555
+ * suite to find these functions.
556
+ */
557
+ #if defined(__GNUC__) \
558
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
559
+ #define _Py_HOT_FUNCTION __attribute__((hot))
560
+ #else
561
+ #define _Py_HOT_FUNCTION
562
+ #endif
563
+
564
+ /* _Py_NO_INLINE
565
+ * Disable inlining on a function. For example, it helps to reduce the C stack
566
+ * consumption.
567
+ *
568
+ * Usage:
569
+ * int _Py_NO_INLINE x(void) { return 3; }
570
+ */
571
+ #if defined(_MSC_VER)
572
+ # define _Py_NO_INLINE __declspec(noinline)
573
+ #elif defined(__GNUC__) || defined(__clang__)
574
+ # define _Py_NO_INLINE __attribute__ ((noinline))
575
+ #else
576
+ # define _Py_NO_INLINE
577
+ #endif
578
+
579
+ /**************************************************************************
580
+ Prototypes that are missing from the standard include files on some systems
581
+ (and possibly only some versions of such systems.)
582
+
583
+ Please be conservative with adding new ones, document them and enclose them
584
+ in platform-specific #ifdefs.
585
+ **************************************************************************/
586
+
587
+ #ifdef SOLARIS
588
+ /* Unchecked */
589
+ extern int gethostname(char *, int);
590
+ #endif
591
+
592
+ #ifdef HAVE__GETPTY
593
+ #include <sys/types.h> /* we need to import mode_t */
594
+ extern char * _getpty(int *, int, mode_t, int);
595
+ #endif
596
+
597
+ /* On QNX 6, struct termio must be declared by including sys/termio.h
598
+ if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must
599
+ be included before termios.h or it will generate an error. */
600
+ #if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux)
601
+ #include <sys/termio.h>
602
+ #endif
603
+
604
+
605
+ /* On 4.4BSD-descendants, ctype functions serves the whole range of
606
+ * wchar_t character set rather than single byte code points only.
607
+ * This characteristic can break some operations of string object
608
+ * including str.upper() and str.split() on UTF-8 locales. This
609
+ * workaround was provided by Tim Robbins of FreeBSD project.
610
+ */
611
+
612
+ #if defined(__APPLE__)
613
+ # define _PY_PORT_CTYPE_UTF8_ISSUE
614
+ #endif
615
+
616
+ #ifdef _PY_PORT_CTYPE_UTF8_ISSUE
617
+ #ifndef __cplusplus
618
+ /* The workaround below is unsafe in C++ because
619
+ * the <locale> defines these symbols as real functions,
620
+ * with a slightly different signature.
621
+ * See issue #10910
622
+ */
623
+ #include <ctype.h>
624
+ #include <wctype.h>
625
+ #undef isalnum
626
+ #define isalnum(c) iswalnum(btowc(c))
627
+ #undef isalpha
628
+ #define isalpha(c) iswalpha(btowc(c))
629
+ #undef islower
630
+ #define islower(c) iswlower(btowc(c))
631
+ #undef isspace
632
+ #define isspace(c) iswspace(btowc(c))
633
+ #undef isupper
634
+ #define isupper(c) iswupper(btowc(c))
635
+ #undef tolower
636
+ #define tolower(c) towlower(btowc(c))
637
+ #undef toupper
638
+ #define toupper(c) towupper(btowc(c))
639
+ #endif
640
+ #endif
641
+
642
+
643
+ /* Declarations for symbol visibility.
644
+
645
+ PyAPI_FUNC(type): Declares a public Python API function and return type
646
+ PyAPI_DATA(type): Declares public Python data and its type
647
+ PyMODINIT_FUNC: A Python module init function. If these functions are
648
+ inside the Python core, they are private to the core.
649
+ If in an extension module, it may be declared with
650
+ external linkage depending on the platform.
651
+
652
+ As a number of platforms support/require "__declspec(dllimport/dllexport)",
653
+ we support a HAVE_DECLSPEC_DLL macro to save duplication.
654
+ */
655
+
656
+ /*
657
+ All windows ports, except cygwin, are handled in PC/pyconfig.h.
658
+
659
+ Cygwin is the only other autoconf platform requiring special
660
+ linkage handling and it uses __declspec().
661
+ */
662
+ #if defined(__CYGWIN__)
663
+ # define HAVE_DECLSPEC_DLL
664
+ #endif
665
+
666
+ #include "exports.h"
667
+
668
+ /* only get special linkage if built as shared or platform is Cygwin */
669
+ #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
670
+ # if defined(HAVE_DECLSPEC_DLL)
671
+ # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
672
+ # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
673
+ # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
674
+ /* module init functions inside the core need no external linkage */
675
+ /* except for Cygwin to handle embedding */
676
+ # if defined(__CYGWIN__)
677
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
678
+ # else /* __CYGWIN__ */
679
+ # define PyMODINIT_FUNC PyObject*
680
+ # endif /* __CYGWIN__ */
681
+ # else /* Py_BUILD_CORE */
682
+ /* Building an extension module, or an embedded situation */
683
+ /* public Python functions and data are imported */
684
+ /* Under Cygwin, auto-import functions to prevent compilation */
685
+ /* failures similar to those described at the bottom of 4.1: */
686
+ /* http://docs.python.org/extending/windows.html#a-cookbook-approach */
687
+ # if !defined(__CYGWIN__)
688
+ # define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE
689
+ # endif /* !__CYGWIN__ */
690
+ # define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
691
+ /* module init functions outside the core must be exported */
692
+ # if defined(__cplusplus)
693
+ # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
694
+ # else /* __cplusplus */
695
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
696
+ # endif /* __cplusplus */
697
+ # endif /* Py_BUILD_CORE */
698
+ # endif /* HAVE_DECLSPEC_DLL */
699
+ #endif /* Py_ENABLE_SHARED */
700
+
701
+ /* If no external linkage macros defined by now, create defaults */
702
+ #ifndef PyAPI_FUNC
703
+ # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
704
+ #endif
705
+ #ifndef PyAPI_DATA
706
+ # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
707
+ #endif
708
+ #ifndef PyMODINIT_FUNC
709
+ # if defined(__cplusplus)
710
+ # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
711
+ # else /* __cplusplus */
712
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
713
+ # endif /* __cplusplus */
714
+ #endif
715
+
716
+ /* limits.h constants that may be missing */
717
+
718
+ #ifndef INT_MAX
719
+ #define INT_MAX 2147483647
720
+ #endif
721
+
722
+ #ifndef LONG_MAX
723
+ #if SIZEOF_LONG == 4
724
+ #define LONG_MAX 0X7FFFFFFFL
725
+ #elif SIZEOF_LONG == 8
726
+ #define LONG_MAX 0X7FFFFFFFFFFFFFFFL
727
+ #else
728
+ #error "could not set LONG_MAX in pyport.h"
729
+ #endif
730
+ #endif
731
+
732
+ #ifndef LONG_MIN
733
+ #define LONG_MIN (-LONG_MAX-1)
734
+ #endif
735
+
736
+ #ifndef LONG_BIT
737
+ #define LONG_BIT (8 * SIZEOF_LONG)
738
+ #endif
739
+
740
+ #if LONG_BIT != 8 * SIZEOF_LONG
741
+ /* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
742
+ * 32-bit platforms using gcc. We try to catch that here at compile-time
743
+ * rather than waiting for integer multiplication to trigger bogus
744
+ * overflows.
745
+ */
746
+ #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
747
+ #endif
748
+
749
+ #ifdef __cplusplus
750
+ }
751
+ #endif
752
+
753
+ /*
754
+ * Hide GCC attributes from compilers that don't support them.
755
+ */
756
+ #if (!defined(__GNUC__) || __GNUC__ < 2 || \
757
+ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) )
758
+ #define Py_GCC_ATTRIBUTE(x)
759
+ #else
760
+ #define Py_GCC_ATTRIBUTE(x) __attribute__(x)
761
+ #endif
762
+
763
+ /*
764
+ * Specify alignment on compilers that support it.
765
+ */
766
+ #if defined(__GNUC__) && __GNUC__ >= 3
767
+ #define Py_ALIGNED(x) __attribute__((aligned(x)))
768
+ #else
769
+ #define Py_ALIGNED(x)
770
+ #endif
771
+
772
+ /* Eliminate end-of-loop code not reached warnings from SunPro C
773
+ * when using do{...}while(0) macros
774
+ */
775
+ #ifdef __SUNPRO_C
776
+ #pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED)
777
+ #endif
778
+
779
+ #ifndef Py_LL
780
+ #define Py_LL(x) x##LL
781
+ #endif
782
+
783
+ #ifndef Py_ULL
784
+ #define Py_ULL(x) Py_LL(x##U)
785
+ #endif
786
+
787
+ #define Py_VA_COPY va_copy
788
+
789
+ /*
790
+ * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
791
+ * detected by configure and defined in pyconfig.h. The code in pyconfig.h
792
+ * also takes care of Apple's universal builds.
793
+ */
794
+
795
+ #ifdef WORDS_BIGENDIAN
796
+ # define PY_BIG_ENDIAN 1
797
+ # define PY_LITTLE_ENDIAN 0
798
+ #else
799
+ # define PY_BIG_ENDIAN 0
800
+ # define PY_LITTLE_ENDIAN 1
801
+ #endif
802
+
803
+ #ifdef Py_BUILD_CORE
804
+ /*
805
+ * Macros to protect CRT calls against instant termination when passed an
806
+ * invalid parameter (issue23524).
807
+ */
808
+ #if defined _MSC_VER && _MSC_VER >= 1900
809
+
810
+ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
811
+ #define _Py_BEGIN_SUPPRESS_IPH { _invalid_parameter_handler _Py_old_handler = \
812
+ _set_thread_local_invalid_parameter_handler(_Py_silent_invalid_parameter_handler);
813
+ #define _Py_END_SUPPRESS_IPH _set_thread_local_invalid_parameter_handler(_Py_old_handler); }
814
+
815
+ #else
816
+
817
+ #define _Py_BEGIN_SUPPRESS_IPH
818
+ #define _Py_END_SUPPRESS_IPH
819
+
820
+ #endif /* _MSC_VER >= 1900 */
821
+ #endif /* Py_BUILD_CORE */
822
+
823
+ #ifdef __ANDROID__
824
+ /* The Android langinfo.h header is not used. */
825
+ # undef HAVE_LANGINFO_H
826
+ # undef CODESET
827
+ #endif
828
+
829
+ /* Maximum value of the Windows DWORD type */
830
+ #define PY_DWORD_MAX 4294967295U
831
+
832
+ /* This macro used to tell whether Python was built with multithreading
833
+ * enabled. Now multithreading is always enabled, but keep the macro
834
+ * for compatibility.
835
+ */
836
+ #ifndef WITH_THREAD
837
+ # define WITH_THREAD
838
+ #endif
839
+
840
+ /* Check that ALT_SOABI is consistent with Py_TRACE_REFS:
841
+ ./configure --with-trace-refs should must be used to define Py_TRACE_REFS */
842
+ #if defined(ALT_SOABI) && defined(Py_TRACE_REFS)
843
+ # error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
844
+ #endif
845
+
846
+ #if defined(__ANDROID__) || defined(__VXWORKS__)
847
+ // Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
848
+ // See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
849
+ // and PyUnicode_EncodeLocale().
850
+ # define _Py_FORCE_UTF8_LOCALE
851
+ #endif
852
+
853
+ #if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__)
854
+ // Use UTF-8 as the filesystem encoding.
855
+ // See PyUnicode_DecodeFSDefaultAndSize(), PyUnicode_EncodeFSDefault(),
856
+ // Py_DecodeLocale() and Py_EncodeLocale().
857
+ # define _Py_FORCE_UTF8_FS_ENCODING
858
+ #endif
859
+
860
+ /* Mark a function which cannot return. Example:
861
+ PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
862
+
863
+ XLC support is intentionally omitted due to bpo-40244 */
864
+ #ifndef _Py_NO_RETURN
865
+ #if defined(__clang__) || \
866
+ (defined(__GNUC__) && \
867
+ ((__GNUC__ >= 3) || \
868
+ (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
869
+ # define _Py_NO_RETURN __attribute__((__noreturn__))
870
+ #elif defined(_MSC_VER)
871
+ # define _Py_NO_RETURN __declspec(noreturn)
872
+ #else
873
+ # define _Py_NO_RETURN
874
+ #endif
875
+ #endif
876
+
877
+
878
+ // Preprocessor check for a builtin preprocessor function. Always return 0
879
+ // if __has_builtin() macro is not defined.
880
+ //
881
+ // __has_builtin() is available on clang and GCC 10.
882
+ #ifdef __has_builtin
883
+ # define _Py__has_builtin(x) __has_builtin(x)
884
+ #else
885
+ # define _Py__has_builtin(x) 0
886
+ #endif
887
+
888
+
889
+ #endif /* Py_PYPORT_H */
janus/include/python3.10/pystrhex.h ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_STRHEX_H
2
+ #define Py_STRHEX_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #ifndef Py_LIMITED_API
9
+ /* Returns a str() containing the hex representation of argbuf. */
10
+ PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen);
11
+ /* Returns a bytes() containing the ASCII hex representation of argbuf. */
12
+ PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen);
13
+ /* These variants include support for a separator between every N bytes: */
14
+ PyAPI_FUNC(PyObject*) _Py_strhex_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group);
15
+ PyAPI_FUNC(PyObject*) _Py_strhex_bytes_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group);
16
+ #endif /* !Py_LIMITED_API */
17
+
18
+ #ifdef __cplusplus
19
+ }
20
+ #endif
21
+
22
+ #endif /* !Py_STRHEX_H */
janus/include/python3.10/pystrtod.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_STRTOD_H
2
+ #define Py_STRTOD_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+
9
+ PyAPI_FUNC(double) PyOS_string_to_double(const char *str,
10
+ char **endptr,
11
+ PyObject *overflow_exception);
12
+
13
+ /* The caller is responsible for calling PyMem_Free to free the buffer
14
+ that's is returned. */
15
+ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
16
+ char format_code,
17
+ int precision,
18
+ int flags,
19
+ int *type);
20
+
21
+ #ifndef Py_LIMITED_API
22
+ PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores(
23
+ const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
24
+ PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
25
+
26
+ PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
27
+ #endif
28
+
29
+
30
+ /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
31
+ #define Py_DTSF_SIGN 0x01 /* always add the sign */
32
+ #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */
33
+ #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code
34
+ specific */
35
+
36
+ /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */
37
+ #define Py_DTST_FINITE 0
38
+ #define Py_DTST_INFINITE 1
39
+ #define Py_DTST_NAN 2
40
+
41
+ #ifdef __cplusplus
42
+ }
43
+ #endif
44
+
45
+ #endif /* !Py_STRTOD_H */
janus/include/python3.10/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 */
janus/include/python3.10/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 */
janus/include/python3.10/unicodeobject.h ADDED
@@ -0,0 +1,1053 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_UNICODEOBJECT_H
2
+ #define Py_UNICODEOBJECT_H
3
+
4
+ #include <stdarg.h>
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
+ /* Use only if you know it's a string */
273
+ #define PyUnicode_CHECK_INTERNED(op) \
274
+ (((PyASCIIObject *)(op))->state.interned)
275
+
276
+ /* --- wchar_t support for platforms which support it --------------------- */
277
+
278
+ #ifdef HAVE_WCHAR_H
279
+
280
+ /* Create a Unicode Object from the wchar_t buffer w of the given
281
+ size.
282
+
283
+ The buffer is copied into the new object. */
284
+
285
+ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
286
+ const wchar_t *w, /* wchar_t buffer */
287
+ Py_ssize_t size /* size of buffer */
288
+ );
289
+
290
+ /* Copies the Unicode Object contents into the wchar_t buffer w. At
291
+ most size wchar_t characters are copied.
292
+
293
+ Note that the resulting wchar_t string may or may not be
294
+ 0-terminated. It is the responsibility of the caller to make sure
295
+ that the wchar_t string is 0-terminated in case this is required by
296
+ the application.
297
+
298
+ Returns the number of wchar_t characters copied (excluding a
299
+ possibly trailing 0-termination character) or -1 in case of an
300
+ error. */
301
+
302
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
303
+ PyObject *unicode, /* Unicode object */
304
+ wchar_t *w, /* wchar_t buffer */
305
+ Py_ssize_t size /* size of buffer */
306
+ );
307
+
308
+ /* Convert the Unicode object to a wide character string. The output string
309
+ always ends with a nul character. If size is not NULL, write the number of
310
+ wide characters (excluding the null character) into *size.
311
+
312
+ Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it)
313
+ on success. On error, returns NULL, *size is undefined and raises a
314
+ MemoryError. */
315
+
316
+ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
317
+ PyObject *unicode, /* Unicode object */
318
+ Py_ssize_t *size /* number of characters of the result */
319
+ );
320
+
321
+ #endif
322
+
323
+ /* --- Unicode ordinals --------------------------------------------------- */
324
+
325
+ /* Create a Unicode Object from the given Unicode code point ordinal.
326
+
327
+ The ordinal must be in range(0x110000). A ValueError is
328
+ raised in case it is not.
329
+
330
+ */
331
+
332
+ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
333
+
334
+ /* === Builtin Codecs =====================================================
335
+
336
+ Many of these APIs take two arguments encoding and errors. These
337
+ parameters encoding and errors have the same semantics as the ones
338
+ of the builtin str() API.
339
+
340
+ Setting encoding to NULL causes the default encoding (UTF-8) to be used.
341
+
342
+ Error handling is set by errors which may also be set to NULL
343
+ meaning to use the default handling defined for the codec. Default
344
+ error handling for all builtin codecs is "strict" (ValueErrors are
345
+ raised).
346
+
347
+ The codecs all use a similar interface. Only deviation from the
348
+ generic ones are documented.
349
+
350
+ */
351
+
352
+ /* --- Manage the default encoding ---------------------------------------- */
353
+
354
+ /* Returns "utf-8". */
355
+ PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
356
+
357
+ /* --- Generic Codecs ----------------------------------------------------- */
358
+
359
+ /* Create a Unicode object by decoding the encoded string s of the
360
+ given size. */
361
+
362
+ PyAPI_FUNC(PyObject*) PyUnicode_Decode(
363
+ const char *s, /* encoded string */
364
+ Py_ssize_t size, /* size of buffer */
365
+ const char *encoding, /* encoding */
366
+ const char *errors /* error handling */
367
+ );
368
+
369
+ /* Decode a Unicode object unicode and return the result as Python
370
+ object.
371
+
372
+ This API is DEPRECATED. The only supported standard encoding is rot13.
373
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
374
+ that decode from str. */
375
+
376
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject(
377
+ PyObject *unicode, /* Unicode object */
378
+ const char *encoding, /* encoding */
379
+ const char *errors /* error handling */
380
+ );
381
+
382
+ /* Decode a Unicode object unicode and return the result as Unicode
383
+ object.
384
+
385
+ This API is DEPRECATED. The only supported standard encoding is rot13.
386
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
387
+ that decode from str to str. */
388
+
389
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
390
+ PyObject *unicode, /* Unicode object */
391
+ const char *encoding, /* encoding */
392
+ const char *errors /* error handling */
393
+ );
394
+
395
+ /* Encodes a Unicode object and returns the result as Python
396
+ object.
397
+
398
+ This API is DEPRECATED. It is superseded by PyUnicode_AsEncodedString()
399
+ since all standard encodings (except rot13) encode str to bytes.
400
+ Use PyCodec_Encode() for encoding with rot13 and non-standard codecs
401
+ that encode form str to non-bytes. */
402
+
403
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
404
+ PyObject *unicode, /* Unicode object */
405
+ const char *encoding, /* encoding */
406
+ const char *errors /* error handling */
407
+ );
408
+
409
+ /* Encodes a Unicode object and returns the result as Python string
410
+ object. */
411
+
412
+ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
413
+ PyObject *unicode, /* Unicode object */
414
+ const char *encoding, /* encoding */
415
+ const char *errors /* error handling */
416
+ );
417
+
418
+ /* Encodes a Unicode object and returns the result as Unicode
419
+ object.
420
+
421
+ This API is DEPRECATED. The only supported standard encodings is rot13.
422
+ Use PyCodec_Encode() to encode with rot13 and non-standard codecs
423
+ that encode from str to str. */
424
+
425
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode(
426
+ PyObject *unicode, /* Unicode object */
427
+ const char *encoding, /* encoding */
428
+ const char *errors /* error handling */
429
+ );
430
+
431
+ /* Build an encoding map. */
432
+
433
+ PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap(
434
+ PyObject* string /* 256 character map */
435
+ );
436
+
437
+ /* --- UTF-7 Codecs ------------------------------------------------------- */
438
+
439
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7(
440
+ const char *string, /* UTF-7 encoded string */
441
+ Py_ssize_t length, /* size of string */
442
+ const char *errors /* error handling */
443
+ );
444
+
445
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
446
+ const char *string, /* UTF-7 encoded string */
447
+ Py_ssize_t length, /* size of string */
448
+ const char *errors, /* error handling */
449
+ Py_ssize_t *consumed /* bytes consumed */
450
+ );
451
+
452
+ /* --- UTF-8 Codecs ------------------------------------------------------- */
453
+
454
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8(
455
+ const char *string, /* UTF-8 encoded string */
456
+ Py_ssize_t length, /* size of string */
457
+ const char *errors /* error handling */
458
+ );
459
+
460
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful(
461
+ const char *string, /* UTF-8 encoded string */
462
+ Py_ssize_t length, /* size of string */
463
+ const char *errors, /* error handling */
464
+ Py_ssize_t *consumed /* bytes consumed */
465
+ );
466
+
467
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
468
+ PyObject *unicode /* Unicode object */
469
+ );
470
+
471
+ /* Returns a pointer to the default encoding (UTF-8) of the
472
+ Unicode object unicode and the size of the encoded representation
473
+ in bytes stored in *size.
474
+
475
+ In case of an error, no *size is set.
476
+
477
+ This function caches the UTF-8 encoded string in the unicodeobject
478
+ and subsequent calls will return the same string. The memory is released
479
+ when the unicodeobject is deallocated.
480
+ */
481
+
482
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
483
+ PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(
484
+ PyObject *unicode,
485
+ Py_ssize_t *size);
486
+ #endif
487
+
488
+ /* --- UTF-32 Codecs ------------------------------------------------------ */
489
+
490
+ /* Decodes length bytes from a UTF-32 encoded buffer string and returns
491
+ the corresponding Unicode object.
492
+
493
+ errors (if non-NULL) defines the error handling. It defaults
494
+ to "strict".
495
+
496
+ If byteorder is non-NULL, the decoder starts decoding using the
497
+ given byte order:
498
+
499
+ *byteorder == -1: little endian
500
+ *byteorder == 0: native order
501
+ *byteorder == 1: big endian
502
+
503
+ In native mode, the first four bytes of the stream are checked for a
504
+ BOM mark. If found, the BOM mark is analysed, the byte order
505
+ adjusted and the BOM skipped. In the other modes, no BOM mark
506
+ interpretation is done. After completion, *byteorder is set to the
507
+ current byte order at the end of input data.
508
+
509
+ If byteorder is NULL, the codec starts in native order mode.
510
+
511
+ */
512
+
513
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32(
514
+ const char *string, /* UTF-32 encoded string */
515
+ Py_ssize_t length, /* size of string */
516
+ const char *errors, /* error handling */
517
+ int *byteorder /* pointer to byteorder to use
518
+ 0=native;-1=LE,1=BE; updated on
519
+ exit */
520
+ );
521
+
522
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful(
523
+ const char *string, /* UTF-32 encoded string */
524
+ Py_ssize_t length, /* size of string */
525
+ const char *errors, /* error handling */
526
+ int *byteorder, /* pointer to byteorder to use
527
+ 0=native;-1=LE,1=BE; updated on
528
+ exit */
529
+ Py_ssize_t *consumed /* bytes consumed */
530
+ );
531
+
532
+ /* Returns a Python string using the UTF-32 encoding in native byte
533
+ order. The string always starts with a BOM mark. */
534
+
535
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
536
+ PyObject *unicode /* Unicode object */
537
+ );
538
+
539
+ /* Returns a Python string object holding the UTF-32 encoded value of
540
+ the Unicode data.
541
+
542
+ If byteorder is not 0, output is written according to the following
543
+ byte order:
544
+
545
+ byteorder == -1: little endian
546
+ byteorder == 0: native byte order (writes a BOM mark)
547
+ byteorder == 1: big endian
548
+
549
+ If byteorder is 0, the output string will always start with the
550
+ Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
551
+ prepended.
552
+
553
+ */
554
+
555
+ /* --- UTF-16 Codecs ------------------------------------------------------ */
556
+
557
+ /* Decodes length bytes from a UTF-16 encoded buffer string and returns
558
+ the corresponding Unicode object.
559
+
560
+ errors (if non-NULL) defines the error handling. It defaults
561
+ to "strict".
562
+
563
+ If byteorder is non-NULL, the decoder starts decoding using the
564
+ given byte order:
565
+
566
+ *byteorder == -1: little endian
567
+ *byteorder == 0: native order
568
+ *byteorder == 1: big endian
569
+
570
+ In native mode, the first two bytes of the stream are checked for a
571
+ BOM mark. If found, the BOM mark is analysed, the byte order
572
+ adjusted and the BOM skipped. In the other modes, no BOM mark
573
+ interpretation is done. After completion, *byteorder is set to the
574
+ current byte order at the end of input data.
575
+
576
+ If byteorder is NULL, the codec starts in native order mode.
577
+
578
+ */
579
+
580
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16(
581
+ const char *string, /* UTF-16 encoded string */
582
+ Py_ssize_t length, /* size of string */
583
+ const char *errors, /* error handling */
584
+ int *byteorder /* pointer to byteorder to use
585
+ 0=native;-1=LE,1=BE; updated on
586
+ exit */
587
+ );
588
+
589
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful(
590
+ const char *string, /* UTF-16 encoded string */
591
+ Py_ssize_t length, /* size of string */
592
+ const char *errors, /* error handling */
593
+ int *byteorder, /* pointer to byteorder to use
594
+ 0=native;-1=LE,1=BE; updated on
595
+ exit */
596
+ Py_ssize_t *consumed /* bytes consumed */
597
+ );
598
+
599
+ /* Returns a Python string using the UTF-16 encoding in native byte
600
+ order. The string always starts with a BOM mark. */
601
+
602
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
603
+ PyObject *unicode /* Unicode object */
604
+ );
605
+
606
+ /* --- Unicode-Escape Codecs ---------------------------------------------- */
607
+
608
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
609
+ const char *string, /* Unicode-Escape encoded string */
610
+ Py_ssize_t length, /* size of string */
611
+ const char *errors /* error handling */
612
+ );
613
+
614
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
615
+ PyObject *unicode /* Unicode object */
616
+ );
617
+
618
+ /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
619
+
620
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape(
621
+ const char *string, /* Raw-Unicode-Escape encoded string */
622
+ Py_ssize_t length, /* size of string */
623
+ const char *errors /* error handling */
624
+ );
625
+
626
+ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
627
+ PyObject *unicode /* Unicode object */
628
+ );
629
+
630
+ /* --- Latin-1 Codecs -----------------------------------------------------
631
+
632
+ Note: Latin-1 corresponds to the first 256 Unicode ordinals. */
633
+
634
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1(
635
+ const char *string, /* Latin-1 encoded string */
636
+ Py_ssize_t length, /* size of string */
637
+ const char *errors /* error handling */
638
+ );
639
+
640
+ PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
641
+ PyObject *unicode /* Unicode object */
642
+ );
643
+
644
+ /* --- ASCII Codecs -------------------------------------------------------
645
+
646
+ Only 7-bit ASCII data is excepted. All other codes generate errors.
647
+
648
+ */
649
+
650
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII(
651
+ const char *string, /* ASCII encoded string */
652
+ Py_ssize_t length, /* size of string */
653
+ const char *errors /* error handling */
654
+ );
655
+
656
+ PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
657
+ PyObject *unicode /* Unicode object */
658
+ );
659
+
660
+ /* --- Character Map Codecs -----------------------------------------------
661
+
662
+ This codec uses mappings to encode and decode characters.
663
+
664
+ Decoding mappings must map byte ordinals (integers in the range from 0 to
665
+ 255) to Unicode strings, integers (which are then interpreted as Unicode
666
+ ordinals) or None. Unmapped data bytes (ones which cause a LookupError)
667
+ as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined
668
+ mapping" and cause an error.
669
+
670
+ Encoding mappings must map Unicode ordinal integers to bytes objects,
671
+ integers in the range from 0 to 255 or None. Unmapped character
672
+ ordinals (ones which cause a LookupError) as well as mapped to
673
+ None are treated as "undefined mapping" and cause an error.
674
+
675
+ */
676
+
677
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap(
678
+ const char *string, /* Encoded string */
679
+ Py_ssize_t length, /* size of string */
680
+ PyObject *mapping, /* decoding mapping */
681
+ const char *errors /* error handling */
682
+ );
683
+
684
+ PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
685
+ PyObject *unicode, /* Unicode object */
686
+ PyObject *mapping /* encoding mapping */
687
+ );
688
+
689
+ /* --- MBCS codecs for Windows -------------------------------------------- */
690
+
691
+ #ifdef MS_WINDOWS
692
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
693
+ const char *string, /* MBCS encoded string */
694
+ Py_ssize_t length, /* size of string */
695
+ const char *errors /* error handling */
696
+ );
697
+
698
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
699
+ const char *string, /* MBCS encoded string */
700
+ Py_ssize_t length, /* size of string */
701
+ const char *errors, /* error handling */
702
+ Py_ssize_t *consumed /* bytes consumed */
703
+ );
704
+
705
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
706
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful(
707
+ int code_page, /* code page number */
708
+ const char *string, /* encoded string */
709
+ Py_ssize_t length, /* size of string */
710
+ const char *errors, /* error handling */
711
+ Py_ssize_t *consumed /* bytes consumed */
712
+ );
713
+ #endif
714
+
715
+ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
716
+ PyObject *unicode /* Unicode object */
717
+ );
718
+
719
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
720
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage(
721
+ int code_page, /* code page number */
722
+ PyObject *unicode, /* Unicode object */
723
+ const char *errors /* error handling */
724
+ );
725
+ #endif
726
+
727
+ #endif /* MS_WINDOWS */
728
+
729
+ /* --- Locale encoding --------------------------------------------------- */
730
+
731
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
732
+ /* Decode a string from the current locale encoding. The decoder is strict if
733
+ *surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape'
734
+ error handler (PEP 383) to escape undecodable bytes. If a byte sequence can
735
+ be decoded as a surrogate character and *surrogateescape* is not equal to
736
+ zero, the byte sequence is escaped using the 'surrogateescape' error handler
737
+ instead of being decoded. *str* must end with a null character but cannot
738
+ contain embedded null characters. */
739
+
740
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
741
+ const char *str,
742
+ Py_ssize_t len,
743
+ const char *errors);
744
+
745
+ /* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string
746
+ length using strlen(). */
747
+
748
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
749
+ const char *str,
750
+ const char *errors);
751
+
752
+ /* Encode a Unicode object to the current locale encoding. The encoder is
753
+ strict is *surrogateescape* is equal to zero, otherwise the
754
+ "surrogateescape" error handler is used. Return a bytes object. The string
755
+ cannot contain embedded null characters. */
756
+
757
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
758
+ PyObject *unicode,
759
+ const char *errors
760
+ );
761
+ #endif
762
+
763
+ /* --- File system encoding ---------------------------------------------- */
764
+
765
+ /* ParseTuple converter: encode str objects to bytes using
766
+ PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */
767
+
768
+ PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
769
+
770
+ /* ParseTuple converter: decode bytes objects to unicode using
771
+ PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */
772
+
773
+ PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
774
+
775
+ /* Decode a null-terminated string using Py_FileSystemDefaultEncoding
776
+ and the "surrogateescape" error handler.
777
+
778
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
779
+ encoding.
780
+
781
+ Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
782
+ */
783
+
784
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
785
+ const char *s /* encoded string */
786
+ );
787
+
788
+ /* Decode a string using Py_FileSystemDefaultEncoding
789
+ and the "surrogateescape" error handler.
790
+
791
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
792
+ encoding.
793
+ */
794
+
795
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
796
+ const char *s, /* encoded string */
797
+ Py_ssize_t size /* size */
798
+ );
799
+
800
+ /* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
801
+ "surrogateescape" error handler, and return bytes.
802
+
803
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
804
+ encoding.
805
+ */
806
+
807
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
808
+ PyObject *unicode
809
+ );
810
+
811
+ /* --- Methods & Slots ----------------------------------------------------
812
+
813
+ These are capable of handling Unicode objects and strings on input
814
+ (we refer to them as strings in the descriptions) and return
815
+ Unicode objects or integers as appropriate. */
816
+
817
+ /* Concat two strings giving a new Unicode string. */
818
+
819
+ PyAPI_FUNC(PyObject*) PyUnicode_Concat(
820
+ PyObject *left, /* Left string */
821
+ PyObject *right /* Right string */
822
+ );
823
+
824
+ /* Concat two strings and put the result in *pleft
825
+ (sets *pleft to NULL on error) */
826
+
827
+ PyAPI_FUNC(void) PyUnicode_Append(
828
+ PyObject **pleft, /* Pointer to left string */
829
+ PyObject *right /* Right string */
830
+ );
831
+
832
+ /* Concat two strings, put the result in *pleft and drop the right object
833
+ (sets *pleft to NULL on error) */
834
+
835
+ PyAPI_FUNC(void) PyUnicode_AppendAndDel(
836
+ PyObject **pleft, /* Pointer to left string */
837
+ PyObject *right /* Right string */
838
+ );
839
+
840
+ /* Split a string giving a list of Unicode strings.
841
+
842
+ If sep is NULL, splitting will be done at all whitespace
843
+ substrings. Otherwise, splits occur at the given separator.
844
+
845
+ At most maxsplit splits will be done. If negative, no limit is set.
846
+
847
+ Separators are not included in the resulting list.
848
+
849
+ */
850
+
851
+ PyAPI_FUNC(PyObject*) PyUnicode_Split(
852
+ PyObject *s, /* String to split */
853
+ PyObject *sep, /* String separator */
854
+ Py_ssize_t maxsplit /* Maxsplit count */
855
+ );
856
+
857
+ /* Dito, but split at line breaks.
858
+
859
+ CRLF is considered to be one line break. Line breaks are not
860
+ included in the resulting list. */
861
+
862
+ PyAPI_FUNC(PyObject*) PyUnicode_Splitlines(
863
+ PyObject *s, /* String to split */
864
+ int keepends /* If true, line end markers are included */
865
+ );
866
+
867
+ /* Partition a string using a given separator. */
868
+
869
+ PyAPI_FUNC(PyObject*) PyUnicode_Partition(
870
+ PyObject *s, /* String to partition */
871
+ PyObject *sep /* String separator */
872
+ );
873
+
874
+ /* Partition a string using a given separator, searching from the end of the
875
+ string. */
876
+
877
+ PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
878
+ PyObject *s, /* String to partition */
879
+ PyObject *sep /* String separator */
880
+ );
881
+
882
+ /* Split a string giving a list of Unicode strings.
883
+
884
+ If sep is NULL, splitting will be done at all whitespace
885
+ substrings. Otherwise, splits occur at the given separator.
886
+
887
+ At most maxsplit splits will be done. But unlike PyUnicode_Split
888
+ PyUnicode_RSplit splits from the end of the string. If negative,
889
+ no limit is set.
890
+
891
+ Separators are not included in the resulting list.
892
+
893
+ */
894
+
895
+ PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
896
+ PyObject *s, /* String to split */
897
+ PyObject *sep, /* String separator */
898
+ Py_ssize_t maxsplit /* Maxsplit count */
899
+ );
900
+
901
+ /* Translate a string by applying a character mapping table to it and
902
+ return the resulting Unicode object.
903
+
904
+ The mapping table must map Unicode ordinal integers to Unicode strings,
905
+ Unicode ordinal integers or None (causing deletion of the character).
906
+
907
+ Mapping tables may be dictionaries or sequences. Unmapped character
908
+ ordinals (ones which cause a LookupError) are left untouched and
909
+ are copied as-is.
910
+
911
+ */
912
+
913
+ PyAPI_FUNC(PyObject *) PyUnicode_Translate(
914
+ PyObject *str, /* String */
915
+ PyObject *table, /* Translate table */
916
+ const char *errors /* error handling */
917
+ );
918
+
919
+ /* Join a sequence of strings using the given separator and return
920
+ the resulting Unicode string. */
921
+
922
+ PyAPI_FUNC(PyObject*) PyUnicode_Join(
923
+ PyObject *separator, /* Separator string */
924
+ PyObject *seq /* Sequence object */
925
+ );
926
+
927
+ /* Return 1 if substr matches str[start:end] at the given tail end, 0
928
+ otherwise. */
929
+
930
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch(
931
+ PyObject *str, /* String */
932
+ PyObject *substr, /* Prefix or Suffix string */
933
+ Py_ssize_t start, /* Start index */
934
+ Py_ssize_t end, /* Stop index */
935
+ int direction /* Tail end: -1 prefix, +1 suffix */
936
+ );
937
+
938
+ /* Return the first position of substr in str[start:end] using the
939
+ given search direction or -1 if not found. -2 is returned in case
940
+ an error occurred and an exception is set. */
941
+
942
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Find(
943
+ PyObject *str, /* String */
944
+ PyObject *substr, /* Substring to find */
945
+ Py_ssize_t start, /* Start index */
946
+ Py_ssize_t end, /* Stop index */
947
+ int direction /* Find direction: +1 forward, -1 backward */
948
+ );
949
+
950
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
951
+ /* Like PyUnicode_Find, but search for single character only. */
952
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_FindChar(
953
+ PyObject *str,
954
+ Py_UCS4 ch,
955
+ Py_ssize_t start,
956
+ Py_ssize_t end,
957
+ int direction
958
+ );
959
+ #endif
960
+
961
+ /* Count the number of occurrences of substr in str[start:end]. */
962
+
963
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Count(
964
+ PyObject *str, /* String */
965
+ PyObject *substr, /* Substring to count */
966
+ Py_ssize_t start, /* Start index */
967
+ Py_ssize_t end /* Stop index */
968
+ );
969
+
970
+ /* Replace at most maxcount occurrences of substr in str with replstr
971
+ and return the resulting Unicode object. */
972
+
973
+ PyAPI_FUNC(PyObject *) PyUnicode_Replace(
974
+ PyObject *str, /* String */
975
+ PyObject *substr, /* Substring to find */
976
+ PyObject *replstr, /* Substring to replace */
977
+ Py_ssize_t maxcount /* Max. number of replacements to apply;
978
+ -1 = all */
979
+ );
980
+
981
+ /* Compare two strings and return -1, 0, 1 for less than, equal,
982
+ greater than resp.
983
+ Raise an exception and return -1 on error. */
984
+
985
+ PyAPI_FUNC(int) PyUnicode_Compare(
986
+ PyObject *left, /* Left string */
987
+ PyObject *right /* Right string */
988
+ );
989
+
990
+ /* Compare a Unicode object with C string and return -1, 0, 1 for less than,
991
+ equal, and greater than, respectively. It is best to pass only
992
+ ASCII-encoded strings, but the function interprets the input string as
993
+ ISO-8859-1 if it contains non-ASCII characters.
994
+ This function does not raise exceptions. */
995
+
996
+ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
997
+ PyObject *left,
998
+ const char *right /* ASCII-encoded string */
999
+ );
1000
+
1001
+ /* Rich compare two strings and return one of the following:
1002
+
1003
+ - NULL in case an exception was raised
1004
+ - Py_True or Py_False for successful comparisons
1005
+ - Py_NotImplemented in case the type combination is unknown
1006
+
1007
+ Possible values for op:
1008
+
1009
+ Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE
1010
+
1011
+ */
1012
+
1013
+ PyAPI_FUNC(PyObject *) PyUnicode_RichCompare(
1014
+ PyObject *left, /* Left string */
1015
+ PyObject *right, /* Right string */
1016
+ int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
1017
+ );
1018
+
1019
+ /* Apply an argument tuple or dictionary to a format string and return
1020
+ the resulting Unicode string. */
1021
+
1022
+ PyAPI_FUNC(PyObject *) PyUnicode_Format(
1023
+ PyObject *format, /* Format string */
1024
+ PyObject *args /* Argument tuple or dictionary */
1025
+ );
1026
+
1027
+ /* Checks whether element is contained in container and return 1/0
1028
+ accordingly.
1029
+
1030
+ element has to coerce to a one element Unicode string. -1 is
1031
+ returned in case of an error. */
1032
+
1033
+ PyAPI_FUNC(int) PyUnicode_Contains(
1034
+ PyObject *container, /* Container string */
1035
+ PyObject *element /* Element string */
1036
+ );
1037
+
1038
+ /* Checks whether argument is a valid identifier. */
1039
+
1040
+ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
1041
+
1042
+ /* === Characters Type APIs =============================================== */
1043
+
1044
+ #ifndef Py_LIMITED_API
1045
+ # define Py_CPYTHON_UNICODEOBJECT_H
1046
+ # include "cpython/unicodeobject.h"
1047
+ # undef Py_CPYTHON_UNICODEOBJECT_H
1048
+ #endif
1049
+
1050
+ #ifdef __cplusplus
1051
+ }
1052
+ #endif
1053
+ #endif /* !Py_UNICODEOBJECT_H */
janus/include/python3.10/weakrefobject.h ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
10
+ typedef struct _PyWeakReference PyWeakReference;
11
+
12
+ /* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
13
+ * and CallableProxyType.
14
+ */
15
+ #ifndef Py_LIMITED_API
16
+ struct _PyWeakReference {
17
+ PyObject_HEAD
18
+
19
+ /* The object to which this is a weak reference, or Py_None if none.
20
+ * Note that this is a stealth reference: wr_object's refcount is
21
+ * not incremented to reflect this pointer.
22
+ */
23
+ PyObject *wr_object;
24
+
25
+ /* A callable to invoke when wr_object dies, or NULL if none. */
26
+ PyObject *wr_callback;
27
+
28
+ /* A cache for wr_object's hash code. As usual for hashes, this is -1
29
+ * if the hash code isn't known yet.
30
+ */
31
+ Py_hash_t hash;
32
+
33
+ /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
34
+ * terminated list of weak references to it. These are the list pointers.
35
+ * If wr_object goes away, wr_object is set to Py_None, and these pointers
36
+ * have no meaning then.
37
+ */
38
+ PyWeakReference *wr_prev;
39
+ PyWeakReference *wr_next;
40
+ };
41
+ #endif
42
+
43
+ PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
44
+ PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
45
+ PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
46
+
47
+ #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
48
+ #define PyWeakref_CheckRefExact(op) \
49
+ Py_IS_TYPE(op, &_PyWeakref_RefType)
50
+ #define PyWeakref_CheckProxy(op) \
51
+ (Py_IS_TYPE(op, &_PyWeakref_ProxyType) || \
52
+ Py_IS_TYPE(op, &_PyWeakref_CallableProxyType))
53
+
54
+ #define PyWeakref_Check(op) \
55
+ (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
56
+
57
+
58
+ PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
59
+ PyObject *callback);
60
+ PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
61
+ PyObject *callback);
62
+ PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
63
+
64
+ #ifndef Py_LIMITED_API
65
+ PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
66
+
67
+ PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
68
+ #endif
69
+
70
+ /* Explanation for the Py_REFCNT() check: when a weakref's target is part
71
+ of a long chain of deallocations which triggers the trashcan mechanism,
72
+ clearing the weakrefs can be delayed long after the target's refcount
73
+ has dropped to zero. In the meantime, code accessing the weakref will
74
+ be able to "see" the target object even though it is supposed to be
75
+ unreachable. See issue #16602. */
76
+
77
+ #define PyWeakref_GET_OBJECT(ref) \
78
+ (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \
79
+ ? ((PyWeakReference *)(ref))->wr_object \
80
+ : Py_None)
81
+
82
+
83
+ #ifdef __cplusplus
84
+ }
85
+ #endif
86
+ #endif /* !Py_WEAKREFOBJECT_H */
janus/include/tcl.h ADDED
@@ -0,0 +1,2642 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.md (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
+ #if !defined(TCL_MAJOR_VERSION)
52
+ # define TCL_MAJOR_VERSION 8
53
+ #endif
54
+ #if TCL_MAJOR_VERSION != 8
55
+ # error "This header-file is for Tcl 8 only"
56
+ #endif
57
+ #define TCL_MINOR_VERSION 6
58
+ #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
59
+ #define TCL_RELEASE_SERIAL 14
60
+
61
+ #define TCL_VERSION "8.6"
62
+ #define TCL_PATCH_LEVEL "8.6.14"
63
+
64
+ /*
65
+ *----------------------------------------------------------------------------
66
+ * The following definitions set up the proper options for Windows compilers.
67
+ * We use this method because there is no autoconf equivalent.
68
+ */
69
+
70
+ #ifdef _WIN32
71
+ # ifndef __WIN32__
72
+ # define __WIN32__
73
+ # endif
74
+ # ifndef WIN32
75
+ # define WIN32
76
+ # endif
77
+ #endif
78
+
79
+ /*
80
+ * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
81
+ * quotation marks), JOIN joins two arguments.
82
+ */
83
+
84
+ #ifndef STRINGIFY
85
+ # define STRINGIFY(x) STRINGIFY1(x)
86
+ # define STRINGIFY1(x) #x
87
+ #endif
88
+ #ifndef JOIN
89
+ # define JOIN(a,b) JOIN1(a,b)
90
+ # define JOIN1(a,b) a##b
91
+ #endif
92
+
93
+ /*
94
+ * A special definition used to allow this header file to be included from
95
+ * windows resource files so that they can obtain version information.
96
+ * RC_INVOKED is defined by default by the windows RC tool.
97
+ *
98
+ * Resource compilers don't like all the C stuff, like typedefs and function
99
+ * declarations, that occur below, so block them out.
100
+ */
101
+
102
+ #ifndef RC_INVOKED
103
+
104
+ /*
105
+ * Special macro to define mutexes, that doesn't do anything if we are not
106
+ * using threads.
107
+ */
108
+
109
+ #ifdef TCL_THREADS
110
+ #define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
111
+ #else
112
+ #define TCL_DECLARE_MUTEX(name)
113
+ #endif
114
+
115
+ /*
116
+ * Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and
117
+ * SEEK_END, all #define'd by stdio.h .
118
+ *
119
+ * Also, many extensions need stdio.h, and they've grown accustomed to tcl.h
120
+ * providing it for them rather than #include-ing it themselves as they
121
+ * should, so also for their sake, we keep the #include to be consistent with
122
+ * prior Tcl releases.
123
+ */
124
+
125
+ #include <stdio.h>
126
+
127
+ /*
128
+ *----------------------------------------------------------------------------
129
+ * Support for functions with a variable number of arguments.
130
+ *
131
+ * The following TCL_VARARGS* macros are to support old extensions
132
+ * written for older versions of Tcl where the macros permitted
133
+ * support for the varargs.h system as well as stdarg.h .
134
+ *
135
+ * New code should just directly be written to use stdarg.h conventions.
136
+ */
137
+
138
+ #include <stdarg.h>
139
+ #if !defined(TCL_NO_DEPRECATED)
140
+ # define TCL_VARARGS(type, name) (type name, ...)
141
+ # define TCL_VARARGS_DEF(type, name) (type name, ...)
142
+ # define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
143
+ #endif /* !TCL_NO_DEPRECATED */
144
+ #if defined(__GNUC__) && (__GNUC__ > 2)
145
+ # if defined(_WIN32) && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO
146
+ # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__MINGW_PRINTF_FORMAT, a, b)))
147
+ # else
148
+ # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
149
+ # endif
150
+ # define TCL_NORETURN __attribute__ ((noreturn))
151
+ # if defined(BUILD_tcl) || defined(BUILD_tk)
152
+ # define TCL_NORETURN1 __attribute__ ((noreturn))
153
+ # else
154
+ # define TCL_NORETURN1 /* nothing */
155
+ # endif
156
+ #else
157
+ # define TCL_FORMAT_PRINTF(a,b)
158
+ # if defined(_MSC_VER) && (_MSC_VER >= 1310)
159
+ # define TCL_NORETURN _declspec(noreturn)
160
+ # else
161
+ # define TCL_NORETURN /* nothing */
162
+ # endif
163
+ # define TCL_NORETURN1 /* nothing */
164
+ #endif
165
+
166
+ /*
167
+ * Allow a part of Tcl's API to be explicitly marked as deprecated.
168
+ *
169
+ * Used to make TIP 330/336 generate moans even if people use the
170
+ * compatibility macros. Change your code, guys! We won't support you forever.
171
+ */
172
+
173
+ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
174
+ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
175
+ # define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__ (msg)))
176
+ # else
177
+ # define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__))
178
+ # endif
179
+ #else
180
+ # define TCL_DEPRECATED_API(msg) /* nothing portable */
181
+ #endif
182
+
183
+ /*
184
+ *----------------------------------------------------------------------------
185
+ * Macros used to declare a function to be exported by a DLL. Used by Windows,
186
+ * maps to no-op declarations on non-Windows systems. The default build on
187
+ * windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
188
+ * nonempty. To build a static library, the macro STATIC_BUILD should be
189
+ * defined.
190
+ *
191
+ * Note: when building static but linking dynamically to MSVCRT we must still
192
+ * correctly decorate the C library imported function. Use CRTIMPORT
193
+ * for this purpose. _DLL is defined by the compiler when linking to
194
+ * MSVCRT.
195
+ */
196
+
197
+ #if (defined(_WIN32) && (defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0550)) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
198
+ # define HAVE_DECLSPEC 1
199
+ # ifdef STATIC_BUILD
200
+ # define DLLIMPORT
201
+ # define DLLEXPORT
202
+ # ifdef _DLL
203
+ # define CRTIMPORT __declspec(dllimport)
204
+ # else
205
+ # define CRTIMPORT
206
+ # endif
207
+ # else
208
+ # define DLLIMPORT __declspec(dllimport)
209
+ # define DLLEXPORT __declspec(dllexport)
210
+ # define CRTIMPORT __declspec(dllimport)
211
+ # endif
212
+ #else
213
+ # define DLLIMPORT
214
+ # if defined(__GNUC__) && __GNUC__ > 3
215
+ # define DLLEXPORT __attribute__ ((visibility("default")))
216
+ # else
217
+ # define DLLEXPORT
218
+ # endif
219
+ # define CRTIMPORT
220
+ #endif
221
+
222
+ /*
223
+ * These macros are used to control whether functions are being declared for
224
+ * import or export. If a function is being declared while it is being built
225
+ * to be included in a shared library, then it should have the DLLEXPORT
226
+ * storage class. If is being declared for use by a module that is going to
227
+ * link against the shared library, then it should have the DLLIMPORT storage
228
+ * class. If the symbol is being declared for a static build or for use from a
229
+ * stub library, then the storage class should be empty.
230
+ *
231
+ * The convention is that a macro called BUILD_xxxx, where xxxx is the name of
232
+ * a library we are building, is set on the compile line for sources that are
233
+ * to be placed in the library. When this macro is set, the storage class will
234
+ * be set to DLLEXPORT. At the end of the header file, the storage class will
235
+ * be reset to DLLIMPORT.
236
+ */
237
+
238
+ #undef TCL_STORAGE_CLASS
239
+ #ifdef BUILD_tcl
240
+ # define TCL_STORAGE_CLASS DLLEXPORT
241
+ #else
242
+ # ifdef USE_TCL_STUBS
243
+ # define TCL_STORAGE_CLASS
244
+ # else
245
+ # define TCL_STORAGE_CLASS DLLIMPORT
246
+ # endif
247
+ #endif
248
+
249
+ /*
250
+ * The following _ANSI_ARGS_ macro is to support old extensions
251
+ * written for older versions of Tcl where it permitted support
252
+ * for compilers written in the pre-prototype era of C.
253
+ *
254
+ * New code should use prototypes.
255
+ */
256
+
257
+ #ifndef TCL_NO_DEPRECATED
258
+ # undef _ANSI_ARGS_
259
+ # define _ANSI_ARGS_(x) x
260
+ #endif
261
+
262
+ /*
263
+ * Definitions that allow this header file to be used either with or without
264
+ * ANSI C features.
265
+ */
266
+
267
+ #ifndef INLINE
268
+ # define INLINE
269
+ #endif
270
+
271
+ #ifdef NO_CONST
272
+ # ifndef const
273
+ # define const
274
+ # endif
275
+ #endif
276
+ #ifndef CONST
277
+ # define CONST const
278
+ #endif
279
+
280
+ #ifdef USE_NON_CONST
281
+ # ifdef USE_COMPAT_CONST
282
+ # error define at most one of USE_NON_CONST and USE_COMPAT_CONST
283
+ # endif
284
+ # define CONST84
285
+ # define CONST84_RETURN
286
+ #else
287
+ # ifdef USE_COMPAT_CONST
288
+ # define CONST84
289
+ # define CONST84_RETURN const
290
+ # else
291
+ # define CONST84 const
292
+ # define CONST84_RETURN const
293
+ # endif
294
+ #endif
295
+
296
+ #ifndef CONST86
297
+ # define CONST86 CONST84
298
+ #endif
299
+
300
+ /*
301
+ * Make sure EXTERN isn't defined elsewhere.
302
+ */
303
+
304
+ #ifdef EXTERN
305
+ # undef EXTERN
306
+ #endif /* EXTERN */
307
+
308
+ #ifdef __cplusplus
309
+ # define EXTERN extern "C" TCL_STORAGE_CLASS
310
+ #else
311
+ # define EXTERN extern TCL_STORAGE_CLASS
312
+ #endif
313
+
314
+ /*
315
+ *----------------------------------------------------------------------------
316
+ * The following code is copied from winnt.h. If we don't replicate it here,
317
+ * then <windows.h> can't be included after tcl.h, since tcl.h also defines
318
+ * VOID. This block is skipped under Cygwin and Mingw.
319
+ */
320
+
321
+ #if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
322
+ #ifndef VOID
323
+ #define VOID void
324
+ typedef char CHAR;
325
+ typedef short SHORT;
326
+ typedef long LONG;
327
+ #endif
328
+ #endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
329
+
330
+ /*
331
+ * Macro to use instead of "void" for arguments that must have type "void *"
332
+ * in ANSI C; maps them to type "char *" in non-ANSI systems.
333
+ */
334
+
335
+ #ifndef __VXWORKS__
336
+ # ifndef NO_VOID
337
+ # define VOID void
338
+ # else
339
+ # define VOID char
340
+ # endif
341
+ #endif
342
+
343
+ /*
344
+ * Miscellaneous declarations.
345
+ */
346
+
347
+ #ifndef _CLIENTDATA
348
+ # ifndef NO_VOID
349
+ typedef void *ClientData;
350
+ # else
351
+ typedef int *ClientData;
352
+ # endif
353
+ # define _CLIENTDATA
354
+ #endif
355
+
356
+ /*
357
+ * Darwin specific configure overrides (to support fat compiles, where
358
+ * configure runs only once for multiple architectures):
359
+ */
360
+
361
+ #ifdef __APPLE__
362
+ # ifdef __LP64__
363
+ # undef TCL_WIDE_INT_TYPE
364
+ # define TCL_WIDE_INT_IS_LONG 1
365
+ # define TCL_CFG_DO64BIT 1
366
+ # else /* !__LP64__ */
367
+ # define TCL_WIDE_INT_TYPE long long
368
+ # undef TCL_WIDE_INT_IS_LONG
369
+ # undef TCL_CFG_DO64BIT
370
+ # endif /* __LP64__ */
371
+ # undef HAVE_STRUCT_STAT64
372
+ #endif /* __APPLE__ */
373
+
374
+ /* Cross-compiling 32-bit on a 64-bit platform? Then our
375
+ * configure script does the wrong thing. Correct that here.
376
+ */
377
+ #if defined(__GNUC__) && !defined(_WIN32) && !defined(__LP64__)
378
+ # undef TCL_WIDE_INT_IS_LONG
379
+ # undef TCL_WIDE_INT_TYPE
380
+ # define TCL_WIDE_INT_TYPE long long
381
+ #endif
382
+
383
+ /*
384
+ * Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
385
+ * Tcl_WideUInt to be the unsigned variant of that type (assuming that where
386
+ * we have one, we can have the other.)
387
+ *
388
+ * Also defines the following macros:
389
+ * TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
390
+ * LP64 system such as modern Solaris or Linux ... not including Win64)
391
+ * Tcl_WideAsLong - forgetful converter from wideInt to long.
392
+ * Tcl_LongAsWide - sign-extending converter from long to wideInt.
393
+ * Tcl_WideAsDouble - converter from wideInt to double.
394
+ * Tcl_DoubleAsWide - converter from double to wideInt.
395
+ *
396
+ * The following invariant should hold for any long value 'longVal':
397
+ * longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
398
+ *
399
+ * Note on converting between Tcl_WideInt and strings. This implementation (in
400
+ * tclObj.c) depends on the function
401
+ * snprintf(...,"%" TCL_LL_MODIFIER "d",...).
402
+ */
403
+
404
+ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
405
+ # ifdef _WIN32
406
+ # define TCL_WIDE_INT_TYPE __int64
407
+ # ifdef __BORLANDC__
408
+ # define TCL_LL_MODIFIER "L"
409
+ # elif defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
410
+ # define TCL_LL_MODIFIER "I64"
411
+ # else
412
+ # define TCL_LL_MODIFIER "ll"
413
+ # endif
414
+ # elif defined(__GNUC__)
415
+ # define TCL_WIDE_INT_TYPE long long
416
+ # define TCL_LL_MODIFIER "ll"
417
+ # else /* ! _WIN32 && ! __GNUC__ */
418
+ /*
419
+ * Don't know what platform it is and configure hasn't discovered what is
420
+ * going on for us. Try to guess...
421
+ */
422
+ # include <limits.h>
423
+ # if (INT_MAX < LONG_MAX)
424
+ # define TCL_WIDE_INT_IS_LONG 1
425
+ # else
426
+ # define TCL_WIDE_INT_TYPE long long
427
+ # endif
428
+ # endif /* _WIN32 */
429
+ #endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
430
+ #ifdef TCL_WIDE_INT_IS_LONG
431
+ # undef TCL_WIDE_INT_TYPE
432
+ # define TCL_WIDE_INT_TYPE long
433
+ #endif /* TCL_WIDE_INT_IS_LONG */
434
+
435
+ typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
436
+ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
437
+
438
+ #ifdef TCL_WIDE_INT_IS_LONG
439
+ # define Tcl_WideAsLong(val) ((long)(val))
440
+ # define Tcl_LongAsWide(val) ((long)(val))
441
+ # define Tcl_WideAsDouble(val) ((double)((long)(val)))
442
+ # define Tcl_DoubleAsWide(val) ((long)((double)(val)))
443
+ # ifndef TCL_LL_MODIFIER
444
+ # define TCL_LL_MODIFIER "l"
445
+ # endif /* !TCL_LL_MODIFIER */
446
+ #else /* TCL_WIDE_INT_IS_LONG */
447
+ /*
448
+ * The next short section of defines are only done when not running on Windows
449
+ * or some other strange platform.
450
+ */
451
+ # ifndef TCL_LL_MODIFIER
452
+ # define TCL_LL_MODIFIER "ll"
453
+ # endif /* !TCL_LL_MODIFIER */
454
+ # define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
455
+ # define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
456
+ # define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
457
+ # define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
458
+ #endif /* TCL_WIDE_INT_IS_LONG */
459
+
460
+ #ifdef _WIN32
461
+ # ifdef __BORLANDC__
462
+ typedef struct stati64 Tcl_StatBuf;
463
+ # elif defined(_WIN64) || defined(_USE_64BIT_TIME_T)
464
+ typedef struct __stat64 Tcl_StatBuf;
465
+ # elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
466
+ typedef struct _stati64 Tcl_StatBuf;
467
+ # else
468
+ typedef struct _stat32i64 Tcl_StatBuf;
469
+ # endif /* _MSC_VER < 1400 */
470
+ #elif defined(__CYGWIN__)
471
+ typedef struct {
472
+ unsigned st_dev;
473
+ unsigned short st_ino;
474
+ unsigned short st_mode;
475
+ short st_nlink;
476
+ short st_uid;
477
+ short st_gid;
478
+ /* Here is a 2-byte gap */
479
+ unsigned st_rdev;
480
+ /* Here is a 4-byte gap */
481
+ long long st_size;
482
+ struct {long tv_sec;} st_atim;
483
+ struct {long tv_sec;} st_mtim;
484
+ struct {long tv_sec;} st_ctim;
485
+ } Tcl_StatBuf;
486
+ #elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
487
+ typedef struct stat64 Tcl_StatBuf;
488
+ #else
489
+ typedef struct stat Tcl_StatBuf;
490
+ #endif
491
+
492
+ /*
493
+ *----------------------------------------------------------------------------
494
+ * Data structures defined opaquely in this module. The definitions below just
495
+ * provide dummy types. A few fields are made visible in Tcl_Interp
496
+ * structures, namely those used for returning a string result from commands.
497
+ * Direct access to the result field is discouraged in Tcl 8.0. The
498
+ * interpreter result is either an object or a string, and the two values are
499
+ * kept consistent unless some C code sets interp->result directly.
500
+ * Programmers should use either the function Tcl_GetObjResult() or
501
+ * Tcl_GetStringResult() to read the interpreter's result. See the SetResult
502
+ * man page for details.
503
+ *
504
+ * Note: any change to the Tcl_Interp definition below must be mirrored in the
505
+ * "real" definition in tclInt.h.
506
+ *
507
+ * Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
508
+ * Instead, they set a Tcl_Obj member in the "real" structure that can be
509
+ * accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
510
+ */
511
+
512
+ typedef struct Tcl_Interp
513
+ #if !defined(TCL_NO_DEPRECATED)
514
+ {
515
+ /* TIP #330: Strongly discourage extensions from using the string
516
+ * result. */
517
+ #ifdef USE_INTERP_RESULT
518
+ char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
519
+ /* If the last command returned a string
520
+ * result, this points to it. */
521
+ void (*freeProc) (char *blockPtr)
522
+ TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
523
+ /* Zero means the string result is statically
524
+ * allocated. TCL_DYNAMIC means it was
525
+ * allocated with ckalloc and should be freed
526
+ * with ckfree. Other values give the address
527
+ * of function to invoke to free the result.
528
+ * Tcl_Eval must free it before executing next
529
+ * command. */
530
+ #else
531
+ char *resultDontUse; /* Don't use in extensions! */
532
+ void (*freeProcDontUse) (char *); /* Don't use in extensions! */
533
+ #endif
534
+ #ifdef USE_INTERP_ERRORLINE
535
+ int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine");
536
+ /* When TCL_ERROR is returned, this gives the
537
+ * line number within the command where the
538
+ * error occurred (1 if first line). */
539
+ #else
540
+ int errorLineDontUse; /* Don't use in extensions! */
541
+ #endif
542
+ }
543
+ #endif /* !TCL_NO_DEPRECATED */
544
+ Tcl_Interp;
545
+
546
+ typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
547
+ typedef struct Tcl_Channel_ *Tcl_Channel;
548
+ typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
549
+ typedef struct Tcl_Command_ *Tcl_Command;
550
+ typedef struct Tcl_Condition_ *Tcl_Condition;
551
+ typedef struct Tcl_Dict_ *Tcl_Dict;
552
+ typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
553
+ typedef struct Tcl_Encoding_ *Tcl_Encoding;
554
+ typedef struct Tcl_Event Tcl_Event;
555
+ typedef struct Tcl_InterpState_ *Tcl_InterpState;
556
+ typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
557
+ typedef struct Tcl_Mutex_ *Tcl_Mutex;
558
+ typedef struct Tcl_Pid_ *Tcl_Pid;
559
+ typedef struct Tcl_RegExp_ *Tcl_RegExp;
560
+ typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
561
+ typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
562
+ typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
563
+ typedef struct Tcl_Trace_ *Tcl_Trace;
564
+ typedef struct Tcl_Var_ *Tcl_Var;
565
+ typedef struct Tcl_ZLibStream_ *Tcl_ZlibStream;
566
+
567
+ /*
568
+ *----------------------------------------------------------------------------
569
+ * Definition of the interface to functions implementing threads. A function
570
+ * following this definition is given to each call of 'Tcl_CreateThread' and
571
+ * will be called as the main fuction of the new thread created by that call.
572
+ */
573
+
574
+ #if defined _WIN32
575
+ typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData);
576
+ #else
577
+ typedef void (Tcl_ThreadCreateProc) (ClientData clientData);
578
+ #endif
579
+
580
+ /*
581
+ * Threading function return types used for abstracting away platform
582
+ * differences when writing a Tcl_ThreadCreateProc. See the NewThread function
583
+ * in generic/tclThreadTest.c for it's usage.
584
+ */
585
+
586
+ #if defined _WIN32
587
+ # define Tcl_ThreadCreateType unsigned __stdcall
588
+ # define TCL_THREAD_CREATE_RETURN return 0
589
+ #else
590
+ # define Tcl_ThreadCreateType void
591
+ # define TCL_THREAD_CREATE_RETURN
592
+ #endif
593
+
594
+ /*
595
+ * Definition of values for default stacksize and the possible flags to be
596
+ * given to Tcl_CreateThread.
597
+ */
598
+
599
+ #define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
600
+ #define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default
601
+ * behaviour. */
602
+ #define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable. */
603
+
604
+ /*
605
+ * Flag values passed to Tcl_StringCaseMatch.
606
+ */
607
+
608
+ #define TCL_MATCH_NOCASE (1<<0)
609
+
610
+ /*
611
+ * Flag values passed to Tcl_GetRegExpFromObj.
612
+ */
613
+
614
+ #define TCL_REG_BASIC 000000 /* BREs (convenience). */
615
+ #define TCL_REG_EXTENDED 000001 /* EREs. */
616
+ #define TCL_REG_ADVF 000002 /* Advanced features in EREs. */
617
+ #define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs). */
618
+ #define TCL_REG_QUOTE 000004 /* No special characters, none. */
619
+ #define TCL_REG_NOCASE 000010 /* Ignore case. */
620
+ #define TCL_REG_NOSUB 000020 /* Don't care about subexpressions. */
621
+ #define TCL_REG_EXPANDED 000040 /* Expanded format, white space &
622
+ * comments. */
623
+ #define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
624
+ #define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before. */
625
+ #define TCL_REG_NEWLINE 000300 /* Newlines are line terminators. */
626
+ #define TCL_REG_CANMATCH 001000 /* Report details on partial/limited
627
+ * matches. */
628
+
629
+ /*
630
+ * Flags values passed to Tcl_RegExpExecObj.
631
+ */
632
+
633
+ #define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
634
+ #define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
635
+
636
+ /*
637
+ * Structures filled in by Tcl_RegExpInfo. Note that all offset values are
638
+ * relative to the start of the match string, not the beginning of the entire
639
+ * string.
640
+ */
641
+
642
+ typedef struct Tcl_RegExpIndices {
643
+ long start; /* Character offset of first character in
644
+ * match. */
645
+ long end; /* Character offset of first character after
646
+ * the match. */
647
+ } Tcl_RegExpIndices;
648
+
649
+ typedef struct Tcl_RegExpInfo {
650
+ int nsubs; /* Number of subexpressions in the compiled
651
+ * expression. */
652
+ Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
653
+ long extendStart; /* The offset at which a subsequent match
654
+ * might begin. */
655
+ long reserved; /* Reserved for later use. */
656
+ } Tcl_RegExpInfo;
657
+
658
+ /*
659
+ * Picky compilers complain if this typdef doesn't appear before the struct's
660
+ * reference in tclDecls.h.
661
+ */
662
+
663
+ typedef Tcl_StatBuf *Tcl_Stat_;
664
+ typedef struct stat *Tcl_OldStat_;
665
+
666
+ /*
667
+ *----------------------------------------------------------------------------
668
+ * When a TCL command returns, the interpreter contains a result from the
669
+ * command. Programmers are strongly encouraged to use one of the functions
670
+ * Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
671
+ * result. See the SetResult man page for details. Besides this result, the
672
+ * command function returns an integer code, which is one of the following:
673
+ *
674
+ * TCL_OK Command completed normally; the interpreter's result
675
+ * contains the command's result.
676
+ * TCL_ERROR The command couldn't be completed successfully; the
677
+ * interpreter's result describes what went wrong.
678
+ * TCL_RETURN The command requests that the current function return;
679
+ * the interpreter's result contains the function's
680
+ * return value.
681
+ * TCL_BREAK The command requests that the innermost loop be
682
+ * exited; the interpreter's result is meaningless.
683
+ * TCL_CONTINUE Go on to the next iteration of the current loop; the
684
+ * interpreter's result is meaningless.
685
+ */
686
+
687
+ #define TCL_OK 0
688
+ #define TCL_ERROR 1
689
+ #define TCL_RETURN 2
690
+ #define TCL_BREAK 3
691
+ #define TCL_CONTINUE 4
692
+
693
+ #define TCL_RESULT_SIZE 200
694
+
695
+ /*
696
+ *----------------------------------------------------------------------------
697
+ * Flags to control what substitutions are performed by Tcl_SubstObj():
698
+ */
699
+
700
+ #define TCL_SUBST_COMMANDS 001
701
+ #define TCL_SUBST_VARIABLES 002
702
+ #define TCL_SUBST_BACKSLASHES 004
703
+ #define TCL_SUBST_ALL 007
704
+
705
+ /*
706
+ * Argument descriptors for math function callbacks in expressions:
707
+ */
708
+
709
+ typedef enum {
710
+ TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
711
+ } Tcl_ValueType;
712
+
713
+ typedef struct Tcl_Value {
714
+ Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
715
+ * or both. */
716
+ long intValue; /* Integer value. */
717
+ double doubleValue; /* Double-precision floating value. */
718
+ Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
719
+ } Tcl_Value;
720
+
721
+ /*
722
+ * Forward declaration of Tcl_Obj to prevent an error when the forward
723
+ * reference to Tcl_Obj is encountered in the function types declared below.
724
+ */
725
+
726
+ struct Tcl_Obj;
727
+
728
+ /*
729
+ *----------------------------------------------------------------------------
730
+ * Function types defined by Tcl:
731
+ */
732
+
733
+ typedef int (Tcl_AppInitProc) (Tcl_Interp *interp);
734
+ typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp,
735
+ int code);
736
+ typedef void (Tcl_ChannelProc) (ClientData clientData, int mask);
737
+ typedef void (Tcl_CloseProc) (ClientData data);
738
+ typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
739
+ typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
740
+ int argc, CONST84 char *argv[]);
741
+ typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp,
742
+ int level, char *command, Tcl_CmdProc *proc,
743
+ ClientData cmdClientData, int argc, CONST84 char *argv[]);
744
+ typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp,
745
+ int level, const char *command, Tcl_Command commandInfo, int objc,
746
+ struct Tcl_Obj *const *objv);
747
+ typedef void (Tcl_CmdObjTraceDeleteProc) (ClientData clientData);
748
+ typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
749
+ struct Tcl_Obj *dupPtr);
750
+ typedef int (Tcl_EncodingConvertProc) (ClientData clientData, const char *src,
751
+ int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst,
752
+ int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr);
753
+ typedef void (Tcl_EncodingFreeProc) (ClientData clientData);
754
+ typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags);
755
+ typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags);
756
+ typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData);
757
+ typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags);
758
+ typedef void (Tcl_ExitProc) (ClientData clientData);
759
+ typedef void (Tcl_FileProc) (ClientData clientData, int mask);
760
+ typedef void (Tcl_FileFreeProc) (ClientData clientData);
761
+ typedef void (Tcl_FreeInternalRepProc) (struct Tcl_Obj *objPtr);
762
+ typedef void (Tcl_FreeProc) (char *blockPtr);
763
+ typedef void (Tcl_IdleProc) (ClientData clientData);
764
+ typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
765
+ Tcl_Interp *interp);
766
+ typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
767
+ Tcl_Value *args, Tcl_Value *resultPtr);
768
+ typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
769
+ typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
770
+ int objc, struct Tcl_Obj *const *objv);
771
+ typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp);
772
+ typedef int (Tcl_PackageUnloadProc) (Tcl_Interp *interp, int flags);
773
+ typedef void (Tcl_PanicProc) (const char *format, ...);
774
+ typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan,
775
+ char *address, int port);
776
+ typedef void (Tcl_TimerProc) (ClientData clientData);
777
+ typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr);
778
+ typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr);
779
+ typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp,
780
+ CONST84 char *part1, CONST84 char *part2, int flags);
781
+ typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp,
782
+ const char *oldName, const char *newName, int flags);
783
+ typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc,
784
+ ClientData clientData);
785
+ typedef void (Tcl_DeleteFileHandlerProc) (int fd);
786
+ typedef void (Tcl_AlertNotifierProc) (ClientData clientData);
787
+ typedef void (Tcl_ServiceModeHookProc) (int mode);
788
+ typedef ClientData (Tcl_InitNotifierProc) (void);
789
+ typedef void (Tcl_FinalizeNotifierProc) (ClientData clientData);
790
+ typedef void (Tcl_MainLoopProc) (void);
791
+
792
+ /*
793
+ *----------------------------------------------------------------------------
794
+ * The following structure represents a type of object, which is a particular
795
+ * internal representation for an object plus a set of functions that provide
796
+ * standard operations on objects of that type.
797
+ */
798
+
799
+ typedef struct Tcl_ObjType {
800
+ const char *name; /* Name of the type, e.g. "int". */
801
+ Tcl_FreeInternalRepProc *freeIntRepProc;
802
+ /* Called to free any storage for the type's
803
+ * internal rep. NULL if the internal rep does
804
+ * not need freeing. */
805
+ Tcl_DupInternalRepProc *dupIntRepProc;
806
+ /* Called to create a new object as a copy of
807
+ * an existing object. */
808
+ Tcl_UpdateStringProc *updateStringProc;
809
+ /* Called to update the string rep from the
810
+ * type's internal representation. */
811
+ Tcl_SetFromAnyProc *setFromAnyProc;
812
+ /* Called to convert the object's internal rep
813
+ * to this type. Frees the internal rep of the
814
+ * old type. Returns TCL_ERROR on failure. */
815
+ } Tcl_ObjType;
816
+
817
+ /*
818
+ * One of the following structures exists for each object in the Tcl system.
819
+ * An object stores a value as either a string, some internal representation,
820
+ * or both.
821
+ */
822
+
823
+ typedef struct Tcl_Obj {
824
+ int refCount; /* When 0 the object will be freed. */
825
+ char *bytes; /* This points to the first byte of the
826
+ * object's string representation. The array
827
+ * must be followed by a null byte (i.e., at
828
+ * offset length) but may also contain
829
+ * embedded null characters. The array's
830
+ * storage is allocated by ckalloc. NULL means
831
+ * the string rep is invalid and must be
832
+ * regenerated from the internal rep. Clients
833
+ * should use Tcl_GetStringFromObj or
834
+ * Tcl_GetString to get a pointer to the byte
835
+ * array as a readonly value. */
836
+ int length; /* The number of bytes at *bytes, not
837
+ * including the terminating null. */
838
+ const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
839
+ * corresponds to the type of the object's
840
+ * internal rep. NULL indicates the object has
841
+ * no internal rep (has no type). */
842
+ union { /* The internal representation: */
843
+ long longValue; /* - an long integer value. */
844
+ double doubleValue; /* - a double-precision floating value. */
845
+ void *otherValuePtr; /* - another, type-specific value,
846
+ not used internally any more. */
847
+ Tcl_WideInt wideValue; /* - a long long value. */
848
+ struct { /* - internal rep as two pointers.
849
+ * the main use of which is a bignum's
850
+ * tightly packed fields, where the alloc,
851
+ * used and signum flags are packed into
852
+ * ptr2 with everything else hung off ptr1. */
853
+ void *ptr1;
854
+ void *ptr2;
855
+ } twoPtrValue;
856
+ struct { /* - internal rep as a pointer and a long,
857
+ not used internally any more. */
858
+ void *ptr;
859
+ unsigned long value;
860
+ } ptrAndLongRep;
861
+ } internalRep;
862
+ } Tcl_Obj;
863
+
864
+ /*
865
+ * Macros to increment and decrement a Tcl_Obj's reference count, and to test
866
+ * whether an object is shared (i.e. has reference count > 1). Note: clients
867
+ * should use Tcl_DecrRefCount() when they are finished using an object, and
868
+ * should never call TclFreeObj() directly. TclFreeObj() is only defined and
869
+ * made public in tcl.h to support Tcl_DecrRefCount's macro definition.
870
+ */
871
+
872
+ void Tcl_IncrRefCount(Tcl_Obj *objPtr);
873
+ void Tcl_DecrRefCount(Tcl_Obj *objPtr);
874
+ int Tcl_IsShared(Tcl_Obj *objPtr);
875
+
876
+ /*
877
+ *----------------------------------------------------------------------------
878
+ * The following structure contains the state needed by Tcl_SaveResult. No-one
879
+ * outside of Tcl should access any of these fields. This structure is
880
+ * typically allocated on the stack.
881
+ */
882
+
883
+ typedef struct Tcl_SavedResult {
884
+ char *result;
885
+ Tcl_FreeProc *freeProc;
886
+ Tcl_Obj *objResultPtr;
887
+ char *appendResult;
888
+ int appendAvl;
889
+ int appendUsed;
890
+ char resultSpace[TCL_RESULT_SIZE+1];
891
+ } Tcl_SavedResult;
892
+
893
+ /*
894
+ *----------------------------------------------------------------------------
895
+ * The following definitions support Tcl's namespace facility. Note: the first
896
+ * five fields must match exactly the fields in a Namespace structure (see
897
+ * tclInt.h).
898
+ */
899
+
900
+ typedef struct Tcl_Namespace {
901
+ char *name; /* The namespace's name within its parent
902
+ * namespace. This contains no ::'s. The name
903
+ * of the global namespace is "" although "::"
904
+ * is an synonym. */
905
+ char *fullName; /* The namespace's fully qualified name. This
906
+ * starts with ::. */
907
+ ClientData clientData; /* Arbitrary value associated with this
908
+ * namespace. */
909
+ Tcl_NamespaceDeleteProc *deleteProc;
910
+ /* Function invoked when deleting the
911
+ * namespace to, e.g., free clientData. */
912
+ struct Tcl_Namespace *parentPtr;
913
+ /* Points to the namespace that contains this
914
+ * one. NULL if this is the global
915
+ * namespace. */
916
+ } Tcl_Namespace;
917
+
918
+ /*
919
+ *----------------------------------------------------------------------------
920
+ * The following structure represents a call frame, or activation record. A
921
+ * call frame defines a naming context for a procedure call: its local scope
922
+ * (for local variables) and its namespace scope (used for non-local
923
+ * variables; often the global :: namespace). A call frame can also define the
924
+ * naming context for a namespace eval or namespace inscope command: the
925
+ * namespace in which the command's code should execute. The Tcl_CallFrame
926
+ * structures exist only while procedures or namespace eval/inscope's are
927
+ * being executed, and provide a Tcl call stack.
928
+ *
929
+ * A call frame is initialized and pushed using Tcl_PushCallFrame and popped
930
+ * using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
931
+ * Tcl_PushCallFrame caller, and callers typically allocate them on the C call
932
+ * stack for efficiency. For this reason, Tcl_CallFrame is defined as a
933
+ * structure and not as an opaque token. However, most Tcl_CallFrame fields
934
+ * are hidden since applications should not access them directly; others are
935
+ * declared as "dummyX".
936
+ *
937
+ * WARNING!! The structure definition must be kept consistent with the
938
+ * CallFrame structure in tclInt.h. If you change one, change the other.
939
+ */
940
+
941
+ typedef struct Tcl_CallFrame {
942
+ Tcl_Namespace *nsPtr;
943
+ int dummy1;
944
+ int dummy2;
945
+ void *dummy3;
946
+ void *dummy4;
947
+ void *dummy5;
948
+ int dummy6;
949
+ void *dummy7;
950
+ void *dummy8;
951
+ int dummy9;
952
+ void *dummy10;
953
+ void *dummy11;
954
+ void *dummy12;
955
+ void *dummy13;
956
+ } Tcl_CallFrame;
957
+
958
+ /*
959
+ *----------------------------------------------------------------------------
960
+ * Information about commands that is returned by Tcl_GetCommandInfo and
961
+ * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
962
+ * function while proc is a traditional Tcl argc/argv string-based function.
963
+ * Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
964
+ * proc are non-NULL and can be called to execute the command. However, it may
965
+ * be faster to call one instead of the other. The member isNativeObjectProc
966
+ * is set to 1 if an object-based function was registered by
967
+ * Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
968
+ * Tcl_CreateCommand. The other function is typically set to a compatibility
969
+ * wrapper that does string-to-object or object-to-string argument conversions
970
+ * then calls the other function.
971
+ */
972
+
973
+ typedef struct Tcl_CmdInfo {
974
+ int isNativeObjectProc; /* 1 if objProc was registered by a call to
975
+ * Tcl_CreateObjCommand; 0 otherwise.
976
+ * Tcl_SetCmdInfo does not modify this
977
+ * field. */
978
+ Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
979
+ ClientData objClientData; /* ClientData for object proc. */
980
+ Tcl_CmdProc *proc; /* Command's string-based function. */
981
+ ClientData clientData; /* ClientData for string proc. */
982
+ Tcl_CmdDeleteProc *deleteProc;
983
+ /* Function to call when command is
984
+ * deleted. */
985
+ ClientData deleteData; /* Value to pass to deleteProc (usually the
986
+ * same as clientData). */
987
+ Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this
988
+ * command. Note that Tcl_SetCmdInfo will not
989
+ * change a command's namespace; use
990
+ * TclRenameCommand or Tcl_Eval (of 'rename')
991
+ * to do that. */
992
+ } Tcl_CmdInfo;
993
+
994
+ /*
995
+ *----------------------------------------------------------------------------
996
+ * The structure defined below is used to hold dynamic strings. The only
997
+ * fields that clients should use are string and length, accessible via the
998
+ * macros Tcl_DStringValue and Tcl_DStringLength.
999
+ */
1000
+
1001
+ #define TCL_DSTRING_STATIC_SIZE 200
1002
+ typedef struct Tcl_DString {
1003
+ char *string; /* Points to beginning of string: either
1004
+ * staticSpace below or a malloced array. */
1005
+ int length; /* Number of non-NULL characters in the
1006
+ * string. */
1007
+ int spaceAvl; /* Total number of bytes available for the
1008
+ * string and its terminating NULL char. */
1009
+ char staticSpace[TCL_DSTRING_STATIC_SIZE];
1010
+ /* Space to use in common case where string is
1011
+ * small. */
1012
+ } Tcl_DString;
1013
+
1014
+ #define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
1015
+ #define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
1016
+ #define Tcl_DStringTrunc Tcl_DStringSetLength
1017
+
1018
+ /*
1019
+ * Definitions for the maximum number of digits of precision that may be
1020
+ * specified in the "tcl_precision" variable, and the number of bytes of
1021
+ * buffer space required by Tcl_PrintDouble.
1022
+ */
1023
+
1024
+ #define TCL_MAX_PREC 17
1025
+ #define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
1026
+
1027
+ /*
1028
+ * Definition for a number of bytes of buffer space sufficient to hold the
1029
+ * string representation of an integer in base 10 (assuming the existence of
1030
+ * 64-bit integers).
1031
+ */
1032
+
1033
+ #define TCL_INTEGER_SPACE 24
1034
+
1035
+ /*
1036
+ * Flag values passed to Tcl_ConvertElement.
1037
+ * TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
1038
+ * use backslash quoting instead.
1039
+ * TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
1040
+ * is safe to leave the hash unquoted when the element is not the first
1041
+ * element of a list, and this flag can be used by the caller to indicate
1042
+ * that condition.
1043
+ */
1044
+
1045
+ #define TCL_DONT_USE_BRACES 1
1046
+ #define TCL_DONT_QUOTE_HASH 8
1047
+
1048
+ /*
1049
+ * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
1050
+ * abbreviated strings.
1051
+ */
1052
+
1053
+ #define TCL_EXACT 1
1054
+
1055
+ /*
1056
+ *----------------------------------------------------------------------------
1057
+ * Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
1058
+ * WARNING: these bit choices must not conflict with the bit choices for
1059
+ * evalFlag bits in tclInt.h!
1060
+ *
1061
+ * Meanings:
1062
+ * TCL_NO_EVAL: Just record this command
1063
+ * TCL_EVAL_GLOBAL: Execute script in global namespace
1064
+ * TCL_EVAL_DIRECT: Do not compile this script
1065
+ * TCL_EVAL_INVOKE: Magical Tcl_EvalObjv mode for aliases/ensembles
1066
+ * o Run in iPtr->lookupNsPtr or global namespace
1067
+ * o Cut out of error traces
1068
+ * o Don't reset the flags controlling ensemble
1069
+ * error message rewriting.
1070
+ * TCL_CANCEL_UNWIND: Magical Tcl_CancelEval mode that causes the
1071
+ * stack for the script in progress to be
1072
+ * completely unwound.
1073
+ * TCL_EVAL_NOERR: Do no exception reporting at all, just return
1074
+ * as the caller will report.
1075
+ */
1076
+
1077
+ #define TCL_NO_EVAL 0x010000
1078
+ #define TCL_EVAL_GLOBAL 0x020000
1079
+ #define TCL_EVAL_DIRECT 0x040000
1080
+ #define TCL_EVAL_INVOKE 0x080000
1081
+ #define TCL_CANCEL_UNWIND 0x100000
1082
+ #define TCL_EVAL_NOERR 0x200000
1083
+
1084
+ /*
1085
+ * Special freeProc values that may be passed to Tcl_SetResult (see the man
1086
+ * page for details):
1087
+ */
1088
+
1089
+ #define TCL_VOLATILE ((Tcl_FreeProc *) 1)
1090
+ #define TCL_STATIC ((Tcl_FreeProc *) 0)
1091
+ #define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
1092
+
1093
+ /*
1094
+ * Flag values passed to variable-related functions.
1095
+ * WARNING: these bit choices must not conflict with the bit choice for
1096
+ * TCL_CANCEL_UNWIND, above.
1097
+ */
1098
+
1099
+ #define TCL_GLOBAL_ONLY 1
1100
+ #define TCL_NAMESPACE_ONLY 2
1101
+ #define TCL_APPEND_VALUE 4
1102
+ #define TCL_LIST_ELEMENT 8
1103
+ #define TCL_TRACE_READS 0x10
1104
+ #define TCL_TRACE_WRITES 0x20
1105
+ #define TCL_TRACE_UNSETS 0x40
1106
+ #define TCL_TRACE_DESTROYED 0x80
1107
+ #define TCL_INTERP_DESTROYED 0x100
1108
+ #define TCL_LEAVE_ERR_MSG 0x200
1109
+ #define TCL_TRACE_ARRAY 0x800
1110
+ #ifndef TCL_REMOVE_OBSOLETE_TRACES
1111
+ /* Required to support old variable/vdelete/vinfo traces. */
1112
+ #define TCL_TRACE_OLD_STYLE 0x1000
1113
+ #endif
1114
+ /* Indicate the semantics of the result of a trace. */
1115
+ #define TCL_TRACE_RESULT_DYNAMIC 0x8000
1116
+ #define TCL_TRACE_RESULT_OBJECT 0x10000
1117
+
1118
+ /*
1119
+ * Flag values for ensemble commands.
1120
+ */
1121
+
1122
+ #define TCL_ENSEMBLE_PREFIX 0x02/* Flag value to say whether to allow
1123
+ * unambiguous prefixes of commands or to
1124
+ * require exact matches for command names. */
1125
+
1126
+ /*
1127
+ * Flag values passed to command-related functions.
1128
+ */
1129
+
1130
+ #define TCL_TRACE_RENAME 0x2000
1131
+ #define TCL_TRACE_DELETE 0x4000
1132
+
1133
+ #define TCL_ALLOW_INLINE_COMPILATION 0x20000
1134
+
1135
+ /*
1136
+ * The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
1137
+ * always parsed whenever the part2 is NULL. (This is to avoid a common error
1138
+ * when converting code to use the new object based APIs and forgetting to
1139
+ * give the flag)
1140
+ */
1141
+
1142
+ #if !defined(TCL_NO_DEPRECATED)
1143
+ # define TCL_PARSE_PART1 0x400
1144
+ #endif /* !TCL_NO_DEPRECATED */
1145
+
1146
+ /*
1147
+ * Types for linked variables:
1148
+ */
1149
+
1150
+ #define TCL_LINK_INT 1
1151
+ #define TCL_LINK_DOUBLE 2
1152
+ #define TCL_LINK_BOOLEAN 3
1153
+ #define TCL_LINK_STRING 4
1154
+ #define TCL_LINK_WIDE_INT 5
1155
+ #define TCL_LINK_CHAR 6
1156
+ #define TCL_LINK_UCHAR 7
1157
+ #define TCL_LINK_SHORT 8
1158
+ #define TCL_LINK_USHORT 9
1159
+ #define TCL_LINK_UINT 10
1160
+ #define TCL_LINK_LONG 11
1161
+ #define TCL_LINK_ULONG 12
1162
+ #define TCL_LINK_FLOAT 13
1163
+ #define TCL_LINK_WIDE_UINT 14
1164
+ #define TCL_LINK_READ_ONLY 0x80
1165
+
1166
+ /*
1167
+ *----------------------------------------------------------------------------
1168
+ * Forward declarations of Tcl_HashTable and related types.
1169
+ */
1170
+
1171
+ typedef struct Tcl_HashKeyType Tcl_HashKeyType;
1172
+ typedef struct Tcl_HashTable Tcl_HashTable;
1173
+ typedef struct Tcl_HashEntry Tcl_HashEntry;
1174
+
1175
+ typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
1176
+ typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
1177
+ typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
1178
+ void *keyPtr);
1179
+ typedef void (Tcl_FreeHashEntryProc) (Tcl_HashEntry *hPtr);
1180
+
1181
+ /*
1182
+ * This flag controls whether the hash table stores the hash of a key, or
1183
+ * recalculates it. There should be no reason for turning this flag off as it
1184
+ * is completely binary and source compatible unless you directly access the
1185
+ * bucketPtr member of the Tcl_HashTableEntry structure. This member has been
1186
+ * removed and the space used to store the hash value.
1187
+ */
1188
+
1189
+ #ifndef TCL_HASH_KEY_STORE_HASH
1190
+ # define TCL_HASH_KEY_STORE_HASH 1
1191
+ #endif
1192
+
1193
+ /*
1194
+ * Structure definition for an entry in a hash table. No-one outside Tcl
1195
+ * should access any of these fields directly; use the macros defined below.
1196
+ */
1197
+
1198
+ struct Tcl_HashEntry {
1199
+ Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
1200
+ * or NULL for end of chain. */
1201
+ Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
1202
+ #if TCL_HASH_KEY_STORE_HASH
1203
+ void *hash; /* Hash value, stored as pointer to ensure
1204
+ * that the offsets of the fields in this
1205
+ * structure are not changed. */
1206
+ #else
1207
+ Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to first
1208
+ * entry in this entry's chain: used for
1209
+ * deleting the entry. */
1210
+ #endif
1211
+ ClientData clientData; /* Application stores something here with
1212
+ * Tcl_SetHashValue. */
1213
+ union { /* Key has one of these forms: */
1214
+ char *oneWordValue; /* One-word value for key. */
1215
+ Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
1216
+ int words[1]; /* Multiple integer words for key. The actual
1217
+ * size will be as large as necessary for this
1218
+ * table's keys. */
1219
+ char string[1]; /* String for key. The actual size will be as
1220
+ * large as needed to hold the key. */
1221
+ } key; /* MUST BE LAST FIELD IN RECORD!! */
1222
+ };
1223
+
1224
+ /*
1225
+ * Flags used in Tcl_HashKeyType.
1226
+ *
1227
+ * TCL_HASH_KEY_RANDOMIZE_HASH -
1228
+ * There are some things, pointers for example
1229
+ * which don't hash well because they do not use
1230
+ * the lower bits. If this flag is set then the
1231
+ * hash table will attempt to rectify this by
1232
+ * randomising the bits and then using the upper
1233
+ * N bits as the index into the table.
1234
+ * TCL_HASH_KEY_SYSTEM_HASH - If this flag is set then all memory internally
1235
+ * allocated for the hash table that is not for an
1236
+ * entry will use the system heap.
1237
+ */
1238
+
1239
+ #define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
1240
+ #define TCL_HASH_KEY_SYSTEM_HASH 0x2
1241
+
1242
+ /*
1243
+ * Structure definition for the methods associated with a hash table key type.
1244
+ */
1245
+
1246
+ #define TCL_HASH_KEY_TYPE_VERSION 1
1247
+ struct Tcl_HashKeyType {
1248
+ int version; /* Version of the table. If this structure is
1249
+ * extended in future then the version can be
1250
+ * used to distinguish between different
1251
+ * structures. */
1252
+ int flags; /* Flags, see above for details. */
1253
+ Tcl_HashKeyProc *hashKeyProc;
1254
+ /* Calculates a hash value for the key. If
1255
+ * this is NULL then the pointer itself is
1256
+ * used as a hash value. */
1257
+ Tcl_CompareHashKeysProc *compareKeysProc;
1258
+ /* Compares two keys and returns zero if they
1259
+ * do not match, and non-zero if they do. If
1260
+ * this is NULL then the pointers are
1261
+ * compared. */
1262
+ Tcl_AllocHashEntryProc *allocEntryProc;
1263
+ /* Called to allocate memory for a new entry,
1264
+ * i.e. if the key is a string then this could
1265
+ * allocate a single block which contains
1266
+ * enough space for both the entry and the
1267
+ * string. Only the key field of the allocated
1268
+ * Tcl_HashEntry structure needs to be filled
1269
+ * in. If something else needs to be done to
1270
+ * the key, i.e. incrementing a reference
1271
+ * count then that should be done by this
1272
+ * function. If this is NULL then Tcl_Alloc is
1273
+ * used to allocate enough space for a
1274
+ * Tcl_HashEntry and the key pointer is
1275
+ * assigned to key.oneWordValue. */
1276
+ Tcl_FreeHashEntryProc *freeEntryProc;
1277
+ /* Called to free memory associated with an
1278
+ * entry. If something else needs to be done
1279
+ * to the key, i.e. decrementing a reference
1280
+ * count then that should be done by this
1281
+ * function. If this is NULL then Tcl_Free is
1282
+ * used to free the Tcl_HashEntry. */
1283
+ };
1284
+
1285
+ /*
1286
+ * Structure definition for a hash table. Must be in tcl.h so clients can
1287
+ * allocate space for these structures, but clients should never access any
1288
+ * fields in this structure.
1289
+ */
1290
+
1291
+ #define TCL_SMALL_HASH_TABLE 4
1292
+ struct Tcl_HashTable {
1293
+ Tcl_HashEntry **buckets; /* Pointer to bucket array. Each element
1294
+ * points to first entry in bucket's hash
1295
+ * chain, or NULL. */
1296
+ Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
1297
+ /* Bucket array used for small tables (to
1298
+ * avoid mallocs and frees). */
1299
+ int numBuckets; /* Total number of buckets allocated at
1300
+ * **bucketPtr. */
1301
+ int numEntries; /* Total number of entries present in
1302
+ * table. */
1303
+ int rebuildSize; /* Enlarge table when numEntries gets to be
1304
+ * this large. */
1305
+ int downShift; /* Shift count used in hashing function.
1306
+ * Designed to use high-order bits of
1307
+ * randomized keys. */
1308
+ int mask; /* Mask value used in hashing function. */
1309
+ int keyType; /* Type of keys used in this table. It's
1310
+ * either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
1311
+ * TCL_ONE_WORD_KEYS, or an integer giving the
1312
+ * number of ints that is the size of the
1313
+ * key. */
1314
+ Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const char *key);
1315
+ Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const char *key,
1316
+ int *newPtr);
1317
+ const Tcl_HashKeyType *typePtr;
1318
+ /* Type of the keys used in the
1319
+ * Tcl_HashTable. */
1320
+ };
1321
+
1322
+ /*
1323
+ * Structure definition for information used to keep track of searches through
1324
+ * hash tables:
1325
+ */
1326
+
1327
+ typedef struct Tcl_HashSearch {
1328
+ Tcl_HashTable *tablePtr; /* Table being searched. */
1329
+ int nextIndex; /* Index of next bucket to be enumerated after
1330
+ * present one. */
1331
+ Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
1332
+ * bucket. */
1333
+ } Tcl_HashSearch;
1334
+
1335
+ /*
1336
+ * Acceptable key types for hash tables:
1337
+ *
1338
+ * TCL_STRING_KEYS: The keys are strings, they are copied into the
1339
+ * entry.
1340
+ * TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored
1341
+ * in the entry.
1342
+ * TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied
1343
+ * into the entry.
1344
+ * TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the
1345
+ * pointer is stored in the entry.
1346
+ *
1347
+ * While maintaining binary compatibility the above have to be distinct values
1348
+ * as they are used to differentiate between old versions of the hash table
1349
+ * which don't have a typePtr and new ones which do. Once binary compatibility
1350
+ * is discarded in favour of making more wide spread changes TCL_STRING_KEYS
1351
+ * can be the same as TCL_CUSTOM_TYPE_KEYS, and TCL_ONE_WORD_KEYS can be the
1352
+ * same as TCL_CUSTOM_PTR_KEYS because they simply determine how the key is
1353
+ * accessed from the entry and not the behaviour.
1354
+ */
1355
+
1356
+ #define TCL_STRING_KEYS (0)
1357
+ #define TCL_ONE_WORD_KEYS (1)
1358
+ #define TCL_CUSTOM_TYPE_KEYS (-2)
1359
+ #define TCL_CUSTOM_PTR_KEYS (-1)
1360
+
1361
+ /*
1362
+ * Structure definition for information used to keep track of searches through
1363
+ * dictionaries. These fields should not be accessed by code outside
1364
+ * tclDictObj.c
1365
+ */
1366
+
1367
+ typedef struct {
1368
+ void *next; /* Search position for underlying hash
1369
+ * table. */
1370
+ int epoch; /* Epoch marker for dictionary being searched,
1371
+ * or -1 if search has terminated. */
1372
+ Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
1373
+ } Tcl_DictSearch;
1374
+
1375
+ /*
1376
+ *----------------------------------------------------------------------------
1377
+ * Flag values to pass to Tcl_DoOneEvent to disable searches for some kinds of
1378
+ * events:
1379
+ */
1380
+
1381
+ #define TCL_DONT_WAIT (1<<1)
1382
+ #define TCL_WINDOW_EVENTS (1<<2)
1383
+ #define TCL_FILE_EVENTS (1<<3)
1384
+ #define TCL_TIMER_EVENTS (1<<4)
1385
+ #define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
1386
+ #define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
1387
+
1388
+ /*
1389
+ * The following structure defines a generic event for the Tcl event system.
1390
+ * These are the things that are queued in calls to Tcl_QueueEvent and
1391
+ * serviced later by Tcl_DoOneEvent. There can be many different kinds of
1392
+ * events with different fields, corresponding to window events, timer events,
1393
+ * etc. The structure for a particular event consists of a Tcl_Event header
1394
+ * followed by additional information specific to that event.
1395
+ */
1396
+
1397
+ struct Tcl_Event {
1398
+ Tcl_EventProc *proc; /* Function to call to service this event. */
1399
+ struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
1400
+ };
1401
+
1402
+ /*
1403
+ * Positions to pass to Tcl_QueueEvent:
1404
+ */
1405
+
1406
+ typedef enum {
1407
+ TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
1408
+ } Tcl_QueuePosition;
1409
+
1410
+ /*
1411
+ * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
1412
+ * event routines.
1413
+ */
1414
+
1415
+ #define TCL_SERVICE_NONE 0
1416
+ #define TCL_SERVICE_ALL 1
1417
+
1418
+ /*
1419
+ * The following structure keeps is used to hold a time value, either as an
1420
+ * absolute time (the number of seconds from the epoch) or as an elapsed time.
1421
+ * On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
1422
+ */
1423
+
1424
+ typedef struct Tcl_Time {
1425
+ long sec; /* Seconds. */
1426
+ long usec; /* Microseconds. */
1427
+ } Tcl_Time;
1428
+
1429
+ typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
1430
+ typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
1431
+
1432
+ /*
1433
+ * TIP #233 (Virtualized Time)
1434
+ */
1435
+
1436
+ typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, ClientData clientData);
1437
+ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
1438
+
1439
+ /*
1440
+ *----------------------------------------------------------------------------
1441
+ * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler to
1442
+ * indicate what sorts of events are of interest:
1443
+ */
1444
+
1445
+ #define TCL_READABLE (1<<1)
1446
+ #define TCL_WRITABLE (1<<2)
1447
+ #define TCL_EXCEPTION (1<<3)
1448
+
1449
+ /*
1450
+ * Flag values to pass to Tcl_OpenCommandChannel to indicate the disposition
1451
+ * of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, are also used in
1452
+ * Tcl_GetStdChannel.
1453
+ */
1454
+
1455
+ #define TCL_STDIN (1<<1)
1456
+ #define TCL_STDOUT (1<<2)
1457
+ #define TCL_STDERR (1<<3)
1458
+ #define TCL_ENFORCE_MODE (1<<4)
1459
+
1460
+ /*
1461
+ * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
1462
+ * should be closed.
1463
+ */
1464
+
1465
+ #define TCL_CLOSE_READ (1<<1)
1466
+ #define TCL_CLOSE_WRITE (1<<2)
1467
+
1468
+ /*
1469
+ * Value to use as the closeProc for a channel that supports the close2Proc
1470
+ * interface.
1471
+ */
1472
+
1473
+ #define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *) 1)
1474
+
1475
+ /*
1476
+ * Channel version tag. This was introduced in 8.3.2/8.4.
1477
+ */
1478
+
1479
+ #define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1)
1480
+ #define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2)
1481
+ #define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3)
1482
+ #define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4)
1483
+ #define TCL_CHANNEL_VERSION_5 ((Tcl_ChannelTypeVersion) 0x5)
1484
+
1485
+ /*
1486
+ * TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc.
1487
+ */
1488
+
1489
+ #define TCL_CHANNEL_THREAD_INSERT (0)
1490
+ #define TCL_CHANNEL_THREAD_REMOVE (1)
1491
+
1492
+ /*
1493
+ * Typedefs for the various operations in a channel type:
1494
+ */
1495
+
1496
+ typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode);
1497
+ typedef int (Tcl_DriverCloseProc) (ClientData instanceData,
1498
+ Tcl_Interp *interp);
1499
+ typedef int (Tcl_DriverClose2Proc) (ClientData instanceData,
1500
+ Tcl_Interp *interp, int flags);
1501
+ typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf,
1502
+ int toRead, int *errorCodePtr);
1503
+ typedef int (Tcl_DriverOutputProc) (ClientData instanceData,
1504
+ CONST84 char *buf, int toWrite, int *errorCodePtr);
1505
+ typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset,
1506
+ int mode, int *errorCodePtr);
1507
+ typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData,
1508
+ Tcl_Interp *interp, const char *optionName,
1509
+ const char *value);
1510
+ typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData,
1511
+ Tcl_Interp *interp, CONST84 char *optionName,
1512
+ Tcl_DString *dsPtr);
1513
+ typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask);
1514
+ typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData,
1515
+ int direction, ClientData *handlePtr);
1516
+ typedef int (Tcl_DriverFlushProc) (ClientData instanceData);
1517
+ typedef int (Tcl_DriverHandlerProc) (ClientData instanceData,
1518
+ int interestMask);
1519
+ typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData,
1520
+ Tcl_WideInt offset, int mode, int *errorCodePtr);
1521
+ /*
1522
+ * TIP #218, Channel Thread Actions
1523
+ */
1524
+ typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData,
1525
+ int action);
1526
+ /*
1527
+ * TIP #208, File Truncation (etc.)
1528
+ */
1529
+ typedef int (Tcl_DriverTruncateProc) (ClientData instanceData,
1530
+ Tcl_WideInt length);
1531
+
1532
+ /*
1533
+ * struct Tcl_ChannelType:
1534
+ *
1535
+ * One such structure exists for each type (kind) of channel. It collects
1536
+ * together in one place all the functions that are part of the specific
1537
+ * channel type.
1538
+ *
1539
+ * It is recommend that the Tcl_Channel* functions are used to access elements
1540
+ * of this structure, instead of direct accessing.
1541
+ */
1542
+
1543
+ typedef struct Tcl_ChannelType {
1544
+ const char *typeName; /* The name of the channel type in Tcl
1545
+ * commands. This storage is owned by channel
1546
+ * type. */
1547
+ Tcl_ChannelTypeVersion version;
1548
+ /* Version of the channel type. */
1549
+ Tcl_DriverCloseProc *closeProc;
1550
+ /* Function to call to close the channel, or
1551
+ * TCL_CLOSE2PROC if the close2Proc should be
1552
+ * used instead. */
1553
+ Tcl_DriverInputProc *inputProc;
1554
+ /* Function to call for input on channel. */
1555
+ Tcl_DriverOutputProc *outputProc;
1556
+ /* Function to call for output on channel. */
1557
+ Tcl_DriverSeekProc *seekProc;
1558
+ /* Function to call to seek on the channel.
1559
+ * May be NULL. */
1560
+ Tcl_DriverSetOptionProc *setOptionProc;
1561
+ /* Set an option on a channel. */
1562
+ Tcl_DriverGetOptionProc *getOptionProc;
1563
+ /* Get an option from a channel. */
1564
+ Tcl_DriverWatchProc *watchProc;
1565
+ /* Set up the notifier to watch for events on
1566
+ * this channel. */
1567
+ Tcl_DriverGetHandleProc *getHandleProc;
1568
+ /* Get an OS handle from the channel or NULL
1569
+ * if not supported. */
1570
+ Tcl_DriverClose2Proc *close2Proc;
1571
+ /* Function to call to close the channel if
1572
+ * the device supports closing the read &
1573
+ * write sides independently. */
1574
+ Tcl_DriverBlockModeProc *blockModeProc;
1575
+ /* Set blocking mode for the raw channel. May
1576
+ * be NULL. */
1577
+ /*
1578
+ * Only valid in TCL_CHANNEL_VERSION_2 channels or later.
1579
+ */
1580
+ Tcl_DriverFlushProc *flushProc;
1581
+ /* Function to call to flush a channel. May be
1582
+ * NULL. */
1583
+ Tcl_DriverHandlerProc *handlerProc;
1584
+ /* Function to call to handle a channel event.
1585
+ * This will be passed up the stacked channel
1586
+ * chain. */
1587
+ /*
1588
+ * Only valid in TCL_CHANNEL_VERSION_3 channels or later.
1589
+ */
1590
+ Tcl_DriverWideSeekProc *wideSeekProc;
1591
+ /* Function to call to seek on the channel
1592
+ * which can handle 64-bit offsets. May be
1593
+ * NULL, and must be NULL if seekProc is
1594
+ * NULL. */
1595
+ /*
1596
+ * Only valid in TCL_CHANNEL_VERSION_4 channels or later.
1597
+ * TIP #218, Channel Thread Actions.
1598
+ */
1599
+ Tcl_DriverThreadActionProc *threadActionProc;
1600
+ /* Function to call to notify the driver of
1601
+ * thread specific activity for a channel. May
1602
+ * be NULL. */
1603
+ /*
1604
+ * Only valid in TCL_CHANNEL_VERSION_5 channels or later.
1605
+ * TIP #208, File Truncation.
1606
+ */
1607
+ Tcl_DriverTruncateProc *truncateProc;
1608
+ /* Function to call to truncate the underlying
1609
+ * file to a particular length. May be NULL if
1610
+ * the channel does not support truncation. */
1611
+ } Tcl_ChannelType;
1612
+
1613
+ /*
1614
+ * The following flags determine whether the blockModeProc above should set
1615
+ * the channel into blocking or nonblocking mode. They are passed as arguments
1616
+ * to the blockModeProc function in the above structure.
1617
+ */
1618
+
1619
+ #define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
1620
+ #define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
1621
+ * mode. */
1622
+
1623
+ /*
1624
+ *----------------------------------------------------------------------------
1625
+ * Enum for different types of file paths.
1626
+ */
1627
+
1628
+ typedef enum Tcl_PathType {
1629
+ TCL_PATH_ABSOLUTE,
1630
+ TCL_PATH_RELATIVE,
1631
+ TCL_PATH_VOLUME_RELATIVE
1632
+ } Tcl_PathType;
1633
+
1634
+ /*
1635
+ * The following structure is used to pass glob type data amongst the various
1636
+ * glob routines and Tcl_FSMatchInDirectory.
1637
+ */
1638
+
1639
+ typedef struct Tcl_GlobTypeData {
1640
+ int type; /* Corresponds to bcdpfls as in 'find -t'. */
1641
+ int perm; /* Corresponds to file permissions. */
1642
+ Tcl_Obj *macType; /* Acceptable Mac type. */
1643
+ Tcl_Obj *macCreator; /* Acceptable Mac creator. */
1644
+ } Tcl_GlobTypeData;
1645
+
1646
+ /*
1647
+ * Type and permission definitions for glob command.
1648
+ */
1649
+
1650
+ #define TCL_GLOB_TYPE_BLOCK (1<<0)
1651
+ #define TCL_GLOB_TYPE_CHAR (1<<1)
1652
+ #define TCL_GLOB_TYPE_DIR (1<<2)
1653
+ #define TCL_GLOB_TYPE_PIPE (1<<3)
1654
+ #define TCL_GLOB_TYPE_FILE (1<<4)
1655
+ #define TCL_GLOB_TYPE_LINK (1<<5)
1656
+ #define TCL_GLOB_TYPE_SOCK (1<<6)
1657
+ #define TCL_GLOB_TYPE_MOUNT (1<<7)
1658
+
1659
+ #define TCL_GLOB_PERM_RONLY (1<<0)
1660
+ #define TCL_GLOB_PERM_HIDDEN (1<<1)
1661
+ #define TCL_GLOB_PERM_R (1<<2)
1662
+ #define TCL_GLOB_PERM_W (1<<3)
1663
+ #define TCL_GLOB_PERM_X (1<<4)
1664
+
1665
+ /*
1666
+ * Flags for the unload callback function.
1667
+ */
1668
+
1669
+ #define TCL_UNLOAD_DETACH_FROM_INTERPRETER (1<<0)
1670
+ #define TCL_UNLOAD_DETACH_FROM_PROCESS (1<<1)
1671
+
1672
+ /*
1673
+ * Typedefs for the various filesystem operations:
1674
+ */
1675
+
1676
+ typedef int (Tcl_FSStatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
1677
+ typedef int (Tcl_FSAccessProc) (Tcl_Obj *pathPtr, int mode);
1678
+ typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) (Tcl_Interp *interp,
1679
+ Tcl_Obj *pathPtr, int mode, int permissions);
1680
+ typedef int (Tcl_FSMatchInDirectoryProc) (Tcl_Interp *interp, Tcl_Obj *result,
1681
+ Tcl_Obj *pathPtr, const char *pattern, Tcl_GlobTypeData *types);
1682
+ typedef Tcl_Obj * (Tcl_FSGetCwdProc) (Tcl_Interp *interp);
1683
+ typedef int (Tcl_FSChdirProc) (Tcl_Obj *pathPtr);
1684
+ typedef int (Tcl_FSLstatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
1685
+ typedef int (Tcl_FSCreateDirectoryProc) (Tcl_Obj *pathPtr);
1686
+ typedef int (Tcl_FSDeleteFileProc) (Tcl_Obj *pathPtr);
1687
+ typedef int (Tcl_FSCopyDirectoryProc) (Tcl_Obj *srcPathPtr,
1688
+ Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr);
1689
+ typedef int (Tcl_FSCopyFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
1690
+ typedef int (Tcl_FSRemoveDirectoryProc) (Tcl_Obj *pathPtr, int recursive,
1691
+ Tcl_Obj **errorPtr);
1692
+ typedef int (Tcl_FSRenameFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
1693
+ typedef void (Tcl_FSUnloadFileProc) (Tcl_LoadHandle loadHandle);
1694
+ typedef Tcl_Obj * (Tcl_FSListVolumesProc) (void);
1695
+ /* We have to declare the utime structure here. */
1696
+ struct utimbuf;
1697
+ typedef int (Tcl_FSUtimeProc) (Tcl_Obj *pathPtr, struct utimbuf *tval);
1698
+ typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
1699
+ int nextCheckpoint);
1700
+ typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
1701
+ Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
1702
+ typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
1703
+ Tcl_Obj **objPtrRef);
1704
+ typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
1705
+ Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
1706
+ typedef Tcl_Obj * (Tcl_FSLinkProc) (Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
1707
+ int linkType);
1708
+ typedef int (Tcl_FSLoadFileProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
1709
+ Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr);
1710
+ typedef int (Tcl_FSPathInFilesystemProc) (Tcl_Obj *pathPtr,
1711
+ ClientData *clientDataPtr);
1712
+ typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) (Tcl_Obj *pathPtr);
1713
+ typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) (Tcl_Obj *pathPtr);
1714
+ typedef void (Tcl_FSFreeInternalRepProc) (ClientData clientData);
1715
+ typedef ClientData (Tcl_FSDupInternalRepProc) (ClientData clientData);
1716
+ typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (ClientData clientData);
1717
+ typedef ClientData (Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
1718
+
1719
+ typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
1720
+
1721
+ /*
1722
+ *----------------------------------------------------------------------------
1723
+ * Data structures related to hooking into the filesystem
1724
+ */
1725
+
1726
+ /*
1727
+ * Filesystem version tag. This was introduced in 8.4.
1728
+ */
1729
+
1730
+ #define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1)
1731
+
1732
+ /*
1733
+ * struct Tcl_Filesystem:
1734
+ *
1735
+ * One such structure exists for each type (kind) of filesystem. It collects
1736
+ * together the functions that form the interface for a particulr the
1737
+ * filesystem. Tcl always accesses the filesystem through one of these
1738
+ * structures.
1739
+ *
1740
+ * Not all entries need be non-NULL; any which are NULL are simply ignored.
1741
+ * However, a complete filesystem should provide all of these functions. The
1742
+ * explanations in the structure show the importance of each function.
1743
+ */
1744
+
1745
+ typedef struct Tcl_Filesystem {
1746
+ const char *typeName; /* The name of the filesystem. */
1747
+ int structureLength; /* Length of this structure, so future binary
1748
+ * compatibility can be assured. */
1749
+ Tcl_FSVersion version; /* Version of the filesystem type. */
1750
+ Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
1751
+ /* Determines whether the pathname is in this
1752
+ * filesystem. This is the most important
1753
+ * filesystem function. */
1754
+ Tcl_FSDupInternalRepProc *dupInternalRepProc;
1755
+ /* Duplicates the internal handle of the node.
1756
+ * If it is NULL, the filesystem is less
1757
+ * performant. */
1758
+ Tcl_FSFreeInternalRepProc *freeInternalRepProc;
1759
+ /* Frees the internal handle of the node. NULL
1760
+ * only if there is no need to free resources
1761
+ * used for the internal handle. */
1762
+ Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
1763
+ /* Converts the internal handle to a normalized
1764
+ * path. NULL if the filesystem creates nodes
1765
+ * having no pathname. */
1766
+ Tcl_FSCreateInternalRepProc *createInternalRepProc;
1767
+ /* Creates an internal handle for a pathname.
1768
+ * May be NULL if pathnames have no internal
1769
+ * handle or if pathInFilesystemProc always
1770
+ * immediately creates an internal
1771
+ * representation for pathnames in the
1772
+ * filesystem. */
1773
+ Tcl_FSNormalizePathProc *normalizePathProc;
1774
+ /* Normalizes a path. Should be implemented if
1775
+ * the filesystems supports multiple paths to
1776
+ * the same node. */
1777
+ Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
1778
+ /* Determines the type of a path in this
1779
+ * filesystem. May be NULL. */
1780
+ Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
1781
+ /* Produces the separator character(s) for this
1782
+ * filesystem. Must not be NULL. */
1783
+ Tcl_FSStatProc *statProc; /* Called by 'Tcl_FSStat()'. Provided by any
1784
+ * reasonable filesystem. */
1785
+ Tcl_FSAccessProc *accessProc;
1786
+ /* Called by 'Tcl_FSAccess()'. Implemented by
1787
+ * any reasonable filesystem. */
1788
+ Tcl_FSOpenFileChannelProc *openFileChannelProc;
1789
+ /* Called by 'Tcl_FSOpenFileChannel()'.
1790
+ * Provided by any reasonable filesystem. */
1791
+ Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
1792
+ /* Called by 'Tcl_FSMatchInDirectory()'. NULL
1793
+ * if the filesystem does not support glob or
1794
+ * recursive copy. */
1795
+ Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
1796
+ * mtime' to set (not read) times, 'file
1797
+ * atime', and the open-r/open-w/fcopy variant
1798
+ * of 'file copy'. */
1799
+ Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
1800
+ * creating links is not supported. */
1801
+ Tcl_FSListVolumesProc *listVolumesProc;
1802
+ /* Lists filesystem volumes added by this
1803
+ * filesystem. NULL if the filesystem does not
1804
+ * use volumes. */
1805
+ Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
1806
+ /* List all valid attributes strings. NULL if
1807
+ * the filesystem does not support the 'file
1808
+ * attributes' command. Can be used to attach
1809
+ * arbitrary additional data to files in a
1810
+ * filesystem. */
1811
+ Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
1812
+ /* Called by 'Tcl_FSFileAttrsGet()' and by
1813
+ * 'file attributes'. */
1814
+ Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
1815
+ /* Called by 'Tcl_FSFileAttrsSet()' and by
1816
+ * 'file attributes'. */
1817
+ Tcl_FSCreateDirectoryProc *createDirectoryProc;
1818
+ /* Called by 'Tcl_FSCreateDirectory()'. May be
1819
+ * NULL if the filesystem is read-only. */
1820
+ Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
1821
+ /* Called by 'Tcl_FSRemoveDirectory()'. May be
1822
+ * NULL if the filesystem is read-only. */
1823
+ Tcl_FSDeleteFileProc *deleteFileProc;
1824
+ /* Called by 'Tcl_FSDeleteFile()' May be NULL
1825
+ * if the filesystem is is read-only. */
1826
+ Tcl_FSCopyFileProc *copyFileProc;
1827
+ /* Called by 'Tcl_FSCopyFile()'. If NULL, for
1828
+ * a copy operation at the script level (not
1829
+ * C) Tcl uses open-r, open-w and fcopy. */
1830
+ Tcl_FSRenameFileProc *renameFileProc;
1831
+ /* Called by 'Tcl_FSRenameFile()'. If NULL, for
1832
+ * a rename operation at the script level (not
1833
+ * C) Tcl performs a copy operation followed
1834
+ * by a delete operation. */
1835
+ Tcl_FSCopyDirectoryProc *copyDirectoryProc;
1836
+ /* Called by 'Tcl_FSCopyDirectory()'. If NULL,
1837
+ * for a copy operation at the script level
1838
+ * (not C) Tcl recursively creates directories
1839
+ * and copies files. */
1840
+ Tcl_FSLstatProc *lstatProc; /* Called by 'Tcl_FSLstat()'. If NULL, Tcl
1841
+ * attempts to use 'statProc' instead. */
1842
+ Tcl_FSLoadFileProc *loadFileProc;
1843
+ /* Called by 'Tcl_FSLoadFile()'. If NULL, Tcl
1844
+ * performs a copy to a temporary file in the
1845
+ * native filesystem and then calls
1846
+ * Tcl_FSLoadFile() on that temporary copy. */
1847
+ Tcl_FSGetCwdProc *getCwdProc;
1848
+ /* Called by 'Tcl_FSGetCwd()'. Normally NULL.
1849
+ * Usually only called once: If 'getcwd' is
1850
+ * called before 'chdir' is ever called. */
1851
+ Tcl_FSChdirProc *chdirProc; /* Called by 'Tcl_FSChdir()'. For a virtual
1852
+ * filesystem, chdirProc just returns zero
1853
+ * (success) if the pathname is a valid
1854
+ * directory, and some other value otherwise.
1855
+ * For A real filesystem, chdirProc performs
1856
+ * the correct action, e.g. calls the system
1857
+ * 'chdir' function. If not implemented, then
1858
+ * 'cd' and 'pwd' fail for a pathname in this
1859
+ * filesystem. On success Tcl stores the
1860
+ * pathname for use by GetCwd. If NULL, Tcl
1861
+ * performs records the pathname as the new
1862
+ * current directory if it passes a series of
1863
+ * directory access checks. */
1864
+ } Tcl_Filesystem;
1865
+
1866
+ /*
1867
+ * The following definitions are used as values for the 'linkAction' flag to
1868
+ * Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
1869
+ * be given. For link creation, the linkProc should create a link which
1870
+ * matches any of the types given.
1871
+ *
1872
+ * TCL_CREATE_SYMBOLIC_LINK - Create a symbolic or soft link.
1873
+ * TCL_CREATE_HARD_LINK - Create a hard link.
1874
+ */
1875
+
1876
+ #define TCL_CREATE_SYMBOLIC_LINK 0x01
1877
+ #define TCL_CREATE_HARD_LINK 0x02
1878
+
1879
+ /*
1880
+ *----------------------------------------------------------------------------
1881
+ * The following structure represents the Notifier functions that you can
1882
+ * override with the Tcl_SetNotifier call.
1883
+ */
1884
+
1885
+ typedef struct Tcl_NotifierProcs {
1886
+ Tcl_SetTimerProc *setTimerProc;
1887
+ Tcl_WaitForEventProc *waitForEventProc;
1888
+ Tcl_CreateFileHandlerProc *createFileHandlerProc;
1889
+ Tcl_DeleteFileHandlerProc *deleteFileHandlerProc;
1890
+ Tcl_InitNotifierProc *initNotifierProc;
1891
+ Tcl_FinalizeNotifierProc *finalizeNotifierProc;
1892
+ Tcl_AlertNotifierProc *alertNotifierProc;
1893
+ Tcl_ServiceModeHookProc *serviceModeHookProc;
1894
+ } Tcl_NotifierProcs;
1895
+
1896
+ /*
1897
+ *----------------------------------------------------------------------------
1898
+ * The following data structures and declarations are for the new Tcl parser.
1899
+ *
1900
+ * For each word of a command, and for each piece of a word such as a variable
1901
+ * reference, one of the following structures is created to describe the
1902
+ * token.
1903
+ */
1904
+
1905
+ typedef struct Tcl_Token {
1906
+ int type; /* Type of token, such as TCL_TOKEN_WORD; see
1907
+ * below for valid types. */
1908
+ const char *start; /* First character in token. */
1909
+ int size; /* Number of bytes in token. */
1910
+ int numComponents; /* If this token is composed of other tokens,
1911
+ * this field tells how many of them there are
1912
+ * (including components of components, etc.).
1913
+ * The component tokens immediately follow
1914
+ * this one. */
1915
+ } Tcl_Token;
1916
+
1917
+ /*
1918
+ * Type values defined for Tcl_Token structures. These values are defined as
1919
+ * mask bits so that it's easy to check for collections of types.
1920
+ *
1921
+ * TCL_TOKEN_WORD - The token describes one word of a command,
1922
+ * from the first non-blank character of the word
1923
+ * (which may be " or {) up to but not including
1924
+ * the space, semicolon, or bracket that
1925
+ * terminates the word. NumComponents counts the
1926
+ * total number of sub-tokens that make up the
1927
+ * word. This includes, for example, sub-tokens
1928
+ * of TCL_TOKEN_VARIABLE tokens.
1929
+ * TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD except
1930
+ * that the word is guaranteed to consist of a
1931
+ * single TCL_TOKEN_TEXT sub-token.
1932
+ * TCL_TOKEN_TEXT - The token describes a range of literal text
1933
+ * that is part of a word. NumComponents is
1934
+ * always 0.
1935
+ * TCL_TOKEN_BS - The token describes a backslash sequence that
1936
+ * must be collapsed. NumComponents is always 0.
1937
+ * TCL_TOKEN_COMMAND - The token describes a command whose result
1938
+ * must be substituted into the word. The token
1939
+ * includes the enclosing brackets. NumComponents
1940
+ * is always 0.
1941
+ * TCL_TOKEN_VARIABLE - The token describes a variable substitution,
1942
+ * including the dollar sign, variable name, and
1943
+ * array index (if there is one) up through the
1944
+ * right parentheses. NumComponents tells how
1945
+ * many additional tokens follow to represent the
1946
+ * variable name. The first token will be a
1947
+ * TCL_TOKEN_TEXT token that describes the
1948
+ * variable name. If the variable is an array
1949
+ * reference then there will be one or more
1950
+ * additional tokens, of type TCL_TOKEN_TEXT,
1951
+ * TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
1952
+ * TCL_TOKEN_VARIABLE, that describe the array
1953
+ * index; numComponents counts the total number
1954
+ * of nested tokens that make up the variable
1955
+ * reference, including sub-tokens of
1956
+ * TCL_TOKEN_VARIABLE tokens.
1957
+ * TCL_TOKEN_SUB_EXPR - The token describes one subexpression of an
1958
+ * expression, from the first non-blank character
1959
+ * of the subexpression up to but not including
1960
+ * the space, brace, or bracket that terminates
1961
+ * the subexpression. NumComponents counts the
1962
+ * total number of following subtokens that make
1963
+ * up the subexpression; this includes all
1964
+ * subtokens for any nested TCL_TOKEN_SUB_EXPR
1965
+ * tokens. For example, a numeric value used as a
1966
+ * primitive operand is described by a
1967
+ * TCL_TOKEN_SUB_EXPR token followed by a
1968
+ * TCL_TOKEN_TEXT token. A binary subexpression
1969
+ * is described by a TCL_TOKEN_SUB_EXPR token
1970
+ * followed by the TCL_TOKEN_OPERATOR token for
1971
+ * the operator, then TCL_TOKEN_SUB_EXPR tokens
1972
+ * for the left then the right operands.
1973
+ * TCL_TOKEN_OPERATOR - The token describes one expression operator.
1974
+ * An operator might be the name of a math
1975
+ * function such as "abs". A TCL_TOKEN_OPERATOR
1976
+ * token is always preceded by one
1977
+ * TCL_TOKEN_SUB_EXPR token for the operator's
1978
+ * subexpression, and is followed by zero or more
1979
+ * TCL_TOKEN_SUB_EXPR tokens for the operator's
1980
+ * operands. NumComponents is always 0.
1981
+ * TCL_TOKEN_EXPAND_WORD - This token is just like TCL_TOKEN_WORD except
1982
+ * that it marks a word that began with the
1983
+ * literal character prefix "{*}". This word is
1984
+ * marked to be expanded - that is, broken into
1985
+ * words after substitution is complete.
1986
+ */
1987
+
1988
+ #define TCL_TOKEN_WORD 1
1989
+ #define TCL_TOKEN_SIMPLE_WORD 2
1990
+ #define TCL_TOKEN_TEXT 4
1991
+ #define TCL_TOKEN_BS 8
1992
+ #define TCL_TOKEN_COMMAND 16
1993
+ #define TCL_TOKEN_VARIABLE 32
1994
+ #define TCL_TOKEN_SUB_EXPR 64
1995
+ #define TCL_TOKEN_OPERATOR 128
1996
+ #define TCL_TOKEN_EXPAND_WORD 256
1997
+
1998
+ /*
1999
+ * Parsing error types. On any parsing error, one of these values will be
2000
+ * stored in the error field of the Tcl_Parse structure defined below.
2001
+ */
2002
+
2003
+ #define TCL_PARSE_SUCCESS 0
2004
+ #define TCL_PARSE_QUOTE_EXTRA 1
2005
+ #define TCL_PARSE_BRACE_EXTRA 2
2006
+ #define TCL_PARSE_MISSING_BRACE 3
2007
+ #define TCL_PARSE_MISSING_BRACKET 4
2008
+ #define TCL_PARSE_MISSING_PAREN 5
2009
+ #define TCL_PARSE_MISSING_QUOTE 6
2010
+ #define TCL_PARSE_MISSING_VAR_BRACE 7
2011
+ #define TCL_PARSE_SYNTAX 8
2012
+ #define TCL_PARSE_BAD_NUMBER 9
2013
+
2014
+ /*
2015
+ * A structure of the following type is filled in by Tcl_ParseCommand. It
2016
+ * describes a single command parsed from an input string.
2017
+ */
2018
+
2019
+ #define NUM_STATIC_TOKENS 20
2020
+
2021
+ typedef struct Tcl_Parse {
2022
+ const char *commentStart; /* Pointer to # that begins the first of one
2023
+ * or more comments preceding the command. */
2024
+ int commentSize; /* Number of bytes in comments (up through
2025
+ * newline character that terminates the last
2026
+ * comment). If there were no comments, this
2027
+ * field is 0. */
2028
+ const char *commandStart; /* First character in first word of
2029
+ * command. */
2030
+ int commandSize; /* Number of bytes in command, including first
2031
+ * character of first word, up through the
2032
+ * terminating newline, close bracket, or
2033
+ * semicolon. */
2034
+ int numWords; /* Total number of words in command. May be
2035
+ * 0. */
2036
+ Tcl_Token *tokenPtr; /* Pointer to first token representing the
2037
+ * words of the command. Initially points to
2038
+ * staticTokens, but may change to point to
2039
+ * malloc-ed space if command exceeds space in
2040
+ * staticTokens. */
2041
+ int numTokens; /* Total number of tokens in command. */
2042
+ int tokensAvailable; /* Total number of tokens available at
2043
+ * *tokenPtr. */
2044
+ int errorType; /* One of the parsing error types defined
2045
+ * above. */
2046
+
2047
+ /*
2048
+ * The fields below are intended only for the private use of the parser.
2049
+ * They should not be used by functions that invoke Tcl_ParseCommand.
2050
+ */
2051
+
2052
+ const char *string; /* The original command string passed to
2053
+ * Tcl_ParseCommand. */
2054
+ const char *end; /* Points to the character just after the last
2055
+ * one in the command string. */
2056
+ Tcl_Interp *interp; /* Interpreter to use for error reporting, or
2057
+ * NULL. */
2058
+ const char *term; /* Points to character in string that
2059
+ * terminated most recent token. Filled in by
2060
+ * ParseTokens. If an error occurs, points to
2061
+ * beginning of region where the error
2062
+ * occurred (e.g. the open brace if the close
2063
+ * brace is missing). */
2064
+ int incomplete; /* This field is set to 1 by Tcl_ParseCommand
2065
+ * if the command appears to be incomplete.
2066
+ * This information is used by
2067
+ * Tcl_CommandComplete. */
2068
+ Tcl_Token staticTokens[NUM_STATIC_TOKENS];
2069
+ /* Initial space for tokens for command. This
2070
+ * space should be large enough to accommodate
2071
+ * most commands; dynamic space is allocated
2072
+ * for very large commands that don't fit
2073
+ * here. */
2074
+ } Tcl_Parse;
2075
+
2076
+ /*
2077
+ *----------------------------------------------------------------------------
2078
+ * The following structure represents a user-defined encoding. It collects
2079
+ * together all the functions that are used by the specific encoding.
2080
+ */
2081
+
2082
+ typedef struct Tcl_EncodingType {
2083
+ const char *encodingName; /* The name of the encoding, e.g. "euc-jp".
2084
+ * This name is the unique key for this
2085
+ * encoding type. */
2086
+ Tcl_EncodingConvertProc *toUtfProc;
2087
+ /* Function to convert from external encoding
2088
+ * into UTF-8. */
2089
+ Tcl_EncodingConvertProc *fromUtfProc;
2090
+ /* Function to convert from UTF-8 into
2091
+ * external encoding. */
2092
+ Tcl_EncodingFreeProc *freeProc;
2093
+ /* If non-NULL, function to call when this
2094
+ * encoding is deleted. */
2095
+ ClientData clientData; /* Arbitrary value associated with encoding
2096
+ * type. Passed to conversion functions. */
2097
+ int nullSize; /* Number of zero bytes that signify
2098
+ * end-of-string in this encoding. This number
2099
+ * is used to determine the source string
2100
+ * length when the srcLen argument is
2101
+ * negative. Must be 1 or 2. */
2102
+ } Tcl_EncodingType;
2103
+
2104
+ /*
2105
+ * The following definitions are used as values for the conversion control
2106
+ * flags argument when converting text from one character set to another:
2107
+ *
2108
+ * TCL_ENCODING_START - Signifies that the source buffer is the first
2109
+ * block in a (potentially multi-block) input
2110
+ * stream. Tells the conversion function to reset
2111
+ * to an initial state and perform any
2112
+ * initialization that needs to occur before the
2113
+ * first byte is converted. If the source buffer
2114
+ * contains the entire input stream to be
2115
+ * converted, this flag should be set.
2116
+ * TCL_ENCODING_END - Signifies that the source buffer is the last
2117
+ * block in a (potentially multi-block) input
2118
+ * stream. Tells the conversion routine to
2119
+ * perform any finalization that needs to occur
2120
+ * after the last byte is converted and then to
2121
+ * reset to an initial state. If the source
2122
+ * buffer contains the entire input stream to be
2123
+ * converted, this flag should be set.
2124
+ * TCL_ENCODING_STOPONERROR - If set, the converter returns immediately upon
2125
+ * encountering an invalid byte sequence or a
2126
+ * source character that has no mapping in the
2127
+ * target encoding. If clear, the converter
2128
+ * substitues the problematic character(s) with
2129
+ * one or more "close" characters in the
2130
+ * destination buffer and then continues to
2131
+ * convert the source.
2132
+ * TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf does not append a
2133
+ * terminating NUL byte. Since it does not need
2134
+ * an extra byte for a terminating NUL, it fills
2135
+ * all dstLen bytes with encoded UTF-8 content if
2136
+ * needed. If clear, a byte is reserved in the
2137
+ * dst space for NUL termination, and a
2138
+ * terminating NUL is appended.
2139
+ * TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
2140
+ * Tcl_ExternalToUtf takes the initial value of
2141
+ * *dstCharsPtr as a limit of the maximum number
2142
+ * of chars to produce in the encoded UTF-8
2143
+ * content. Otherwise, the number of chars
2144
+ * produced is controlled only by other limiting
2145
+ * factors.
2146
+ */
2147
+
2148
+ #define TCL_ENCODING_START 0x01
2149
+ #define TCL_ENCODING_END 0x02
2150
+ #define TCL_ENCODING_STOPONERROR 0x04
2151
+ #define TCL_ENCODING_NO_TERMINATE 0x08
2152
+ #define TCL_ENCODING_CHAR_LIMIT 0x10
2153
+
2154
+ /*
2155
+ * The following definitions are the error codes returned by the conversion
2156
+ * routines:
2157
+ *
2158
+ * TCL_OK - All characters were converted.
2159
+ * TCL_CONVERT_NOSPACE - The output buffer would not have been large
2160
+ * enough for all of the converted data; as many
2161
+ * characters as could fit were converted though.
2162
+ * TCL_CONVERT_MULTIBYTE - The last few bytes in the source string were
2163
+ * the beginning of a multibyte sequence, but
2164
+ * more bytes were needed to complete this
2165
+ * sequence. A subsequent call to the conversion
2166
+ * routine should pass the beginning of this
2167
+ * unconverted sequence plus additional bytes
2168
+ * from the source stream to properly convert the
2169
+ * formerly split-up multibyte sequence.
2170
+ * TCL_CONVERT_SYNTAX - The source stream contained an invalid
2171
+ * character sequence. This may occur if the
2172
+ * input stream has been damaged or if the input
2173
+ * encoding method was misidentified. This error
2174
+ * is reported only if TCL_ENCODING_STOPONERROR
2175
+ * was specified.
2176
+ * TCL_CONVERT_UNKNOWN - The source string contained a character that
2177
+ * could not be represented in the target
2178
+ * encoding. This error is reported only if
2179
+ * TCL_ENCODING_STOPONERROR was specified.
2180
+ */
2181
+
2182
+ #define TCL_CONVERT_MULTIBYTE (-1)
2183
+ #define TCL_CONVERT_SYNTAX (-2)
2184
+ #define TCL_CONVERT_UNKNOWN (-3)
2185
+ #define TCL_CONVERT_NOSPACE (-4)
2186
+
2187
+ /*
2188
+ * The maximum number of bytes that are necessary to represent a single
2189
+ * Unicode character in UTF-8. The valid values should be 3, 4 or 6. If 3 or
2190
+ * 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
2191
+ * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
2192
+ * is the default and recommended mode. UCS-4 is experimental and not
2193
+ * recommended. It works for the core, but most extensions expect UCS-2.
2194
+ */
2195
+
2196
+ #ifndef TCL_UTF_MAX
2197
+ #define TCL_UTF_MAX 3
2198
+ #endif
2199
+
2200
+ /*
2201
+ * This represents a Unicode character. Any changes to this should also be
2202
+ * reflected in regcustom.h.
2203
+ */
2204
+
2205
+ #if TCL_UTF_MAX > 4
2206
+ /*
2207
+ * unsigned int isn't 100% accurate as it should be a strict 4-byte value.
2208
+ * The size of this value must be reflected correctly in regcustom.h.
2209
+ * XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
2210
+ * XXX: string rep that Tcl_UniChar represents. Changing the size
2211
+ * XXX: of Tcl_UniChar is /not/ supported.
2212
+ */
2213
+ typedef unsigned int Tcl_UniChar;
2214
+ #else
2215
+ typedef unsigned short Tcl_UniChar;
2216
+ #endif
2217
+
2218
+ /*
2219
+ *----------------------------------------------------------------------------
2220
+ * TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
2221
+ * provide the system with the embedded configuration data.
2222
+ */
2223
+
2224
+ typedef struct Tcl_Config {
2225
+ const char *key; /* Configuration key to register. ASCII
2226
+ * encoded, thus UTF-8. */
2227
+ const char *value; /* The value associated with the key. System
2228
+ * encoding. */
2229
+ } Tcl_Config;
2230
+
2231
+ /*
2232
+ *----------------------------------------------------------------------------
2233
+ * Flags for TIP#143 limits, detailing which limits are active in an
2234
+ * interpreter. Used for Tcl_{Add,Remove}LimitHandler type argument.
2235
+ */
2236
+
2237
+ #define TCL_LIMIT_COMMANDS 0x01
2238
+ #define TCL_LIMIT_TIME 0x02
2239
+
2240
+ /*
2241
+ * Structure containing information about a limit handler to be called when a
2242
+ * command- or time-limit is exceeded by an interpreter.
2243
+ */
2244
+
2245
+ typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
2246
+ typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
2247
+
2248
+ /*
2249
+ *----------------------------------------------------------------------------
2250
+ * Override definitions for libtommath.
2251
+ */
2252
+
2253
+ typedef struct mp_int mp_int;
2254
+ #define MP_INT_DECLARED
2255
+ typedef unsigned int mp_digit;
2256
+ #define MP_DIGIT_DECLARED
2257
+
2258
+ /*
2259
+ *----------------------------------------------------------------------------
2260
+ * Definitions needed for Tcl_ParseArgvObj routines.
2261
+ * Based on tkArgv.c.
2262
+ * Modifications from the original are copyright (c) Sam Bromley 2006
2263
+ */
2264
+
2265
+ typedef struct {
2266
+ int type; /* Indicates the option type; see below. */
2267
+ const char *keyStr; /* The key string that flags the option in the
2268
+ * argv array. */
2269
+ void *srcPtr; /* Value to be used in setting dst; usage
2270
+ * depends on type.*/
2271
+ void *dstPtr; /* Address of value to be modified; usage
2272
+ * depends on type.*/
2273
+ const char *helpStr; /* Documentation message describing this
2274
+ * option. */
2275
+ ClientData clientData; /* Word to pass to function callbacks. */
2276
+ } Tcl_ArgvInfo;
2277
+
2278
+ /*
2279
+ * Legal values for the type field of a Tcl_ArgInfo: see the user
2280
+ * documentation for details.
2281
+ */
2282
+
2283
+ #define TCL_ARGV_CONSTANT 15
2284
+ #define TCL_ARGV_INT 16
2285
+ #define TCL_ARGV_STRING 17
2286
+ #define TCL_ARGV_REST 18
2287
+ #define TCL_ARGV_FLOAT 19
2288
+ #define TCL_ARGV_FUNC 20
2289
+ #define TCL_ARGV_GENFUNC 21
2290
+ #define TCL_ARGV_HELP 22
2291
+ #define TCL_ARGV_END 23
2292
+
2293
+ /*
2294
+ * Types of callback functions for the TCL_ARGV_FUNC and TCL_ARGV_GENFUNC
2295
+ * argument types:
2296
+ */
2297
+
2298
+ typedef int (Tcl_ArgvFuncProc)(ClientData clientData, Tcl_Obj *objPtr,
2299
+ void *dstPtr);
2300
+ typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
2301
+ int objc, Tcl_Obj *const *objv, void *dstPtr);
2302
+
2303
+ /*
2304
+ * Shorthand for commonly used argTable entries.
2305
+ */
2306
+
2307
+ #define TCL_ARGV_AUTO_HELP \
2308
+ {TCL_ARGV_HELP, "-help", NULL, NULL, \
2309
+ "Print summary of command-line options and abort", NULL}
2310
+ #define TCL_ARGV_AUTO_REST \
2311
+ {TCL_ARGV_REST, "--", NULL, NULL, \
2312
+ "Marks the end of the options", NULL}
2313
+ #define TCL_ARGV_TABLE_END \
2314
+ {TCL_ARGV_END, NULL, NULL, NULL, NULL, NULL}
2315
+
2316
+ /*
2317
+ *----------------------------------------------------------------------------
2318
+ * Definitions needed for Tcl_Zlib routines. [TIP #234]
2319
+ *
2320
+ * Constants for the format flags describing what sort of data format is
2321
+ * desired/expected for the Tcl_ZlibDeflate, Tcl_ZlibInflate and
2322
+ * Tcl_ZlibStreamInit functions.
2323
+ */
2324
+
2325
+ #define TCL_ZLIB_FORMAT_RAW 1
2326
+ #define TCL_ZLIB_FORMAT_ZLIB 2
2327
+ #define TCL_ZLIB_FORMAT_GZIP 4
2328
+ #define TCL_ZLIB_FORMAT_AUTO 8
2329
+
2330
+ /*
2331
+ * Constants that describe whether the stream is to operate in compressing or
2332
+ * decompressing mode.
2333
+ */
2334
+
2335
+ #define TCL_ZLIB_STREAM_DEFLATE 16
2336
+ #define TCL_ZLIB_STREAM_INFLATE 32
2337
+
2338
+ /*
2339
+ * Constants giving compression levels. Use of TCL_ZLIB_COMPRESS_DEFAULT is
2340
+ * recommended.
2341
+ */
2342
+
2343
+ #define TCL_ZLIB_COMPRESS_NONE 0
2344
+ #define TCL_ZLIB_COMPRESS_FAST 1
2345
+ #define TCL_ZLIB_COMPRESS_BEST 9
2346
+ #define TCL_ZLIB_COMPRESS_DEFAULT (-1)
2347
+
2348
+ /*
2349
+ * Constants for types of flushing, used with Tcl_ZlibFlush.
2350
+ */
2351
+
2352
+ #define TCL_ZLIB_NO_FLUSH 0
2353
+ #define TCL_ZLIB_FLUSH 2
2354
+ #define TCL_ZLIB_FULLFLUSH 3
2355
+ #define TCL_ZLIB_FINALIZE 4
2356
+
2357
+ /*
2358
+ *----------------------------------------------------------------------------
2359
+ * Definitions needed for the Tcl_LoadFile function. [TIP #416]
2360
+ */
2361
+
2362
+ #define TCL_LOAD_GLOBAL 1
2363
+ #define TCL_LOAD_LAZY 2
2364
+
2365
+ /*
2366
+ *----------------------------------------------------------------------------
2367
+ * Single public declaration for NRE.
2368
+ */
2369
+
2370
+ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
2371
+ int result);
2372
+
2373
+ /*
2374
+ *----------------------------------------------------------------------------
2375
+ * The following constant is used to test for older versions of Tcl in the
2376
+ * stubs tables.
2377
+ */
2378
+
2379
+ #define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
2380
+
2381
+ /*
2382
+ * The following function is required to be defined in all stubs aware
2383
+ * extensions. The function is actually implemented in the stub library, not
2384
+ * the main Tcl library, although there is a trivial implementation in the
2385
+ * main library in case an extension is statically linked into an application.
2386
+ */
2387
+
2388
+ const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
2389
+ int exact);
2390
+ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
2391
+ const char *version, int epoch, int revision);
2392
+
2393
+ /*
2394
+ * When not using stubs, make it a macro.
2395
+ */
2396
+
2397
+ #ifndef USE_TCL_STUBS
2398
+ #define Tcl_InitStubs(interp, version, exact) \
2399
+ Tcl_PkgInitStubsCheck(interp, version, exact)
2400
+ #endif
2401
+
2402
+ /*
2403
+ * Public functions that are not accessible via the stubs table.
2404
+ * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
2405
+ */
2406
+
2407
+ #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
2408
+ ((Tcl_CreateInterp)()))
2409
+ EXTERN void Tcl_MainEx(int argc, char **argv,
2410
+ Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
2411
+ EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
2412
+ const char *version, int exact);
2413
+ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
2414
+
2415
+ /*
2416
+ *----------------------------------------------------------------------------
2417
+ * Include the public function declarations that are accessible via the stubs
2418
+ * table.
2419
+ */
2420
+
2421
+ #include "tclDecls.h"
2422
+
2423
+ /*
2424
+ * Include platform specific public function declarations that are accessible
2425
+ * via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only
2426
+ * has effect on building it as a shared library). See ticket [3010352].
2427
+ */
2428
+
2429
+ #if defined(BUILD_tcl)
2430
+ # undef TCLAPI
2431
+ # define TCLAPI MODULE_SCOPE
2432
+ #endif
2433
+
2434
+ #include "tclPlatDecls.h"
2435
+
2436
+ /*
2437
+ *----------------------------------------------------------------------------
2438
+ * The following declarations either map ckalloc and ckfree to malloc and
2439
+ * free, or they map them to functions with all sorts of debugging hooks
2440
+ * defined in tclCkalloc.c.
2441
+ */
2442
+
2443
+ #ifdef TCL_MEM_DEBUG
2444
+
2445
+ # define ckalloc(x) \
2446
+ ((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__))
2447
+ # define ckfree(x) \
2448
+ Tcl_DbCkfree((char *)(x), __FILE__, __LINE__)
2449
+ # define ckrealloc(x,y) \
2450
+ ((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
2451
+ # define attemptckalloc(x) \
2452
+ ((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__))
2453
+ # define attemptckrealloc(x,y) \
2454
+ ((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
2455
+
2456
+ #else /* !TCL_MEM_DEBUG */
2457
+
2458
+ /*
2459
+ * If we are not using the debugging allocator, we should call the Tcl_Alloc,
2460
+ * et al. routines in order to guarantee that every module is using the same
2461
+ * memory allocator both inside and outside of the Tcl library.
2462
+ */
2463
+
2464
+ # define ckalloc(x) \
2465
+ ((void *) Tcl_Alloc((unsigned)(x)))
2466
+ # define ckfree(x) \
2467
+ Tcl_Free((char *)(x))
2468
+ # define ckrealloc(x,y) \
2469
+ ((void *) Tcl_Realloc((char *)(x), (unsigned)(y)))
2470
+ # define attemptckalloc(x) \
2471
+ ((void *) Tcl_AttemptAlloc((unsigned)(x)))
2472
+ # define attemptckrealloc(x,y) \
2473
+ ((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y)))
2474
+ # undef Tcl_InitMemory
2475
+ # define Tcl_InitMemory(x)
2476
+ # undef Tcl_DumpActiveMemory
2477
+ # define Tcl_DumpActiveMemory(x)
2478
+ # undef Tcl_ValidateAllMemory
2479
+ # define Tcl_ValidateAllMemory(x,y)
2480
+
2481
+ #endif /* !TCL_MEM_DEBUG */
2482
+
2483
+ #ifdef TCL_MEM_DEBUG
2484
+ # define Tcl_IncrRefCount(objPtr) \
2485
+ Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
2486
+ # define Tcl_DecrRefCount(objPtr) \
2487
+ Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
2488
+ # define Tcl_IsShared(objPtr) \
2489
+ Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
2490
+ #else
2491
+ # define Tcl_IncrRefCount(objPtr) \
2492
+ ++(objPtr)->refCount
2493
+ /*
2494
+ * Use do/while0 idiom for optimum correctness without compiler warnings.
2495
+ * https://wiki.c2.com/?TrivialDoWhileLoop
2496
+ */
2497
+ # define Tcl_DecrRefCount(objPtr) \
2498
+ do { \
2499
+ Tcl_Obj *_objPtr = (objPtr); \
2500
+ if (_objPtr->refCount-- <= 1) { \
2501
+ TclFreeObj(_objPtr); \
2502
+ } \
2503
+ } while(0)
2504
+ # define Tcl_IsShared(objPtr) \
2505
+ ((objPtr)->refCount > 1)
2506
+ #endif
2507
+
2508
+ /*
2509
+ * Macros and definitions that help to debug the use of Tcl objects. When
2510
+ * TCL_MEM_DEBUG is defined, the Tcl_New declarations are overridden to call
2511
+ * debugging versions of the object creation functions.
2512
+ */
2513
+
2514
+ #ifdef TCL_MEM_DEBUG
2515
+ # undef Tcl_NewBignumObj
2516
+ # define Tcl_NewBignumObj(val) \
2517
+ Tcl_DbNewBignumObj(val, __FILE__, __LINE__)
2518
+ # undef Tcl_NewBooleanObj
2519
+ # define Tcl_NewBooleanObj(val) \
2520
+ Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
2521
+ # undef Tcl_NewByteArrayObj
2522
+ # define Tcl_NewByteArrayObj(bytes, len) \
2523
+ Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
2524
+ # undef Tcl_NewDoubleObj
2525
+ # define Tcl_NewDoubleObj(val) \
2526
+ Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
2527
+ # undef Tcl_NewIntObj
2528
+ # define Tcl_NewIntObj(val) \
2529
+ Tcl_DbNewLongObj(val, __FILE__, __LINE__)
2530
+ # undef Tcl_NewListObj
2531
+ # define Tcl_NewListObj(objc, objv) \
2532
+ Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
2533
+ # undef Tcl_NewLongObj
2534
+ # define Tcl_NewLongObj(val) \
2535
+ Tcl_DbNewLongObj(val, __FILE__, __LINE__)
2536
+ # undef Tcl_NewObj
2537
+ # define Tcl_NewObj() \
2538
+ Tcl_DbNewObj(__FILE__, __LINE__)
2539
+ # undef Tcl_NewStringObj
2540
+ # define Tcl_NewStringObj(bytes, len) \
2541
+ Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
2542
+ # undef Tcl_NewWideIntObj
2543
+ # define Tcl_NewWideIntObj(val) \
2544
+ Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
2545
+ #endif /* TCL_MEM_DEBUG */
2546
+
2547
+ /*
2548
+ *----------------------------------------------------------------------------
2549
+ * Macros for clients to use to access fields of hash entries:
2550
+ */
2551
+
2552
+ #define Tcl_GetHashValue(h) ((h)->clientData)
2553
+ #define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
2554
+ #define Tcl_GetHashKey(tablePtr, h) \
2555
+ ((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
2556
+ (tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
2557
+ ? (h)->key.oneWordValue \
2558
+ : (h)->key.string))
2559
+
2560
+ /*
2561
+ * Macros to use for clients to use to invoke find and create functions for
2562
+ * hash tables:
2563
+ */
2564
+
2565
+ #undef Tcl_FindHashEntry
2566
+ #define Tcl_FindHashEntry(tablePtr, key) \
2567
+ (*((tablePtr)->findProc))(tablePtr, (const char *)(key))
2568
+ #undef Tcl_CreateHashEntry
2569
+ #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
2570
+ (*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
2571
+
2572
+ /*
2573
+ *----------------------------------------------------------------------------
2574
+ * Macros that eliminate the overhead of the thread synchronization functions
2575
+ * when compiling without thread support.
2576
+ */
2577
+
2578
+ #ifndef TCL_THREADS
2579
+ #undef Tcl_MutexLock
2580
+ #define Tcl_MutexLock(mutexPtr)
2581
+ #undef Tcl_MutexUnlock
2582
+ #define Tcl_MutexUnlock(mutexPtr)
2583
+ #undef Tcl_MutexFinalize
2584
+ #define Tcl_MutexFinalize(mutexPtr)
2585
+ #undef Tcl_ConditionNotify
2586
+ #define Tcl_ConditionNotify(condPtr)
2587
+ #undef Tcl_ConditionWait
2588
+ #define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
2589
+ #undef Tcl_ConditionFinalize
2590
+ #define Tcl_ConditionFinalize(condPtr)
2591
+ #endif /* TCL_THREADS */
2592
+
2593
+ /*
2594
+ *----------------------------------------------------------------------------
2595
+ * Deprecated Tcl functions:
2596
+ */
2597
+
2598
+ #ifndef TCL_NO_DEPRECATED
2599
+ /*
2600
+ * These function have been renamed. The old names are deprecated, but we
2601
+ * define these macros for backwards compatibility.
2602
+ */
2603
+
2604
+ # define Tcl_Ckalloc Tcl_Alloc
2605
+ # define Tcl_Ckfree Tcl_Free
2606
+ # define Tcl_Ckrealloc Tcl_Realloc
2607
+ # define Tcl_Return Tcl_SetResult
2608
+ # define Tcl_TildeSubst Tcl_TranslateFileName
2609
+ #if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
2610
+ # define panic Tcl_Panic
2611
+ #endif
2612
+ # define panicVA Tcl_PanicVA
2613
+ #endif /* !TCL_NO_DEPRECATED */
2614
+
2615
+ /*
2616
+ *----------------------------------------------------------------------------
2617
+ * Convenience declaration of Tcl_AppInit for backwards compatibility. This
2618
+ * function is not *implemented* by the tcl library, so the storage class is
2619
+ * neither DLLEXPORT nor DLLIMPORT.
2620
+ */
2621
+
2622
+ extern Tcl_AppInitProc Tcl_AppInit;
2623
+
2624
+ #endif /* RC_INVOKED */
2625
+
2626
+ /*
2627
+ * end block for C++
2628
+ */
2629
+
2630
+ #ifdef __cplusplus
2631
+ }
2632
+ #endif
2633
+
2634
+ #endif /* _TCL */
2635
+
2636
+ /*
2637
+ * Local Variables:
2638
+ * mode: c
2639
+ * c-basic-offset: 4
2640
+ * fill-column: 78
2641
+ * End:
2642
+ */
janus/include/tclInt.h ADDED
The diff for this file is too large to render. See raw diff
 
janus/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
+ */