ZTWHHH commited on
Commit
7d4c909
·
verified ·
1 Parent(s): 8347576

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. .gitattributes +1 -0
  2. evalkit_llava/include/curses.h +0 -0
  3. evalkit_llava/include/cursesapp.h +191 -0
  4. evalkit_llava/include/cursesm.h +674 -0
  5. evalkit_llava/include/cursesw.h +1581 -0
  6. evalkit_llava/include/cursslk.h +240 -0
  7. evalkit_llava/include/eti.h +55 -0
  8. evalkit_llava/include/etip.h +406 -0
  9. evalkit_llava/include/fakepq.h +46 -0
  10. evalkit_llava/include/fakesql.h +283 -0
  11. evalkit_llava/include/ffi.h +531 -0
  12. evalkit_llava/include/itcl.h +198 -0
  13. evalkit_llava/include/itclDecls.h +206 -0
  14. evalkit_llava/include/itclTclIntStubsFcn.h +38 -0
  15. evalkit_llava/include/lzma.h +327 -0
  16. evalkit_llava/include/menu.h +281 -0
  17. evalkit_llava/include/ncurses.h +0 -0
  18. evalkit_llava/include/ncurses_dll.h +99 -0
  19. evalkit_llava/include/panel.h +100 -0
  20. evalkit_llava/include/pqStubs.h +85 -0
  21. evalkit_llava/include/python3.10/boolobject.h +43 -0
  22. evalkit_llava/include/python3.10/cellobject.h +29 -0
  23. evalkit_llava/include/python3.10/ceval.h +158 -0
  24. evalkit_llava/include/python3.10/dictobject.h +97 -0
  25. evalkit_llava/include/python3.10/dynamic_annotations.h +499 -0
  26. evalkit_llava/include/python3.10/enumobject.h +17 -0
  27. evalkit_llava/include/python3.10/exports.h +30 -0
  28. evalkit_llava/include/python3.10/fileutils.h +26 -0
  29. evalkit_llava/include/python3.10/frameobject.h +20 -0
  30. evalkit_llava/include/python3.10/funcobject.h +110 -0
  31. evalkit_llava/include/python3.10/import.h +98 -0
  32. evalkit_llava/include/python3.10/interpreteridobject.h +17 -0
  33. evalkit_llava/include/python3.10/listobject.h +52 -0
  34. evalkit_llava/include/python3.10/longintrepr.h +99 -0
  35. evalkit_llava/include/python3.10/longobject.h +220 -0
  36. evalkit_llava/include/python3.10/methodobject.h +116 -0
  37. evalkit_llava/include/python3.10/py_curses.h +99 -0
  38. evalkit_llava/include/python3.10/pycapsule.h +59 -0
  39. evalkit_llava/include/python3.10/pyconfig.h +1703 -0
  40. evalkit_llava/include/python3.10/pyexpat.h +57 -0
  41. evalkit_llava/include/python3.10/pyframe.h +22 -0
  42. evalkit_llava/include/python3.10/pyhash.h +144 -0
  43. evalkit_llava/include/python3.10/pymem.h +104 -0
  44. evalkit_llava/include/python3.10/pyport.h +889 -0
  45. evalkit_llava/include/python3.10/pystrhex.h +22 -0
  46. evalkit_llava/include/python3.10/sliceobject.h +65 -0
  47. evalkit_llava/include/python3.10/sysmodule.h +41 -0
  48. evalkit_llava/include/python3.10/unicodeobject.h +1053 -0
  49. evalkit_llava/include/python3.10/warnings.h +67 -0
  50. evalkit_llava/include/python3.10/weakrefobject.h +86 -0
.gitattributes CHANGED
@@ -186,3 +186,4 @@ evalkit_llava/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so fi
186
  evalkit_llava/lib/liblsan.so.0 filter=lfs diff=lfs merge=lfs -text
187
  evalkit_llava/lib/libitm.so filter=lfs diff=lfs merge=lfs -text
188
  evalkit_llava/lib/liblsan.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
 
 
186
  evalkit_llava/lib/liblsan.so.0 filter=lfs diff=lfs merge=lfs -text
187
  evalkit_llava/lib/libitm.so filter=lfs diff=lfs merge=lfs -text
188
  evalkit_llava/lib/liblsan.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
189
+ evalkit_llava/lib/libitm.so.1 filter=lfs diff=lfs merge=lfs -text
evalkit_llava/include/curses.h ADDED
The diff for this file is too large to render. See raw diff
 
evalkit_llava/include/cursesapp.h ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // * This makes emacs happy -*-Mode: C++;-*-
2
+ /****************************************************************************
3
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
4
+ * Copyright 1998-2005,2011 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: cursesapp.h,v 1.18 2021/06/17 21:26:02 tom Exp $
36
+
37
+ #ifndef NCURSES_CURSESAPP_H_incl
38
+ #define NCURSES_CURSESAPP_H_incl
39
+
40
+ #include <ncursesw/cursslk.h>
41
+
42
+ #if (defined(_WIN32) || defined(_WIN64))
43
+ # define NCURSES_CXX_MAIN_NAME cursespp_main
44
+ # define NCURSES_CXX_MAIN \
45
+ int main(int argc, char *argv[]) { \
46
+ return NCURSES_CXX_MAIN_NAME(argc, argv); \
47
+ }
48
+ #else
49
+ # define NCURSES_CXX_MAIN_NAME main
50
+ #endif
51
+ NCURSES_CXX_IMPEXP int NCURSES_CXX_MAIN_NAME(int argc, char *argv[]);
52
+
53
+ class NCURSES_CXX_IMPEXP NCursesApplication {
54
+ public:
55
+ typedef struct _slk_link { // This structure is used to maintain
56
+ struct _slk_link* prev; // a stack of SLKs
57
+ Soft_Label_Key_Set* SLKs;
58
+ } SLK_Link;
59
+ private:
60
+ static int rinit(NCursesWindow& w); // Internal Init function for title
61
+ static NCursesApplication* theApp; // Global ref. to the application
62
+
63
+ static SLK_Link* slk_stack;
64
+
65
+ protected:
66
+ static NCursesWindow* titleWindow; // The Title Window (if any)
67
+
68
+ bool b_Colors; // Is this a color application?
69
+ NCursesWindow* Root_Window; // This is the stdscr equiv.
70
+
71
+ // Initialization of attributes;
72
+ // Rewrite this in your derived class if you prefer other settings
73
+ virtual void init(bool bColors);
74
+
75
+ // The number of lines for the title window. Default is no title window
76
+ // You may rewrite this in your derived class
77
+ virtual int titlesize() const {
78
+ return 0;
79
+ }
80
+
81
+ // This method is called to put something into the title window initially
82
+ // You may rewrite this in your derived class
83
+ virtual void title() {
84
+ }
85
+
86
+ // The layout used for the Soft Label Keys. Default is to have no SLKs.
87
+ // You may rewrite this in your derived class
88
+ virtual Soft_Label_Key_Set::Label_Layout useSLKs() const {
89
+ return Soft_Label_Key_Set::None;
90
+ }
91
+
92
+ // This method is called to initialize the SLKs. Default is nothing.
93
+ // You may rewrite this in your derived class
94
+ virtual void init_labels(Soft_Label_Key_Set& S) const {
95
+ (void) S;
96
+ }
97
+
98
+ // Your derived class must implement this method. The return value must
99
+ // be the exit value of your application.
100
+ virtual int run() = 0;
101
+
102
+ // The constructor is protected, so you may use it in your derived
103
+ // class constructor. The argument tells whether or not you want colors.
104
+ NCursesApplication(bool wantColors = FALSE);
105
+
106
+ NCursesApplication& operator=(const NCursesApplication& rhs)
107
+ {
108
+ if (this != &rhs) {
109
+ *this = rhs;
110
+ }
111
+ return *this;
112
+ }
113
+
114
+ NCursesApplication(const NCursesApplication& rhs)
115
+ : b_Colors(rhs.b_Colors),
116
+ Root_Window(rhs.Root_Window)
117
+ {
118
+ }
119
+
120
+ static NCursesWindow *&getTitleWindow();
121
+
122
+ public:
123
+ virtual ~NCursesApplication() THROWS(NCursesException);
124
+
125
+ // Get a pointer to the current application object
126
+ static NCursesApplication* getApplication();
127
+
128
+ // This method runs the application and returns its exit value
129
+ int operator()(void);
130
+
131
+ // Process the commandline arguments. The default implementation simply
132
+ // ignores them. Your derived class may rewrite this.
133
+ virtual void handleArgs(int argc, char* argv[]) {
134
+ (void) argc;
135
+ (void) argv;
136
+ }
137
+
138
+ // Does this application use colors?
139
+ inline bool useColors() const {
140
+ return b_Colors;
141
+ }
142
+
143
+ // Push the Key Set S onto the SLK Stack. S then becomes the current set
144
+ // of Soft Labelled Keys.
145
+ void push(Soft_Label_Key_Set& S);
146
+
147
+ // Throw away the current set of SLKs and make the previous one the
148
+ // new current set.
149
+ bool pop();
150
+
151
+ // Retrieve the current set of Soft Labelled Keys.
152
+ Soft_Label_Key_Set* top() const;
153
+
154
+ // Attributes to use for menu and forms foregrounds
155
+ virtual chtype foregrounds() const {
156
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(1)) : A_BOLD;
157
+ }
158
+
159
+ // Attributes to use for menu and forms backgrounds
160
+ virtual chtype backgrounds() const {
161
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(2)) : A_NORMAL;
162
+ }
163
+
164
+ // Attributes to use for inactive (menu) elements
165
+ virtual chtype inactives() const {
166
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(3)|A_DIM) : A_DIM;
167
+ }
168
+
169
+ // Attributes to use for (form) labels and SLKs
170
+ virtual chtype labels() const {
171
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL;
172
+ }
173
+
174
+ // Attributes to use for form backgrounds
175
+ virtual chtype dialog_backgrounds() const {
176
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL;
177
+ }
178
+
179
+ // Attributes to use as default for (form) window backgrounds
180
+ virtual chtype window_backgrounds() const {
181
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(5)) : A_NORMAL;
182
+ }
183
+
184
+ // Attributes to use for the title window
185
+ virtual chtype screen_titles() const {
186
+ return b_Colors ? static_cast<chtype>(COLOR_PAIR(6)) : A_BOLD;
187
+ }
188
+
189
+ };
190
+
191
+ #endif /* NCURSES_CURSESAPP_H_incl */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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
evalkit_llava/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 */
evalkit_llava/include/fakepq.h ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fakepq.h --
3
+ *
4
+ * Minimal replacement for 'pq-fe.h' in the PostgreSQL client
5
+ * without having a PostgreSQL installation on the build system.
6
+ * This file 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 FAKEPQ_H_INCLUDED
17
+ #define FAKEPQ_H_INCLUDED
18
+
19
+ #ifndef MODULE_SCOPE
20
+ #define MODULE_SCOPE extern
21
+ #endif
22
+
23
+ MODULE_SCOPE Tcl_LoadHandle PostgresqlInitStubs(Tcl_Interp*);
24
+
25
+ typedef enum {
26
+ CONNECTION_OK=0,
27
+ } ConnStatusType;
28
+ typedef enum {
29
+ PGRES_EMPTY_QUERY=0,
30
+ PGRES_BAD_RESPONSE=5,
31
+ PGRES_NONFATAL_ERROR=6,
32
+ PGRES_FATAL_ERROR=7,
33
+ } ExecStatusType;
34
+ typedef unsigned int Oid;
35
+ typedef struct pg_conn PGconn;
36
+ typedef struct pg_result PGresult;
37
+ typedef void (*PQnoticeProcessor)(void*, const PGresult*);
38
+
39
+ #define PG_DIAG_SQLSTATE 'C'
40
+ #define PG_DIAG_MESSAGE_PRIMARY 'M'
41
+
42
+ #include "pqStubs.h"
43
+
44
+ MODULE_SCOPE const pqStubDefs* pqStubs;
45
+
46
+ #endif
evalkit_llava/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
evalkit_llava/include/ffi.h ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* -----------------------------------------------------------------*-C-*-
2
+ libffi 3.4.4
3
+ - Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green
4
+ - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
5
+
6
+ Permission is hereby granted, free of charge, to any person
7
+ obtaining a copy of this software and associated documentation
8
+ files (the ``Software''), to deal in the Software without
9
+ restriction, including without limitation the rights to use, copy,
10
+ modify, merge, publish, distribute, sublicense, and/or sell copies
11
+ 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
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24
+ DEALINGS IN THE SOFTWARE.
25
+
26
+ ----------------------------------------------------------------------- */
27
+
28
+ /* -------------------------------------------------------------------
29
+ Most of the API is documented in doc/libffi.texi.
30
+
31
+ The raw API is designed to bypass some of the argument packing and
32
+ unpacking on architectures for which it can be avoided. Routines
33
+ are provided to emulate the raw API if the underlying platform
34
+ doesn't allow faster implementation.
35
+
36
+ More details on the raw API can be found in:
37
+
38
+ http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
39
+
40
+ and
41
+
42
+ http://gcc.gnu.org/ml/java/1999-q3/msg00174.html
43
+ -------------------------------------------------------------------- */
44
+
45
+ #ifndef LIBFFI_H
46
+ #define LIBFFI_H
47
+
48
+ #ifdef __cplusplus
49
+ extern "C" {
50
+ #endif
51
+
52
+ /* Specify which architecture libffi is configured for. */
53
+ #ifndef X86_64
54
+ #define X86_64
55
+ #endif
56
+
57
+ /* ---- System configuration information --------------------------------- */
58
+
59
+ /* If these change, update src/mips/ffitarget.h. */
60
+ #define FFI_TYPE_VOID 0
61
+ #define FFI_TYPE_INT 1
62
+ #define FFI_TYPE_FLOAT 2
63
+ #define FFI_TYPE_DOUBLE 3
64
+ #if 1
65
+ #define FFI_TYPE_LONGDOUBLE 4
66
+ #else
67
+ #define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
68
+ #endif
69
+ #define FFI_TYPE_UINT8 5
70
+ #define FFI_TYPE_SINT8 6
71
+ #define FFI_TYPE_UINT16 7
72
+ #define FFI_TYPE_SINT16 8
73
+ #define FFI_TYPE_UINT32 9
74
+ #define FFI_TYPE_SINT32 10
75
+ #define FFI_TYPE_UINT64 11
76
+ #define FFI_TYPE_SINT64 12
77
+ #define FFI_TYPE_STRUCT 13
78
+ #define FFI_TYPE_POINTER 14
79
+ #define FFI_TYPE_COMPLEX 15
80
+
81
+ /* This should always refer to the last type code (for sanity checks). */
82
+ #define FFI_TYPE_LAST FFI_TYPE_COMPLEX
83
+
84
+ #include <ffitarget.h>
85
+
86
+ #ifndef LIBFFI_ASM
87
+
88
+ #if defined(_MSC_VER) && !defined(__clang__)
89
+ #define __attribute__(X)
90
+ #endif
91
+
92
+ #include <stddef.h>
93
+ #include <limits.h>
94
+
95
+ /* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
96
+ But we can find it either under the correct ANSI name, or under GNU
97
+ C's internal name. */
98
+
99
+ #define FFI_64_BIT_MAX 9223372036854775807
100
+
101
+ #ifdef LONG_LONG_MAX
102
+ # define FFI_LONG_LONG_MAX LONG_LONG_MAX
103
+ #else
104
+ # ifdef LLONG_MAX
105
+ # define FFI_LONG_LONG_MAX LLONG_MAX
106
+ # ifdef _AIX52 /* or newer has C99 LLONG_MAX */
107
+ # undef FFI_64_BIT_MAX
108
+ # define FFI_64_BIT_MAX 9223372036854775807LL
109
+ # endif /* _AIX52 or newer */
110
+ # else
111
+ # ifdef __GNUC__
112
+ # define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
113
+ # endif
114
+ # ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
115
+ # ifndef __PPC64__
116
+ # if defined (__IBMC__) || defined (__IBMCPP__)
117
+ # define FFI_LONG_LONG_MAX LONGLONG_MAX
118
+ # endif
119
+ # endif /* __PPC64__ */
120
+ # undef FFI_64_BIT_MAX
121
+ # define FFI_64_BIT_MAX 9223372036854775807LL
122
+ # endif
123
+ # endif
124
+ #endif
125
+
126
+ /* The closure code assumes that this works on pointers, i.e. a size_t
127
+ can hold a pointer. */
128
+
129
+ typedef struct _ffi_type
130
+ {
131
+ size_t size;
132
+ unsigned short alignment;
133
+ unsigned short type;
134
+ struct _ffi_type **elements;
135
+ } ffi_type;
136
+
137
+ /* Need minimal decorations for DLLs to work on Windows. GCC has
138
+ autoimport and autoexport. Always mark externally visible symbols
139
+ as dllimport for MSVC clients, even if it means an extra indirection
140
+ when using the static version of the library.
141
+ Besides, as a workaround, they can define FFI_BUILDING if they
142
+ *know* they are going to link with the static library. */
143
+ #if defined _MSC_VER
144
+ # if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */
145
+ # define FFI_API __declspec(dllexport)
146
+ # elif !defined FFI_BUILDING /* Importing libffi.DLL */
147
+ # define FFI_API __declspec(dllimport)
148
+ # else /* Building/linking static library */
149
+ # define FFI_API
150
+ # endif
151
+ #else
152
+ # define FFI_API
153
+ #endif
154
+
155
+ /* The externally visible type declarations also need the MSVC DLL
156
+ decorations, or they will not be exported from the object file. */
157
+ #if defined LIBFFI_HIDE_BASIC_TYPES
158
+ # define FFI_EXTERN FFI_API
159
+ #else
160
+ # define FFI_EXTERN extern FFI_API
161
+ #endif
162
+
163
+ #ifndef LIBFFI_HIDE_BASIC_TYPES
164
+ #if SCHAR_MAX == 127
165
+ # define ffi_type_uchar ffi_type_uint8
166
+ # define ffi_type_schar ffi_type_sint8
167
+ #else
168
+ #error "char size not supported"
169
+ #endif
170
+
171
+ #if SHRT_MAX == 32767
172
+ # define ffi_type_ushort ffi_type_uint16
173
+ # define ffi_type_sshort ffi_type_sint16
174
+ #elif SHRT_MAX == 2147483647
175
+ # define ffi_type_ushort ffi_type_uint32
176
+ # define ffi_type_sshort ffi_type_sint32
177
+ #else
178
+ #error "short size not supported"
179
+ #endif
180
+
181
+ #if INT_MAX == 32767
182
+ # define ffi_type_uint ffi_type_uint16
183
+ # define ffi_type_sint ffi_type_sint16
184
+ #elif INT_MAX == 2147483647
185
+ # define ffi_type_uint ffi_type_uint32
186
+ # define ffi_type_sint ffi_type_sint32
187
+ #elif INT_MAX == 9223372036854775807
188
+ # define ffi_type_uint ffi_type_uint64
189
+ # define ffi_type_sint ffi_type_sint64
190
+ #else
191
+ #error "int size not supported"
192
+ #endif
193
+
194
+ #if LONG_MAX == 2147483647
195
+ # if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX
196
+ #error "no 64-bit data type supported"
197
+ # endif
198
+ #elif LONG_MAX != FFI_64_BIT_MAX
199
+ #error "long size not supported"
200
+ #endif
201
+
202
+ #if LONG_MAX == 2147483647
203
+ # define ffi_type_ulong ffi_type_uint32
204
+ # define ffi_type_slong ffi_type_sint32
205
+ #elif LONG_MAX == FFI_64_BIT_MAX
206
+ # define ffi_type_ulong ffi_type_uint64
207
+ # define ffi_type_slong ffi_type_sint64
208
+ #else
209
+ #error "long size not supported"
210
+ #endif
211
+
212
+ /* These are defined in types.c. */
213
+ FFI_EXTERN ffi_type ffi_type_void;
214
+ FFI_EXTERN ffi_type ffi_type_uint8;
215
+ FFI_EXTERN ffi_type ffi_type_sint8;
216
+ FFI_EXTERN ffi_type ffi_type_uint16;
217
+ FFI_EXTERN ffi_type ffi_type_sint16;
218
+ FFI_EXTERN ffi_type ffi_type_uint32;
219
+ FFI_EXTERN ffi_type ffi_type_sint32;
220
+ FFI_EXTERN ffi_type ffi_type_uint64;
221
+ FFI_EXTERN ffi_type ffi_type_sint64;
222
+ FFI_EXTERN ffi_type ffi_type_float;
223
+ FFI_EXTERN ffi_type ffi_type_double;
224
+ FFI_EXTERN ffi_type ffi_type_pointer;
225
+
226
+ #if 1
227
+ FFI_EXTERN ffi_type ffi_type_longdouble;
228
+ #else
229
+ #define ffi_type_longdouble ffi_type_double
230
+ #endif
231
+
232
+ #ifdef FFI_TARGET_HAS_COMPLEX_TYPE
233
+ FFI_EXTERN ffi_type ffi_type_complex_float;
234
+ FFI_EXTERN ffi_type ffi_type_complex_double;
235
+ #if 1
236
+ FFI_EXTERN ffi_type ffi_type_complex_longdouble;
237
+ #else
238
+ #define ffi_type_complex_longdouble ffi_type_complex_double
239
+ #endif
240
+ #endif
241
+ #endif /* LIBFFI_HIDE_BASIC_TYPES */
242
+
243
+ typedef enum {
244
+ FFI_OK = 0,
245
+ FFI_BAD_TYPEDEF,
246
+ FFI_BAD_ABI,
247
+ FFI_BAD_ARGTYPE
248
+ } ffi_status;
249
+
250
+ typedef struct {
251
+ ffi_abi abi;
252
+ unsigned nargs;
253
+ ffi_type **arg_types;
254
+ ffi_type *rtype;
255
+ unsigned bytes;
256
+ unsigned flags;
257
+ #ifdef FFI_EXTRA_CIF_FIELDS
258
+ FFI_EXTRA_CIF_FIELDS;
259
+ #endif
260
+ } ffi_cif;
261
+
262
+ /* ---- Definitions for the raw API -------------------------------------- */
263
+
264
+ #ifndef FFI_SIZEOF_ARG
265
+ # if LONG_MAX == 2147483647
266
+ # define FFI_SIZEOF_ARG 4
267
+ # elif LONG_MAX == FFI_64_BIT_MAX
268
+ # define FFI_SIZEOF_ARG 8
269
+ # endif
270
+ #endif
271
+
272
+ #ifndef FFI_SIZEOF_JAVA_RAW
273
+ # define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
274
+ #endif
275
+
276
+ typedef union {
277
+ ffi_sarg sint;
278
+ ffi_arg uint;
279
+ float flt;
280
+ char data[FFI_SIZEOF_ARG];
281
+ void* ptr;
282
+ } ffi_raw;
283
+
284
+ #if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
285
+ /* This is a special case for mips64/n32 ABI (and perhaps others) where
286
+ sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */
287
+ typedef union {
288
+ signed int sint;
289
+ unsigned int uint;
290
+ float flt;
291
+ char data[FFI_SIZEOF_JAVA_RAW];
292
+ void* ptr;
293
+ } ffi_java_raw;
294
+ #else
295
+ typedef ffi_raw ffi_java_raw;
296
+ #endif
297
+
298
+
299
+ FFI_API
300
+ void ffi_raw_call (ffi_cif *cif,
301
+ void (*fn)(void),
302
+ void *rvalue,
303
+ ffi_raw *avalue);
304
+
305
+ FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
306
+ FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
307
+ FFI_API size_t ffi_raw_size (ffi_cif *cif);
308
+
309
+ /* This is analogous to the raw API, except it uses Java parameter
310
+ packing, even on 64-bit machines. I.e. on 64-bit machines longs
311
+ and doubles are followed by an empty 64-bit word. */
312
+
313
+ #if !FFI_NATIVE_RAW_API
314
+ FFI_API
315
+ void ffi_java_raw_call (ffi_cif *cif,
316
+ void (*fn)(void),
317
+ void *rvalue,
318
+ ffi_java_raw *avalue) __attribute__((deprecated));
319
+ #endif
320
+
321
+ FFI_API
322
+ void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
323
+ FFI_API
324
+ void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated));
325
+ FFI_API
326
+ size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
327
+
328
+ /* ---- Definitions for closures ----------------------------------------- */
329
+
330
+ #if FFI_CLOSURES
331
+
332
+ #ifdef _MSC_VER
333
+ __declspec(align(8))
334
+ #endif
335
+ typedef struct {
336
+ #if 0
337
+ void *trampoline_table;
338
+ void *trampoline_table_entry;
339
+ #else
340
+ union {
341
+ char tramp[FFI_TRAMPOLINE_SIZE];
342
+ void *ftramp;
343
+ };
344
+ #endif
345
+ ffi_cif *cif;
346
+ void (*fun)(ffi_cif*,void*,void**,void*);
347
+ void *user_data;
348
+ #if defined(_MSC_VER) && defined(_M_IX86)
349
+ void *padding;
350
+ #endif
351
+ } ffi_closure
352
+ #ifdef __GNUC__
353
+ __attribute__((aligned (8)))
354
+ #endif
355
+ ;
356
+
357
+ #ifndef __GNUC__
358
+ # ifdef __sgi
359
+ # pragma pack 0
360
+ # endif
361
+ #endif
362
+
363
+ FFI_API void *ffi_closure_alloc (size_t size, void **code);
364
+ FFI_API void ffi_closure_free (void *);
365
+
366
+ #if defined(PA_LINUX) || defined(PA_HPUX)
367
+ #define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
368
+ #define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
369
+ #else
370
+ #define FFI_CLOSURE_PTR(X) (X)
371
+ #define FFI_RESTORE_PTR(X) (X)
372
+ #endif
373
+
374
+ FFI_API ffi_status
375
+ ffi_prep_closure (ffi_closure*,
376
+ ffi_cif *,
377
+ void (*fun)(ffi_cif*,void*,void**,void*),
378
+ void *user_data)
379
+ #if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405)
380
+ __attribute__((deprecated ("use ffi_prep_closure_loc instead")))
381
+ #elif defined(__GNUC__) && __GNUC__ >= 3
382
+ __attribute__((deprecated))
383
+ #endif
384
+ ;
385
+
386
+ FFI_API ffi_status
387
+ ffi_prep_closure_loc (ffi_closure*,
388
+ ffi_cif *,
389
+ void (*fun)(ffi_cif*,void*,void**,void*),
390
+ void *user_data,
391
+ void *codeloc);
392
+
393
+ #ifdef __sgi
394
+ # pragma pack 8
395
+ #endif
396
+ typedef struct {
397
+ #if 0
398
+ void *trampoline_table;
399
+ void *trampoline_table_entry;
400
+ #else
401
+ char tramp[FFI_TRAMPOLINE_SIZE];
402
+ #endif
403
+ ffi_cif *cif;
404
+
405
+ #if !FFI_NATIVE_RAW_API
406
+
407
+ /* If this is enabled, then a raw closure has the same layout
408
+ as a regular closure. We use this to install an intermediate
409
+ handler to do the translation, void** -> ffi_raw*. */
410
+
411
+ void (*translate_args)(ffi_cif*,void*,void**,void*);
412
+ void *this_closure;
413
+
414
+ #endif
415
+
416
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*);
417
+ void *user_data;
418
+
419
+ } ffi_raw_closure;
420
+
421
+ typedef struct {
422
+ #if 0
423
+ void *trampoline_table;
424
+ void *trampoline_table_entry;
425
+ #else
426
+ char tramp[FFI_TRAMPOLINE_SIZE];
427
+ #endif
428
+
429
+ ffi_cif *cif;
430
+
431
+ #if !FFI_NATIVE_RAW_API
432
+
433
+ /* If this is enabled, then a raw closure has the same layout
434
+ as a regular closure. We use this to install an intermediate
435
+ handler to do the translation, void** -> ffi_raw*. */
436
+
437
+ void (*translate_args)(ffi_cif*,void*,void**,void*);
438
+ void *this_closure;
439
+
440
+ #endif
441
+
442
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
443
+ void *user_data;
444
+
445
+ } ffi_java_raw_closure;
446
+
447
+ FFI_API ffi_status
448
+ ffi_prep_raw_closure (ffi_raw_closure*,
449
+ ffi_cif *cif,
450
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
451
+ void *user_data);
452
+
453
+ FFI_API ffi_status
454
+ ffi_prep_raw_closure_loc (ffi_raw_closure*,
455
+ ffi_cif *cif,
456
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
457
+ void *user_data,
458
+ void *codeloc);
459
+
460
+ #if !FFI_NATIVE_RAW_API
461
+ FFI_API ffi_status
462
+ ffi_prep_java_raw_closure (ffi_java_raw_closure*,
463
+ ffi_cif *cif,
464
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
465
+ void *user_data) __attribute__((deprecated));
466
+
467
+ FFI_API ffi_status
468
+ ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
469
+ ffi_cif *cif,
470
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
471
+ void *user_data,
472
+ void *codeloc) __attribute__((deprecated));
473
+ #endif
474
+
475
+ #endif /* FFI_CLOSURES */
476
+
477
+ #if FFI_GO_CLOSURES
478
+
479
+ typedef struct {
480
+ void *tramp;
481
+ ffi_cif *cif;
482
+ void (*fun)(ffi_cif*,void*,void**,void*);
483
+ } ffi_go_closure;
484
+
485
+ FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *,
486
+ void (*fun)(ffi_cif*,void*,void**,void*));
487
+
488
+ FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
489
+ void **avalue, void *closure);
490
+
491
+ #endif /* FFI_GO_CLOSURES */
492
+
493
+ /* ---- Public interface definition -------------------------------------- */
494
+
495
+ FFI_API
496
+ ffi_status ffi_prep_cif(ffi_cif *cif,
497
+ ffi_abi abi,
498
+ unsigned int nargs,
499
+ ffi_type *rtype,
500
+ ffi_type **atypes);
501
+
502
+ FFI_API
503
+ ffi_status ffi_prep_cif_var(ffi_cif *cif,
504
+ ffi_abi abi,
505
+ unsigned int nfixedargs,
506
+ unsigned int ntotalargs,
507
+ ffi_type *rtype,
508
+ ffi_type **atypes);
509
+
510
+ FFI_API
511
+ void ffi_call(ffi_cif *cif,
512
+ void (*fn)(void),
513
+ void *rvalue,
514
+ void **avalue);
515
+
516
+ FFI_API
517
+ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
518
+ size_t *offsets);
519
+
520
+ /* Useful for eliminating compiler warnings. */
521
+ #define FFI_FN(f) ((void (*)(void))f)
522
+
523
+ /* ---- Definitions shared with assembly code ---------------------------- */
524
+
525
+ #endif
526
+
527
+ #ifdef __cplusplus
528
+ }
529
+ #endif
530
+
531
+ #endif
evalkit_llava/include/itcl.h ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * itcl.h --
3
+ *
4
+ * This file contains definitions for the C-implemeted part of a Itcl
5
+ * this version of [incr Tcl] (Itcl) is a completely new implementation
6
+ * based on TclOO extension of Tcl 8.5
7
+ * It tries to provide the same interfaces as the original implementation
8
+ * of Michael J. McLennan
9
+ * Some small pieces of code are taken from that implementation
10
+ *
11
+ * Copyright (c) 2007 by Arnulf P. Wiedemann
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
+ /*
18
+ * ------------------------------------------------------------------------
19
+ * PACKAGE: [incr Tcl]
20
+ * DESCRIPTION: Object-Oriented Extensions to Tcl
21
+ *
22
+ * [incr Tcl] provides object-oriented extensions to Tcl, much as
23
+ * C++ provides object-oriented extensions to C. It provides a means
24
+ * of encapsulating related procedures together with their shared data
25
+ * in a local namespace that is hidden from the outside world. It
26
+ * promotes code re-use through inheritance. More than anything else,
27
+ * it encourages better organization of Tcl applications through the
28
+ * object-oriented paradigm, leading to code that is easier to
29
+ * understand and maintain.
30
+ *
31
+ * ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
32
+ *
33
+ * To add [incr Tcl] facilities to a Tcl application, modify the
34
+ * Tcl_AppInit() routine as follows:
35
+ *
36
+ * 1) Include this header file near the top of the file containing
37
+ * Tcl_AppInit():
38
+ *
39
+ * #include "itcl.h"
40
+ *
41
+ * 2) Within the body of Tcl_AppInit(), add the following lines:
42
+ *
43
+ * if (Itcl_Init(interp) == TCL_ERROR) {
44
+ * return TCL_ERROR;
45
+ * }
46
+ *
47
+ * 3) Link your application with libitcl.a
48
+ *
49
+ * NOTE: An example file "tclAppInit.c" containing the changes shown
50
+ * above is included in this distribution.
51
+ *
52
+ *---------------------------------------------------------------------
53
+ */
54
+
55
+ #ifndef ITCL_H_INCLUDED
56
+ #define ITCL_H_INCLUDED
57
+
58
+ #include <tcl.h>
59
+
60
+ #if (TCL_MAJOR_VERSION == 8) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 6)
61
+ # error Itcl 4 build requires tcl.h from Tcl 8.6 or later
62
+ #endif
63
+
64
+ /*
65
+ * For C++ compilers, use extern "C"
66
+ */
67
+
68
+ #ifdef __cplusplus
69
+ extern "C" {
70
+ #endif
71
+
72
+ #ifndef TCL_ALPHA_RELEASE
73
+ # define TCL_ALPHA_RELEASE 0
74
+ #endif
75
+ #ifndef TCL_BETA_RELEASE
76
+ # define TCL_BETA_RELEASE 1
77
+ #endif
78
+ #ifndef TCL_FINAL_RELEASE
79
+ # define TCL_FINAL_RELEASE 2
80
+ #endif
81
+
82
+ #define ITCL_MAJOR_VERSION 4
83
+ #define ITCL_MINOR_VERSION 2
84
+ #define ITCL_RELEASE_LEVEL TCL_FINAL_RELEASE
85
+ #define ITCL_RELEASE_SERIAL 4
86
+
87
+ #define ITCL_VERSION "4.2"
88
+ #define ITCL_PATCH_LEVEL "4.2.4"
89
+
90
+
91
+ /*
92
+ * A special definition used to allow this header file to be included from
93
+ * windows resource files so that they can obtain version information.
94
+ * RC_INVOKED is defined by default by the windows RC tool.
95
+ *
96
+ * Resource compilers don't like all the C stuff, like typedefs and function
97
+ * declarations, that occur below, so block them out.
98
+ */
99
+
100
+ #ifndef RC_INVOKED
101
+
102
+ #define ITCL_NAMESPACE "::itcl"
103
+
104
+ #ifndef ITCLAPI
105
+ # if defined(BUILD_itcl)
106
+ # define ITCLAPI MODULE_SCOPE
107
+ # else
108
+ # define ITCLAPI extern
109
+ # undef USE_ITCL_STUBS
110
+ # define USE_ITCL_STUBS 1
111
+ # endif
112
+ #endif
113
+
114
+ #if defined(BUILD_itcl) && !defined(STATIC_BUILD)
115
+ # define ITCL_EXTERN extern DLLEXPORT
116
+ #else
117
+ # define ITCL_EXTERN extern
118
+ #endif
119
+
120
+ ITCL_EXTERN int Itcl_Init(Tcl_Interp *interp);
121
+ ITCL_EXTERN int Itcl_SafeInit(Tcl_Interp *interp);
122
+
123
+ /*
124
+ * Protection levels:
125
+ *
126
+ * ITCL_PUBLIC - accessible from any namespace
127
+ * ITCL_PROTECTED - accessible from namespace that imports in "protected" mode
128
+ * ITCL_PRIVATE - accessible only within the namespace that contains it
129
+ */
130
+ #define ITCL_PUBLIC 1
131
+ #define ITCL_PROTECTED 2
132
+ #define ITCL_PRIVATE 3
133
+ #define ITCL_DEFAULT_PROTECT 4
134
+
135
+ #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) && !defined(Tcl_Size)
136
+ # define Tcl_Size int
137
+ #endif
138
+
139
+ /*
140
+ * Generic stack.
141
+ */
142
+ typedef struct Itcl_Stack {
143
+ void **values; /* values on stack */
144
+ Tcl_Size len; /* number of values on stack */
145
+ Tcl_Size max; /* maximum size of stack */
146
+ void *space[5]; /* initial space for stack data */
147
+ } Itcl_Stack;
148
+
149
+ #define Itcl_GetStackSize(stackPtr) ((stackPtr)->len)
150
+
151
+ /*
152
+ * Generic linked list.
153
+ */
154
+ struct Itcl_List;
155
+ typedef struct Itcl_ListElem {
156
+ struct Itcl_List* owner; /* list containing this element */
157
+ void *value; /* value associated with this element */
158
+ struct Itcl_ListElem *prev; /* previous element in linked list */
159
+ struct Itcl_ListElem *next; /* next element in linked list */
160
+ } Itcl_ListElem;
161
+
162
+ typedef struct Itcl_List {
163
+ int validate; /* validation stamp */
164
+ Tcl_Size num; /* number of elements */
165
+ struct Itcl_ListElem *head; /* previous element in linked list */
166
+ struct Itcl_ListElem *tail; /* next element in linked list */
167
+ } Itcl_List;
168
+
169
+ #define Itcl_FirstListElem(listPtr) ((listPtr)->head)
170
+ #define Itcl_LastListElem(listPtr) ((listPtr)->tail)
171
+ #define Itcl_NextListElem(elemPtr) ((elemPtr)->next)
172
+ #define Itcl_PrevListElem(elemPtr) ((elemPtr)->prev)
173
+ #define Itcl_GetListLength(listPtr) ((listPtr)->num)
174
+ #define Itcl_GetListValue(elemPtr) ((elemPtr)->value)
175
+
176
+ /*
177
+ * Token representing the state of an interpreter.
178
+ */
179
+ typedef struct Itcl_InterpState_ *Itcl_InterpState;
180
+
181
+
182
+ /*
183
+ * Include all the public API, generated from itcl.decls.
184
+ */
185
+
186
+ #include "itclDecls.h"
187
+
188
+ #endif /* RC_INVOKED */
189
+
190
+ /*
191
+ * end block for C++
192
+ */
193
+
194
+ #ifdef __cplusplus
195
+ }
196
+ #endif
197
+
198
+ #endif /* ITCL_H_INCLUDED */
evalkit_llava/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 */
evalkit_llava/include/itclTclIntStubsFcn.h ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* these functions are Tcl internal stubs so make an Itcl_* wrapper */
2
+ MODULE_SCOPE void Itcl_GetVariableFullName (Tcl_Interp * interp,
3
+ Tcl_Var variable, Tcl_Obj * objPtr);
4
+ MODULE_SCOPE Tcl_Var Itcl_FindNamespaceVar (Tcl_Interp * interp,
5
+ const char * name, Tcl_Namespace * contextNsPtr, int flags);
6
+ MODULE_SCOPE void Itcl_SetNamespaceResolvers (Tcl_Namespace * namespacePtr,
7
+ Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc,
8
+ Tcl_ResolveCompiledVarProc * compiledVarProc);
9
+
10
+ #ifndef _TCL_PROC_DEFINED
11
+ typedef struct Tcl_Proc_ *Tcl_Proc;
12
+ #define _TCL_PROC_DEFINED 1
13
+ #endif
14
+ #ifndef _TCL_RESOLVE_DEFINED
15
+ struct Tcl_Resolve;
16
+ #endif
17
+
18
+ #define Tcl_GetOriginalCommand _Tcl_GetOriginalCommand
19
+ #define Tcl_CreateProc _Tcl_CreateProc
20
+ #define Tcl_ProcDeleteProc _Tcl_ProcDeleteProc
21
+ #define Tcl_GetObjInterpProc _Tcl_GetObjInterpProc
22
+
23
+ MODULE_SCOPE Tcl_Command _Tcl_GetOriginalCommand(Tcl_Command command);
24
+ MODULE_SCOPE int _Tcl_CreateProc(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
25
+ const char *procName, Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr,
26
+ Tcl_Proc *procPtrPtr);
27
+ MODULE_SCOPE void _Tcl_ProcDeleteProc(void *clientData);
28
+ MODULE_SCOPE Tcl_ObjCmdProc *_Tcl_GetObjInterpProc(void);
29
+ MODULE_SCOPE int Tcl_RenameCommand(Tcl_Interp *interp, const char *oldName,
30
+ const char *newName);
31
+ MODULE_SCOPE Tcl_HashTable *Itcl_GetNamespaceChildTable(Tcl_Namespace *nsPtr);
32
+ MODULE_SCOPE Tcl_HashTable *Itcl_GetNamespaceCommandTable(Tcl_Namespace *nsPtr);
33
+ MODULE_SCOPE int Itcl_InitRewriteEnsemble(Tcl_Interp *interp, size_t numRemoved,
34
+ size_t numInserted, size_t objc, Tcl_Obj *const *objv);
35
+ MODULE_SCOPE void Itcl_ResetRewriteEnsemble(Tcl_Interp *interp,
36
+ int isRootEnsemble);
37
+
38
+
evalkit_llava/include/lzma.h ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SPDX-License-Identifier: 0BSD */
2
+
3
+ /**
4
+ * \file api/lzma.h
5
+ * \brief The public API of liblzma data compression library
6
+ * \mainpage
7
+ *
8
+ * liblzma is a general-purpose data compression library with a zlib-like API.
9
+ * The native file format is .xz, but also the old .lzma format and raw (no
10
+ * headers) streams are supported. Multiple compression algorithms (filters)
11
+ * are supported. Currently LZMA2 is the primary filter.
12
+ *
13
+ * liblzma is part of XZ Utils <https://tukaani.org/xz/>. XZ Utils
14
+ * includes a gzip-like command line tool named xz and some other tools.
15
+ * XZ Utils is developed and maintained by Lasse Collin.
16
+ *
17
+ * Major parts of liblzma are based on code written by Igor Pavlov,
18
+ * specifically the LZMA SDK <https://7-zip.org/sdk.html>.
19
+ *
20
+ * The SHA-256 implementation in liblzma is based on code written by
21
+ * Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
22
+ *
23
+ * liblzma is distributed under the BSD Zero Clause License (0BSD).
24
+ */
25
+
26
+ /*
27
+ * Author: Lasse Collin
28
+ */
29
+
30
+ #ifndef LZMA_H
31
+ #define LZMA_H
32
+
33
+ /*****************************
34
+ * Required standard headers *
35
+ *****************************/
36
+
37
+ /*
38
+ * liblzma API headers need some standard types and macros. To allow
39
+ * including lzma.h without requiring the application to include other
40
+ * headers first, lzma.h includes the required standard headers unless
41
+ * they already seem to be included already or if LZMA_MANUAL_HEADERS
42
+ * has been defined.
43
+ *
44
+ * Here's what types and macros are needed and from which headers:
45
+ * - stddef.h: size_t, NULL
46
+ * - stdint.h: uint8_t, uint32_t, uint64_t, UINT32_C(n), uint64_C(n),
47
+ * UINT32_MAX, UINT64_MAX
48
+ *
49
+ * However, inttypes.h is a little more portable than stdint.h, although
50
+ * inttypes.h declares some unneeded things compared to plain stdint.h.
51
+ *
52
+ * The hacks below aren't perfect, specifically they assume that inttypes.h
53
+ * exists and that it typedefs at least uint8_t, uint32_t, and uint64_t,
54
+ * and that, in case of incomplete inttypes.h, unsigned int is 32-bit.
55
+ * If the application already takes care of setting up all the types and
56
+ * macros properly (for example by using gnulib's stdint.h or inttypes.h),
57
+ * we try to detect that the macros are already defined and don't include
58
+ * inttypes.h here again. However, you may define LZMA_MANUAL_HEADERS to
59
+ * force this file to never include any system headers.
60
+ *
61
+ * Some could argue that liblzma API should provide all the required types,
62
+ * for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was
63
+ * seen as an unnecessary mess, since most systems already provide all the
64
+ * necessary types and macros in the standard headers.
65
+ *
66
+ * Note that liblzma API still has lzma_bool, because using stdbool.h would
67
+ * break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't
68
+ * necessarily the same as sizeof(bool) in C++.
69
+ */
70
+
71
+ #ifndef LZMA_MANUAL_HEADERS
72
+ /*
73
+ * I suppose this works portably also in C++. Note that in C++,
74
+ * we need to get size_t into the global namespace.
75
+ */
76
+ # include <stddef.h>
77
+
78
+ /*
79
+ * Skip inttypes.h if we already have all the required macros. If we
80
+ * have the macros, we assume that we have the matching typedefs too.
81
+ */
82
+ # if !defined(UINT32_C) || !defined(UINT64_C) \
83
+ || !defined(UINT32_MAX) || !defined(UINT64_MAX)
84
+ /*
85
+ * MSVC versions older than 2013 have no C99 support, and
86
+ * thus they cannot be used to compile liblzma. Using an
87
+ * existing liblzma.dll with old MSVC can work though(*),
88
+ * but we need to define the required standard integer
89
+ * types here in a MSVC-specific way.
90
+ *
91
+ * (*) If you do this, the existing liblzma.dll probably uses
92
+ * a different runtime library than your MSVC-built
93
+ * application. Mixing runtimes is generally bad, but
94
+ * in this case it should work as long as you avoid
95
+ * the few rarely-needed liblzma functions that allocate
96
+ * memory and expect the caller to free it using free().
97
+ */
98
+ # if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1800
99
+ typedef unsigned __int8 uint8_t;
100
+ typedef unsigned __int32 uint32_t;
101
+ typedef unsigned __int64 uint64_t;
102
+ # else
103
+ /* Use the standard inttypes.h. */
104
+ # ifdef __cplusplus
105
+ /*
106
+ * C99 sections 7.18.2 and 7.18.4 specify
107
+ * that C++ implementations define the limit
108
+ * and constant macros only if specifically
109
+ * requested. Note that if you want the
110
+ * format macros (PRIu64 etc.) too, you need
111
+ * to define __STDC_FORMAT_MACROS before
112
+ * including lzma.h, since re-including
113
+ * inttypes.h with __STDC_FORMAT_MACROS
114
+ * defined doesn't necessarily work.
115
+ */
116
+ # ifndef __STDC_LIMIT_MACROS
117
+ # define __STDC_LIMIT_MACROS 1
118
+ # endif
119
+ # ifndef __STDC_CONSTANT_MACROS
120
+ # define __STDC_CONSTANT_MACROS 1
121
+ # endif
122
+ # endif
123
+
124
+ # include <inttypes.h>
125
+ # endif
126
+
127
+ /*
128
+ * Some old systems have only the typedefs in inttypes.h, and
129
+ * lack all the macros. For those systems, we need a few more
130
+ * hacks. We assume that unsigned int is 32-bit and unsigned
131
+ * long is either 32-bit or 64-bit. If these hacks aren't
132
+ * enough, the application has to setup the types manually
133
+ * before including lzma.h.
134
+ */
135
+ # ifndef UINT32_C
136
+ # if defined(_WIN32) && defined(_MSC_VER)
137
+ # define UINT32_C(n) n ## UI32
138
+ # else
139
+ # define UINT32_C(n) n ## U
140
+ # endif
141
+ # endif
142
+
143
+ # ifndef UINT64_C
144
+ # if defined(_WIN32) && defined(_MSC_VER)
145
+ # define UINT64_C(n) n ## UI64
146
+ # else
147
+ /* Get ULONG_MAX. */
148
+ # include <limits.h>
149
+ # if ULONG_MAX == 4294967295UL
150
+ # define UINT64_C(n) n ## ULL
151
+ # else
152
+ # define UINT64_C(n) n ## UL
153
+ # endif
154
+ # endif
155
+ # endif
156
+
157
+ # ifndef UINT32_MAX
158
+ # define UINT32_MAX (UINT32_C(4294967295))
159
+ # endif
160
+
161
+ # ifndef UINT64_MAX
162
+ # define UINT64_MAX (UINT64_C(18446744073709551615))
163
+ # endif
164
+ # endif
165
+ #endif /* ifdef LZMA_MANUAL_HEADERS */
166
+
167
+
168
+ /******************
169
+ * LZMA_API macro *
170
+ ******************/
171
+
172
+ /*
173
+ * Some systems require that the functions and function pointers are
174
+ * declared specially in the headers. LZMA_API_IMPORT is for importing
175
+ * symbols and LZMA_API_CALL is to specify the calling convention.
176
+ *
177
+ * By default it is assumed that the application will link dynamically
178
+ * against liblzma. #define LZMA_API_STATIC in your application if you
179
+ * want to link against static liblzma. If you don't care about portability
180
+ * to operating systems like Windows, or at least don't care about linking
181
+ * against static liblzma on them, don't worry about LZMA_API_STATIC. That
182
+ * is, most developers will never need to use LZMA_API_STATIC.
183
+ *
184
+ * The GCC variants are a special case on Windows (Cygwin and MinGW-w64).
185
+ * We rely on GCC doing the right thing with its auto-import feature,
186
+ * and thus don't use __declspec(dllimport). This way developers don't
187
+ * need to worry about LZMA_API_STATIC. Also the calling convention is
188
+ * omitted on Cygwin but not on MinGW-w64.
189
+ */
190
+ #ifndef LZMA_API_IMPORT
191
+ # if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__)
192
+ # define LZMA_API_IMPORT __declspec(dllimport)
193
+ # else
194
+ # define LZMA_API_IMPORT
195
+ # endif
196
+ #endif
197
+
198
+ #ifndef LZMA_API_CALL
199
+ # if defined(_WIN32) && !defined(__CYGWIN__)
200
+ # define LZMA_API_CALL __cdecl
201
+ # else
202
+ # define LZMA_API_CALL
203
+ # endif
204
+ #endif
205
+
206
+ #ifndef LZMA_API
207
+ # define LZMA_API(type) LZMA_API_IMPORT type LZMA_API_CALL
208
+ #endif
209
+
210
+
211
+ /***********
212
+ * nothrow *
213
+ ***********/
214
+
215
+ /*
216
+ * None of the functions in liblzma may throw an exception. Even
217
+ * the functions that use callback functions won't throw exceptions,
218
+ * because liblzma would break if a callback function threw an exception.
219
+ */
220
+ #ifndef lzma_nothrow
221
+ # if defined(__cplusplus)
222
+ # if __cplusplus >= 201103L || (defined(_MSVC_LANG) \
223
+ && _MSVC_LANG >= 201103L)
224
+ # define lzma_nothrow noexcept
225
+ # else
226
+ # define lzma_nothrow throw()
227
+ # endif
228
+ # elif defined(__GNUC__) && (__GNUC__ > 3 \
229
+ || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
230
+ # define lzma_nothrow __attribute__((__nothrow__))
231
+ # else
232
+ # define lzma_nothrow
233
+ # endif
234
+ #endif
235
+
236
+
237
+ /********************
238
+ * GNU C extensions *
239
+ ********************/
240
+
241
+ /*
242
+ * GNU C extensions are used conditionally in the public API. It doesn't
243
+ * break anything if these are sometimes enabled and sometimes not, only
244
+ * affects warnings and optimizations.
245
+ */
246
+ #if defined(__GNUC__) && __GNUC__ >= 3
247
+ # ifndef lzma_attribute
248
+ # define lzma_attribute(attr) __attribute__(attr)
249
+ # endif
250
+
251
+ /* warn_unused_result was added in GCC 3.4. */
252
+ # ifndef lzma_attr_warn_unused_result
253
+ # if __GNUC__ == 3 && __GNUC_MINOR__ < 4
254
+ # define lzma_attr_warn_unused_result
255
+ # endif
256
+ # endif
257
+
258
+ #else
259
+ # ifndef lzma_attribute
260
+ # define lzma_attribute(attr)
261
+ # endif
262
+ #endif
263
+
264
+
265
+ #ifndef lzma_attr_pure
266
+ # define lzma_attr_pure lzma_attribute((__pure__))
267
+ #endif
268
+
269
+ #ifndef lzma_attr_const
270
+ # define lzma_attr_const lzma_attribute((__const__))
271
+ #endif
272
+
273
+ #ifndef lzma_attr_warn_unused_result
274
+ # define lzma_attr_warn_unused_result \
275
+ lzma_attribute((__warn_unused_result__))
276
+ #endif
277
+
278
+
279
+ /**************
280
+ * Subheaders *
281
+ **************/
282
+
283
+ #ifdef __cplusplus
284
+ extern "C" {
285
+ #endif
286
+
287
+ /*
288
+ * Subheaders check that this is defined. It is to prevent including
289
+ * them directly from applications.
290
+ */
291
+ #define LZMA_H_INTERNAL 1
292
+
293
+ /* Basic features */
294
+ #include "lzma/version.h"
295
+ #include "lzma/base.h"
296
+ #include "lzma/vli.h"
297
+ #include "lzma/check.h"
298
+
299
+ /* Filters */
300
+ #include "lzma/filter.h"
301
+ #include "lzma/bcj.h"
302
+ #include "lzma/delta.h"
303
+ #include "lzma/lzma12.h"
304
+
305
+ /* Container formats */
306
+ #include "lzma/container.h"
307
+
308
+ /* Advanced features */
309
+ #include "lzma/stream_flags.h"
310
+ #include "lzma/block.h"
311
+ #include "lzma/index.h"
312
+ #include "lzma/index_hash.h"
313
+
314
+ /* Hardware information */
315
+ #include "lzma/hardware.h"
316
+
317
+ /*
318
+ * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications
319
+ * re-including the subheaders.
320
+ */
321
+ #undef LZMA_H_INTERNAL
322
+
323
+ #ifdef __cplusplus
324
+ }
325
+ #endif
326
+
327
+ #endif /* ifndef LZMA_H */
evalkit_llava/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 */
evalkit_llava/include/ncurses.h ADDED
The diff for this file is too large to render. See raw diff
 
evalkit_llava/include/ncurses_dll.h ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2018,2020 Thomas E. Dickey *
3
+ * Copyright 2009,2014 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
+ /* $Id: ncurses_dll.h.in,v 1.17 2020/09/05 17:58:47 juergen Exp $ */
30
+
31
+ #ifndef NCURSES_DLL_H_incl
32
+ #define NCURSES_DLL_H_incl 1
33
+
34
+ /*
35
+ * MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64.
36
+ */
37
+ #if defined(__MINGW64__)
38
+
39
+ #ifndef _WIN64
40
+ #define _WIN64 1
41
+ #endif
42
+
43
+ #elif defined(__MINGW32__)
44
+
45
+ #ifndef _WIN32
46
+ #define _WIN32 1
47
+ #endif
48
+
49
+ /* 2014-08-02 workaround for broken MinGW compiler.
50
+ * Oddly, only TRACE is mapped to trace - the other -D's are okay.
51
+ * suggest TDM as an alternative.
52
+ */
53
+ #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
54
+
55
+ #ifdef trace
56
+ #undef trace
57
+ #define TRACE
58
+ #endif
59
+
60
+ #endif /* broken compiler */
61
+
62
+ #endif /* MingW */
63
+
64
+ /*
65
+ * For reentrant code, we map the various global variables into SCREEN by
66
+ * using functions to access them.
67
+ */
68
+ #define NCURSES_PUBLIC_VAR(name) _nc_##name
69
+
70
+ #if defined(BUILDING_NCURSES)
71
+ # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
72
+ #else
73
+ # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
74
+ #endif
75
+
76
+ #define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
77
+
78
+ #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
79
+ #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
80
+
81
+ /*
82
+ * These symbols hide dllimport/dllexport, for compilers which care about it.
83
+ */
84
+ #if defined(__CYGWIN__) || (defined(_WIN32) || defined(_WIN64))
85
+ # if defined(NCURSES_STATIC) /* "static" here only implies "not-a-DLL" */
86
+ # define NCURSES_EXPORT_GENERAL_IMPORT
87
+ # define NCURSES_EXPORT_GENERAL_EXPORT
88
+ # else
89
+ # define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport)
90
+ # define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport)
91
+ # endif
92
+ # define NCURSES_API __cdecl
93
+ #else
94
+ # define NCURSES_EXPORT_GENERAL_IMPORT
95
+ # define NCURSES_EXPORT_GENERAL_EXPORT
96
+ # define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */
97
+ #endif
98
+
99
+ #endif /* NCURSES_DLL_H_incl */
evalkit_llava/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 */
evalkit_llava/include/pqStubs.h ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *-----------------------------------------------------------------------------
3
+ *
4
+ * ../generic/pqStubs.h --
5
+ *
6
+ * Stubs for procedures in pqStubDefs.txt
7
+ *
8
+ * Generated by genExtStubs.tcl: DO NOT EDIT
9
+ * 2015-06-26 12:55:15Z
10
+ *
11
+ *-----------------------------------------------------------------------------
12
+ */
13
+
14
+ typedef struct pqStubDefs {
15
+
16
+ /* Functions from libraries: pq */
17
+
18
+ const char* (*pg_encoding_to_charPtr)(int);
19
+ void (*PQclearPtr)(PGresult*);
20
+ int (*PQclientEncodingPtr)(const PGconn*);
21
+ char* (*PQcmdTuplesPtr)(PGresult*);
22
+ PGconn* (*PQconnectdbPtr)(const char*);
23
+ char* (*PQerrorMessagePtr)(const PGconn*);
24
+ PGresult* (*PQdescribePreparedPtr)(PGconn*, const char*);
25
+ PGresult* (*PQexecPtr)(PGconn*, const char*);
26
+ PGresult* (*PQexecPreparedPtr)(PGconn*, const char*, int, const char *const*, const int*, const int*, int);
27
+ char* (*PQdbPtr)(const PGconn *);
28
+ void (*PQfinishPtr)(PGconn*);
29
+ char* (*PQfnamePtr)(PGresult*, int);
30
+ int (*PQfnumberPtr)(const PGresult*, const char*);
31
+ Oid (*PQftypePtr)(const PGresult*, int);
32
+ int (*PQgetisnullPtr)(const PGresult*, int, int);
33
+ int (*PQgetlengthPtr)(const PGresult*, int, int);
34
+ char* (*PQgetvaluePtr)(const PGresult*, int, int);
35
+ char* (*PQhostPtr)(const PGconn*);
36
+ int (*PQnfieldsPtr)(const PGresult*);
37
+ int (*PQnparamsPtr)(const PGresult*);
38
+ int (*PQntuplesPtr)(const PGresult*);
39
+ char* (*PQoptionsPtr)(const PGconn*);
40
+ Oid (*PQparamtypePtr)(const PGresult*, int);
41
+ char* (*PQpassPtr)(const PGconn*);
42
+ char* (*PQportPtr)(const PGconn*);
43
+ PGresult* (*PQpreparePtr)(PGconn*, const char*, const char*, int, const Oid*);
44
+ char* (*PQresultErrorFieldPtr)(const PGresult*, int);
45
+ ExecStatusType (*PQresultStatusPtr)(const PGresult*);
46
+ int (*PQsetClientEncodingPtr)(PGconn*, const char*);
47
+ PQnoticeProcessor (*PQsetNoticeProcessorPtr)(PGconn*, PQnoticeProcessor, void*);
48
+ ConnStatusType (*PQstatusPtr)(PGconn*);
49
+ char* (*PQuserPtr)(const PGconn*);
50
+ char* (*PQttyPtr)(const PGconn*);
51
+ } pqStubDefs;
52
+ #define pg_encoding_to_char (pqStubs->pg_encoding_to_charPtr)
53
+ #define PQclear (pqStubs->PQclearPtr)
54
+ #define PQclientEncoding (pqStubs->PQclientEncodingPtr)
55
+ #define PQcmdTuples (pqStubs->PQcmdTuplesPtr)
56
+ #define PQconnectdb (pqStubs->PQconnectdbPtr)
57
+ #define PQerrorMessage (pqStubs->PQerrorMessagePtr)
58
+ #define PQdescribePrepared (pqStubs->PQdescribePreparedPtr)
59
+ #define PQexec (pqStubs->PQexecPtr)
60
+ #define PQexecPrepared (pqStubs->PQexecPreparedPtr)
61
+ #define PQdb (pqStubs->PQdbPtr)
62
+ #define PQfinish (pqStubs->PQfinishPtr)
63
+ #define PQfname (pqStubs->PQfnamePtr)
64
+ #define PQfnumber (pqStubs->PQfnumberPtr)
65
+ #define PQftype (pqStubs->PQftypePtr)
66
+ #define PQgetisnull (pqStubs->PQgetisnullPtr)
67
+ #define PQgetlength (pqStubs->PQgetlengthPtr)
68
+ #define PQgetvalue (pqStubs->PQgetvaluePtr)
69
+ #define PQhost (pqStubs->PQhostPtr)
70
+ #define PQnfields (pqStubs->PQnfieldsPtr)
71
+ #define PQnparams (pqStubs->PQnparamsPtr)
72
+ #define PQntuples (pqStubs->PQntuplesPtr)
73
+ #define PQoptions (pqStubs->PQoptionsPtr)
74
+ #define PQparamtype (pqStubs->PQparamtypePtr)
75
+ #define PQpass (pqStubs->PQpassPtr)
76
+ #define PQport (pqStubs->PQportPtr)
77
+ #define PQprepare (pqStubs->PQpreparePtr)
78
+ #define PQresultErrorField (pqStubs->PQresultErrorFieldPtr)
79
+ #define PQresultStatus (pqStubs->PQresultStatusPtr)
80
+ #define PQsetClientEncoding (pqStubs->PQsetClientEncodingPtr)
81
+ #define PQsetNoticeProcessor (pqStubs->PQsetNoticeProcessorPtr)
82
+ #define PQstatus (pqStubs->PQstatusPtr)
83
+ #define PQuser (pqStubs->PQuserPtr)
84
+ #define PQtty (pqStubs->PQttyPtr)
85
+ MODULE_SCOPE const pqStubDefs *pqStubs;
evalkit_llava/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 */
evalkit_llava/include/python3.10/cellobject.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Cell object interface */
2
+ #ifndef Py_LIMITED_API
3
+ #ifndef Py_CELLOBJECT_H
4
+ #define Py_CELLOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ typedef struct {
10
+ PyObject_HEAD
11
+ PyObject *ob_ref; /* Content of the cell or NULL when empty */
12
+ } PyCellObject;
13
+
14
+ PyAPI_DATA(PyTypeObject) PyCell_Type;
15
+
16
+ #define PyCell_Check(op) Py_IS_TYPE(op, &PyCell_Type)
17
+
18
+ PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
19
+ PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
20
+ PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
21
+
22
+ #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
23
+ #define PyCell_SET(op, v) ((void)(((PyCellObject *)(op))->ob_ref = v))
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
28
+ #endif /* !Py_TUPLEOBJECT_H */
29
+ #endif /* Py_LIMITED_API */
evalkit_llava/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 */
evalkit_llava/include/python3.10/dictobject.h ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_DICTOBJECT_H
2
+ #define Py_DICTOBJECT_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ /* Dictionary object type -- mapping from hashable object to object */
8
+
9
+ /* The distribution includes a separate file, Objects/dictnotes.txt,
10
+ describing explorations into dictionary design and optimization.
11
+ It covers typical dictionary use patterns, the parameters for
12
+ tuning dictionaries, and several ideas for possible optimizations.
13
+ */
14
+
15
+ PyAPI_DATA(PyTypeObject) PyDict_Type;
16
+
17
+ #define PyDict_Check(op) \
18
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
19
+ #define PyDict_CheckExact(op) Py_IS_TYPE(op, &PyDict_Type)
20
+
21
+ PyAPI_FUNC(PyObject *) PyDict_New(void);
22
+ PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
23
+ PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key);
24
+ PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
25
+ PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
26
+ PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
27
+ PyAPI_FUNC(int) PyDict_Next(
28
+ PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
29
+ PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
30
+ PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
31
+ PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
32
+ PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
33
+ PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
34
+ PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
35
+
36
+ /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
37
+ PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
38
+
39
+ /* PyDict_Merge updates/merges from a mapping object (an object that
40
+ supports PyMapping_Keys() and PyObject_GetItem()). If override is true,
41
+ the last occurrence of a key wins, else the first. The Python
42
+ dict.update(other) is equivalent to PyDict_Merge(dict, other, 1).
43
+ */
44
+ PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
45
+ PyObject *other,
46
+ int override);
47
+
48
+ /* PyDict_MergeFromSeq2 updates/merges from an iterable object producing
49
+ iterable objects of length 2. If override is true, the last occurrence
50
+ of a key wins, else the first. The Python dict constructor dict(seq2)
51
+ is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1).
52
+ */
53
+ PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
54
+ PyObject *seq2,
55
+ int override);
56
+
57
+ PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
58
+ PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
59
+ PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
60
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
61
+ PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *);
62
+ #endif
63
+
64
+ /* Dictionary (keys, values, items) views */
65
+
66
+ PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
67
+ PyAPI_DATA(PyTypeObject) PyDictValues_Type;
68
+ PyAPI_DATA(PyTypeObject) PyDictItems_Type;
69
+
70
+ #define PyDictKeys_Check(op) PyObject_TypeCheck(op, &PyDictKeys_Type)
71
+ #define PyDictValues_Check(op) PyObject_TypeCheck(op, &PyDictValues_Type)
72
+ #define PyDictItems_Check(op) PyObject_TypeCheck(op, &PyDictItems_Type)
73
+ /* This excludes Values, since they are not sets. */
74
+ # define PyDictViewSet_Check(op) \
75
+ (PyDictKeys_Check(op) || PyDictItems_Check(op))
76
+
77
+ /* Dictionary (key, value, items) iterators */
78
+
79
+ PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
80
+ PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
81
+ PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
82
+
83
+ PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type;
84
+ PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type;
85
+ PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type;
86
+
87
+
88
+ #ifndef Py_LIMITED_API
89
+ # define Py_CPYTHON_DICTOBJECT_H
90
+ # include "cpython/dictobject.h"
91
+ # undef Py_CPYTHON_DICTOBJECT_H
92
+ #endif
93
+
94
+ #ifdef __cplusplus
95
+ }
96
+ #endif
97
+ #endif /* !Py_DICTOBJECT_H */
evalkit_llava/include/python3.10/dynamic_annotations.h ADDED
@@ -0,0 +1,499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright (c) 2008-2009, Google Inc.
2
+ * All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions are
6
+ * met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright
9
+ * notice, this list of conditions and the following disclaimer.
10
+ * * Neither the name of Google Inc. nor the names of its
11
+ * contributors may be used to endorse or promote products derived from
12
+ * this software without specific prior written permission.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+ *
26
+ * ---
27
+ * Author: Kostya Serebryany
28
+ * Copied to CPython by Jeffrey Yasskin, with all macros renamed to
29
+ * start with _Py_ to avoid colliding with users embedding Python, and
30
+ * with deprecated macros removed.
31
+ */
32
+
33
+ /* This file defines dynamic annotations for use with dynamic analysis
34
+ tool such as valgrind, PIN, etc.
35
+
36
+ Dynamic annotation is a source code annotation that affects
37
+ the generated code (that is, the annotation is not a comment).
38
+ Each such annotation is attached to a particular
39
+ instruction and/or to a particular object (address) in the program.
40
+
41
+ The annotations that should be used by users are macros in all upper-case
42
+ (e.g., _Py_ANNOTATE_NEW_MEMORY).
43
+
44
+ Actual implementation of these macros may differ depending on the
45
+ dynamic analysis tool being used.
46
+
47
+ See https://code.google.com/p/data-race-test/ for more information.
48
+
49
+ This file supports the following dynamic analysis tools:
50
+ - None (DYNAMIC_ANNOTATIONS_ENABLED is not defined or zero).
51
+ Macros are defined empty.
52
+ - ThreadSanitizer, Helgrind, DRD (DYNAMIC_ANNOTATIONS_ENABLED is 1).
53
+ Macros are defined as calls to non-inlinable empty functions
54
+ that are intercepted by Valgrind. */
55
+
56
+ #ifndef __DYNAMIC_ANNOTATIONS_H__
57
+ #define __DYNAMIC_ANNOTATIONS_H__
58
+
59
+ #ifndef DYNAMIC_ANNOTATIONS_ENABLED
60
+ # define DYNAMIC_ANNOTATIONS_ENABLED 0
61
+ #endif
62
+
63
+ #if DYNAMIC_ANNOTATIONS_ENABLED != 0
64
+
65
+ /* -------------------------------------------------------------
66
+ Annotations useful when implementing condition variables such as CondVar,
67
+ using conditional critical sections (Await/LockWhen) and when constructing
68
+ user-defined synchronization mechanisms.
69
+
70
+ The annotations _Py_ANNOTATE_HAPPENS_BEFORE() and
71
+ _Py_ANNOTATE_HAPPENS_AFTER() can be used to define happens-before arcs in
72
+ user-defined synchronization mechanisms: the race detector will infer an
73
+ arc from the former to the latter when they share the same argument
74
+ pointer.
75
+
76
+ Example 1 (reference counting):
77
+
78
+ void Unref() {
79
+ _Py_ANNOTATE_HAPPENS_BEFORE(&refcount_);
80
+ if (AtomicDecrementByOne(&refcount_) == 0) {
81
+ _Py_ANNOTATE_HAPPENS_AFTER(&refcount_);
82
+ delete this;
83
+ }
84
+ }
85
+
86
+ Example 2 (message queue):
87
+
88
+ void MyQueue::Put(Type *e) {
89
+ MutexLock lock(&mu_);
90
+ _Py_ANNOTATE_HAPPENS_BEFORE(e);
91
+ PutElementIntoMyQueue(e);
92
+ }
93
+
94
+ Type *MyQueue::Get() {
95
+ MutexLock lock(&mu_);
96
+ Type *e = GetElementFromMyQueue();
97
+ _Py_ANNOTATE_HAPPENS_AFTER(e);
98
+ return e;
99
+ }
100
+
101
+ Note: when possible, please use the existing reference counting and message
102
+ queue implementations instead of inventing new ones. */
103
+
104
+ /* Report that wait on the condition variable at address "cv" has succeeded
105
+ and the lock at address "lock" is held. */
106
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) \
107
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, lock)
108
+
109
+ /* Report that wait on the condition variable at "cv" has succeeded. Variant
110
+ w/o lock. */
111
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) \
112
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, NULL)
113
+
114
+ /* Report that we are about to signal on the condition variable at address
115
+ "cv". */
116
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) \
117
+ AnnotateCondVarSignal(__FILE__, __LINE__, cv)
118
+
119
+ /* Report that we are about to signal_all on the condition variable at "cv". */
120
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) \
121
+ AnnotateCondVarSignalAll(__FILE__, __LINE__, cv)
122
+
123
+ /* Annotations for user-defined synchronization mechanisms. */
124
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) _Py_ANNOTATE_CONDVAR_SIGNAL(obj)
125
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) _Py_ANNOTATE_CONDVAR_WAIT(obj)
126
+
127
+ /* Report that the bytes in the range [pointer, pointer+size) are about
128
+ to be published safely. The race checker will create a happens-before
129
+ arc from the call _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) to
130
+ subsequent accesses to this memory.
131
+ Note: this annotation may not work properly if the race detector uses
132
+ sampling, i.e. does not observe all memory accesses.
133
+ */
134
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) \
135
+ AnnotatePublishMemoryRange(__FILE__, __LINE__, pointer, size)
136
+
137
+ /* Instruct the tool to create a happens-before arc between mu->Unlock() and
138
+ mu->Lock(). This annotation may slow down the race detector and hide real
139
+ races. Normally it is used only when it would be difficult to annotate each
140
+ of the mutex's critical sections individually using the annotations above.
141
+ This annotation makes sense only for hybrid race detectors. For pure
142
+ happens-before detectors this is a no-op. For more details see
143
+ https://code.google.com/p/data-race-test/wiki/PureHappensBeforeVsHybrid . */
144
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) \
145
+ AnnotateMutexIsUsedAsCondVar(__FILE__, __LINE__, mu)
146
+
147
+ /* -------------------------------------------------------------
148
+ Annotations useful when defining memory allocators, or when memory that
149
+ was protected in one way starts to be protected in another. */
150
+
151
+ /* Report that a new memory at "address" of size "size" has been allocated.
152
+ This might be used when the memory has been retrieved from a free list and
153
+ is about to be reused, or when the locking discipline for a variable
154
+ changes. */
155
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) \
156
+ AnnotateNewMemory(__FILE__, __LINE__, address, size)
157
+
158
+ /* -------------------------------------------------------------
159
+ Annotations useful when defining FIFO queues that transfer data between
160
+ threads. */
161
+
162
+ /* Report that the producer-consumer queue (such as ProducerConsumerQueue) at
163
+ address "pcq" has been created. The _Py_ANNOTATE_PCQ_* annotations should
164
+ be used only for FIFO queues. For non-FIFO queues use
165
+ _Py_ANNOTATE_HAPPENS_BEFORE (for put) and _Py_ANNOTATE_HAPPENS_AFTER (for
166
+ get). */
167
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) \
168
+ AnnotatePCQCreate(__FILE__, __LINE__, pcq)
169
+
170
+ /* Report that the queue at address "pcq" is about to be destroyed. */
171
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) \
172
+ AnnotatePCQDestroy(__FILE__, __LINE__, pcq)
173
+
174
+ /* Report that we are about to put an element into a FIFO queue at address
175
+ "pcq". */
176
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) \
177
+ AnnotatePCQPut(__FILE__, __LINE__, pcq)
178
+
179
+ /* Report that we've just got an element from a FIFO queue at address "pcq". */
180
+ #define _Py_ANNOTATE_PCQ_GET(pcq) \
181
+ AnnotatePCQGet(__FILE__, __LINE__, pcq)
182
+
183
+ /* -------------------------------------------------------------
184
+ Annotations that suppress errors. It is usually better to express the
185
+ program's synchronization using the other annotations, but these can
186
+ be used when all else fails. */
187
+
188
+ /* Report that we may have a benign race at "pointer", with size
189
+ "sizeof(*(pointer))". "pointer" must be a non-void* pointer. Insert at the
190
+ point where "pointer" has been allocated, preferably close to the point
191
+ where the race happens. See also _Py_ANNOTATE_BENIGN_RACE_STATIC. */
192
+ #define _Py_ANNOTATE_BENIGN_RACE(pointer, description) \
193
+ AnnotateBenignRaceSized(__FILE__, __LINE__, pointer, \
194
+ sizeof(*(pointer)), description)
195
+
196
+ /* Same as _Py_ANNOTATE_BENIGN_RACE(address, description), but applies to
197
+ the memory range [address, address+size). */
198
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
199
+ AnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description)
200
+
201
+ /* Request the analysis tool to ignore all reads in the current thread
202
+ until _Py_ANNOTATE_IGNORE_READS_END is called.
203
+ Useful to ignore intentional racey reads, while still checking
204
+ other reads and all writes.
205
+ See also _Py_ANNOTATE_UNPROTECTED_READ. */
206
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() \
207
+ AnnotateIgnoreReadsBegin(__FILE__, __LINE__)
208
+
209
+ /* Stop ignoring reads. */
210
+ #define _Py_ANNOTATE_IGNORE_READS_END() \
211
+ AnnotateIgnoreReadsEnd(__FILE__, __LINE__)
212
+
213
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes. */
214
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() \
215
+ AnnotateIgnoreWritesBegin(__FILE__, __LINE__)
216
+
217
+ /* Stop ignoring writes. */
218
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() \
219
+ AnnotateIgnoreWritesEnd(__FILE__, __LINE__)
220
+
221
+ /* Start ignoring all memory accesses (reads and writes). */
222
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
223
+ do {\
224
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();\
225
+ _Py_ANNOTATE_IGNORE_WRITES_BEGIN();\
226
+ }while(0)\
227
+
228
+ /* Stop ignoring all memory accesses. */
229
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() \
230
+ do {\
231
+ _Py_ANNOTATE_IGNORE_WRITES_END();\
232
+ _Py_ANNOTATE_IGNORE_READS_END();\
233
+ }while(0)\
234
+
235
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore synchronization events:
236
+ RWLOCK* and CONDVAR*. */
237
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() \
238
+ AnnotateIgnoreSyncBegin(__FILE__, __LINE__)
239
+
240
+ /* Stop ignoring sync events. */
241
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() \
242
+ AnnotateIgnoreSyncEnd(__FILE__, __LINE__)
243
+
244
+
245
+ /* Enable (enable!=0) or disable (enable==0) race detection for all threads.
246
+ This annotation could be useful if you want to skip expensive race analysis
247
+ during some period of program execution, e.g. during initialization. */
248
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
249
+ AnnotateEnableRaceDetection(__FILE__, __LINE__, enable)
250
+
251
+ /* -------------------------------------------------------------
252
+ Annotations useful for debugging. */
253
+
254
+ /* Request to trace every access to "address". */
255
+ #define _Py_ANNOTATE_TRACE_MEMORY(address) \
256
+ AnnotateTraceMemory(__FILE__, __LINE__, address)
257
+
258
+ /* Report the current thread name to a race detector. */
259
+ #define _Py_ANNOTATE_THREAD_NAME(name) \
260
+ AnnotateThreadName(__FILE__, __LINE__, name)
261
+
262
+ /* -------------------------------------------------------------
263
+ Annotations useful when implementing locks. They are not
264
+ normally needed by modules that merely use locks.
265
+ The "lock" argument is a pointer to the lock object. */
266
+
267
+ /* Report that a lock has been created at address "lock". */
268
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) \
269
+ AnnotateRWLockCreate(__FILE__, __LINE__, lock)
270
+
271
+ /* Report that the lock at address "lock" is about to be destroyed. */
272
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) \
273
+ AnnotateRWLockDestroy(__FILE__, __LINE__, lock)
274
+
275
+ /* Report that the lock at address "lock" has been acquired.
276
+ is_w=1 for writer lock, is_w=0 for reader lock. */
277
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
278
+ AnnotateRWLockAcquired(__FILE__, __LINE__, lock, is_w)
279
+
280
+ /* Report that the lock at address "lock" is about to be released. */
281
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
282
+ AnnotateRWLockReleased(__FILE__, __LINE__, lock, is_w)
283
+
284
+ /* -------------------------------------------------------------
285
+ Annotations useful when implementing barriers. They are not
286
+ normally needed by modules that merely use barriers.
287
+ The "barrier" argument is a pointer to the barrier object. */
288
+
289
+ /* Report that the "barrier" has been initialized with initial "count".
290
+ If 'reinitialization_allowed' is true, initialization is allowed to happen
291
+ multiple times w/o calling barrier_destroy() */
292
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
293
+ AnnotateBarrierInit(__FILE__, __LINE__, barrier, count, \
294
+ reinitialization_allowed)
295
+
296
+ /* Report that we are about to enter barrier_wait("barrier"). */
297
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
298
+ AnnotateBarrierWaitBefore(__FILE__, __LINE__, barrier)
299
+
300
+ /* Report that we just exited barrier_wait("barrier"). */
301
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
302
+ AnnotateBarrierWaitAfter(__FILE__, __LINE__, barrier)
303
+
304
+ /* Report that the "barrier" has been destroyed. */
305
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) \
306
+ AnnotateBarrierDestroy(__FILE__, __LINE__, barrier)
307
+
308
+ /* -------------------------------------------------------------
309
+ Annotations useful for testing race detectors. */
310
+
311
+ /* Report that we expect a race on the variable at "address".
312
+ Use only in unit tests for a race detector. */
313
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) \
314
+ AnnotateExpectRace(__FILE__, __LINE__, address, description)
315
+
316
+ /* A no-op. Insert where you like to test the interceptors. */
317
+ #define _Py_ANNOTATE_NO_OP(arg) \
318
+ AnnotateNoOp(__FILE__, __LINE__, arg)
319
+
320
+ /* Force the race detector to flush its state. The actual effect depends on
321
+ * the implementation of the detector. */
322
+ #define _Py_ANNOTATE_FLUSH_STATE() \
323
+ AnnotateFlushState(__FILE__, __LINE__)
324
+
325
+
326
+ #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
327
+
328
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) /* empty */
329
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) /* empty */
330
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) /* empty */
331
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) /* empty */
332
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) /* */
333
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) /* empty */
334
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) /* empty */
335
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) /* empty */
336
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) /* empty */
337
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) /* empty */
338
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) /* empty */
339
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) /* empty */
340
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
341
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) /* empty */
342
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(address, size) /* empty */
343
+ #define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size) /* empty */
344
+ #define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size) /* empty */
345
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) /* empty */
346
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) /* empty */
347
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) /* empty */
348
+ #define _Py_ANNOTATE_PCQ_GET(pcq) /* empty */
349
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) /* empty */
350
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) /* empty */
351
+ #define _Py_ANNOTATE_BENIGN_RACE(address, description) /* empty */
352
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) /* empty */
353
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) /* empty */
354
+ #define _Py_ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mu) /* empty */
355
+ #define _Py_ANNOTATE_TRACE_MEMORY(arg) /* empty */
356
+ #define _Py_ANNOTATE_THREAD_NAME(name) /* empty */
357
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() /* empty */
358
+ #define _Py_ANNOTATE_IGNORE_READS_END() /* empty */
359
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() /* empty */
360
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() /* empty */
361
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() /* empty */
362
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() /* empty */
363
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() /* empty */
364
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() /* empty */
365
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) /* empty */
366
+ #define _Py_ANNOTATE_NO_OP(arg) /* empty */
367
+ #define _Py_ANNOTATE_FLUSH_STATE() /* empty */
368
+
369
+ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */
370
+
371
+ /* Use the macros above rather than using these functions directly. */
372
+ #ifdef __cplusplus
373
+ extern "C" {
374
+ #endif
375
+ void AnnotateRWLockCreate(const char *file, int line,
376
+ const volatile void *lock);
377
+ void AnnotateRWLockDestroy(const char *file, int line,
378
+ const volatile void *lock);
379
+ void AnnotateRWLockAcquired(const char *file, int line,
380
+ const volatile void *lock, long is_w);
381
+ void AnnotateRWLockReleased(const char *file, int line,
382
+ const volatile void *lock, long is_w);
383
+ void AnnotateBarrierInit(const char *file, int line,
384
+ const volatile void *barrier, long count,
385
+ long reinitialization_allowed);
386
+ void AnnotateBarrierWaitBefore(const char *file, int line,
387
+ const volatile void *barrier);
388
+ void AnnotateBarrierWaitAfter(const char *file, int line,
389
+ const volatile void *barrier);
390
+ void AnnotateBarrierDestroy(const char *file, int line,
391
+ const volatile void *barrier);
392
+ void AnnotateCondVarWait(const char *file, int line,
393
+ const volatile void *cv,
394
+ const volatile void *lock);
395
+ void AnnotateCondVarSignal(const char *file, int line,
396
+ const volatile void *cv);
397
+ void AnnotateCondVarSignalAll(const char *file, int line,
398
+ const volatile void *cv);
399
+ void AnnotatePublishMemoryRange(const char *file, int line,
400
+ const volatile void *address,
401
+ long size);
402
+ void AnnotateUnpublishMemoryRange(const char *file, int line,
403
+ const volatile void *address,
404
+ long size);
405
+ void AnnotatePCQCreate(const char *file, int line,
406
+ const volatile void *pcq);
407
+ void AnnotatePCQDestroy(const char *file, int line,
408
+ const volatile void *pcq);
409
+ void AnnotatePCQPut(const char *file, int line,
410
+ const volatile void *pcq);
411
+ void AnnotatePCQGet(const char *file, int line,
412
+ const volatile void *pcq);
413
+ void AnnotateNewMemory(const char *file, int line,
414
+ const volatile void *address,
415
+ long size);
416
+ void AnnotateExpectRace(const char *file, int line,
417
+ const volatile void *address,
418
+ const char *description);
419
+ void AnnotateBenignRace(const char *file, int line,
420
+ const volatile void *address,
421
+ const char *description);
422
+ void AnnotateBenignRaceSized(const char *file, int line,
423
+ const volatile void *address,
424
+ long size,
425
+ const char *description);
426
+ void AnnotateMutexIsUsedAsCondVar(const char *file, int line,
427
+ const volatile void *mu);
428
+ void AnnotateTraceMemory(const char *file, int line,
429
+ const volatile void *arg);
430
+ void AnnotateThreadName(const char *file, int line,
431
+ const char *name);
432
+ void AnnotateIgnoreReadsBegin(const char *file, int line);
433
+ void AnnotateIgnoreReadsEnd(const char *file, int line);
434
+ void AnnotateIgnoreWritesBegin(const char *file, int line);
435
+ void AnnotateIgnoreWritesEnd(const char *file, int line);
436
+ void AnnotateEnableRaceDetection(const char *file, int line, int enable);
437
+ void AnnotateNoOp(const char *file, int line,
438
+ const volatile void *arg);
439
+ void AnnotateFlushState(const char *file, int line);
440
+
441
+ /* Return non-zero value if running under valgrind.
442
+
443
+ If "valgrind.h" is included into dynamic_annotations.c,
444
+ the regular valgrind mechanism will be used.
445
+ See http://valgrind.org/docs/manual/manual-core-adv.html about
446
+ RUNNING_ON_VALGRIND and other valgrind "client requests".
447
+ The file "valgrind.h" may be obtained by doing
448
+ svn co svn://svn.valgrind.org/valgrind/trunk/include
449
+
450
+ If for some reason you can't use "valgrind.h" or want to fake valgrind,
451
+ there are two ways to make this function return non-zero:
452
+ - Use environment variable: export RUNNING_ON_VALGRIND=1
453
+ - Make your tool intercept the function RunningOnValgrind() and
454
+ change its return value.
455
+ */
456
+ int RunningOnValgrind(void);
457
+
458
+ #ifdef __cplusplus
459
+ }
460
+ #endif
461
+
462
+ #if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus)
463
+
464
+ /* _Py_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
465
+
466
+ Instead of doing
467
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
468
+ ... = x;
469
+ _Py_ANNOTATE_IGNORE_READS_END();
470
+ one can use
471
+ ... = _Py_ANNOTATE_UNPROTECTED_READ(x); */
472
+ template <class T>
473
+ inline T _Py_ANNOTATE_UNPROTECTED_READ(const volatile T &x) {
474
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
475
+ T res = x;
476
+ _Py_ANNOTATE_IGNORE_READS_END();
477
+ return res;
478
+ }
479
+ /* Apply _Py_ANNOTATE_BENIGN_RACE_SIZED to a static variable. */
480
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
481
+ namespace { \
482
+ class static_var ## _annotator { \
483
+ public: \
484
+ static_var ## _annotator() { \
485
+ _Py_ANNOTATE_BENIGN_RACE_SIZED(&static_var, \
486
+ sizeof(static_var), \
487
+ # static_var ": " description); \
488
+ } \
489
+ }; \
490
+ static static_var ## _annotator the ## static_var ## _annotator;\
491
+ }
492
+ #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
493
+
494
+ #define _Py_ANNOTATE_UNPROTECTED_READ(x) (x)
495
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) /* empty */
496
+
497
+ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */
498
+
499
+ #endif /* __DYNAMIC_ANNOTATIONS_H__ */
evalkit_llava/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 */
evalkit_llava/include/python3.10/exports.h ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_EXPORTS_H
2
+ #define Py_EXPORTS_H
3
+
4
+ #if defined(_WIN32) || defined(__CYGWIN__)
5
+ #define Py_IMPORTED_SYMBOL __declspec(dllimport)
6
+ #define Py_EXPORTED_SYMBOL __declspec(dllexport)
7
+ #define Py_LOCAL_SYMBOL
8
+ #else
9
+ /*
10
+ * If we only ever used gcc >= 5, we could use __has_attribute(visibility)
11
+ * as a cross-platform way to determine if visibility is supported. However,
12
+ * we may still need to support gcc >= 4, as some Ubuntu LTS and Centos versions
13
+ * have 4 < gcc < 5.
14
+ */
15
+ #ifndef __has_attribute
16
+ #define __has_attribute(x) 0 // Compatibility with non-clang compilers.
17
+ #endif
18
+ #if (defined(__GNUC__) && (__GNUC__ >= 4)) ||\
19
+ (defined(__clang__) && __has_attribute(visibility))
20
+ #define Py_IMPORTED_SYMBOL __attribute__ ((visibility ("default")))
21
+ #define Py_EXPORTED_SYMBOL __attribute__ ((visibility ("default")))
22
+ #define Py_LOCAL_SYMBOL __attribute__ ((visibility ("hidden")))
23
+ #else
24
+ #define Py_IMPORTED_SYMBOL
25
+ #define Py_EXPORTED_SYMBOL
26
+ #define Py_LOCAL_SYMBOL
27
+ #endif
28
+ #endif
29
+
30
+ #endif /* Py_EXPORTS_H */
evalkit_llava/include/python3.10/fileutils.h ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_FILEUTILS_H
2
+ #define Py_FILEUTILS_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
8
+ PyAPI_FUNC(wchar_t *) Py_DecodeLocale(
9
+ const char *arg,
10
+ size_t *size);
11
+
12
+ PyAPI_FUNC(char*) Py_EncodeLocale(
13
+ const wchar_t *text,
14
+ size_t *error_pos);
15
+ #endif
16
+
17
+ #ifndef Py_LIMITED_API
18
+ # define Py_CPYTHON_FILEUTILS_H
19
+ # include "cpython/fileutils.h"
20
+ # undef Py_CPYTHON_FILEUTILS_H
21
+ #endif
22
+
23
+ #ifdef __cplusplus
24
+ }
25
+ #endif
26
+ #endif /* !Py_FILEUTILS_H */
evalkit_llava/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 */
evalkit_llava/include/python3.10/funcobject.h ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Function object interface */
3
+ #ifndef Py_LIMITED_API
4
+ #ifndef Py_FUNCOBJECT_H
5
+ #define Py_FUNCOBJECT_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+
11
+ #define COMMON_FIELDS(PREFIX) \
12
+ PyObject *PREFIX ## globals; \
13
+ PyObject *PREFIX ## builtins; \
14
+ PyObject *PREFIX ## name; \
15
+ PyObject *PREFIX ## qualname; \
16
+ PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \
17
+ PyObject *PREFIX ## defaults; /* NULL or a tuple */ \
18
+ PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \
19
+ PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
20
+
21
+ typedef struct {
22
+ COMMON_FIELDS(fc_)
23
+ } PyFrameConstructor;
24
+
25
+ /* Function objects and code objects should not be confused with each other:
26
+ *
27
+ * Function objects are created by the execution of the 'def' statement.
28
+ * They reference a code object in their __code__ attribute, which is a
29
+ * purely syntactic object, i.e. nothing more than a compiled version of some
30
+ * source code lines. There is one code object per source code "fragment",
31
+ * but each code object can be referenced by zero or many function objects
32
+ * depending only on how many times the 'def' statement in the source was
33
+ * executed so far.
34
+ */
35
+
36
+ typedef struct {
37
+ PyObject_HEAD
38
+ COMMON_FIELDS(func_)
39
+ PyObject *func_doc; /* The __doc__ attribute, can be anything */
40
+ PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
41
+ PyObject *func_weakreflist; /* List of weak references */
42
+ PyObject *func_module; /* The __module__ attribute, can be anything */
43
+ PyObject *func_annotations; /* Annotations, a dict or NULL */
44
+ vectorcallfunc vectorcall;
45
+
46
+ /* Invariant:
47
+ * func_closure contains the bindings for func_code->co_freevars, so
48
+ * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code)
49
+ * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0).
50
+ */
51
+ } PyFunctionObject;
52
+
53
+ PyAPI_DATA(PyTypeObject) PyFunction_Type;
54
+
55
+ #define PyFunction_Check(op) Py_IS_TYPE(op, &PyFunction_Type)
56
+
57
+ PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
58
+ PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *);
59
+ PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);
60
+ PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *);
61
+ PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *);
62
+ PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
63
+ PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
64
+ PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *);
65
+ PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
66
+ PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
67
+ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
68
+ PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
69
+ PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
70
+
71
+ #ifndef Py_LIMITED_API
72
+ PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
73
+ PyObject *func,
74
+ PyObject *const *stack,
75
+ size_t nargsf,
76
+ PyObject *kwnames);
77
+ #endif
78
+
79
+ /* Macros for direct access to these values. Type checks are *not*
80
+ done, so use with care. */
81
+ #define PyFunction_GET_CODE(func) \
82
+ (((PyFunctionObject *)func) -> func_code)
83
+ #define PyFunction_GET_GLOBALS(func) \
84
+ (((PyFunctionObject *)func) -> func_globals)
85
+ #define PyFunction_GET_MODULE(func) \
86
+ (((PyFunctionObject *)func) -> func_module)
87
+ #define PyFunction_GET_DEFAULTS(func) \
88
+ (((PyFunctionObject *)func) -> func_defaults)
89
+ #define PyFunction_GET_KW_DEFAULTS(func) \
90
+ (((PyFunctionObject *)func) -> func_kwdefaults)
91
+ #define PyFunction_GET_CLOSURE(func) \
92
+ (((PyFunctionObject *)func) -> func_closure)
93
+ #define PyFunction_GET_ANNOTATIONS(func) \
94
+ (((PyFunctionObject *)func) -> func_annotations)
95
+
96
+ #define PyFunction_AS_FRAME_CONSTRUCTOR(func) \
97
+ ((PyFrameConstructor *)&((PyFunctionObject *)(func))->func_globals)
98
+
99
+ /* The classmethod and staticmethod types lives here, too */
100
+ PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
101
+ PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
102
+
103
+ PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
104
+ PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
105
+
106
+ #ifdef __cplusplus
107
+ }
108
+ #endif
109
+ #endif /* !Py_FUNCOBJECT_H */
110
+ #endif /* Py_LIMITED_API */
evalkit_llava/include/python3.10/import.h ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Module definition and import interface */
2
+
3
+ #ifndef Py_IMPORT_H
4
+ #define Py_IMPORT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
10
+ PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
11
+ PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
12
+ const char *name, /* UTF-8 encoded string */
13
+ PyObject *co
14
+ );
15
+ PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
16
+ const char *name, /* UTF-8 encoded string */
17
+ PyObject *co,
18
+ const char *pathname /* decoded from the filesystem encoding */
19
+ );
20
+ PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
21
+ const char *name, /* UTF-8 encoded string */
22
+ PyObject *co,
23
+ const char *pathname, /* decoded from the filesystem encoding */
24
+ const char *cpathname /* decoded from the filesystem encoding */
25
+ );
26
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
27
+ PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
28
+ PyObject *name,
29
+ PyObject *co,
30
+ PyObject *pathname,
31
+ PyObject *cpathname
32
+ );
33
+ #endif
34
+ PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
35
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
36
+ PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name);
37
+ #endif
38
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
39
+ PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
40
+ PyObject *name
41
+ );
42
+ #endif
43
+ PyAPI_FUNC(PyObject *) PyImport_AddModule(
44
+ const char *name /* UTF-8 encoded string */
45
+ );
46
+ PyAPI_FUNC(PyObject *) PyImport_ImportModule(
47
+ const char *name /* UTF-8 encoded string */
48
+ );
49
+ PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
50
+ const char *name /* UTF-8 encoded string */
51
+ );
52
+ PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
53
+ const char *name, /* UTF-8 encoded string */
54
+ PyObject *globals,
55
+ PyObject *locals,
56
+ PyObject *fromlist,
57
+ int level
58
+ );
59
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
60
+ PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
61
+ PyObject *name,
62
+ PyObject *globals,
63
+ PyObject *locals,
64
+ PyObject *fromlist,
65
+ int level
66
+ );
67
+ #endif
68
+
69
+ #define PyImport_ImportModuleEx(n, g, l, f) \
70
+ PyImport_ImportModuleLevel(n, g, l, f, 0)
71
+
72
+ PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
73
+ PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
74
+ PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
75
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
76
+ PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
77
+ PyObject *name
78
+ );
79
+ #endif
80
+ PyAPI_FUNC(int) PyImport_ImportFrozenModule(
81
+ const char *name /* UTF-8 encoded string */
82
+ );
83
+
84
+ PyAPI_FUNC(int) PyImport_AppendInittab(
85
+ const char *name, /* ASCII encoded string */
86
+ PyObject* (*initfunc)(void)
87
+ );
88
+
89
+ #ifndef Py_LIMITED_API
90
+ # define Py_CPYTHON_IMPORT_H
91
+ # include "cpython/import.h"
92
+ # undef Py_CPYTHON_IMPORT_H
93
+ #endif
94
+
95
+ #ifdef __cplusplus
96
+ }
97
+ #endif
98
+ #endif /* !Py_IMPORT_H */
evalkit_llava/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 */
evalkit_llava/include/python3.10/listobject.h ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* List object interface
2
+
3
+ Another generally useful object type is a list of object pointers.
4
+ This is a mutable type: the list items can be changed, and items can be
5
+ added or removed. Out-of-range indices or non-list objects are ignored.
6
+
7
+ WARNING: PyList_SetItem does not increment the new item's reference count,
8
+ but does decrement the reference count of the item it replaces, if not nil.
9
+ It does *decrement* the reference count if it is *not* inserted in the list.
10
+ Similarly, PyList_GetItem does not increment the returned item's reference
11
+ count.
12
+ */
13
+
14
+ #ifndef Py_LISTOBJECT_H
15
+ #define Py_LISTOBJECT_H
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ PyAPI_DATA(PyTypeObject) PyList_Type;
21
+ PyAPI_DATA(PyTypeObject) PyListIter_Type;
22
+ PyAPI_DATA(PyTypeObject) PyListRevIter_Type;
23
+
24
+ #define PyList_Check(op) \
25
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
26
+ #define PyList_CheckExact(op) Py_IS_TYPE(op, &PyList_Type)
27
+
28
+ PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
29
+ PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
30
+
31
+ PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t);
32
+ PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
33
+ PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
34
+ PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
35
+
36
+ PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
37
+ PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
38
+
39
+ PyAPI_FUNC(int) PyList_Sort(PyObject *);
40
+ PyAPI_FUNC(int) PyList_Reverse(PyObject *);
41
+ PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
42
+
43
+ #ifndef Py_LIMITED_API
44
+ # define Py_CPYTHON_LISTOBJECT_H
45
+ # include "cpython/listobject.h"
46
+ # undef Py_CPYTHON_LISTOBJECT_H
47
+ #endif
48
+
49
+ #ifdef __cplusplus
50
+ }
51
+ #endif
52
+ #endif /* !Py_LISTOBJECT_H */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/include/python3.10/py_curses.h ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #ifndef Py_CURSES_H
3
+ #define Py_CURSES_H
4
+
5
+ #ifdef __APPLE__
6
+ /*
7
+ ** On Mac OS X 10.2 [n]curses.h and stdlib.h use different guards
8
+ ** against multiple definition of wchar_t.
9
+ */
10
+ #ifdef _BSD_WCHAR_T_DEFINED_
11
+ #define _WCHAR_T
12
+ #endif
13
+ #endif /* __APPLE__ */
14
+
15
+ /* On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards
16
+ against multiple definition of wchar_t and wint_t. */
17
+ #if defined(__FreeBSD__) && defined(_XOPEN_SOURCE_EXTENDED)
18
+ # ifndef __wchar_t
19
+ # define __wchar_t
20
+ # endif
21
+ # ifndef __wint_t
22
+ # define __wint_t
23
+ # endif
24
+ #endif
25
+
26
+ #if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS)
27
+ /* The following definition is necessary for ncurses 5.7; without it,
28
+ some of [n]curses.h set NCURSES_OPAQUE to 1, and then Python
29
+ can't get at the WINDOW flags field. */
30
+ #define NCURSES_OPAQUE 0
31
+ #endif
32
+
33
+ #ifdef HAVE_NCURSES_H
34
+ #include <ncurses.h>
35
+ #else
36
+ #include <curses.h>
37
+ #endif
38
+
39
+ #ifdef HAVE_NCURSES_H
40
+ /* configure was checking <curses.h>, but we will
41
+ use <ncurses.h>, which has some or all these features. */
42
+ #if !defined(WINDOW_HAS_FLAGS) && !(NCURSES_OPAQUE+0)
43
+ #define WINDOW_HAS_FLAGS 1
44
+ #endif
45
+ #if !defined(HAVE_CURSES_IS_PAD) && NCURSES_VERSION_PATCH+0 >= 20090906
46
+ #define HAVE_CURSES_IS_PAD 1
47
+ #endif
48
+ #ifndef MVWDELCH_IS_EXPRESSION
49
+ #define MVWDELCH_IS_EXPRESSION 1
50
+ #endif
51
+ #endif
52
+
53
+ #ifdef __cplusplus
54
+ extern "C" {
55
+ #endif
56
+
57
+ #define PyCurses_API_pointers 4
58
+
59
+ /* Type declarations */
60
+
61
+ typedef struct {
62
+ PyObject_HEAD
63
+ WINDOW *win;
64
+ char *encoding;
65
+ } PyCursesWindowObject;
66
+
67
+ #define PyCursesWindow_Check(v) Py_IS_TYPE(v, &PyCursesWindow_Type)
68
+
69
+ #define PyCurses_CAPSULE_NAME "_curses._C_API"
70
+
71
+
72
+ #ifdef CURSES_MODULE
73
+ /* This section is used when compiling _cursesmodule.c */
74
+
75
+ #else
76
+ /* This section is used in modules that use the _cursesmodule API */
77
+
78
+ static void **PyCurses_API;
79
+
80
+ #define PyCursesWindow_Type (*(PyTypeObject *) PyCurses_API[0])
81
+ #define PyCursesSetupTermCalled {if (! ((int (*)(void))PyCurses_API[1]) () ) return NULL;}
82
+ #define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;}
83
+ #define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;}
84
+
85
+ #define import_curses() \
86
+ PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1);
87
+
88
+ #endif
89
+
90
+ /* general error messages */
91
+ static const char catchall_ERR[] = "curses function returned ERR";
92
+ static const char catchall_NULL[] = "curses function returned NULL";
93
+
94
+ #ifdef __cplusplus
95
+ }
96
+ #endif
97
+
98
+ #endif /* !defined(Py_CURSES_H) */
99
+
evalkit_llava/include/python3.10/pycapsule.h ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Capsule objects let you wrap a C "void *" pointer in a Python
3
+ object. They're a way of passing data through the Python interpreter
4
+ without creating your own custom type.
5
+
6
+ Capsules are used for communication between extension modules.
7
+ They provide a way for an extension module to export a C interface
8
+ to other extension modules, so that extension modules can use the
9
+ Python import mechanism to link to one another.
10
+
11
+ For more information, please see "c-api/capsule.html" in the
12
+ documentation.
13
+ */
14
+
15
+ #ifndef Py_CAPSULE_H
16
+ #define Py_CAPSULE_H
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ PyAPI_DATA(PyTypeObject) PyCapsule_Type;
22
+
23
+ typedef void (*PyCapsule_Destructor)(PyObject *);
24
+
25
+ #define PyCapsule_CheckExact(op) Py_IS_TYPE(op, &PyCapsule_Type)
26
+
27
+
28
+ PyAPI_FUNC(PyObject *) PyCapsule_New(
29
+ void *pointer,
30
+ const char *name,
31
+ PyCapsule_Destructor destructor);
32
+
33
+ PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name);
34
+
35
+ PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule);
36
+
37
+ PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule);
38
+
39
+ PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule);
40
+
41
+ PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name);
42
+
43
+ PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer);
44
+
45
+ PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);
46
+
47
+ PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
48
+
49
+ PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
50
+
51
+ PyAPI_FUNC(void *) PyCapsule_Import(
52
+ const char *name, /* UTF-8 encoded string */
53
+ int no_block);
54
+
55
+
56
+ #ifdef __cplusplus
57
+ }
58
+ #endif
59
+ #endif /* !Py_CAPSULE_H */
evalkit_llava/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
+
evalkit_llava/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
+
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/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 */
evalkit_llava/include/python3.10/sysmodule.h ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* System module interface */
3
+
4
+ #ifndef Py_SYSMODULE_H
5
+ #define Py_SYSMODULE_H
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
11
+ PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
12
+
13
+ PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
14
+ PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
15
+ PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
16
+
17
+ PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
18
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
19
+ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
20
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
21
+ PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
22
+ PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
23
+
24
+ PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
25
+ PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
26
+ PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *);
27
+ PyAPI_FUNC(int) PySys_HasWarnOptions(void);
28
+
29
+ PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
30
+ PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
31
+
32
+ #ifndef Py_LIMITED_API
33
+ # define Py_CPYTHON_SYSMODULE_H
34
+ # include "cpython/sysmodule.h"
35
+ # undef Py_CPYTHON_SYSMODULE_H
36
+ #endif
37
+
38
+ #ifdef __cplusplus
39
+ }
40
+ #endif
41
+ #endif /* !Py_SYSMODULE_H */
evalkit_llava/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 */
evalkit_llava/include/python3.10/warnings.h ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef Py_WARNINGS_H
2
+ #define Py_WARNINGS_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ #ifndef Py_LIMITED_API
8
+ PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
9
+ #endif
10
+
11
+ PyAPI_FUNC(int) PyErr_WarnEx(
12
+ PyObject *category,
13
+ const char *message, /* UTF-8 encoded string */
14
+ Py_ssize_t stack_level);
15
+ PyAPI_FUNC(int) PyErr_WarnFormat(
16
+ PyObject *category,
17
+ Py_ssize_t stack_level,
18
+ const char *format, /* ASCII-encoded string */
19
+ ...);
20
+
21
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
22
+ /* Emit a ResourceWarning warning */
23
+ PyAPI_FUNC(int) PyErr_ResourceWarning(
24
+ PyObject *source,
25
+ Py_ssize_t stack_level,
26
+ const char *format, /* ASCII-encoded string */
27
+ ...);
28
+ #endif
29
+ #ifndef Py_LIMITED_API
30
+ PyAPI_FUNC(int) PyErr_WarnExplicitObject(
31
+ PyObject *category,
32
+ PyObject *message,
33
+ PyObject *filename,
34
+ int lineno,
35
+ PyObject *module,
36
+ PyObject *registry);
37
+ #endif
38
+ PyAPI_FUNC(int) PyErr_WarnExplicit(
39
+ PyObject *category,
40
+ const char *message, /* UTF-8 encoded string */
41
+ const char *filename, /* decoded from the filesystem encoding */
42
+ int lineno,
43
+ const char *module, /* UTF-8 encoded string */
44
+ PyObject *registry);
45
+
46
+ #ifndef Py_LIMITED_API
47
+ PyAPI_FUNC(int)
48
+ PyErr_WarnExplicitFormat(PyObject *category,
49
+ const char *filename, int lineno,
50
+ const char *module, PyObject *registry,
51
+ const char *format, ...);
52
+ #endif
53
+
54
+ /* DEPRECATED: Use PyErr_WarnEx() instead. */
55
+ #ifndef Py_LIMITED_API
56
+ #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
57
+ #endif
58
+
59
+ #ifndef Py_LIMITED_API
60
+ void _PyErr_WarnUnawaitedCoroutine(PyObject *coro);
61
+ #endif
62
+
63
+ #ifdef __cplusplus
64
+ }
65
+ #endif
66
+ #endif /* !Py_WARNINGS_H */
67
+
evalkit_llava/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 */