Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- mantis_evalkit/include/curses.h +0 -0
- mantis_evalkit/include/cursesapp.h +191 -0
- mantis_evalkit/include/cursslk.h +240 -0
- mantis_evalkit/include/eti.h +55 -0
- mantis_evalkit/include/itcl.h +198 -0
- mantis_evalkit/include/menu.h +281 -0
- mantis_evalkit/include/ncurses.h +0 -0
- mantis_evalkit/include/panel.h +100 -0
- mantis_evalkit/include/pqStubs.h +85 -0
- mantis_evalkit/include/python3.10/boolobject.h +43 -0
- mantis_evalkit/include/python3.10/bytearrayobject.h +46 -0
- mantis_evalkit/include/python3.10/cellobject.h +29 -0
- mantis_evalkit/include/python3.10/ceval.h +158 -0
- mantis_evalkit/include/python3.10/classobject.h +57 -0
- mantis_evalkit/include/python3.10/datetime.h +267 -0
- mantis_evalkit/include/python3.10/dictobject.h +97 -0
- mantis_evalkit/include/python3.10/dynamic_annotations.h +499 -0
- mantis_evalkit/include/python3.10/enumobject.h +17 -0
- mantis_evalkit/include/python3.10/errcode.h +38 -0
- mantis_evalkit/include/python3.10/exports.h +30 -0
- mantis_evalkit/include/python3.10/frameobject.h +20 -0
- mantis_evalkit/include/python3.10/genericaliasobject.h +14 -0
- mantis_evalkit/include/python3.10/import.h +98 -0
- mantis_evalkit/include/python3.10/interpreteridobject.h +17 -0
- mantis_evalkit/include/python3.10/listobject.h +52 -0
- mantis_evalkit/include/python3.10/longobject.h +220 -0
- mantis_evalkit/include/python3.10/memoryobject.h +72 -0
- mantis_evalkit/include/python3.10/methodobject.h +116 -0
- mantis_evalkit/include/python3.10/moduleobject.h +96 -0
- mantis_evalkit/include/python3.10/py_curses.h +99 -0
- mantis_evalkit/include/python3.10/pycapsule.h +59 -0
- mantis_evalkit/include/python3.10/pyexpat.h +57 -0
- mantis_evalkit/include/python3.10/pyframe.h +22 -0
- mantis_evalkit/include/python3.10/pymem.h +104 -0
- mantis_evalkit/include/python3.10/pyport.h +889 -0
- mantis_evalkit/include/python3.10/pystrtod.h +45 -0
- mantis_evalkit/include/python3.10/pythonrun.h +44 -0
- mantis_evalkit/include/python3.10/sliceobject.h +65 -0
- mantis_evalkit/include/python3.10/sysmodule.h +41 -0
- mantis_evalkit/include/python3.10/unicodeobject.h +1053 -0
- mantis_evalkit/include/python3.10/weakrefobject.h +86 -0
- mantis_evalkit/include/tcl.h +2642 -0
- mantis_evalkit/include/tclPort.h +46 -0
- mantis_evalkit/include/tclTomMath.h +1131 -0
- mantis_evalkit/include/tclTomMathDecls.h +685 -0
- mantis_evalkit/include/tclUnixPort.h +732 -0
- mantis_evalkit/include/tk.h +1635 -0
- mantis_evalkit/include/tkBusy.h +41 -0
- mantis_evalkit/include/tkButton.h +322 -0
- mantis_evalkit/include/tkDecls.h +1791 -0
mantis_evalkit/include/curses.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
mantis_evalkit/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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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 */
|
mantis_evalkit/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
|
mantis_evalkit/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 __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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 */
|
mantis_evalkit/include/ncurses.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
mantis_evalkit/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 */
|
mantis_evalkit/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;
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/bytearrayobject.h
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* ByteArray object interface */
|
| 2 |
+
|
| 3 |
+
#ifndef Py_BYTEARRAYOBJECT_H
|
| 4 |
+
#define Py_BYTEARRAYOBJECT_H
|
| 5 |
+
#ifdef __cplusplus
|
| 6 |
+
extern "C" {
|
| 7 |
+
#endif
|
| 8 |
+
|
| 9 |
+
#include <stdarg.h>
|
| 10 |
+
|
| 11 |
+
/* Type PyByteArrayObject represents a mutable array of bytes.
|
| 12 |
+
* The Python API is that of a sequence;
|
| 13 |
+
* the bytes are mapped to ints in [0, 256).
|
| 14 |
+
* Bytes are not characters; they may be used to encode characters.
|
| 15 |
+
* The only way to go between bytes and str/unicode is via encoding
|
| 16 |
+
* and decoding.
|
| 17 |
+
* For the convenience of C programmers, the bytes type is considered
|
| 18 |
+
* to contain a char pointer, not an unsigned char pointer.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
/* Type object */
|
| 22 |
+
PyAPI_DATA(PyTypeObject) PyByteArray_Type;
|
| 23 |
+
PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type;
|
| 24 |
+
|
| 25 |
+
/* Type check macros */
|
| 26 |
+
#define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type)
|
| 27 |
+
#define PyByteArray_CheckExact(self) Py_IS_TYPE(self, &PyByteArray_Type)
|
| 28 |
+
|
| 29 |
+
/* Direct API functions */
|
| 30 |
+
PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *);
|
| 31 |
+
PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *);
|
| 32 |
+
PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t);
|
| 33 |
+
PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *);
|
| 34 |
+
PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *);
|
| 35 |
+
PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
|
| 36 |
+
|
| 37 |
+
#ifndef Py_LIMITED_API
|
| 38 |
+
# define Py_CPYTHON_BYTEARRAYOBJECT_H
|
| 39 |
+
# include "cpython/bytearrayobject.h"
|
| 40 |
+
# undef Py_CPYTHON_BYTEARRAYOBJECT_H
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#ifdef __cplusplus
|
| 44 |
+
}
|
| 45 |
+
#endif
|
| 46 |
+
#endif /* !Py_BYTEARRAYOBJECT_H */
|
mantis_evalkit/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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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 */
|
mantis_evalkit/include/python3.10/classobject.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Former class object interface -- now only bound methods are here */
|
| 2 |
+
|
| 3 |
+
/* Revealing some structures (not for general use) */
|
| 4 |
+
|
| 5 |
+
#ifndef Py_LIMITED_API
|
| 6 |
+
#ifndef Py_CLASSOBJECT_H
|
| 7 |
+
#define Py_CLASSOBJECT_H
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
typedef struct {
|
| 13 |
+
PyObject_HEAD
|
| 14 |
+
PyObject *im_func; /* The callable object implementing the method */
|
| 15 |
+
PyObject *im_self; /* The instance it is bound to */
|
| 16 |
+
PyObject *im_weakreflist; /* List of weak references */
|
| 17 |
+
vectorcallfunc vectorcall;
|
| 18 |
+
} PyMethodObject;
|
| 19 |
+
|
| 20 |
+
PyAPI_DATA(PyTypeObject) PyMethod_Type;
|
| 21 |
+
|
| 22 |
+
#define PyMethod_Check(op) Py_IS_TYPE(op, &PyMethod_Type)
|
| 23 |
+
|
| 24 |
+
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
|
| 25 |
+
|
| 26 |
+
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
|
| 27 |
+
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
|
| 28 |
+
|
| 29 |
+
/* Macros for direct access to these values. Type checks are *not*
|
| 30 |
+
done, so use with care. */
|
| 31 |
+
#define PyMethod_GET_FUNCTION(meth) \
|
| 32 |
+
(((PyMethodObject *)meth) -> im_func)
|
| 33 |
+
#define PyMethod_GET_SELF(meth) \
|
| 34 |
+
(((PyMethodObject *)meth) -> im_self)
|
| 35 |
+
|
| 36 |
+
typedef struct {
|
| 37 |
+
PyObject_HEAD
|
| 38 |
+
PyObject *func;
|
| 39 |
+
} PyInstanceMethodObject;
|
| 40 |
+
|
| 41 |
+
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
|
| 42 |
+
|
| 43 |
+
#define PyInstanceMethod_Check(op) Py_IS_TYPE(op, &PyInstanceMethod_Type)
|
| 44 |
+
|
| 45 |
+
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
|
| 46 |
+
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
|
| 47 |
+
|
| 48 |
+
/* Macros for direct access to these values. Type checks are *not*
|
| 49 |
+
done, so use with care. */
|
| 50 |
+
#define PyInstanceMethod_GET_FUNCTION(meth) \
|
| 51 |
+
(((PyInstanceMethodObject *)meth) -> func)
|
| 52 |
+
|
| 53 |
+
#ifdef __cplusplus
|
| 54 |
+
}
|
| 55 |
+
#endif
|
| 56 |
+
#endif /*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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* datetime.h
|
| 2 |
+
*/
|
| 3 |
+
#ifndef Py_LIMITED_API
|
| 4 |
+
#ifndef DATETIME_H
|
| 5 |
+
#define DATETIME_H
|
| 6 |
+
#ifdef __cplusplus
|
| 7 |
+
extern "C" {
|
| 8 |
+
#endif
|
| 9 |
+
|
| 10 |
+
/* Fields are packed into successive bytes, each viewed as unsigned and
|
| 11 |
+
* big-endian, unless otherwise noted:
|
| 12 |
+
*
|
| 13 |
+
* byte offset
|
| 14 |
+
* 0 year 2 bytes, 1-9999
|
| 15 |
+
* 2 month 1 byte, 1-12
|
| 16 |
+
* 3 day 1 byte, 1-31
|
| 17 |
+
* 4 hour 1 byte, 0-23
|
| 18 |
+
* 5 minute 1 byte, 0-59
|
| 19 |
+
* 6 second 1 byte, 0-59
|
| 20 |
+
* 7 usecond 3 bytes, 0-999999
|
| 21 |
+
* 10
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
/* # of bytes for year, month, and day. */
|
| 25 |
+
#define _PyDateTime_DATE_DATASIZE 4
|
| 26 |
+
|
| 27 |
+
/* # of bytes for hour, minute, second, and usecond. */
|
| 28 |
+
#define _PyDateTime_TIME_DATASIZE 6
|
| 29 |
+
|
| 30 |
+
/* # of bytes for year, month, day, hour, minute, second, and usecond. */
|
| 31 |
+
#define _PyDateTime_DATETIME_DATASIZE 10
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
typedef struct
|
| 35 |
+
{
|
| 36 |
+
PyObject_HEAD
|
| 37 |
+
Py_hash_t hashcode; /* -1 when unknown */
|
| 38 |
+
int days; /* -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS */
|
| 39 |
+
int seconds; /* 0 <= seconds < 24*3600 is invariant */
|
| 40 |
+
int microseconds; /* 0 <= microseconds < 1000000 is invariant */
|
| 41 |
+
} PyDateTime_Delta;
|
| 42 |
+
|
| 43 |
+
typedef struct
|
| 44 |
+
{
|
| 45 |
+
PyObject_HEAD /* a pure abstract base class */
|
| 46 |
+
} PyDateTime_TZInfo;
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
/* The datetime and time types have hashcodes, and an optional tzinfo member,
|
| 50 |
+
* present if and only if hastzinfo is true.
|
| 51 |
+
*/
|
| 52 |
+
#define _PyTZINFO_HEAD \
|
| 53 |
+
PyObject_HEAD \
|
| 54 |
+
Py_hash_t hashcode; \
|
| 55 |
+
char hastzinfo; /* boolean flag */
|
| 56 |
+
|
| 57 |
+
/* No _PyDateTime_BaseTZInfo is allocated; it's just to have something
|
| 58 |
+
* convenient to cast to, when getting at the hastzinfo member of objects
|
| 59 |
+
* starting with _PyTZINFO_HEAD.
|
| 60 |
+
*/
|
| 61 |
+
typedef struct
|
| 62 |
+
{
|
| 63 |
+
_PyTZINFO_HEAD
|
| 64 |
+
} _PyDateTime_BaseTZInfo;
|
| 65 |
+
|
| 66 |
+
/* All time objects are of PyDateTime_TimeType, but that can be allocated
|
| 67 |
+
* in two ways, with or without a tzinfo member. Without is the same as
|
| 68 |
+
* tzinfo == None, but consumes less memory. _PyDateTime_BaseTime is an
|
| 69 |
+
* internal struct used to allocate the right amount of space for the
|
| 70 |
+
* "without" case.
|
| 71 |
+
*/
|
| 72 |
+
#define _PyDateTime_TIMEHEAD \
|
| 73 |
+
_PyTZINFO_HEAD \
|
| 74 |
+
unsigned char data[_PyDateTime_TIME_DATASIZE];
|
| 75 |
+
|
| 76 |
+
typedef struct
|
| 77 |
+
{
|
| 78 |
+
_PyDateTime_TIMEHEAD
|
| 79 |
+
} _PyDateTime_BaseTime; /* hastzinfo false */
|
| 80 |
+
|
| 81 |
+
typedef struct
|
| 82 |
+
{
|
| 83 |
+
_PyDateTime_TIMEHEAD
|
| 84 |
+
unsigned char fold;
|
| 85 |
+
PyObject *tzinfo;
|
| 86 |
+
} PyDateTime_Time; /* hastzinfo true */
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
/* All datetime objects are of PyDateTime_DateTimeType, but that can be
|
| 90 |
+
* allocated in two ways too, just like for time objects above. In addition,
|
| 91 |
+
* the plain date type is a base class for datetime, so it must also have
|
| 92 |
+
* a hastzinfo member (although it's unused there).
|
| 93 |
+
*/
|
| 94 |
+
typedef struct
|
| 95 |
+
{
|
| 96 |
+
_PyTZINFO_HEAD
|
| 97 |
+
unsigned char data[_PyDateTime_DATE_DATASIZE];
|
| 98 |
+
} PyDateTime_Date;
|
| 99 |
+
|
| 100 |
+
#define _PyDateTime_DATETIMEHEAD \
|
| 101 |
+
_PyTZINFO_HEAD \
|
| 102 |
+
unsigned char data[_PyDateTime_DATETIME_DATASIZE];
|
| 103 |
+
|
| 104 |
+
typedef struct
|
| 105 |
+
{
|
| 106 |
+
_PyDateTime_DATETIMEHEAD
|
| 107 |
+
} _PyDateTime_BaseDateTime; /* hastzinfo false */
|
| 108 |
+
|
| 109 |
+
typedef struct
|
| 110 |
+
{
|
| 111 |
+
_PyDateTime_DATETIMEHEAD
|
| 112 |
+
unsigned char fold;
|
| 113 |
+
PyObject *tzinfo;
|
| 114 |
+
} PyDateTime_DateTime; /* hastzinfo true */
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
/* Apply for date and datetime instances. */
|
| 118 |
+
|
| 119 |
+
// o is a pointer to a time or a datetime object.
|
| 120 |
+
#define _PyDateTime_HAS_TZINFO(o) (((_PyDateTime_BaseTZInfo *)(o))->hastzinfo)
|
| 121 |
+
|
| 122 |
+
#define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \
|
| 123 |
+
((PyDateTime_Date*)o)->data[1])
|
| 124 |
+
#define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2])
|
| 125 |
+
#define PyDateTime_GET_DAY(o) (((PyDateTime_Date*)o)->data[3])
|
| 126 |
+
|
| 127 |
+
#define PyDateTime_DATE_GET_HOUR(o) (((PyDateTime_DateTime*)o)->data[4])
|
| 128 |
+
#define PyDateTime_DATE_GET_MINUTE(o) (((PyDateTime_DateTime*)o)->data[5])
|
| 129 |
+
#define PyDateTime_DATE_GET_SECOND(o) (((PyDateTime_DateTime*)o)->data[6])
|
| 130 |
+
#define PyDateTime_DATE_GET_MICROSECOND(o) \
|
| 131 |
+
((((PyDateTime_DateTime*)o)->data[7] << 16) | \
|
| 132 |
+
(((PyDateTime_DateTime*)o)->data[8] << 8) | \
|
| 133 |
+
((PyDateTime_DateTime*)o)->data[9])
|
| 134 |
+
#define PyDateTime_DATE_GET_FOLD(o) (((PyDateTime_DateTime*)o)->fold)
|
| 135 |
+
#define PyDateTime_DATE_GET_TZINFO(o) (_PyDateTime_HAS_TZINFO(o) ? \
|
| 136 |
+
((PyDateTime_DateTime *)(o))->tzinfo : Py_None)
|
| 137 |
+
|
| 138 |
+
/* Apply for time instances. */
|
| 139 |
+
#define PyDateTime_TIME_GET_HOUR(o) (((PyDateTime_Time*)o)->data[0])
|
| 140 |
+
#define PyDateTime_TIME_GET_MINUTE(o) (((PyDateTime_Time*)o)->data[1])
|
| 141 |
+
#define PyDateTime_TIME_GET_SECOND(o) (((PyDateTime_Time*)o)->data[2])
|
| 142 |
+
#define PyDateTime_TIME_GET_MICROSECOND(o) \
|
| 143 |
+
((((PyDateTime_Time*)o)->data[3] << 16) | \
|
| 144 |
+
(((PyDateTime_Time*)o)->data[4] << 8) | \
|
| 145 |
+
((PyDateTime_Time*)o)->data[5])
|
| 146 |
+
#define PyDateTime_TIME_GET_FOLD(o) (((PyDateTime_Time*)o)->fold)
|
| 147 |
+
#define PyDateTime_TIME_GET_TZINFO(o) (_PyDateTime_HAS_TZINFO(o) ? \
|
| 148 |
+
((PyDateTime_Time *)(o))->tzinfo : Py_None)
|
| 149 |
+
|
| 150 |
+
/* Apply for time delta instances */
|
| 151 |
+
#define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days)
|
| 152 |
+
#define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds)
|
| 153 |
+
#define PyDateTime_DELTA_GET_MICROSECONDS(o) \
|
| 154 |
+
(((PyDateTime_Delta*)o)->microseconds)
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
/* Define structure for C API. */
|
| 158 |
+
typedef struct {
|
| 159 |
+
/* type objects */
|
| 160 |
+
PyTypeObject *DateType;
|
| 161 |
+
PyTypeObject *DateTimeType;
|
| 162 |
+
PyTypeObject *TimeType;
|
| 163 |
+
PyTypeObject *DeltaType;
|
| 164 |
+
PyTypeObject *TZInfoType;
|
| 165 |
+
|
| 166 |
+
/* singletons */
|
| 167 |
+
PyObject *TimeZone_UTC;
|
| 168 |
+
|
| 169 |
+
/* constructors */
|
| 170 |
+
PyObject *(*Date_FromDate)(int, int, int, PyTypeObject*);
|
| 171 |
+
PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int,
|
| 172 |
+
PyObject*, PyTypeObject*);
|
| 173 |
+
PyObject *(*Time_FromTime)(int, int, int, int, PyObject*, PyTypeObject*);
|
| 174 |
+
PyObject *(*Delta_FromDelta)(int, int, int, int, PyTypeObject*);
|
| 175 |
+
PyObject *(*TimeZone_FromTimeZone)(PyObject *offset, PyObject *name);
|
| 176 |
+
|
| 177 |
+
/* constructors for the DB API */
|
| 178 |
+
PyObject *(*DateTime_FromTimestamp)(PyObject*, PyObject*, PyObject*);
|
| 179 |
+
PyObject *(*Date_FromTimestamp)(PyObject*, PyObject*);
|
| 180 |
+
|
| 181 |
+
/* PEP 495 constructors */
|
| 182 |
+
PyObject *(*DateTime_FromDateAndTimeAndFold)(int, int, int, int, int, int, int,
|
| 183 |
+
PyObject*, int, PyTypeObject*);
|
| 184 |
+
PyObject *(*Time_FromTimeAndFold)(int, int, int, int, PyObject*, int, PyTypeObject*);
|
| 185 |
+
|
| 186 |
+
} PyDateTime_CAPI;
|
| 187 |
+
|
| 188 |
+
#define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI"
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
/* This block is only used as part of the public API and should not be
|
| 192 |
+
* included in _datetimemodule.c, which does not use the C API capsule.
|
| 193 |
+
* See bpo-35081 for more details.
|
| 194 |
+
* */
|
| 195 |
+
#ifndef _PY_DATETIME_IMPL
|
| 196 |
+
/* Define global variable for the C API and a macro for setting it. */
|
| 197 |
+
static PyDateTime_CAPI *PyDateTimeAPI = NULL;
|
| 198 |
+
|
| 199 |
+
#define PyDateTime_IMPORT \
|
| 200 |
+
PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)
|
| 201 |
+
|
| 202 |
+
/* Macro for access to the UTC singleton */
|
| 203 |
+
#define PyDateTime_TimeZone_UTC PyDateTimeAPI->TimeZone_UTC
|
| 204 |
+
|
| 205 |
+
/* Macros for type checking when not building the Python core. */
|
| 206 |
+
#define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType)
|
| 207 |
+
#define PyDate_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DateType)
|
| 208 |
+
|
| 209 |
+
#define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType)
|
| 210 |
+
#define PyDateTime_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DateTimeType)
|
| 211 |
+
|
| 212 |
+
#define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType)
|
| 213 |
+
#define PyTime_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->TimeType)
|
| 214 |
+
|
| 215 |
+
#define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType)
|
| 216 |
+
#define PyDelta_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DeltaType)
|
| 217 |
+
|
| 218 |
+
#define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType)
|
| 219 |
+
#define PyTZInfo_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->TZInfoType)
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
/* Macros for accessing constructors in a simplified fashion. */
|
| 223 |
+
#define PyDate_FromDate(year, month, day) \
|
| 224 |
+
PyDateTimeAPI->Date_FromDate(year, month, day, PyDateTimeAPI->DateType)
|
| 225 |
+
|
| 226 |
+
#define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec) \
|
| 227 |
+
PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \
|
| 228 |
+
min, sec, usec, Py_None, PyDateTimeAPI->DateTimeType)
|
| 229 |
+
|
| 230 |
+
#define PyDateTime_FromDateAndTimeAndFold(year, month, day, hour, min, sec, usec, fold) \
|
| 231 |
+
PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, \
|
| 232 |
+
min, sec, usec, Py_None, fold, PyDateTimeAPI->DateTimeType)
|
| 233 |
+
|
| 234 |
+
#define PyTime_FromTime(hour, minute, second, usecond) \
|
| 235 |
+
PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \
|
| 236 |
+
Py_None, PyDateTimeAPI->TimeType)
|
| 237 |
+
|
| 238 |
+
#define PyTime_FromTimeAndFold(hour, minute, second, usecond, fold) \
|
| 239 |
+
PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, usecond, \
|
| 240 |
+
Py_None, fold, PyDateTimeAPI->TimeType)
|
| 241 |
+
|
| 242 |
+
#define PyDelta_FromDSU(days, seconds, useconds) \
|
| 243 |
+
PyDateTimeAPI->Delta_FromDelta(days, seconds, useconds, 1, \
|
| 244 |
+
PyDateTimeAPI->DeltaType)
|
| 245 |
+
|
| 246 |
+
#define PyTimeZone_FromOffset(offset) \
|
| 247 |
+
PyDateTimeAPI->TimeZone_FromTimeZone(offset, NULL)
|
| 248 |
+
|
| 249 |
+
#define PyTimeZone_FromOffsetAndName(offset, name) \
|
| 250 |
+
PyDateTimeAPI->TimeZone_FromTimeZone(offset, name)
|
| 251 |
+
|
| 252 |
+
/* Macros supporting the DB API. */
|
| 253 |
+
#define PyDateTime_FromTimestamp(args) \
|
| 254 |
+
PyDateTimeAPI->DateTime_FromTimestamp( \
|
| 255 |
+
(PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL)
|
| 256 |
+
|
| 257 |
+
#define PyDate_FromTimestamp(args) \
|
| 258 |
+
PyDateTimeAPI->Date_FromTimestamp( \
|
| 259 |
+
(PyObject*) (PyDateTimeAPI->DateType), args)
|
| 260 |
+
|
| 261 |
+
#endif /* !defined(_PY_DATETIME_IMPL) */
|
| 262 |
+
|
| 263 |
+
#ifdef __cplusplus
|
| 264 |
+
}
|
| 265 |
+
#endif
|
| 266 |
+
#endif
|
| 267 |
+
#endif /* !Py_LIMITED_API */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/dynamic_annotations.h
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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__ */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/errcode.h
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef Py_ERRCODE_H
|
| 2 |
+
#define Py_ERRCODE_H
|
| 3 |
+
#ifdef __cplusplus
|
| 4 |
+
extern "C" {
|
| 5 |
+
#endif
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
/* Error codes passed around between file input, tokenizer, parser and
|
| 9 |
+
interpreter. This is necessary so we can turn them into Python
|
| 10 |
+
exceptions at a higher level. Note that some errors have a
|
| 11 |
+
slightly different meaning when passed from the tokenizer to the
|
| 12 |
+
parser than when passed from the parser to the interpreter; e.g.
|
| 13 |
+
the parser only returns E_EOF when it hits EOF immediately, and it
|
| 14 |
+
never returns E_OK. */
|
| 15 |
+
|
| 16 |
+
#define E_OK 10 /* No error */
|
| 17 |
+
#define E_EOF 11 /* End Of File */
|
| 18 |
+
#define E_INTR 12 /* Interrupted */
|
| 19 |
+
#define E_TOKEN 13 /* Bad token */
|
| 20 |
+
#define E_SYNTAX 14 /* Syntax error */
|
| 21 |
+
#define E_NOMEM 15 /* Ran out of memory */
|
| 22 |
+
#define E_DONE 16 /* Parsing complete */
|
| 23 |
+
#define E_ERROR 17 /* Execution error */
|
| 24 |
+
#define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */
|
| 25 |
+
#define E_OVERFLOW 19 /* Node had too many children */
|
| 26 |
+
#define E_TOODEEP 20 /* Too many indentation levels */
|
| 27 |
+
#define E_DEDENT 21 /* No matching outer block for dedent */
|
| 28 |
+
#define E_DECODE 22 /* Error in decoding into Unicode */
|
| 29 |
+
#define E_EOFS 23 /* EOF in triple-quoted string */
|
| 30 |
+
#define E_EOLS 24 /* EOL in single-quoted string */
|
| 31 |
+
#define E_LINECONT 25 /* Unexpected characters after a line continuation */
|
| 32 |
+
#define E_BADSINGLE 27 /* Ill-formed single statement input */
|
| 33 |
+
#define E_INTERACT_STOP 28 /* Interactive mode stopped tokenization */
|
| 34 |
+
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
}
|
| 37 |
+
#endif
|
| 38 |
+
#endif /* !Py_ERRCODE_H */
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/genericaliasobject.h
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Implementation of PEP 585: support list[int] etc.
|
| 2 |
+
#ifndef Py_GENERICALIASOBJECT_H
|
| 3 |
+
#define Py_GENERICALIASOBJECT_H
|
| 4 |
+
#ifdef __cplusplus
|
| 5 |
+
extern "C" {
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
PyAPI_FUNC(PyObject *) Py_GenericAlias(PyObject *, PyObject *);
|
| 9 |
+
PyAPI_DATA(PyTypeObject) Py_GenericAliasType;
|
| 10 |
+
|
| 11 |
+
#ifdef __cplusplus
|
| 12 |
+
}
|
| 13 |
+
#endif
|
| 14 |
+
#endif /* !Py_GENERICALIASOBJECT_H */
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/memoryobject.h
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Memory view object. In Python this is available as "memoryview". */
|
| 2 |
+
|
| 3 |
+
#ifndef Py_MEMORYOBJECT_H
|
| 4 |
+
#define Py_MEMORYOBJECT_H
|
| 5 |
+
#ifdef __cplusplus
|
| 6 |
+
extern "C" {
|
| 7 |
+
#endif
|
| 8 |
+
|
| 9 |
+
#ifndef Py_LIMITED_API
|
| 10 |
+
PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type;
|
| 11 |
+
#endif
|
| 12 |
+
PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
|
| 13 |
+
|
| 14 |
+
#define PyMemoryView_Check(op) Py_IS_TYPE(op, &PyMemoryView_Type)
|
| 15 |
+
|
| 16 |
+
#ifndef Py_LIMITED_API
|
| 17 |
+
/* Get a pointer to the memoryview's private copy of the exporter's buffer. */
|
| 18 |
+
#define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view)
|
| 19 |
+
/* Get a pointer to the exporting object (this may be NULL!). */
|
| 20 |
+
#define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj)
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
|
| 24 |
+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
|
| 25 |
+
PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size,
|
| 26 |
+
int flags);
|
| 27 |
+
#endif
|
| 28 |
+
#ifndef Py_LIMITED_API
|
| 29 |
+
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info);
|
| 30 |
+
#endif
|
| 31 |
+
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
|
| 32 |
+
int buffertype,
|
| 33 |
+
char order);
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
/* The structs are declared here so that macros can work, but they shouldn't
|
| 37 |
+
be considered public. Don't access their fields directly, use the macros
|
| 38 |
+
and functions instead! */
|
| 39 |
+
#ifndef Py_LIMITED_API
|
| 40 |
+
#define _Py_MANAGED_BUFFER_RELEASED 0x001 /* access to exporter blocked */
|
| 41 |
+
#define _Py_MANAGED_BUFFER_FREE_FORMAT 0x002 /* free format */
|
| 42 |
+
typedef struct {
|
| 43 |
+
PyObject_HEAD
|
| 44 |
+
int flags; /* state flags */
|
| 45 |
+
Py_ssize_t exports; /* number of direct memoryview exports */
|
| 46 |
+
Py_buffer master; /* snapshot buffer obtained from the original exporter */
|
| 47 |
+
} _PyManagedBufferObject;
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
/* memoryview state flags */
|
| 51 |
+
#define _Py_MEMORYVIEW_RELEASED 0x001 /* access to master buffer blocked */
|
| 52 |
+
#define _Py_MEMORYVIEW_C 0x002 /* C-contiguous layout */
|
| 53 |
+
#define _Py_MEMORYVIEW_FORTRAN 0x004 /* Fortran contiguous layout */
|
| 54 |
+
#define _Py_MEMORYVIEW_SCALAR 0x008 /* scalar: ndim = 0 */
|
| 55 |
+
#define _Py_MEMORYVIEW_PIL 0x010 /* PIL-style layout */
|
| 56 |
+
|
| 57 |
+
typedef struct {
|
| 58 |
+
PyObject_VAR_HEAD
|
| 59 |
+
_PyManagedBufferObject *mbuf; /* managed buffer */
|
| 60 |
+
Py_hash_t hash; /* hash value for read-only views */
|
| 61 |
+
int flags; /* state flags */
|
| 62 |
+
Py_ssize_t exports; /* number of buffer re-exports */
|
| 63 |
+
Py_buffer view; /* private copy of the exporter's view */
|
| 64 |
+
PyObject *weakreflist;
|
| 65 |
+
Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */
|
| 66 |
+
} PyMemoryViewObject;
|
| 67 |
+
#endif
|
| 68 |
+
|
| 69 |
+
#ifdef __cplusplus
|
| 70 |
+
}
|
| 71 |
+
#endif
|
| 72 |
+
#endif /* !Py_MEMORYOBJECT_H */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/moduleobject.h
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
/* Module object interface */
|
| 3 |
+
|
| 4 |
+
#ifndef Py_MODULEOBJECT_H
|
| 5 |
+
#define Py_MODULEOBJECT_H
|
| 6 |
+
#ifdef __cplusplus
|
| 7 |
+
extern "C" {
|
| 8 |
+
#endif
|
| 9 |
+
|
| 10 |
+
PyAPI_DATA(PyTypeObject) PyModule_Type;
|
| 11 |
+
|
| 12 |
+
#define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
|
| 13 |
+
#define PyModule_CheckExact(op) Py_IS_TYPE(op, &PyModule_Type)
|
| 14 |
+
|
| 15 |
+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
|
| 16 |
+
PyAPI_FUNC(PyObject *) PyModule_NewObject(
|
| 17 |
+
PyObject *name
|
| 18 |
+
);
|
| 19 |
+
#endif
|
| 20 |
+
PyAPI_FUNC(PyObject *) PyModule_New(
|
| 21 |
+
const char *name /* UTF-8 encoded string */
|
| 22 |
+
);
|
| 23 |
+
PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
|
| 24 |
+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
|
| 25 |
+
PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
|
| 26 |
+
#endif
|
| 27 |
+
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
|
| 28 |
+
Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
|
| 29 |
+
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
|
| 30 |
+
#ifndef Py_LIMITED_API
|
| 31 |
+
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
|
| 32 |
+
PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
|
| 33 |
+
PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *);
|
| 34 |
+
#endif
|
| 35 |
+
PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
|
| 36 |
+
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
|
| 37 |
+
|
| 38 |
+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
|
| 39 |
+
/* New in 3.5 */
|
| 40 |
+
PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*);
|
| 41 |
+
PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
typedef struct PyModuleDef_Base {
|
| 45 |
+
PyObject_HEAD
|
| 46 |
+
PyObject* (*m_init)(void);
|
| 47 |
+
Py_ssize_t m_index;
|
| 48 |
+
PyObject* m_copy;
|
| 49 |
+
} PyModuleDef_Base;
|
| 50 |
+
|
| 51 |
+
#define PyModuleDef_HEAD_INIT { \
|
| 52 |
+
PyObject_HEAD_INIT(NULL) \
|
| 53 |
+
NULL, /* m_init */ \
|
| 54 |
+
0, /* m_index */ \
|
| 55 |
+
NULL, /* m_copy */ \
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
struct PyModuleDef_Slot;
|
| 59 |
+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
|
| 60 |
+
/* New in 3.5 */
|
| 61 |
+
typedef struct PyModuleDef_Slot{
|
| 62 |
+
int slot;
|
| 63 |
+
void *value;
|
| 64 |
+
} PyModuleDef_Slot;
|
| 65 |
+
|
| 66 |
+
#define Py_mod_create 1
|
| 67 |
+
#define Py_mod_exec 2
|
| 68 |
+
|
| 69 |
+
#ifndef Py_LIMITED_API
|
| 70 |
+
#define _Py_mod_LAST_SLOT 2
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
#endif /* New in 3.5 */
|
| 74 |
+
|
| 75 |
+
typedef struct PyModuleDef{
|
| 76 |
+
PyModuleDef_Base m_base;
|
| 77 |
+
const char* m_name;
|
| 78 |
+
const char* m_doc;
|
| 79 |
+
Py_ssize_t m_size;
|
| 80 |
+
PyMethodDef *m_methods;
|
| 81 |
+
struct PyModuleDef_Slot* m_slots;
|
| 82 |
+
traverseproc m_traverse;
|
| 83 |
+
inquiry m_clear;
|
| 84 |
+
freefunc m_free;
|
| 85 |
+
} PyModuleDef;
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
// Internal C API
|
| 89 |
+
#ifdef Py_BUILD_CORE
|
| 90 |
+
extern int _PyModule_IsExtension(PyObject *obj);
|
| 91 |
+
#endif
|
| 92 |
+
|
| 93 |
+
#ifdef __cplusplus
|
| 94 |
+
}
|
| 95 |
+
#endif
|
| 96 |
+
#endif /* !Py_MODULEOBJECT_H */
|
mantis_evalkit/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 |
+
|
mantis_evalkit/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 */
|
mantis_evalkit/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 |
+
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/pyport.h
ADDED
|
@@ -0,0 +1,889 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
| 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 */
|
mantis_evalkit/include/python3.10/pystrtod.h
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef Py_STRTOD_H
|
| 2 |
+
#define Py_STRTOD_H
|
| 3 |
+
|
| 4 |
+
#ifdef __cplusplus
|
| 5 |
+
extern "C" {
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
PyAPI_FUNC(double) PyOS_string_to_double(const char *str,
|
| 10 |
+
char **endptr,
|
| 11 |
+
PyObject *overflow_exception);
|
| 12 |
+
|
| 13 |
+
/* The caller is responsible for calling PyMem_Free to free the buffer
|
| 14 |
+
that's is returned. */
|
| 15 |
+
PyAPI_FUNC(char *) PyOS_double_to_string(double val,
|
| 16 |
+
char format_code,
|
| 17 |
+
int precision,
|
| 18 |
+
int flags,
|
| 19 |
+
int *type);
|
| 20 |
+
|
| 21 |
+
#ifndef Py_LIMITED_API
|
| 22 |
+
PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores(
|
| 23 |
+
const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
|
| 24 |
+
PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
|
| 25 |
+
|
| 26 |
+
PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
|
| 31 |
+
#define Py_DTSF_SIGN 0x01 /* always add the sign */
|
| 32 |
+
#define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */
|
| 33 |
+
#define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code
|
| 34 |
+
specific */
|
| 35 |
+
|
| 36 |
+
/* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */
|
| 37 |
+
#define Py_DTST_FINITE 0
|
| 38 |
+
#define Py_DTST_INFINITE 1
|
| 39 |
+
#define Py_DTST_NAN 2
|
| 40 |
+
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
}
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#endif /* !Py_STRTOD_H */
|
mantis_evalkit/include/python3.10/pythonrun.h
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
/* Interfaces to parse and execute pieces of python code */
|
| 3 |
+
|
| 4 |
+
#ifndef Py_PYTHONRUN_H
|
| 5 |
+
#define Py_PYTHONRUN_H
|
| 6 |
+
#ifdef __cplusplus
|
| 7 |
+
extern "C" {
|
| 8 |
+
#endif
|
| 9 |
+
|
| 10 |
+
PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
|
| 11 |
+
|
| 12 |
+
PyAPI_FUNC(void) PyErr_Print(void);
|
| 13 |
+
PyAPI_FUNC(void) PyErr_PrintEx(int);
|
| 14 |
+
PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
/* Stuff with no proper home (yet) */
|
| 18 |
+
PyAPI_DATA(int) (*PyOS_InputHook)(void);
|
| 19 |
+
|
| 20 |
+
/* Stack size, in "pointers" (so we get extra safety margins
|
| 21 |
+
on 64-bit platforms). On a 32-bit platform, this translates
|
| 22 |
+
to an 8k margin. */
|
| 23 |
+
#define PYOS_STACK_MARGIN 2048
|
| 24 |
+
|
| 25 |
+
#if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
|
| 26 |
+
/* Enable stack checking under Microsoft C */
|
| 27 |
+
#define USE_STACKCHECK
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
#ifdef USE_STACKCHECK
|
| 31 |
+
/* Check that we aren't overflowing our stack */
|
| 32 |
+
PyAPI_FUNC(int) PyOS_CheckStack(void);
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
#ifndef Py_LIMITED_API
|
| 36 |
+
# define Py_CPYTHON_PYTHONRUN_H
|
| 37 |
+
# include "cpython/pythonrun.h"
|
| 38 |
+
# undef Py_CPYTHON_PYTHONRUN_H
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
}
|
| 43 |
+
#endif
|
| 44 |
+
#endif /* !Py_PYTHONRUN_H */
|
mantis_evalkit/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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/python3.10/unicodeobject.h
ADDED
|
@@ -0,0 +1,1053 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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ndef 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 */
|
mantis_evalkit/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 */
|
mantis_evalkit/include/tcl.h
ADDED
|
@@ -0,0 +1,2642 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tcl.h --
|
| 3 |
+
*
|
| 4 |
+
* This header file describes the externally-visible facilities of the
|
| 5 |
+
* Tcl interpreter.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1987-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1993-1996 Lucent Technologies.
|
| 9 |
+
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
| 10 |
+
* Copyright (c) 1998-2000 by Scriptics Corporation.
|
| 11 |
+
* Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
|
| 12 |
+
*
|
| 13 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 14 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef _TCL
|
| 18 |
+
#define _TCL
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* For C++ compilers, use extern "C"
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* The following defines are used to indicate the various release levels.
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
#define TCL_ALPHA_RELEASE 0
|
| 33 |
+
#define TCL_BETA_RELEASE 1
|
| 34 |
+
#define TCL_FINAL_RELEASE 2
|
| 35 |
+
|
| 36 |
+
/*
|
| 37 |
+
* When version numbers change here, must also go into the following files and
|
| 38 |
+
* update the version numbers:
|
| 39 |
+
*
|
| 40 |
+
* library/init.tcl (1 LOC patch)
|
| 41 |
+
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
|
| 42 |
+
* win/configure.in (as above)
|
| 43 |
+
* win/tcl.m4 (not patchlevel)
|
| 44 |
+
* README.md (sections 0 and 2, with and without separator)
|
| 45 |
+
* macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
|
| 46 |
+
* win/README (not patchlevel) (sections 0 and 2)
|
| 47 |
+
* unix/tcl.spec (1 LOC patch)
|
| 48 |
+
* tools/tcl.hpj.in (not patchlevel, for windows installer)
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
#if !defined(TCL_MAJOR_VERSION)
|
| 52 |
+
# define TCL_MAJOR_VERSION 8
|
| 53 |
+
#endif
|
| 54 |
+
#if TCL_MAJOR_VERSION != 8
|
| 55 |
+
# error "This header-file is for Tcl 8 only"
|
| 56 |
+
#endif
|
| 57 |
+
#define TCL_MINOR_VERSION 6
|
| 58 |
+
#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
| 59 |
+
#define TCL_RELEASE_SERIAL 14
|
| 60 |
+
|
| 61 |
+
#define TCL_VERSION "8.6"
|
| 62 |
+
#define TCL_PATCH_LEVEL "8.6.14"
|
| 63 |
+
|
| 64 |
+
/*
|
| 65 |
+
*----------------------------------------------------------------------------
|
| 66 |
+
* The following definitions set up the proper options for Windows compilers.
|
| 67 |
+
* We use this method because there is no autoconf equivalent.
|
| 68 |
+
*/
|
| 69 |
+
|
| 70 |
+
#ifdef _WIN32
|
| 71 |
+
# ifndef __WIN32__
|
| 72 |
+
# define __WIN32__
|
| 73 |
+
# endif
|
| 74 |
+
# ifndef WIN32
|
| 75 |
+
# define WIN32
|
| 76 |
+
# endif
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
| 81 |
+
* quotation marks), JOIN joins two arguments.
|
| 82 |
+
*/
|
| 83 |
+
|
| 84 |
+
#ifndef STRINGIFY
|
| 85 |
+
# define STRINGIFY(x) STRINGIFY1(x)
|
| 86 |
+
# define STRINGIFY1(x) #x
|
| 87 |
+
#endif
|
| 88 |
+
#ifndef JOIN
|
| 89 |
+
# define JOIN(a,b) JOIN1(a,b)
|
| 90 |
+
# define JOIN1(a,b) a##b
|
| 91 |
+
#endif
|
| 92 |
+
|
| 93 |
+
/*
|
| 94 |
+
* A special definition used to allow this header file to be included from
|
| 95 |
+
* windows resource files so that they can obtain version information.
|
| 96 |
+
* RC_INVOKED is defined by default by the windows RC tool.
|
| 97 |
+
*
|
| 98 |
+
* Resource compilers don't like all the C stuff, like typedefs and function
|
| 99 |
+
* declarations, that occur below, so block them out.
|
| 100 |
+
*/
|
| 101 |
+
|
| 102 |
+
#ifndef RC_INVOKED
|
| 103 |
+
|
| 104 |
+
/*
|
| 105 |
+
* Special macro to define mutexes, that doesn't do anything if we are not
|
| 106 |
+
* using threads.
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
#ifdef TCL_THREADS
|
| 110 |
+
#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
|
| 111 |
+
#else
|
| 112 |
+
#define TCL_DECLARE_MUTEX(name)
|
| 113 |
+
#endif
|
| 114 |
+
|
| 115 |
+
/*
|
| 116 |
+
* Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and
|
| 117 |
+
* SEEK_END, all #define'd by stdio.h .
|
| 118 |
+
*
|
| 119 |
+
* Also, many extensions need stdio.h, and they've grown accustomed to tcl.h
|
| 120 |
+
* providing it for them rather than #include-ing it themselves as they
|
| 121 |
+
* should, so also for their sake, we keep the #include to be consistent with
|
| 122 |
+
* prior Tcl releases.
|
| 123 |
+
*/
|
| 124 |
+
|
| 125 |
+
#include <stdio.h>
|
| 126 |
+
|
| 127 |
+
/*
|
| 128 |
+
*----------------------------------------------------------------------------
|
| 129 |
+
* Support for functions with a variable number of arguments.
|
| 130 |
+
*
|
| 131 |
+
* The following TCL_VARARGS* macros are to support old extensions
|
| 132 |
+
* written for older versions of Tcl where the macros permitted
|
| 133 |
+
* support for the varargs.h system as well as stdarg.h .
|
| 134 |
+
*
|
| 135 |
+
* New code should just directly be written to use stdarg.h conventions.
|
| 136 |
+
*/
|
| 137 |
+
|
| 138 |
+
#include <stdarg.h>
|
| 139 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 140 |
+
# define TCL_VARARGS(type, name) (type name, ...)
|
| 141 |
+
# define TCL_VARARGS_DEF(type, name) (type name, ...)
|
| 142 |
+
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
|
| 143 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 144 |
+
#if defined(__GNUC__) && (__GNUC__ > 2)
|
| 145 |
+
# if defined(_WIN32) && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO
|
| 146 |
+
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__MINGW_PRINTF_FORMAT, a, b)))
|
| 147 |
+
# else
|
| 148 |
+
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
| 149 |
+
# endif
|
| 150 |
+
# define TCL_NORETURN __attribute__ ((noreturn))
|
| 151 |
+
# if defined(BUILD_tcl) || defined(BUILD_tk)
|
| 152 |
+
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
| 153 |
+
# else
|
| 154 |
+
# define TCL_NORETURN1 /* nothing */
|
| 155 |
+
# endif
|
| 156 |
+
#else
|
| 157 |
+
# define TCL_FORMAT_PRINTF(a,b)
|
| 158 |
+
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
|
| 159 |
+
# define TCL_NORETURN _declspec(noreturn)
|
| 160 |
+
# else
|
| 161 |
+
# define TCL_NORETURN /* nothing */
|
| 162 |
+
# endif
|
| 163 |
+
# define TCL_NORETURN1 /* nothing */
|
| 164 |
+
#endif
|
| 165 |
+
|
| 166 |
+
/*
|
| 167 |
+
* Allow a part of Tcl's API to be explicitly marked as deprecated.
|
| 168 |
+
*
|
| 169 |
+
* Used to make TIP 330/336 generate moans even if people use the
|
| 170 |
+
* compatibility macros. Change your code, guys! We won't support you forever.
|
| 171 |
+
*/
|
| 172 |
+
|
| 173 |
+
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
| 174 |
+
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
|
| 175 |
+
# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__ (msg)))
|
| 176 |
+
# else
|
| 177 |
+
# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__))
|
| 178 |
+
# endif
|
| 179 |
+
#else
|
| 180 |
+
# define TCL_DEPRECATED_API(msg) /* nothing portable */
|
| 181 |
+
#endif
|
| 182 |
+
|
| 183 |
+
/*
|
| 184 |
+
*----------------------------------------------------------------------------
|
| 185 |
+
* Macros used to declare a function to be exported by a DLL. Used by Windows,
|
| 186 |
+
* maps to no-op declarations on non-Windows systems. The default build on
|
| 187 |
+
* windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
|
| 188 |
+
* nonempty. To build a static library, the macro STATIC_BUILD should be
|
| 189 |
+
* defined.
|
| 190 |
+
*
|
| 191 |
+
* Note: when building static but linking dynamically to MSVCRT we must still
|
| 192 |
+
* correctly decorate the C library imported function. Use CRTIMPORT
|
| 193 |
+
* for this purpose. _DLL is defined by the compiler when linking to
|
| 194 |
+
* MSVCRT.
|
| 195 |
+
*/
|
| 196 |
+
|
| 197 |
+
#if (defined(_WIN32) && (defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0550)) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
|
| 198 |
+
# define HAVE_DECLSPEC 1
|
| 199 |
+
# ifdef STATIC_BUILD
|
| 200 |
+
# define DLLIMPORT
|
| 201 |
+
# define DLLEXPORT
|
| 202 |
+
# ifdef _DLL
|
| 203 |
+
# define CRTIMPORT __declspec(dllimport)
|
| 204 |
+
# else
|
| 205 |
+
# define CRTIMPORT
|
| 206 |
+
# endif
|
| 207 |
+
# else
|
| 208 |
+
# define DLLIMPORT __declspec(dllimport)
|
| 209 |
+
# define DLLEXPORT __declspec(dllexport)
|
| 210 |
+
# define CRTIMPORT __declspec(dllimport)
|
| 211 |
+
# endif
|
| 212 |
+
#else
|
| 213 |
+
# define DLLIMPORT
|
| 214 |
+
# if defined(__GNUC__) && __GNUC__ > 3
|
| 215 |
+
# define DLLEXPORT __attribute__ ((visibility("default")))
|
| 216 |
+
# else
|
| 217 |
+
# define DLLEXPORT
|
| 218 |
+
# endif
|
| 219 |
+
# define CRTIMPORT
|
| 220 |
+
#endif
|
| 221 |
+
|
| 222 |
+
/*
|
| 223 |
+
* These macros are used to control whether functions are being declared for
|
| 224 |
+
* import or export. If a function is being declared while it is being built
|
| 225 |
+
* to be included in a shared library, then it should have the DLLEXPORT
|
| 226 |
+
* storage class. If is being declared for use by a module that is going to
|
| 227 |
+
* link against the shared library, then it should have the DLLIMPORT storage
|
| 228 |
+
* class. If the symbol is being declared for a static build or for use from a
|
| 229 |
+
* stub library, then the storage class should be empty.
|
| 230 |
+
*
|
| 231 |
+
* The convention is that a macro called BUILD_xxxx, where xxxx is the name of
|
| 232 |
+
* a library we are building, is set on the compile line for sources that are
|
| 233 |
+
* to be placed in the library. When this macro is set, the storage class will
|
| 234 |
+
* be set to DLLEXPORT. At the end of the header file, the storage class will
|
| 235 |
+
* be reset to DLLIMPORT.
|
| 236 |
+
*/
|
| 237 |
+
|
| 238 |
+
#undef TCL_STORAGE_CLASS
|
| 239 |
+
#ifdef BUILD_tcl
|
| 240 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 241 |
+
#else
|
| 242 |
+
# ifdef USE_TCL_STUBS
|
| 243 |
+
# define TCL_STORAGE_CLASS
|
| 244 |
+
# else
|
| 245 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 246 |
+
# endif
|
| 247 |
+
#endif
|
| 248 |
+
|
| 249 |
+
/*
|
| 250 |
+
* The following _ANSI_ARGS_ macro is to support old extensions
|
| 251 |
+
* written for older versions of Tcl where it permitted support
|
| 252 |
+
* for compilers written in the pre-prototype era of C.
|
| 253 |
+
*
|
| 254 |
+
* New code should use prototypes.
|
| 255 |
+
*/
|
| 256 |
+
|
| 257 |
+
#ifndef TCL_NO_DEPRECATED
|
| 258 |
+
# undef _ANSI_ARGS_
|
| 259 |
+
# define _ANSI_ARGS_(x) x
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
/*
|
| 263 |
+
* Definitions that allow this header file to be used either with or without
|
| 264 |
+
* ANSI C features.
|
| 265 |
+
*/
|
| 266 |
+
|
| 267 |
+
#ifndef INLINE
|
| 268 |
+
# define INLINE
|
| 269 |
+
#endif
|
| 270 |
+
|
| 271 |
+
#ifdef NO_CONST
|
| 272 |
+
# ifndef const
|
| 273 |
+
# define const
|
| 274 |
+
# endif
|
| 275 |
+
#endif
|
| 276 |
+
#ifndef CONST
|
| 277 |
+
# define CONST const
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
#ifdef USE_NON_CONST
|
| 281 |
+
# ifdef USE_COMPAT_CONST
|
| 282 |
+
# error define at most one of USE_NON_CONST and USE_COMPAT_CONST
|
| 283 |
+
# endif
|
| 284 |
+
# define CONST84
|
| 285 |
+
# define CONST84_RETURN
|
| 286 |
+
#else
|
| 287 |
+
# ifdef USE_COMPAT_CONST
|
| 288 |
+
# define CONST84
|
| 289 |
+
# define CONST84_RETURN const
|
| 290 |
+
# else
|
| 291 |
+
# define CONST84 const
|
| 292 |
+
# define CONST84_RETURN const
|
| 293 |
+
# endif
|
| 294 |
+
#endif
|
| 295 |
+
|
| 296 |
+
#ifndef CONST86
|
| 297 |
+
# define CONST86 CONST84
|
| 298 |
+
#endif
|
| 299 |
+
|
| 300 |
+
/*
|
| 301 |
+
* Make sure EXTERN isn't defined elsewhere.
|
| 302 |
+
*/
|
| 303 |
+
|
| 304 |
+
#ifdef EXTERN
|
| 305 |
+
# undef EXTERN
|
| 306 |
+
#endif /* EXTERN */
|
| 307 |
+
|
| 308 |
+
#ifdef __cplusplus
|
| 309 |
+
# define EXTERN extern "C" TCL_STORAGE_CLASS
|
| 310 |
+
#else
|
| 311 |
+
# define EXTERN extern TCL_STORAGE_CLASS
|
| 312 |
+
#endif
|
| 313 |
+
|
| 314 |
+
/*
|
| 315 |
+
*----------------------------------------------------------------------------
|
| 316 |
+
* The following code is copied from winnt.h. If we don't replicate it here,
|
| 317 |
+
* then <windows.h> can't be included after tcl.h, since tcl.h also defines
|
| 318 |
+
* VOID. This block is skipped under Cygwin and Mingw.
|
| 319 |
+
*/
|
| 320 |
+
|
| 321 |
+
#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
|
| 322 |
+
#ifndef VOID
|
| 323 |
+
#define VOID void
|
| 324 |
+
typedef char CHAR;
|
| 325 |
+
typedef short SHORT;
|
| 326 |
+
typedef long LONG;
|
| 327 |
+
#endif
|
| 328 |
+
#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
|
| 329 |
+
|
| 330 |
+
/*
|
| 331 |
+
* Macro to use instead of "void" for arguments that must have type "void *"
|
| 332 |
+
* in ANSI C; maps them to type "char *" in non-ANSI systems.
|
| 333 |
+
*/
|
| 334 |
+
|
| 335 |
+
#ifndef __VXWORKS__
|
| 336 |
+
# ifndef NO_VOID
|
| 337 |
+
# define VOID void
|
| 338 |
+
# else
|
| 339 |
+
# define VOID char
|
| 340 |
+
# endif
|
| 341 |
+
#endif
|
| 342 |
+
|
| 343 |
+
/*
|
| 344 |
+
* Miscellaneous declarations.
|
| 345 |
+
*/
|
| 346 |
+
|
| 347 |
+
#ifndef _CLIENTDATA
|
| 348 |
+
# ifndef NO_VOID
|
| 349 |
+
typedef void *ClientData;
|
| 350 |
+
# else
|
| 351 |
+
typedef int *ClientData;
|
| 352 |
+
# endif
|
| 353 |
+
# define _CLIENTDATA
|
| 354 |
+
#endif
|
| 355 |
+
|
| 356 |
+
/*
|
| 357 |
+
* Darwin specific configure overrides (to support fat compiles, where
|
| 358 |
+
* configure runs only once for multiple architectures):
|
| 359 |
+
*/
|
| 360 |
+
|
| 361 |
+
#ifdef __APPLE__
|
| 362 |
+
# ifdef __LP64__
|
| 363 |
+
# undef TCL_WIDE_INT_TYPE
|
| 364 |
+
# define TCL_WIDE_INT_IS_LONG 1
|
| 365 |
+
# define TCL_CFG_DO64BIT 1
|
| 366 |
+
# else /* !__LP64__ */
|
| 367 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 368 |
+
# undef TCL_WIDE_INT_IS_LONG
|
| 369 |
+
# undef TCL_CFG_DO64BIT
|
| 370 |
+
# endif /* __LP64__ */
|
| 371 |
+
# undef HAVE_STRUCT_STAT64
|
| 372 |
+
#endif /* __APPLE__ */
|
| 373 |
+
|
| 374 |
+
/* Cross-compiling 32-bit on a 64-bit platform? Then our
|
| 375 |
+
* configure script does the wrong thing. Correct that here.
|
| 376 |
+
*/
|
| 377 |
+
#if defined(__GNUC__) && !defined(_WIN32) && !defined(__LP64__)
|
| 378 |
+
# undef TCL_WIDE_INT_IS_LONG
|
| 379 |
+
# undef TCL_WIDE_INT_TYPE
|
| 380 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 381 |
+
#endif
|
| 382 |
+
|
| 383 |
+
/*
|
| 384 |
+
* Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
|
| 385 |
+
* Tcl_WideUInt to be the unsigned variant of that type (assuming that where
|
| 386 |
+
* we have one, we can have the other.)
|
| 387 |
+
*
|
| 388 |
+
* Also defines the following macros:
|
| 389 |
+
* TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
|
| 390 |
+
* LP64 system such as modern Solaris or Linux ... not including Win64)
|
| 391 |
+
* Tcl_WideAsLong - forgetful converter from wideInt to long.
|
| 392 |
+
* Tcl_LongAsWide - sign-extending converter from long to wideInt.
|
| 393 |
+
* Tcl_WideAsDouble - converter from wideInt to double.
|
| 394 |
+
* Tcl_DoubleAsWide - converter from double to wideInt.
|
| 395 |
+
*
|
| 396 |
+
* The following invariant should hold for any long value 'longVal':
|
| 397 |
+
* longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
|
| 398 |
+
*
|
| 399 |
+
* Note on converting between Tcl_WideInt and strings. This implementation (in
|
| 400 |
+
* tclObj.c) depends on the function
|
| 401 |
+
* snprintf(...,"%" TCL_LL_MODIFIER "d",...).
|
| 402 |
+
*/
|
| 403 |
+
|
| 404 |
+
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
|
| 405 |
+
# ifdef _WIN32
|
| 406 |
+
# define TCL_WIDE_INT_TYPE __int64
|
| 407 |
+
# ifdef __BORLANDC__
|
| 408 |
+
# define TCL_LL_MODIFIER "L"
|
| 409 |
+
# elif defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
|
| 410 |
+
# define TCL_LL_MODIFIER "I64"
|
| 411 |
+
# else
|
| 412 |
+
# define TCL_LL_MODIFIER "ll"
|
| 413 |
+
# endif
|
| 414 |
+
# elif defined(__GNUC__)
|
| 415 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 416 |
+
# define TCL_LL_MODIFIER "ll"
|
| 417 |
+
# else /* ! _WIN32 && ! __GNUC__ */
|
| 418 |
+
/*
|
| 419 |
+
* Don't know what platform it is and configure hasn't discovered what is
|
| 420 |
+
* going on for us. Try to guess...
|
| 421 |
+
*/
|
| 422 |
+
# include <limits.h>
|
| 423 |
+
# if (INT_MAX < LONG_MAX)
|
| 424 |
+
# define TCL_WIDE_INT_IS_LONG 1
|
| 425 |
+
# else
|
| 426 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 427 |
+
# endif
|
| 428 |
+
# endif /* _WIN32 */
|
| 429 |
+
#endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
|
| 430 |
+
#ifdef TCL_WIDE_INT_IS_LONG
|
| 431 |
+
# undef TCL_WIDE_INT_TYPE
|
| 432 |
+
# define TCL_WIDE_INT_TYPE long
|
| 433 |
+
#endif /* TCL_WIDE_INT_IS_LONG */
|
| 434 |
+
|
| 435 |
+
typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
|
| 436 |
+
typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
| 437 |
+
|
| 438 |
+
#ifdef TCL_WIDE_INT_IS_LONG
|
| 439 |
+
# define Tcl_WideAsLong(val) ((long)(val))
|
| 440 |
+
# define Tcl_LongAsWide(val) ((long)(val))
|
| 441 |
+
# define Tcl_WideAsDouble(val) ((double)((long)(val)))
|
| 442 |
+
# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
|
| 443 |
+
# ifndef TCL_LL_MODIFIER
|
| 444 |
+
# define TCL_LL_MODIFIER "l"
|
| 445 |
+
# endif /* !TCL_LL_MODIFIER */
|
| 446 |
+
#else /* TCL_WIDE_INT_IS_LONG */
|
| 447 |
+
/*
|
| 448 |
+
* The next short section of defines are only done when not running on Windows
|
| 449 |
+
* or some other strange platform.
|
| 450 |
+
*/
|
| 451 |
+
# ifndef TCL_LL_MODIFIER
|
| 452 |
+
# define TCL_LL_MODIFIER "ll"
|
| 453 |
+
# endif /* !TCL_LL_MODIFIER */
|
| 454 |
+
# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
|
| 455 |
+
# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
|
| 456 |
+
# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
|
| 457 |
+
# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
|
| 458 |
+
#endif /* TCL_WIDE_INT_IS_LONG */
|
| 459 |
+
|
| 460 |
+
#ifdef _WIN32
|
| 461 |
+
# ifdef __BORLANDC__
|
| 462 |
+
typedef struct stati64 Tcl_StatBuf;
|
| 463 |
+
# elif defined(_WIN64) || defined(_USE_64BIT_TIME_T)
|
| 464 |
+
typedef struct __stat64 Tcl_StatBuf;
|
| 465 |
+
# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
|
| 466 |
+
typedef struct _stati64 Tcl_StatBuf;
|
| 467 |
+
# else
|
| 468 |
+
typedef struct _stat32i64 Tcl_StatBuf;
|
| 469 |
+
# endif /* _MSC_VER < 1400 */
|
| 470 |
+
#elif defined(__CYGWIN__)
|
| 471 |
+
typedef struct {
|
| 472 |
+
unsigned st_dev;
|
| 473 |
+
unsigned short st_ino;
|
| 474 |
+
unsigned short st_mode;
|
| 475 |
+
short st_nlink;
|
| 476 |
+
short st_uid;
|
| 477 |
+
short st_gid;
|
| 478 |
+
/* Here is a 2-byte gap */
|
| 479 |
+
unsigned st_rdev;
|
| 480 |
+
/* Here is a 4-byte gap */
|
| 481 |
+
long long st_size;
|
| 482 |
+
struct {long tv_sec;} st_atim;
|
| 483 |
+
struct {long tv_sec;} st_mtim;
|
| 484 |
+
struct {long tv_sec;} st_ctim;
|
| 485 |
+
} Tcl_StatBuf;
|
| 486 |
+
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
|
| 487 |
+
typedef struct stat64 Tcl_StatBuf;
|
| 488 |
+
#else
|
| 489 |
+
typedef struct stat Tcl_StatBuf;
|
| 490 |
+
#endif
|
| 491 |
+
|
| 492 |
+
/*
|
| 493 |
+
*----------------------------------------------------------------------------
|
| 494 |
+
* Data structures defined opaquely in this module. The definitions below just
|
| 495 |
+
* provide dummy types. A few fields are made visible in Tcl_Interp
|
| 496 |
+
* structures, namely those used for returning a string result from commands.
|
| 497 |
+
* Direct access to the result field is discouraged in Tcl 8.0. The
|
| 498 |
+
* interpreter result is either an object or a string, and the two values are
|
| 499 |
+
* kept consistent unless some C code sets interp->result directly.
|
| 500 |
+
* Programmers should use either the function Tcl_GetObjResult() or
|
| 501 |
+
* Tcl_GetStringResult() to read the interpreter's result. See the SetResult
|
| 502 |
+
* man page for details.
|
| 503 |
+
*
|
| 504 |
+
* Note: any change to the Tcl_Interp definition below must be mirrored in the
|
| 505 |
+
* "real" definition in tclInt.h.
|
| 506 |
+
*
|
| 507 |
+
* Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
|
| 508 |
+
* Instead, they set a Tcl_Obj member in the "real" structure that can be
|
| 509 |
+
* accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
|
| 510 |
+
*/
|
| 511 |
+
|
| 512 |
+
typedef struct Tcl_Interp
|
| 513 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 514 |
+
{
|
| 515 |
+
/* TIP #330: Strongly discourage extensions from using the string
|
| 516 |
+
* result. */
|
| 517 |
+
#ifdef USE_INTERP_RESULT
|
| 518 |
+
char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
|
| 519 |
+
/* If the last command returned a string
|
| 520 |
+
* result, this points to it. */
|
| 521 |
+
void (*freeProc) (char *blockPtr)
|
| 522 |
+
TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
|
| 523 |
+
/* Zero means the string result is statically
|
| 524 |
+
* allocated. TCL_DYNAMIC means it was
|
| 525 |
+
* allocated with ckalloc and should be freed
|
| 526 |
+
* with ckfree. Other values give the address
|
| 527 |
+
* of function to invoke to free the result.
|
| 528 |
+
* Tcl_Eval must free it before executing next
|
| 529 |
+
* command. */
|
| 530 |
+
#else
|
| 531 |
+
char *resultDontUse; /* Don't use in extensions! */
|
| 532 |
+
void (*freeProcDontUse) (char *); /* Don't use in extensions! */
|
| 533 |
+
#endif
|
| 534 |
+
#ifdef USE_INTERP_ERRORLINE
|
| 535 |
+
int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine");
|
| 536 |
+
/* When TCL_ERROR is returned, this gives the
|
| 537 |
+
* line number within the command where the
|
| 538 |
+
* error occurred (1 if first line). */
|
| 539 |
+
#else
|
| 540 |
+
int errorLineDontUse; /* Don't use in extensions! */
|
| 541 |
+
#endif
|
| 542 |
+
}
|
| 543 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 544 |
+
Tcl_Interp;
|
| 545 |
+
|
| 546 |
+
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
|
| 547 |
+
typedef struct Tcl_Channel_ *Tcl_Channel;
|
| 548 |
+
typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
|
| 549 |
+
typedef struct Tcl_Command_ *Tcl_Command;
|
| 550 |
+
typedef struct Tcl_Condition_ *Tcl_Condition;
|
| 551 |
+
typedef struct Tcl_Dict_ *Tcl_Dict;
|
| 552 |
+
typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
|
| 553 |
+
typedef struct Tcl_Encoding_ *Tcl_Encoding;
|
| 554 |
+
typedef struct Tcl_Event Tcl_Event;
|
| 555 |
+
typedef struct Tcl_InterpState_ *Tcl_InterpState;
|
| 556 |
+
typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
|
| 557 |
+
typedef struct Tcl_Mutex_ *Tcl_Mutex;
|
| 558 |
+
typedef struct Tcl_Pid_ *Tcl_Pid;
|
| 559 |
+
typedef struct Tcl_RegExp_ *Tcl_RegExp;
|
| 560 |
+
typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
|
| 561 |
+
typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
|
| 562 |
+
typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
|
| 563 |
+
typedef struct Tcl_Trace_ *Tcl_Trace;
|
| 564 |
+
typedef struct Tcl_Var_ *Tcl_Var;
|
| 565 |
+
typedef struct Tcl_ZLibStream_ *Tcl_ZlibStream;
|
| 566 |
+
|
| 567 |
+
/*
|
| 568 |
+
*----------------------------------------------------------------------------
|
| 569 |
+
* Definition of the interface to functions implementing threads. A function
|
| 570 |
+
* following this definition is given to each call of 'Tcl_CreateThread' and
|
| 571 |
+
* will be called as the main fuction of the new thread created by that call.
|
| 572 |
+
*/
|
| 573 |
+
|
| 574 |
+
#if defined _WIN32
|
| 575 |
+
typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData);
|
| 576 |
+
#else
|
| 577 |
+
typedef void (Tcl_ThreadCreateProc) (ClientData clientData);
|
| 578 |
+
#endif
|
| 579 |
+
|
| 580 |
+
/*
|
| 581 |
+
* Threading function return types used for abstracting away platform
|
| 582 |
+
* differences when writing a Tcl_ThreadCreateProc. See the NewThread function
|
| 583 |
+
* in generic/tclThreadTest.c for it's usage.
|
| 584 |
+
*/
|
| 585 |
+
|
| 586 |
+
#if defined _WIN32
|
| 587 |
+
# define Tcl_ThreadCreateType unsigned __stdcall
|
| 588 |
+
# define TCL_THREAD_CREATE_RETURN return 0
|
| 589 |
+
#else
|
| 590 |
+
# define Tcl_ThreadCreateType void
|
| 591 |
+
# define TCL_THREAD_CREATE_RETURN
|
| 592 |
+
#endif
|
| 593 |
+
|
| 594 |
+
/*
|
| 595 |
+
* Definition of values for default stacksize and the possible flags to be
|
| 596 |
+
* given to Tcl_CreateThread.
|
| 597 |
+
*/
|
| 598 |
+
|
| 599 |
+
#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
|
| 600 |
+
#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default
|
| 601 |
+
* behaviour. */
|
| 602 |
+
#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable. */
|
| 603 |
+
|
| 604 |
+
/*
|
| 605 |
+
* Flag values passed to Tcl_StringCaseMatch.
|
| 606 |
+
*/
|
| 607 |
+
|
| 608 |
+
#define TCL_MATCH_NOCASE (1<<0)
|
| 609 |
+
|
| 610 |
+
/*
|
| 611 |
+
* Flag values passed to Tcl_GetRegExpFromObj.
|
| 612 |
+
*/
|
| 613 |
+
|
| 614 |
+
#define TCL_REG_BASIC 000000 /* BREs (convenience). */
|
| 615 |
+
#define TCL_REG_EXTENDED 000001 /* EREs. */
|
| 616 |
+
#define TCL_REG_ADVF 000002 /* Advanced features in EREs. */
|
| 617 |
+
#define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs). */
|
| 618 |
+
#define TCL_REG_QUOTE 000004 /* No special characters, none. */
|
| 619 |
+
#define TCL_REG_NOCASE 000010 /* Ignore case. */
|
| 620 |
+
#define TCL_REG_NOSUB 000020 /* Don't care about subexpressions. */
|
| 621 |
+
#define TCL_REG_EXPANDED 000040 /* Expanded format, white space &
|
| 622 |
+
* comments. */
|
| 623 |
+
#define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
|
| 624 |
+
#define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before. */
|
| 625 |
+
#define TCL_REG_NEWLINE 000300 /* Newlines are line terminators. */
|
| 626 |
+
#define TCL_REG_CANMATCH 001000 /* Report details on partial/limited
|
| 627 |
+
* matches. */
|
| 628 |
+
|
| 629 |
+
/*
|
| 630 |
+
* Flags values passed to Tcl_RegExpExecObj.
|
| 631 |
+
*/
|
| 632 |
+
|
| 633 |
+
#define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
|
| 634 |
+
#define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
|
| 635 |
+
|
| 636 |
+
/*
|
| 637 |
+
* Structures filled in by Tcl_RegExpInfo. Note that all offset values are
|
| 638 |
+
* relative to the start of the match string, not the beginning of the entire
|
| 639 |
+
* string.
|
| 640 |
+
*/
|
| 641 |
+
|
| 642 |
+
typedef struct Tcl_RegExpIndices {
|
| 643 |
+
long start; /* Character offset of first character in
|
| 644 |
+
* match. */
|
| 645 |
+
long end; /* Character offset of first character after
|
| 646 |
+
* the match. */
|
| 647 |
+
} Tcl_RegExpIndices;
|
| 648 |
+
|
| 649 |
+
typedef struct Tcl_RegExpInfo {
|
| 650 |
+
int nsubs; /* Number of subexpressions in the compiled
|
| 651 |
+
* expression. */
|
| 652 |
+
Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
|
| 653 |
+
long extendStart; /* The offset at which a subsequent match
|
| 654 |
+
* might begin. */
|
| 655 |
+
long reserved; /* Reserved for later use. */
|
| 656 |
+
} Tcl_RegExpInfo;
|
| 657 |
+
|
| 658 |
+
/*
|
| 659 |
+
* Picky compilers complain if this typdef doesn't appear before the struct's
|
| 660 |
+
* reference in tclDecls.h.
|
| 661 |
+
*/
|
| 662 |
+
|
| 663 |
+
typedef Tcl_StatBuf *Tcl_Stat_;
|
| 664 |
+
typedef struct stat *Tcl_OldStat_;
|
| 665 |
+
|
| 666 |
+
/*
|
| 667 |
+
*----------------------------------------------------------------------------
|
| 668 |
+
* When a TCL command returns, the interpreter contains a result from the
|
| 669 |
+
* command. Programmers are strongly encouraged to use one of the functions
|
| 670 |
+
* Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
|
| 671 |
+
* result. See the SetResult man page for details. Besides this result, the
|
| 672 |
+
* command function returns an integer code, which is one of the following:
|
| 673 |
+
*
|
| 674 |
+
* TCL_OK Command completed normally; the interpreter's result
|
| 675 |
+
* contains the command's result.
|
| 676 |
+
* TCL_ERROR The command couldn't be completed successfully; the
|
| 677 |
+
* interpreter's result describes what went wrong.
|
| 678 |
+
* TCL_RETURN The command requests that the current function return;
|
| 679 |
+
* the interpreter's result contains the function's
|
| 680 |
+
* return value.
|
| 681 |
+
* TCL_BREAK The command requests that the innermost loop be
|
| 682 |
+
* exited; the interpreter's result is meaningless.
|
| 683 |
+
* TCL_CONTINUE Go on to the next iteration of the current loop; the
|
| 684 |
+
* interpreter's result is meaningless.
|
| 685 |
+
*/
|
| 686 |
+
|
| 687 |
+
#define TCL_OK 0
|
| 688 |
+
#define TCL_ERROR 1
|
| 689 |
+
#define TCL_RETURN 2
|
| 690 |
+
#define TCL_BREAK 3
|
| 691 |
+
#define TCL_CONTINUE 4
|
| 692 |
+
|
| 693 |
+
#define TCL_RESULT_SIZE 200
|
| 694 |
+
|
| 695 |
+
/*
|
| 696 |
+
*----------------------------------------------------------------------------
|
| 697 |
+
* Flags to control what substitutions are performed by Tcl_SubstObj():
|
| 698 |
+
*/
|
| 699 |
+
|
| 700 |
+
#define TCL_SUBST_COMMANDS 001
|
| 701 |
+
#define TCL_SUBST_VARIABLES 002
|
| 702 |
+
#define TCL_SUBST_BACKSLASHES 004
|
| 703 |
+
#define TCL_SUBST_ALL 007
|
| 704 |
+
|
| 705 |
+
/*
|
| 706 |
+
* Argument descriptors for math function callbacks in expressions:
|
| 707 |
+
*/
|
| 708 |
+
|
| 709 |
+
typedef enum {
|
| 710 |
+
TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
|
| 711 |
+
} Tcl_ValueType;
|
| 712 |
+
|
| 713 |
+
typedef struct Tcl_Value {
|
| 714 |
+
Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
|
| 715 |
+
* or both. */
|
| 716 |
+
long intValue; /* Integer value. */
|
| 717 |
+
double doubleValue; /* Double-precision floating value. */
|
| 718 |
+
Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
|
| 719 |
+
} Tcl_Value;
|
| 720 |
+
|
| 721 |
+
/*
|
| 722 |
+
* Forward declaration of Tcl_Obj to prevent an error when the forward
|
| 723 |
+
* reference to Tcl_Obj is encountered in the function types declared below.
|
| 724 |
+
*/
|
| 725 |
+
|
| 726 |
+
struct Tcl_Obj;
|
| 727 |
+
|
| 728 |
+
/*
|
| 729 |
+
*----------------------------------------------------------------------------
|
| 730 |
+
* Function types defined by Tcl:
|
| 731 |
+
*/
|
| 732 |
+
|
| 733 |
+
typedef int (Tcl_AppInitProc) (Tcl_Interp *interp);
|
| 734 |
+
typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp,
|
| 735 |
+
int code);
|
| 736 |
+
typedef void (Tcl_ChannelProc) (ClientData clientData, int mask);
|
| 737 |
+
typedef void (Tcl_CloseProc) (ClientData data);
|
| 738 |
+
typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
|
| 739 |
+
typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
|
| 740 |
+
int argc, CONST84 char *argv[]);
|
| 741 |
+
typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 742 |
+
int level, char *command, Tcl_CmdProc *proc,
|
| 743 |
+
ClientData cmdClientData, int argc, CONST84 char *argv[]);
|
| 744 |
+
typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 745 |
+
int level, const char *command, Tcl_Command commandInfo, int objc,
|
| 746 |
+
struct Tcl_Obj *const *objv);
|
| 747 |
+
typedef void (Tcl_CmdObjTraceDeleteProc) (ClientData clientData);
|
| 748 |
+
typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
|
| 749 |
+
struct Tcl_Obj *dupPtr);
|
| 750 |
+
typedef int (Tcl_EncodingConvertProc) (ClientData clientData, const char *src,
|
| 751 |
+
int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst,
|
| 752 |
+
int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr);
|
| 753 |
+
typedef void (Tcl_EncodingFreeProc) (ClientData clientData);
|
| 754 |
+
typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags);
|
| 755 |
+
typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags);
|
| 756 |
+
typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData);
|
| 757 |
+
typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags);
|
| 758 |
+
typedef void (Tcl_ExitProc) (ClientData clientData);
|
| 759 |
+
typedef void (Tcl_FileProc) (ClientData clientData, int mask);
|
| 760 |
+
typedef void (Tcl_FileFreeProc) (ClientData clientData);
|
| 761 |
+
typedef void (Tcl_FreeInternalRepProc) (struct Tcl_Obj *objPtr);
|
| 762 |
+
typedef void (Tcl_FreeProc) (char *blockPtr);
|
| 763 |
+
typedef void (Tcl_IdleProc) (ClientData clientData);
|
| 764 |
+
typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
|
| 765 |
+
Tcl_Interp *interp);
|
| 766 |
+
typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
|
| 767 |
+
Tcl_Value *args, Tcl_Value *resultPtr);
|
| 768 |
+
typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
|
| 769 |
+
typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
|
| 770 |
+
int objc, struct Tcl_Obj *const *objv);
|
| 771 |
+
typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp);
|
| 772 |
+
typedef int (Tcl_PackageUnloadProc) (Tcl_Interp *interp, int flags);
|
| 773 |
+
typedef void (Tcl_PanicProc) (const char *format, ...);
|
| 774 |
+
typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan,
|
| 775 |
+
char *address, int port);
|
| 776 |
+
typedef void (Tcl_TimerProc) (ClientData clientData);
|
| 777 |
+
typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr);
|
| 778 |
+
typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr);
|
| 779 |
+
typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 780 |
+
CONST84 char *part1, CONST84 char *part2, int flags);
|
| 781 |
+
typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 782 |
+
const char *oldName, const char *newName, int flags);
|
| 783 |
+
typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc,
|
| 784 |
+
ClientData clientData);
|
| 785 |
+
typedef void (Tcl_DeleteFileHandlerProc) (int fd);
|
| 786 |
+
typedef void (Tcl_AlertNotifierProc) (ClientData clientData);
|
| 787 |
+
typedef void (Tcl_ServiceModeHookProc) (int mode);
|
| 788 |
+
typedef ClientData (Tcl_InitNotifierProc) (void);
|
| 789 |
+
typedef void (Tcl_FinalizeNotifierProc) (ClientData clientData);
|
| 790 |
+
typedef void (Tcl_MainLoopProc) (void);
|
| 791 |
+
|
| 792 |
+
/*
|
| 793 |
+
*----------------------------------------------------------------------------
|
| 794 |
+
* The following structure represents a type of object, which is a particular
|
| 795 |
+
* internal representation for an object plus a set of functions that provide
|
| 796 |
+
* standard operations on objects of that type.
|
| 797 |
+
*/
|
| 798 |
+
|
| 799 |
+
typedef struct Tcl_ObjType {
|
| 800 |
+
const char *name; /* Name of the type, e.g. "int". */
|
| 801 |
+
Tcl_FreeInternalRepProc *freeIntRepProc;
|
| 802 |
+
/* Called to free any storage for the type's
|
| 803 |
+
* internal rep. NULL if the internal rep does
|
| 804 |
+
* not need freeing. */
|
| 805 |
+
Tcl_DupInternalRepProc *dupIntRepProc;
|
| 806 |
+
/* Called to create a new object as a copy of
|
| 807 |
+
* an existing object. */
|
| 808 |
+
Tcl_UpdateStringProc *updateStringProc;
|
| 809 |
+
/* Called to update the string rep from the
|
| 810 |
+
* type's internal representation. */
|
| 811 |
+
Tcl_SetFromAnyProc *setFromAnyProc;
|
| 812 |
+
/* Called to convert the object's internal rep
|
| 813 |
+
* to this type. Frees the internal rep of the
|
| 814 |
+
* old type. Returns TCL_ERROR on failure. */
|
| 815 |
+
} Tcl_ObjType;
|
| 816 |
+
|
| 817 |
+
/*
|
| 818 |
+
* One of the following structures exists for each object in the Tcl system.
|
| 819 |
+
* An object stores a value as either a string, some internal representation,
|
| 820 |
+
* or both.
|
| 821 |
+
*/
|
| 822 |
+
|
| 823 |
+
typedef struct Tcl_Obj {
|
| 824 |
+
int refCount; /* When 0 the object will be freed. */
|
| 825 |
+
char *bytes; /* This points to the first byte of the
|
| 826 |
+
* object's string representation. The array
|
| 827 |
+
* must be followed by a null byte (i.e., at
|
| 828 |
+
* offset length) but may also contain
|
| 829 |
+
* embedded null characters. The array's
|
| 830 |
+
* storage is allocated by ckalloc. NULL means
|
| 831 |
+
* the string rep is invalid and must be
|
| 832 |
+
* regenerated from the internal rep. Clients
|
| 833 |
+
* should use Tcl_GetStringFromObj or
|
| 834 |
+
* Tcl_GetString to get a pointer to the byte
|
| 835 |
+
* array as a readonly value. */
|
| 836 |
+
int length; /* The number of bytes at *bytes, not
|
| 837 |
+
* including the terminating null. */
|
| 838 |
+
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
|
| 839 |
+
* corresponds to the type of the object's
|
| 840 |
+
* internal rep. NULL indicates the object has
|
| 841 |
+
* no internal rep (has no type). */
|
| 842 |
+
union { /* The internal representation: */
|
| 843 |
+
long longValue; /* - an long integer value. */
|
| 844 |
+
double doubleValue; /* - a double-precision floating value. */
|
| 845 |
+
void *otherValuePtr; /* - another, type-specific value,
|
| 846 |
+
not used internally any more. */
|
| 847 |
+
Tcl_WideInt wideValue; /* - a long long value. */
|
| 848 |
+
struct { /* - internal rep as two pointers.
|
| 849 |
+
* the main use of which is a bignum's
|
| 850 |
+
* tightly packed fields, where the alloc,
|
| 851 |
+
* used and signum flags are packed into
|
| 852 |
+
* ptr2 with everything else hung off ptr1. */
|
| 853 |
+
void *ptr1;
|
| 854 |
+
void *ptr2;
|
| 855 |
+
} twoPtrValue;
|
| 856 |
+
struct { /* - internal rep as a pointer and a long,
|
| 857 |
+
not used internally any more. */
|
| 858 |
+
void *ptr;
|
| 859 |
+
unsigned long value;
|
| 860 |
+
} ptrAndLongRep;
|
| 861 |
+
} internalRep;
|
| 862 |
+
} Tcl_Obj;
|
| 863 |
+
|
| 864 |
+
/*
|
| 865 |
+
* Macros to increment and decrement a Tcl_Obj's reference count, and to test
|
| 866 |
+
* whether an object is shared (i.e. has reference count > 1). Note: clients
|
| 867 |
+
* should use Tcl_DecrRefCount() when they are finished using an object, and
|
| 868 |
+
* should never call TclFreeObj() directly. TclFreeObj() is only defined and
|
| 869 |
+
* made public in tcl.h to support Tcl_DecrRefCount's macro definition.
|
| 870 |
+
*/
|
| 871 |
+
|
| 872 |
+
void Tcl_IncrRefCount(Tcl_Obj *objPtr);
|
| 873 |
+
void Tcl_DecrRefCount(Tcl_Obj *objPtr);
|
| 874 |
+
int Tcl_IsShared(Tcl_Obj *objPtr);
|
| 875 |
+
|
| 876 |
+
/*
|
| 877 |
+
*----------------------------------------------------------------------------
|
| 878 |
+
* The following structure contains the state needed by Tcl_SaveResult. No-one
|
| 879 |
+
* outside of Tcl should access any of these fields. This structure is
|
| 880 |
+
* typically allocated on the stack.
|
| 881 |
+
*/
|
| 882 |
+
|
| 883 |
+
typedef struct Tcl_SavedResult {
|
| 884 |
+
char *result;
|
| 885 |
+
Tcl_FreeProc *freeProc;
|
| 886 |
+
Tcl_Obj *objResultPtr;
|
| 887 |
+
char *appendResult;
|
| 888 |
+
int appendAvl;
|
| 889 |
+
int appendUsed;
|
| 890 |
+
char resultSpace[TCL_RESULT_SIZE+1];
|
| 891 |
+
} Tcl_SavedResult;
|
| 892 |
+
|
| 893 |
+
/*
|
| 894 |
+
*----------------------------------------------------------------------------
|
| 895 |
+
* The following definitions support Tcl's namespace facility. Note: the first
|
| 896 |
+
* five fields must match exactly the fields in a Namespace structure (see
|
| 897 |
+
* tclInt.h).
|
| 898 |
+
*/
|
| 899 |
+
|
| 900 |
+
typedef struct Tcl_Namespace {
|
| 901 |
+
char *name; /* The namespace's name within its parent
|
| 902 |
+
* namespace. This contains no ::'s. The name
|
| 903 |
+
* of the global namespace is "" although "::"
|
| 904 |
+
* is an synonym. */
|
| 905 |
+
char *fullName; /* The namespace's fully qualified name. This
|
| 906 |
+
* starts with ::. */
|
| 907 |
+
ClientData clientData; /* Arbitrary value associated with this
|
| 908 |
+
* namespace. */
|
| 909 |
+
Tcl_NamespaceDeleteProc *deleteProc;
|
| 910 |
+
/* Function invoked when deleting the
|
| 911 |
+
* namespace to, e.g., free clientData. */
|
| 912 |
+
struct Tcl_Namespace *parentPtr;
|
| 913 |
+
/* Points to the namespace that contains this
|
| 914 |
+
* one. NULL if this is the global
|
| 915 |
+
* namespace. */
|
| 916 |
+
} Tcl_Namespace;
|
| 917 |
+
|
| 918 |
+
/*
|
| 919 |
+
*----------------------------------------------------------------------------
|
| 920 |
+
* The following structure represents a call frame, or activation record. A
|
| 921 |
+
* call frame defines a naming context for a procedure call: its local scope
|
| 922 |
+
* (for local variables) and its namespace scope (used for non-local
|
| 923 |
+
* variables; often the global :: namespace). A call frame can also define the
|
| 924 |
+
* naming context for a namespace eval or namespace inscope command: the
|
| 925 |
+
* namespace in which the command's code should execute. The Tcl_CallFrame
|
| 926 |
+
* structures exist only while procedures or namespace eval/inscope's are
|
| 927 |
+
* being executed, and provide a Tcl call stack.
|
| 928 |
+
*
|
| 929 |
+
* A call frame is initialized and pushed using Tcl_PushCallFrame and popped
|
| 930 |
+
* using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
|
| 931 |
+
* Tcl_PushCallFrame caller, and callers typically allocate them on the C call
|
| 932 |
+
* stack for efficiency. For this reason, Tcl_CallFrame is defined as a
|
| 933 |
+
* structure and not as an opaque token. However, most Tcl_CallFrame fields
|
| 934 |
+
* are hidden since applications should not access them directly; others are
|
| 935 |
+
* declared as "dummyX".
|
| 936 |
+
*
|
| 937 |
+
* WARNING!! The structure definition must be kept consistent with the
|
| 938 |
+
* CallFrame structure in tclInt.h. If you change one, change the other.
|
| 939 |
+
*/
|
| 940 |
+
|
| 941 |
+
typedef struct Tcl_CallFrame {
|
| 942 |
+
Tcl_Namespace *nsPtr;
|
| 943 |
+
int dummy1;
|
| 944 |
+
int dummy2;
|
| 945 |
+
void *dummy3;
|
| 946 |
+
void *dummy4;
|
| 947 |
+
void *dummy5;
|
| 948 |
+
int dummy6;
|
| 949 |
+
void *dummy7;
|
| 950 |
+
void *dummy8;
|
| 951 |
+
int dummy9;
|
| 952 |
+
void *dummy10;
|
| 953 |
+
void *dummy11;
|
| 954 |
+
void *dummy12;
|
| 955 |
+
void *dummy13;
|
| 956 |
+
} Tcl_CallFrame;
|
| 957 |
+
|
| 958 |
+
/*
|
| 959 |
+
*----------------------------------------------------------------------------
|
| 960 |
+
* Information about commands that is returned by Tcl_GetCommandInfo and
|
| 961 |
+
* passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
|
| 962 |
+
* function while proc is a traditional Tcl argc/argv string-based function.
|
| 963 |
+
* Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
|
| 964 |
+
* proc are non-NULL and can be called to execute the command. However, it may
|
| 965 |
+
* be faster to call one instead of the other. The member isNativeObjectProc
|
| 966 |
+
* is set to 1 if an object-based function was registered by
|
| 967 |
+
* Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
|
| 968 |
+
* Tcl_CreateCommand. The other function is typically set to a compatibility
|
| 969 |
+
* wrapper that does string-to-object or object-to-string argument conversions
|
| 970 |
+
* then calls the other function.
|
| 971 |
+
*/
|
| 972 |
+
|
| 973 |
+
typedef struct Tcl_CmdInfo {
|
| 974 |
+
int isNativeObjectProc; /* 1 if objProc was registered by a call to
|
| 975 |
+
* Tcl_CreateObjCommand; 0 otherwise.
|
| 976 |
+
* Tcl_SetCmdInfo does not modify this
|
| 977 |
+
* field. */
|
| 978 |
+
Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
|
| 979 |
+
ClientData objClientData; /* ClientData for object proc. */
|
| 980 |
+
Tcl_CmdProc *proc; /* Command's string-based function. */
|
| 981 |
+
ClientData clientData; /* ClientData for string proc. */
|
| 982 |
+
Tcl_CmdDeleteProc *deleteProc;
|
| 983 |
+
/* Function to call when command is
|
| 984 |
+
* deleted. */
|
| 985 |
+
ClientData deleteData; /* Value to pass to deleteProc (usually the
|
| 986 |
+
* same as clientData). */
|
| 987 |
+
Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this
|
| 988 |
+
* command. Note that Tcl_SetCmdInfo will not
|
| 989 |
+
* change a command's namespace; use
|
| 990 |
+
* TclRenameCommand or Tcl_Eval (of 'rename')
|
| 991 |
+
* to do that. */
|
| 992 |
+
} Tcl_CmdInfo;
|
| 993 |
+
|
| 994 |
+
/*
|
| 995 |
+
*----------------------------------------------------------------------------
|
| 996 |
+
* The structure defined below is used to hold dynamic strings. The only
|
| 997 |
+
* fields that clients should use are string and length, accessible via the
|
| 998 |
+
* macros Tcl_DStringValue and Tcl_DStringLength.
|
| 999 |
+
*/
|
| 1000 |
+
|
| 1001 |
+
#define TCL_DSTRING_STATIC_SIZE 200
|
| 1002 |
+
typedef struct Tcl_DString {
|
| 1003 |
+
char *string; /* Points to beginning of string: either
|
| 1004 |
+
* staticSpace below or a malloced array. */
|
| 1005 |
+
int length; /* Number of non-NULL characters in the
|
| 1006 |
+
* string. */
|
| 1007 |
+
int spaceAvl; /* Total number of bytes available for the
|
| 1008 |
+
* string and its terminating NULL char. */
|
| 1009 |
+
char staticSpace[TCL_DSTRING_STATIC_SIZE];
|
| 1010 |
+
/* Space to use in common case where string is
|
| 1011 |
+
* small. */
|
| 1012 |
+
} Tcl_DString;
|
| 1013 |
+
|
| 1014 |
+
#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
|
| 1015 |
+
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
|
| 1016 |
+
#define Tcl_DStringTrunc Tcl_DStringSetLength
|
| 1017 |
+
|
| 1018 |
+
/*
|
| 1019 |
+
* Definitions for the maximum number of digits of precision that may be
|
| 1020 |
+
* specified in the "tcl_precision" variable, and the number of bytes of
|
| 1021 |
+
* buffer space required by Tcl_PrintDouble.
|
| 1022 |
+
*/
|
| 1023 |
+
|
| 1024 |
+
#define TCL_MAX_PREC 17
|
| 1025 |
+
#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
|
| 1026 |
+
|
| 1027 |
+
/*
|
| 1028 |
+
* Definition for a number of bytes of buffer space sufficient to hold the
|
| 1029 |
+
* string representation of an integer in base 10 (assuming the existence of
|
| 1030 |
+
* 64-bit integers).
|
| 1031 |
+
*/
|
| 1032 |
+
|
| 1033 |
+
#define TCL_INTEGER_SPACE 24
|
| 1034 |
+
|
| 1035 |
+
/*
|
| 1036 |
+
* Flag values passed to Tcl_ConvertElement.
|
| 1037 |
+
* TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
|
| 1038 |
+
* use backslash quoting instead.
|
| 1039 |
+
* TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
|
| 1040 |
+
* is safe to leave the hash unquoted when the element is not the first
|
| 1041 |
+
* element of a list, and this flag can be used by the caller to indicate
|
| 1042 |
+
* that condition.
|
| 1043 |
+
*/
|
| 1044 |
+
|
| 1045 |
+
#define TCL_DONT_USE_BRACES 1
|
| 1046 |
+
#define TCL_DONT_QUOTE_HASH 8
|
| 1047 |
+
|
| 1048 |
+
/*
|
| 1049 |
+
* Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
|
| 1050 |
+
* abbreviated strings.
|
| 1051 |
+
*/
|
| 1052 |
+
|
| 1053 |
+
#define TCL_EXACT 1
|
| 1054 |
+
|
| 1055 |
+
/*
|
| 1056 |
+
*----------------------------------------------------------------------------
|
| 1057 |
+
* Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
|
| 1058 |
+
* WARNING: these bit choices must not conflict with the bit choices for
|
| 1059 |
+
* evalFlag bits in tclInt.h!
|
| 1060 |
+
*
|
| 1061 |
+
* Meanings:
|
| 1062 |
+
* TCL_NO_EVAL: Just record this command
|
| 1063 |
+
* TCL_EVAL_GLOBAL: Execute script in global namespace
|
| 1064 |
+
* TCL_EVAL_DIRECT: Do not compile this script
|
| 1065 |
+
* TCL_EVAL_INVOKE: Magical Tcl_EvalObjv mode for aliases/ensembles
|
| 1066 |
+
* o Run in iPtr->lookupNsPtr or global namespace
|
| 1067 |
+
* o Cut out of error traces
|
| 1068 |
+
* o Don't reset the flags controlling ensemble
|
| 1069 |
+
* error message rewriting.
|
| 1070 |
+
* TCL_CANCEL_UNWIND: Magical Tcl_CancelEval mode that causes the
|
| 1071 |
+
* stack for the script in progress to be
|
| 1072 |
+
* completely unwound.
|
| 1073 |
+
* TCL_EVAL_NOERR: Do no exception reporting at all, just return
|
| 1074 |
+
* as the caller will report.
|
| 1075 |
+
*/
|
| 1076 |
+
|
| 1077 |
+
#define TCL_NO_EVAL 0x010000
|
| 1078 |
+
#define TCL_EVAL_GLOBAL 0x020000
|
| 1079 |
+
#define TCL_EVAL_DIRECT 0x040000
|
| 1080 |
+
#define TCL_EVAL_INVOKE 0x080000
|
| 1081 |
+
#define TCL_CANCEL_UNWIND 0x100000
|
| 1082 |
+
#define TCL_EVAL_NOERR 0x200000
|
| 1083 |
+
|
| 1084 |
+
/*
|
| 1085 |
+
* Special freeProc values that may be passed to Tcl_SetResult (see the man
|
| 1086 |
+
* page for details):
|
| 1087 |
+
*/
|
| 1088 |
+
|
| 1089 |
+
#define TCL_VOLATILE ((Tcl_FreeProc *) 1)
|
| 1090 |
+
#define TCL_STATIC ((Tcl_FreeProc *) 0)
|
| 1091 |
+
#define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
|
| 1092 |
+
|
| 1093 |
+
/*
|
| 1094 |
+
* Flag values passed to variable-related functions.
|
| 1095 |
+
* WARNING: these bit choices must not conflict with the bit choice for
|
| 1096 |
+
* TCL_CANCEL_UNWIND, above.
|
| 1097 |
+
*/
|
| 1098 |
+
|
| 1099 |
+
#define TCL_GLOBAL_ONLY 1
|
| 1100 |
+
#define TCL_NAMESPACE_ONLY 2
|
| 1101 |
+
#define TCL_APPEND_VALUE 4
|
| 1102 |
+
#define TCL_LIST_ELEMENT 8
|
| 1103 |
+
#define TCL_TRACE_READS 0x10
|
| 1104 |
+
#define TCL_TRACE_WRITES 0x20
|
| 1105 |
+
#define TCL_TRACE_UNSETS 0x40
|
| 1106 |
+
#define TCL_TRACE_DESTROYED 0x80
|
| 1107 |
+
#define TCL_INTERP_DESTROYED 0x100
|
| 1108 |
+
#define TCL_LEAVE_ERR_MSG 0x200
|
| 1109 |
+
#define TCL_TRACE_ARRAY 0x800
|
| 1110 |
+
#ifndef TCL_REMOVE_OBSOLETE_TRACES
|
| 1111 |
+
/* Required to support old variable/vdelete/vinfo traces. */
|
| 1112 |
+
#define TCL_TRACE_OLD_STYLE 0x1000
|
| 1113 |
+
#endif
|
| 1114 |
+
/* Indicate the semantics of the result of a trace. */
|
| 1115 |
+
#define TCL_TRACE_RESULT_DYNAMIC 0x8000
|
| 1116 |
+
#define TCL_TRACE_RESULT_OBJECT 0x10000
|
| 1117 |
+
|
| 1118 |
+
/*
|
| 1119 |
+
* Flag values for ensemble commands.
|
| 1120 |
+
*/
|
| 1121 |
+
|
| 1122 |
+
#define TCL_ENSEMBLE_PREFIX 0x02/* Flag value to say whether to allow
|
| 1123 |
+
* unambiguous prefixes of commands or to
|
| 1124 |
+
* require exact matches for command names. */
|
| 1125 |
+
|
| 1126 |
+
/*
|
| 1127 |
+
* Flag values passed to command-related functions.
|
| 1128 |
+
*/
|
| 1129 |
+
|
| 1130 |
+
#define TCL_TRACE_RENAME 0x2000
|
| 1131 |
+
#define TCL_TRACE_DELETE 0x4000
|
| 1132 |
+
|
| 1133 |
+
#define TCL_ALLOW_INLINE_COMPILATION 0x20000
|
| 1134 |
+
|
| 1135 |
+
/*
|
| 1136 |
+
* The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
|
| 1137 |
+
* always parsed whenever the part2 is NULL. (This is to avoid a common error
|
| 1138 |
+
* when converting code to use the new object based APIs and forgetting to
|
| 1139 |
+
* give the flag)
|
| 1140 |
+
*/
|
| 1141 |
+
|
| 1142 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 1143 |
+
# define TCL_PARSE_PART1 0x400
|
| 1144 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 1145 |
+
|
| 1146 |
+
/*
|
| 1147 |
+
* Types for linked variables:
|
| 1148 |
+
*/
|
| 1149 |
+
|
| 1150 |
+
#define TCL_LINK_INT 1
|
| 1151 |
+
#define TCL_LINK_DOUBLE 2
|
| 1152 |
+
#define TCL_LINK_BOOLEAN 3
|
| 1153 |
+
#define TCL_LINK_STRING 4
|
| 1154 |
+
#define TCL_LINK_WIDE_INT 5
|
| 1155 |
+
#define TCL_LINK_CHAR 6
|
| 1156 |
+
#define TCL_LINK_UCHAR 7
|
| 1157 |
+
#define TCL_LINK_SHORT 8
|
| 1158 |
+
#define TCL_LINK_USHORT 9
|
| 1159 |
+
#define TCL_LINK_UINT 10
|
| 1160 |
+
#define TCL_LINK_LONG 11
|
| 1161 |
+
#define TCL_LINK_ULONG 12
|
| 1162 |
+
#define TCL_LINK_FLOAT 13
|
| 1163 |
+
#define TCL_LINK_WIDE_UINT 14
|
| 1164 |
+
#define TCL_LINK_READ_ONLY 0x80
|
| 1165 |
+
|
| 1166 |
+
/*
|
| 1167 |
+
*----------------------------------------------------------------------------
|
| 1168 |
+
* Forward declarations of Tcl_HashTable and related types.
|
| 1169 |
+
*/
|
| 1170 |
+
|
| 1171 |
+
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
|
| 1172 |
+
typedef struct Tcl_HashTable Tcl_HashTable;
|
| 1173 |
+
typedef struct Tcl_HashEntry Tcl_HashEntry;
|
| 1174 |
+
|
| 1175 |
+
typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
|
| 1176 |
+
typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
|
| 1177 |
+
typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
|
| 1178 |
+
void *keyPtr);
|
| 1179 |
+
typedef void (Tcl_FreeHashEntryProc) (Tcl_HashEntry *hPtr);
|
| 1180 |
+
|
| 1181 |
+
/*
|
| 1182 |
+
* This flag controls whether the hash table stores the hash of a key, or
|
| 1183 |
+
* recalculates it. There should be no reason for turning this flag off as it
|
| 1184 |
+
* is completely binary and source compatible unless you directly access the
|
| 1185 |
+
* bucketPtr member of the Tcl_HashTableEntry structure. This member has been
|
| 1186 |
+
* removed and the space used to store the hash value.
|
| 1187 |
+
*/
|
| 1188 |
+
|
| 1189 |
+
#ifndef TCL_HASH_KEY_STORE_HASH
|
| 1190 |
+
# define TCL_HASH_KEY_STORE_HASH 1
|
| 1191 |
+
#endif
|
| 1192 |
+
|
| 1193 |
+
/*
|
| 1194 |
+
* Structure definition for an entry in a hash table. No-one outside Tcl
|
| 1195 |
+
* should access any of these fields directly; use the macros defined below.
|
| 1196 |
+
*/
|
| 1197 |
+
|
| 1198 |
+
struct Tcl_HashEntry {
|
| 1199 |
+
Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
|
| 1200 |
+
* or NULL for end of chain. */
|
| 1201 |
+
Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
|
| 1202 |
+
#if TCL_HASH_KEY_STORE_HASH
|
| 1203 |
+
void *hash; /* Hash value, stored as pointer to ensure
|
| 1204 |
+
* that the offsets of the fields in this
|
| 1205 |
+
* structure are not changed. */
|
| 1206 |
+
#else
|
| 1207 |
+
Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to first
|
| 1208 |
+
* entry in this entry's chain: used for
|
| 1209 |
+
* deleting the entry. */
|
| 1210 |
+
#endif
|
| 1211 |
+
ClientData clientData; /* Application stores something here with
|
| 1212 |
+
* Tcl_SetHashValue. */
|
| 1213 |
+
union { /* Key has one of these forms: */
|
| 1214 |
+
char *oneWordValue; /* One-word value for key. */
|
| 1215 |
+
Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
|
| 1216 |
+
int words[1]; /* Multiple integer words for key. The actual
|
| 1217 |
+
* size will be as large as necessary for this
|
| 1218 |
+
* table's keys. */
|
| 1219 |
+
char string[1]; /* String for key. The actual size will be as
|
| 1220 |
+
* large as needed to hold the key. */
|
| 1221 |
+
} key; /* MUST BE LAST FIELD IN RECORD!! */
|
| 1222 |
+
};
|
| 1223 |
+
|
| 1224 |
+
/*
|
| 1225 |
+
* Flags used in Tcl_HashKeyType.
|
| 1226 |
+
*
|
| 1227 |
+
* TCL_HASH_KEY_RANDOMIZE_HASH -
|
| 1228 |
+
* There are some things, pointers for example
|
| 1229 |
+
* which don't hash well because they do not use
|
| 1230 |
+
* the lower bits. If this flag is set then the
|
| 1231 |
+
* hash table will attempt to rectify this by
|
| 1232 |
+
* randomising the bits and then using the upper
|
| 1233 |
+
* N bits as the index into the table.
|
| 1234 |
+
* TCL_HASH_KEY_SYSTEM_HASH - If this flag is set then all memory internally
|
| 1235 |
+
* allocated for the hash table that is not for an
|
| 1236 |
+
* entry will use the system heap.
|
| 1237 |
+
*/
|
| 1238 |
+
|
| 1239 |
+
#define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
|
| 1240 |
+
#define TCL_HASH_KEY_SYSTEM_HASH 0x2
|
| 1241 |
+
|
| 1242 |
+
/*
|
| 1243 |
+
* Structure definition for the methods associated with a hash table key type.
|
| 1244 |
+
*/
|
| 1245 |
+
|
| 1246 |
+
#define TCL_HASH_KEY_TYPE_VERSION 1
|
| 1247 |
+
struct Tcl_HashKeyType {
|
| 1248 |
+
int version; /* Version of the table. If this structure is
|
| 1249 |
+
* extended in future then the version can be
|
| 1250 |
+
* used to distinguish between different
|
| 1251 |
+
* structures. */
|
| 1252 |
+
int flags; /* Flags, see above for details. */
|
| 1253 |
+
Tcl_HashKeyProc *hashKeyProc;
|
| 1254 |
+
/* Calculates a hash value for the key. If
|
| 1255 |
+
* this is NULL then the pointer itself is
|
| 1256 |
+
* used as a hash value. */
|
| 1257 |
+
Tcl_CompareHashKeysProc *compareKeysProc;
|
| 1258 |
+
/* Compares two keys and returns zero if they
|
| 1259 |
+
* do not match, and non-zero if they do. If
|
| 1260 |
+
* this is NULL then the pointers are
|
| 1261 |
+
* compared. */
|
| 1262 |
+
Tcl_AllocHashEntryProc *allocEntryProc;
|
| 1263 |
+
/* Called to allocate memory for a new entry,
|
| 1264 |
+
* i.e. if the key is a string then this could
|
| 1265 |
+
* allocate a single block which contains
|
| 1266 |
+
* enough space for both the entry and the
|
| 1267 |
+
* string. Only the key field of the allocated
|
| 1268 |
+
* Tcl_HashEntry structure needs to be filled
|
| 1269 |
+
* in. If something else needs to be done to
|
| 1270 |
+
* the key, i.e. incrementing a reference
|
| 1271 |
+
* count then that should be done by this
|
| 1272 |
+
* function. If this is NULL then Tcl_Alloc is
|
| 1273 |
+
* used to allocate enough space for a
|
| 1274 |
+
* Tcl_HashEntry and the key pointer is
|
| 1275 |
+
* assigned to key.oneWordValue. */
|
| 1276 |
+
Tcl_FreeHashEntryProc *freeEntryProc;
|
| 1277 |
+
/* Called to free memory associated with an
|
| 1278 |
+
* entry. If something else needs to be done
|
| 1279 |
+
* to the key, i.e. decrementing a reference
|
| 1280 |
+
* count then that should be done by this
|
| 1281 |
+
* function. If this is NULL then Tcl_Free is
|
| 1282 |
+
* used to free the Tcl_HashEntry. */
|
| 1283 |
+
};
|
| 1284 |
+
|
| 1285 |
+
/*
|
| 1286 |
+
* Structure definition for a hash table. Must be in tcl.h so clients can
|
| 1287 |
+
* allocate space for these structures, but clients should never access any
|
| 1288 |
+
* fields in this structure.
|
| 1289 |
+
*/
|
| 1290 |
+
|
| 1291 |
+
#define TCL_SMALL_HASH_TABLE 4
|
| 1292 |
+
struct Tcl_HashTable {
|
| 1293 |
+
Tcl_HashEntry **buckets; /* Pointer to bucket array. Each element
|
| 1294 |
+
* points to first entry in bucket's hash
|
| 1295 |
+
* chain, or NULL. */
|
| 1296 |
+
Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
|
| 1297 |
+
/* Bucket array used for small tables (to
|
| 1298 |
+
* avoid mallocs and frees). */
|
| 1299 |
+
int numBuckets; /* Total number of buckets allocated at
|
| 1300 |
+
* **bucketPtr. */
|
| 1301 |
+
int numEntries; /* Total number of entries present in
|
| 1302 |
+
* table. */
|
| 1303 |
+
int rebuildSize; /* Enlarge table when numEntries gets to be
|
| 1304 |
+
* this large. */
|
| 1305 |
+
int downShift; /* Shift count used in hashing function.
|
| 1306 |
+
* Designed to use high-order bits of
|
| 1307 |
+
* randomized keys. */
|
| 1308 |
+
int mask; /* Mask value used in hashing function. */
|
| 1309 |
+
int keyType; /* Type of keys used in this table. It's
|
| 1310 |
+
* either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
|
| 1311 |
+
* TCL_ONE_WORD_KEYS, or an integer giving the
|
| 1312 |
+
* number of ints that is the size of the
|
| 1313 |
+
* key. */
|
| 1314 |
+
Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const char *key);
|
| 1315 |
+
Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const char *key,
|
| 1316 |
+
int *newPtr);
|
| 1317 |
+
const Tcl_HashKeyType *typePtr;
|
| 1318 |
+
/* Type of the keys used in the
|
| 1319 |
+
* Tcl_HashTable. */
|
| 1320 |
+
};
|
| 1321 |
+
|
| 1322 |
+
/*
|
| 1323 |
+
* Structure definition for information used to keep track of searches through
|
| 1324 |
+
* hash tables:
|
| 1325 |
+
*/
|
| 1326 |
+
|
| 1327 |
+
typedef struct Tcl_HashSearch {
|
| 1328 |
+
Tcl_HashTable *tablePtr; /* Table being searched. */
|
| 1329 |
+
int nextIndex; /* Index of next bucket to be enumerated after
|
| 1330 |
+
* present one. */
|
| 1331 |
+
Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
|
| 1332 |
+
* bucket. */
|
| 1333 |
+
} Tcl_HashSearch;
|
| 1334 |
+
|
| 1335 |
+
/*
|
| 1336 |
+
* Acceptable key types for hash tables:
|
| 1337 |
+
*
|
| 1338 |
+
* TCL_STRING_KEYS: The keys are strings, they are copied into the
|
| 1339 |
+
* entry.
|
| 1340 |
+
* TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored
|
| 1341 |
+
* in the entry.
|
| 1342 |
+
* TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied
|
| 1343 |
+
* into the entry.
|
| 1344 |
+
* TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the
|
| 1345 |
+
* pointer is stored in the entry.
|
| 1346 |
+
*
|
| 1347 |
+
* While maintaining binary compatibility the above have to be distinct values
|
| 1348 |
+
* as they are used to differentiate between old versions of the hash table
|
| 1349 |
+
* which don't have a typePtr and new ones which do. Once binary compatibility
|
| 1350 |
+
* is discarded in favour of making more wide spread changes TCL_STRING_KEYS
|
| 1351 |
+
* can be the same as TCL_CUSTOM_TYPE_KEYS, and TCL_ONE_WORD_KEYS can be the
|
| 1352 |
+
* same as TCL_CUSTOM_PTR_KEYS because they simply determine how the key is
|
| 1353 |
+
* accessed from the entry and not the behaviour.
|
| 1354 |
+
*/
|
| 1355 |
+
|
| 1356 |
+
#define TCL_STRING_KEYS (0)
|
| 1357 |
+
#define TCL_ONE_WORD_KEYS (1)
|
| 1358 |
+
#define TCL_CUSTOM_TYPE_KEYS (-2)
|
| 1359 |
+
#define TCL_CUSTOM_PTR_KEYS (-1)
|
| 1360 |
+
|
| 1361 |
+
/*
|
| 1362 |
+
* Structure definition for information used to keep track of searches through
|
| 1363 |
+
* dictionaries. These fields should not be accessed by code outside
|
| 1364 |
+
* tclDictObj.c
|
| 1365 |
+
*/
|
| 1366 |
+
|
| 1367 |
+
typedef struct {
|
| 1368 |
+
void *next; /* Search position for underlying hash
|
| 1369 |
+
* table. */
|
| 1370 |
+
int epoch; /* Epoch marker for dictionary being searched,
|
| 1371 |
+
* or -1 if search has terminated. */
|
| 1372 |
+
Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
|
| 1373 |
+
} Tcl_DictSearch;
|
| 1374 |
+
|
| 1375 |
+
/*
|
| 1376 |
+
*----------------------------------------------------------------------------
|
| 1377 |
+
* Flag values to pass to Tcl_DoOneEvent to disable searches for some kinds of
|
| 1378 |
+
* events:
|
| 1379 |
+
*/
|
| 1380 |
+
|
| 1381 |
+
#define TCL_DONT_WAIT (1<<1)
|
| 1382 |
+
#define TCL_WINDOW_EVENTS (1<<2)
|
| 1383 |
+
#define TCL_FILE_EVENTS (1<<3)
|
| 1384 |
+
#define TCL_TIMER_EVENTS (1<<4)
|
| 1385 |
+
#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
|
| 1386 |
+
#define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
|
| 1387 |
+
|
| 1388 |
+
/*
|
| 1389 |
+
* The following structure defines a generic event for the Tcl event system.
|
| 1390 |
+
* These are the things that are queued in calls to Tcl_QueueEvent and
|
| 1391 |
+
* serviced later by Tcl_DoOneEvent. There can be many different kinds of
|
| 1392 |
+
* events with different fields, corresponding to window events, timer events,
|
| 1393 |
+
* etc. The structure for a particular event consists of a Tcl_Event header
|
| 1394 |
+
* followed by additional information specific to that event.
|
| 1395 |
+
*/
|
| 1396 |
+
|
| 1397 |
+
struct Tcl_Event {
|
| 1398 |
+
Tcl_EventProc *proc; /* Function to call to service this event. */
|
| 1399 |
+
struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
|
| 1400 |
+
};
|
| 1401 |
+
|
| 1402 |
+
/*
|
| 1403 |
+
* Positions to pass to Tcl_QueueEvent:
|
| 1404 |
+
*/
|
| 1405 |
+
|
| 1406 |
+
typedef enum {
|
| 1407 |
+
TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
|
| 1408 |
+
} Tcl_QueuePosition;
|
| 1409 |
+
|
| 1410 |
+
/*
|
| 1411 |
+
* Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
|
| 1412 |
+
* event routines.
|
| 1413 |
+
*/
|
| 1414 |
+
|
| 1415 |
+
#define TCL_SERVICE_NONE 0
|
| 1416 |
+
#define TCL_SERVICE_ALL 1
|
| 1417 |
+
|
| 1418 |
+
/*
|
| 1419 |
+
* The following structure keeps is used to hold a time value, either as an
|
| 1420 |
+
* absolute time (the number of seconds from the epoch) or as an elapsed time.
|
| 1421 |
+
* On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
|
| 1422 |
+
*/
|
| 1423 |
+
|
| 1424 |
+
typedef struct Tcl_Time {
|
| 1425 |
+
long sec; /* Seconds. */
|
| 1426 |
+
long usec; /* Microseconds. */
|
| 1427 |
+
} Tcl_Time;
|
| 1428 |
+
|
| 1429 |
+
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
|
| 1430 |
+
typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
|
| 1431 |
+
|
| 1432 |
+
/*
|
| 1433 |
+
* TIP #233 (Virtualized Time)
|
| 1434 |
+
*/
|
| 1435 |
+
|
| 1436 |
+
typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
| 1437 |
+
typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
| 1438 |
+
|
| 1439 |
+
/*
|
| 1440 |
+
*----------------------------------------------------------------------------
|
| 1441 |
+
* Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler to
|
| 1442 |
+
* indicate what sorts of events are of interest:
|
| 1443 |
+
*/
|
| 1444 |
+
|
| 1445 |
+
#define TCL_READABLE (1<<1)
|
| 1446 |
+
#define TCL_WRITABLE (1<<2)
|
| 1447 |
+
#define TCL_EXCEPTION (1<<3)
|
| 1448 |
+
|
| 1449 |
+
/*
|
| 1450 |
+
* Flag values to pass to Tcl_OpenCommandChannel to indicate the disposition
|
| 1451 |
+
* of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, are also used in
|
| 1452 |
+
* Tcl_GetStdChannel.
|
| 1453 |
+
*/
|
| 1454 |
+
|
| 1455 |
+
#define TCL_STDIN (1<<1)
|
| 1456 |
+
#define TCL_STDOUT (1<<2)
|
| 1457 |
+
#define TCL_STDERR (1<<3)
|
| 1458 |
+
#define TCL_ENFORCE_MODE (1<<4)
|
| 1459 |
+
|
| 1460 |
+
/*
|
| 1461 |
+
* Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
|
| 1462 |
+
* should be closed.
|
| 1463 |
+
*/
|
| 1464 |
+
|
| 1465 |
+
#define TCL_CLOSE_READ (1<<1)
|
| 1466 |
+
#define TCL_CLOSE_WRITE (1<<2)
|
| 1467 |
+
|
| 1468 |
+
/*
|
| 1469 |
+
* Value to use as the closeProc for a channel that supports the close2Proc
|
| 1470 |
+
* interface.
|
| 1471 |
+
*/
|
| 1472 |
+
|
| 1473 |
+
#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *) 1)
|
| 1474 |
+
|
| 1475 |
+
/*
|
| 1476 |
+
* Channel version tag. This was introduced in 8.3.2/8.4.
|
| 1477 |
+
*/
|
| 1478 |
+
|
| 1479 |
+
#define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1)
|
| 1480 |
+
#define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2)
|
| 1481 |
+
#define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3)
|
| 1482 |
+
#define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4)
|
| 1483 |
+
#define TCL_CHANNEL_VERSION_5 ((Tcl_ChannelTypeVersion) 0x5)
|
| 1484 |
+
|
| 1485 |
+
/*
|
| 1486 |
+
* TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc.
|
| 1487 |
+
*/
|
| 1488 |
+
|
| 1489 |
+
#define TCL_CHANNEL_THREAD_INSERT (0)
|
| 1490 |
+
#define TCL_CHANNEL_THREAD_REMOVE (1)
|
| 1491 |
+
|
| 1492 |
+
/*
|
| 1493 |
+
* Typedefs for the various operations in a channel type:
|
| 1494 |
+
*/
|
| 1495 |
+
|
| 1496 |
+
typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode);
|
| 1497 |
+
typedef int (Tcl_DriverCloseProc) (ClientData instanceData,
|
| 1498 |
+
Tcl_Interp *interp);
|
| 1499 |
+
typedef int (Tcl_DriverClose2Proc) (ClientData instanceData,
|
| 1500 |
+
Tcl_Interp *interp, int flags);
|
| 1501 |
+
typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf,
|
| 1502 |
+
int toRead, int *errorCodePtr);
|
| 1503 |
+
typedef int (Tcl_DriverOutputProc) (ClientData instanceData,
|
| 1504 |
+
CONST84 char *buf, int toWrite, int *errorCodePtr);
|
| 1505 |
+
typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset,
|
| 1506 |
+
int mode, int *errorCodePtr);
|
| 1507 |
+
typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData,
|
| 1508 |
+
Tcl_Interp *interp, const char *optionName,
|
| 1509 |
+
const char *value);
|
| 1510 |
+
typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData,
|
| 1511 |
+
Tcl_Interp *interp, CONST84 char *optionName,
|
| 1512 |
+
Tcl_DString *dsPtr);
|
| 1513 |
+
typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask);
|
| 1514 |
+
typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData,
|
| 1515 |
+
int direction, ClientData *handlePtr);
|
| 1516 |
+
typedef int (Tcl_DriverFlushProc) (ClientData instanceData);
|
| 1517 |
+
typedef int (Tcl_DriverHandlerProc) (ClientData instanceData,
|
| 1518 |
+
int interestMask);
|
| 1519 |
+
typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData,
|
| 1520 |
+
Tcl_WideInt offset, int mode, int *errorCodePtr);
|
| 1521 |
+
/*
|
| 1522 |
+
* TIP #218, Channel Thread Actions
|
| 1523 |
+
*/
|
| 1524 |
+
typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData,
|
| 1525 |
+
int action);
|
| 1526 |
+
/*
|
| 1527 |
+
* TIP #208, File Truncation (etc.)
|
| 1528 |
+
*/
|
| 1529 |
+
typedef int (Tcl_DriverTruncateProc) (ClientData instanceData,
|
| 1530 |
+
Tcl_WideInt length);
|
| 1531 |
+
|
| 1532 |
+
/*
|
| 1533 |
+
* struct Tcl_ChannelType:
|
| 1534 |
+
*
|
| 1535 |
+
* One such structure exists for each type (kind) of channel. It collects
|
| 1536 |
+
* together in one place all the functions that are part of the specific
|
| 1537 |
+
* channel type.
|
| 1538 |
+
*
|
| 1539 |
+
* It is recommend that the Tcl_Channel* functions are used to access elements
|
| 1540 |
+
* of this structure, instead of direct accessing.
|
| 1541 |
+
*/
|
| 1542 |
+
|
| 1543 |
+
typedef struct Tcl_ChannelType {
|
| 1544 |
+
const char *typeName; /* The name of the channel type in Tcl
|
| 1545 |
+
* commands. This storage is owned by channel
|
| 1546 |
+
* type. */
|
| 1547 |
+
Tcl_ChannelTypeVersion version;
|
| 1548 |
+
/* Version of the channel type. */
|
| 1549 |
+
Tcl_DriverCloseProc *closeProc;
|
| 1550 |
+
/* Function to call to close the channel, or
|
| 1551 |
+
* TCL_CLOSE2PROC if the close2Proc should be
|
| 1552 |
+
* used instead. */
|
| 1553 |
+
Tcl_DriverInputProc *inputProc;
|
| 1554 |
+
/* Function to call for input on channel. */
|
| 1555 |
+
Tcl_DriverOutputProc *outputProc;
|
| 1556 |
+
/* Function to call for output on channel. */
|
| 1557 |
+
Tcl_DriverSeekProc *seekProc;
|
| 1558 |
+
/* Function to call to seek on the channel.
|
| 1559 |
+
* May be NULL. */
|
| 1560 |
+
Tcl_DriverSetOptionProc *setOptionProc;
|
| 1561 |
+
/* Set an option on a channel. */
|
| 1562 |
+
Tcl_DriverGetOptionProc *getOptionProc;
|
| 1563 |
+
/* Get an option from a channel. */
|
| 1564 |
+
Tcl_DriverWatchProc *watchProc;
|
| 1565 |
+
/* Set up the notifier to watch for events on
|
| 1566 |
+
* this channel. */
|
| 1567 |
+
Tcl_DriverGetHandleProc *getHandleProc;
|
| 1568 |
+
/* Get an OS handle from the channel or NULL
|
| 1569 |
+
* if not supported. */
|
| 1570 |
+
Tcl_DriverClose2Proc *close2Proc;
|
| 1571 |
+
/* Function to call to close the channel if
|
| 1572 |
+
* the device supports closing the read &
|
| 1573 |
+
* write sides independently. */
|
| 1574 |
+
Tcl_DriverBlockModeProc *blockModeProc;
|
| 1575 |
+
/* Set blocking mode for the raw channel. May
|
| 1576 |
+
* be NULL. */
|
| 1577 |
+
/*
|
| 1578 |
+
* Only valid in TCL_CHANNEL_VERSION_2 channels or later.
|
| 1579 |
+
*/
|
| 1580 |
+
Tcl_DriverFlushProc *flushProc;
|
| 1581 |
+
/* Function to call to flush a channel. May be
|
| 1582 |
+
* NULL. */
|
| 1583 |
+
Tcl_DriverHandlerProc *handlerProc;
|
| 1584 |
+
/* Function to call to handle a channel event.
|
| 1585 |
+
* This will be passed up the stacked channel
|
| 1586 |
+
* chain. */
|
| 1587 |
+
/*
|
| 1588 |
+
* Only valid in TCL_CHANNEL_VERSION_3 channels or later.
|
| 1589 |
+
*/
|
| 1590 |
+
Tcl_DriverWideSeekProc *wideSeekProc;
|
| 1591 |
+
/* Function to call to seek on the channel
|
| 1592 |
+
* which can handle 64-bit offsets. May be
|
| 1593 |
+
* NULL, and must be NULL if seekProc is
|
| 1594 |
+
* NULL. */
|
| 1595 |
+
/*
|
| 1596 |
+
* Only valid in TCL_CHANNEL_VERSION_4 channels or later.
|
| 1597 |
+
* TIP #218, Channel Thread Actions.
|
| 1598 |
+
*/
|
| 1599 |
+
Tcl_DriverThreadActionProc *threadActionProc;
|
| 1600 |
+
/* Function to call to notify the driver of
|
| 1601 |
+
* thread specific activity for a channel. May
|
| 1602 |
+
* be NULL. */
|
| 1603 |
+
/*
|
| 1604 |
+
* Only valid in TCL_CHANNEL_VERSION_5 channels or later.
|
| 1605 |
+
* TIP #208, File Truncation.
|
| 1606 |
+
*/
|
| 1607 |
+
Tcl_DriverTruncateProc *truncateProc;
|
| 1608 |
+
/* Function to call to truncate the underlying
|
| 1609 |
+
* file to a particular length. May be NULL if
|
| 1610 |
+
* the channel does not support truncation. */
|
| 1611 |
+
} Tcl_ChannelType;
|
| 1612 |
+
|
| 1613 |
+
/*
|
| 1614 |
+
* The following flags determine whether the blockModeProc above should set
|
| 1615 |
+
* the channel into blocking or nonblocking mode. They are passed as arguments
|
| 1616 |
+
* to the blockModeProc function in the above structure.
|
| 1617 |
+
*/
|
| 1618 |
+
|
| 1619 |
+
#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
|
| 1620 |
+
#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
|
| 1621 |
+
* mode. */
|
| 1622 |
+
|
| 1623 |
+
/*
|
| 1624 |
+
*----------------------------------------------------------------------------
|
| 1625 |
+
* Enum for different types of file paths.
|
| 1626 |
+
*/
|
| 1627 |
+
|
| 1628 |
+
typedef enum Tcl_PathType {
|
| 1629 |
+
TCL_PATH_ABSOLUTE,
|
| 1630 |
+
TCL_PATH_RELATIVE,
|
| 1631 |
+
TCL_PATH_VOLUME_RELATIVE
|
| 1632 |
+
} Tcl_PathType;
|
| 1633 |
+
|
| 1634 |
+
/*
|
| 1635 |
+
* The following structure is used to pass glob type data amongst the various
|
| 1636 |
+
* glob routines and Tcl_FSMatchInDirectory.
|
| 1637 |
+
*/
|
| 1638 |
+
|
| 1639 |
+
typedef struct Tcl_GlobTypeData {
|
| 1640 |
+
int type; /* Corresponds to bcdpfls as in 'find -t'. */
|
| 1641 |
+
int perm; /* Corresponds to file permissions. */
|
| 1642 |
+
Tcl_Obj *macType; /* Acceptable Mac type. */
|
| 1643 |
+
Tcl_Obj *macCreator; /* Acceptable Mac creator. */
|
| 1644 |
+
} Tcl_GlobTypeData;
|
| 1645 |
+
|
| 1646 |
+
/*
|
| 1647 |
+
* Type and permission definitions for glob command.
|
| 1648 |
+
*/
|
| 1649 |
+
|
| 1650 |
+
#define TCL_GLOB_TYPE_BLOCK (1<<0)
|
| 1651 |
+
#define TCL_GLOB_TYPE_CHAR (1<<1)
|
| 1652 |
+
#define TCL_GLOB_TYPE_DIR (1<<2)
|
| 1653 |
+
#define TCL_GLOB_TYPE_PIPE (1<<3)
|
| 1654 |
+
#define TCL_GLOB_TYPE_FILE (1<<4)
|
| 1655 |
+
#define TCL_GLOB_TYPE_LINK (1<<5)
|
| 1656 |
+
#define TCL_GLOB_TYPE_SOCK (1<<6)
|
| 1657 |
+
#define TCL_GLOB_TYPE_MOUNT (1<<7)
|
| 1658 |
+
|
| 1659 |
+
#define TCL_GLOB_PERM_RONLY (1<<0)
|
| 1660 |
+
#define TCL_GLOB_PERM_HIDDEN (1<<1)
|
| 1661 |
+
#define TCL_GLOB_PERM_R (1<<2)
|
| 1662 |
+
#define TCL_GLOB_PERM_W (1<<3)
|
| 1663 |
+
#define TCL_GLOB_PERM_X (1<<4)
|
| 1664 |
+
|
| 1665 |
+
/*
|
| 1666 |
+
* Flags for the unload callback function.
|
| 1667 |
+
*/
|
| 1668 |
+
|
| 1669 |
+
#define TCL_UNLOAD_DETACH_FROM_INTERPRETER (1<<0)
|
| 1670 |
+
#define TCL_UNLOAD_DETACH_FROM_PROCESS (1<<1)
|
| 1671 |
+
|
| 1672 |
+
/*
|
| 1673 |
+
* Typedefs for the various filesystem operations:
|
| 1674 |
+
*/
|
| 1675 |
+
|
| 1676 |
+
typedef int (Tcl_FSStatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
|
| 1677 |
+
typedef int (Tcl_FSAccessProc) (Tcl_Obj *pathPtr, int mode);
|
| 1678 |
+
typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) (Tcl_Interp *interp,
|
| 1679 |
+
Tcl_Obj *pathPtr, int mode, int permissions);
|
| 1680 |
+
typedef int (Tcl_FSMatchInDirectoryProc) (Tcl_Interp *interp, Tcl_Obj *result,
|
| 1681 |
+
Tcl_Obj *pathPtr, const char *pattern, Tcl_GlobTypeData *types);
|
| 1682 |
+
typedef Tcl_Obj * (Tcl_FSGetCwdProc) (Tcl_Interp *interp);
|
| 1683 |
+
typedef int (Tcl_FSChdirProc) (Tcl_Obj *pathPtr);
|
| 1684 |
+
typedef int (Tcl_FSLstatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
|
| 1685 |
+
typedef int (Tcl_FSCreateDirectoryProc) (Tcl_Obj *pathPtr);
|
| 1686 |
+
typedef int (Tcl_FSDeleteFileProc) (Tcl_Obj *pathPtr);
|
| 1687 |
+
typedef int (Tcl_FSCopyDirectoryProc) (Tcl_Obj *srcPathPtr,
|
| 1688 |
+
Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr);
|
| 1689 |
+
typedef int (Tcl_FSCopyFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
|
| 1690 |
+
typedef int (Tcl_FSRemoveDirectoryProc) (Tcl_Obj *pathPtr, int recursive,
|
| 1691 |
+
Tcl_Obj **errorPtr);
|
| 1692 |
+
typedef int (Tcl_FSRenameFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
|
| 1693 |
+
typedef void (Tcl_FSUnloadFileProc) (Tcl_LoadHandle loadHandle);
|
| 1694 |
+
typedef Tcl_Obj * (Tcl_FSListVolumesProc) (void);
|
| 1695 |
+
/* We have to declare the utime structure here. */
|
| 1696 |
+
struct utimbuf;
|
| 1697 |
+
typedef int (Tcl_FSUtimeProc) (Tcl_Obj *pathPtr, struct utimbuf *tval);
|
| 1698 |
+
typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
| 1699 |
+
int nextCheckpoint);
|
| 1700 |
+
typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
|
| 1701 |
+
Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
|
| 1702 |
+
typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
| 1703 |
+
Tcl_Obj **objPtrRef);
|
| 1704 |
+
typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
|
| 1705 |
+
Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
|
| 1706 |
+
typedef Tcl_Obj * (Tcl_FSLinkProc) (Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
|
| 1707 |
+
int linkType);
|
| 1708 |
+
typedef int (Tcl_FSLoadFileProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
| 1709 |
+
Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr);
|
| 1710 |
+
typedef int (Tcl_FSPathInFilesystemProc) (Tcl_Obj *pathPtr,
|
| 1711 |
+
ClientData *clientDataPtr);
|
| 1712 |
+
typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) (Tcl_Obj *pathPtr);
|
| 1713 |
+
typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) (Tcl_Obj *pathPtr);
|
| 1714 |
+
typedef void (Tcl_FSFreeInternalRepProc) (ClientData clientData);
|
| 1715 |
+
typedef ClientData (Tcl_FSDupInternalRepProc) (ClientData clientData);
|
| 1716 |
+
typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (ClientData clientData);
|
| 1717 |
+
typedef ClientData (Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
|
| 1718 |
+
|
| 1719 |
+
typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
|
| 1720 |
+
|
| 1721 |
+
/*
|
| 1722 |
+
*----------------------------------------------------------------------------
|
| 1723 |
+
* Data structures related to hooking into the filesystem
|
| 1724 |
+
*/
|
| 1725 |
+
|
| 1726 |
+
/*
|
| 1727 |
+
* Filesystem version tag. This was introduced in 8.4.
|
| 1728 |
+
*/
|
| 1729 |
+
|
| 1730 |
+
#define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1)
|
| 1731 |
+
|
| 1732 |
+
/*
|
| 1733 |
+
* struct Tcl_Filesystem:
|
| 1734 |
+
*
|
| 1735 |
+
* One such structure exists for each type (kind) of filesystem. It collects
|
| 1736 |
+
* together the functions that form the interface for a particulr the
|
| 1737 |
+
* filesystem. Tcl always accesses the filesystem through one of these
|
| 1738 |
+
* structures.
|
| 1739 |
+
*
|
| 1740 |
+
* Not all entries need be non-NULL; any which are NULL are simply ignored.
|
| 1741 |
+
* However, a complete filesystem should provide all of these functions. The
|
| 1742 |
+
* explanations in the structure show the importance of each function.
|
| 1743 |
+
*/
|
| 1744 |
+
|
| 1745 |
+
typedef struct Tcl_Filesystem {
|
| 1746 |
+
const char *typeName; /* The name of the filesystem. */
|
| 1747 |
+
int structureLength; /* Length of this structure, so future binary
|
| 1748 |
+
* compatibility can be assured. */
|
| 1749 |
+
Tcl_FSVersion version; /* Version of the filesystem type. */
|
| 1750 |
+
Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
|
| 1751 |
+
/* Determines whether the pathname is in this
|
| 1752 |
+
* filesystem. This is the most important
|
| 1753 |
+
* filesystem function. */
|
| 1754 |
+
Tcl_FSDupInternalRepProc *dupInternalRepProc;
|
| 1755 |
+
/* Duplicates the internal handle of the node.
|
| 1756 |
+
* If it is NULL, the filesystem is less
|
| 1757 |
+
* performant. */
|
| 1758 |
+
Tcl_FSFreeInternalRepProc *freeInternalRepProc;
|
| 1759 |
+
/* Frees the internal handle of the node. NULL
|
| 1760 |
+
* only if there is no need to free resources
|
| 1761 |
+
* used for the internal handle. */
|
| 1762 |
+
Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
|
| 1763 |
+
/* Converts the internal handle to a normalized
|
| 1764 |
+
* path. NULL if the filesystem creates nodes
|
| 1765 |
+
* having no pathname. */
|
| 1766 |
+
Tcl_FSCreateInternalRepProc *createInternalRepProc;
|
| 1767 |
+
/* Creates an internal handle for a pathname.
|
| 1768 |
+
* May be NULL if pathnames have no internal
|
| 1769 |
+
* handle or if pathInFilesystemProc always
|
| 1770 |
+
* immediately creates an internal
|
| 1771 |
+
* representation for pathnames in the
|
| 1772 |
+
* filesystem. */
|
| 1773 |
+
Tcl_FSNormalizePathProc *normalizePathProc;
|
| 1774 |
+
/* Normalizes a path. Should be implemented if
|
| 1775 |
+
* the filesystems supports multiple paths to
|
| 1776 |
+
* the same node. */
|
| 1777 |
+
Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
|
| 1778 |
+
/* Determines the type of a path in this
|
| 1779 |
+
* filesystem. May be NULL. */
|
| 1780 |
+
Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
|
| 1781 |
+
/* Produces the separator character(s) for this
|
| 1782 |
+
* filesystem. Must not be NULL. */
|
| 1783 |
+
Tcl_FSStatProc *statProc; /* Called by 'Tcl_FSStat()'. Provided by any
|
| 1784 |
+
* reasonable filesystem. */
|
| 1785 |
+
Tcl_FSAccessProc *accessProc;
|
| 1786 |
+
/* Called by 'Tcl_FSAccess()'. Implemented by
|
| 1787 |
+
* any reasonable filesystem. */
|
| 1788 |
+
Tcl_FSOpenFileChannelProc *openFileChannelProc;
|
| 1789 |
+
/* Called by 'Tcl_FSOpenFileChannel()'.
|
| 1790 |
+
* Provided by any reasonable filesystem. */
|
| 1791 |
+
Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
|
| 1792 |
+
/* Called by 'Tcl_FSMatchInDirectory()'. NULL
|
| 1793 |
+
* if the filesystem does not support glob or
|
| 1794 |
+
* recursive copy. */
|
| 1795 |
+
Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
|
| 1796 |
+
* mtime' to set (not read) times, 'file
|
| 1797 |
+
* atime', and the open-r/open-w/fcopy variant
|
| 1798 |
+
* of 'file copy'. */
|
| 1799 |
+
Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
|
| 1800 |
+
* creating links is not supported. */
|
| 1801 |
+
Tcl_FSListVolumesProc *listVolumesProc;
|
| 1802 |
+
/* Lists filesystem volumes added by this
|
| 1803 |
+
* filesystem. NULL if the filesystem does not
|
| 1804 |
+
* use volumes. */
|
| 1805 |
+
Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
|
| 1806 |
+
/* List all valid attributes strings. NULL if
|
| 1807 |
+
* the filesystem does not support the 'file
|
| 1808 |
+
* attributes' command. Can be used to attach
|
| 1809 |
+
* arbitrary additional data to files in a
|
| 1810 |
+
* filesystem. */
|
| 1811 |
+
Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
|
| 1812 |
+
/* Called by 'Tcl_FSFileAttrsGet()' and by
|
| 1813 |
+
* 'file attributes'. */
|
| 1814 |
+
Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
|
| 1815 |
+
/* Called by 'Tcl_FSFileAttrsSet()' and by
|
| 1816 |
+
* 'file attributes'. */
|
| 1817 |
+
Tcl_FSCreateDirectoryProc *createDirectoryProc;
|
| 1818 |
+
/* Called by 'Tcl_FSCreateDirectory()'. May be
|
| 1819 |
+
* NULL if the filesystem is read-only. */
|
| 1820 |
+
Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
|
| 1821 |
+
/* Called by 'Tcl_FSRemoveDirectory()'. May be
|
| 1822 |
+
* NULL if the filesystem is read-only. */
|
| 1823 |
+
Tcl_FSDeleteFileProc *deleteFileProc;
|
| 1824 |
+
/* Called by 'Tcl_FSDeleteFile()' May be NULL
|
| 1825 |
+
* if the filesystem is is read-only. */
|
| 1826 |
+
Tcl_FSCopyFileProc *copyFileProc;
|
| 1827 |
+
/* Called by 'Tcl_FSCopyFile()'. If NULL, for
|
| 1828 |
+
* a copy operation at the script level (not
|
| 1829 |
+
* C) Tcl uses open-r, open-w and fcopy. */
|
| 1830 |
+
Tcl_FSRenameFileProc *renameFileProc;
|
| 1831 |
+
/* Called by 'Tcl_FSRenameFile()'. If NULL, for
|
| 1832 |
+
* a rename operation at the script level (not
|
| 1833 |
+
* C) Tcl performs a copy operation followed
|
| 1834 |
+
* by a delete operation. */
|
| 1835 |
+
Tcl_FSCopyDirectoryProc *copyDirectoryProc;
|
| 1836 |
+
/* Called by 'Tcl_FSCopyDirectory()'. If NULL,
|
| 1837 |
+
* for a copy operation at the script level
|
| 1838 |
+
* (not C) Tcl recursively creates directories
|
| 1839 |
+
* and copies files. */
|
| 1840 |
+
Tcl_FSLstatProc *lstatProc; /* Called by 'Tcl_FSLstat()'. If NULL, Tcl
|
| 1841 |
+
* attempts to use 'statProc' instead. */
|
| 1842 |
+
Tcl_FSLoadFileProc *loadFileProc;
|
| 1843 |
+
/* Called by 'Tcl_FSLoadFile()'. If NULL, Tcl
|
| 1844 |
+
* performs a copy to a temporary file in the
|
| 1845 |
+
* native filesystem and then calls
|
| 1846 |
+
* Tcl_FSLoadFile() on that temporary copy. */
|
| 1847 |
+
Tcl_FSGetCwdProc *getCwdProc;
|
| 1848 |
+
/* Called by 'Tcl_FSGetCwd()'. Normally NULL.
|
| 1849 |
+
* Usually only called once: If 'getcwd' is
|
| 1850 |
+
* called before 'chdir' is ever called. */
|
| 1851 |
+
Tcl_FSChdirProc *chdirProc; /* Called by 'Tcl_FSChdir()'. For a virtual
|
| 1852 |
+
* filesystem, chdirProc just returns zero
|
| 1853 |
+
* (success) if the pathname is a valid
|
| 1854 |
+
* directory, and some other value otherwise.
|
| 1855 |
+
* For A real filesystem, chdirProc performs
|
| 1856 |
+
* the correct action, e.g. calls the system
|
| 1857 |
+
* 'chdir' function. If not implemented, then
|
| 1858 |
+
* 'cd' and 'pwd' fail for a pathname in this
|
| 1859 |
+
* filesystem. On success Tcl stores the
|
| 1860 |
+
* pathname for use by GetCwd. If NULL, Tcl
|
| 1861 |
+
* performs records the pathname as the new
|
| 1862 |
+
* current directory if it passes a series of
|
| 1863 |
+
* directory access checks. */
|
| 1864 |
+
} Tcl_Filesystem;
|
| 1865 |
+
|
| 1866 |
+
/*
|
| 1867 |
+
* The following definitions are used as values for the 'linkAction' flag to
|
| 1868 |
+
* Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
|
| 1869 |
+
* be given. For link creation, the linkProc should create a link which
|
| 1870 |
+
* matches any of the types given.
|
| 1871 |
+
*
|
| 1872 |
+
* TCL_CREATE_SYMBOLIC_LINK - Create a symbolic or soft link.
|
| 1873 |
+
* TCL_CREATE_HARD_LINK - Create a hard link.
|
| 1874 |
+
*/
|
| 1875 |
+
|
| 1876 |
+
#define TCL_CREATE_SYMBOLIC_LINK 0x01
|
| 1877 |
+
#define TCL_CREATE_HARD_LINK 0x02
|
| 1878 |
+
|
| 1879 |
+
/*
|
| 1880 |
+
*----------------------------------------------------------------------------
|
| 1881 |
+
* The following structure represents the Notifier functions that you can
|
| 1882 |
+
* override with the Tcl_SetNotifier call.
|
| 1883 |
+
*/
|
| 1884 |
+
|
| 1885 |
+
typedef struct Tcl_NotifierProcs {
|
| 1886 |
+
Tcl_SetTimerProc *setTimerProc;
|
| 1887 |
+
Tcl_WaitForEventProc *waitForEventProc;
|
| 1888 |
+
Tcl_CreateFileHandlerProc *createFileHandlerProc;
|
| 1889 |
+
Tcl_DeleteFileHandlerProc *deleteFileHandlerProc;
|
| 1890 |
+
Tcl_InitNotifierProc *initNotifierProc;
|
| 1891 |
+
Tcl_FinalizeNotifierProc *finalizeNotifierProc;
|
| 1892 |
+
Tcl_AlertNotifierProc *alertNotifierProc;
|
| 1893 |
+
Tcl_ServiceModeHookProc *serviceModeHookProc;
|
| 1894 |
+
} Tcl_NotifierProcs;
|
| 1895 |
+
|
| 1896 |
+
/*
|
| 1897 |
+
*----------------------------------------------------------------------------
|
| 1898 |
+
* The following data structures and declarations are for the new Tcl parser.
|
| 1899 |
+
*
|
| 1900 |
+
* For each word of a command, and for each piece of a word such as a variable
|
| 1901 |
+
* reference, one of the following structures is created to describe the
|
| 1902 |
+
* token.
|
| 1903 |
+
*/
|
| 1904 |
+
|
| 1905 |
+
typedef struct Tcl_Token {
|
| 1906 |
+
int type; /* Type of token, such as TCL_TOKEN_WORD; see
|
| 1907 |
+
* below for valid types. */
|
| 1908 |
+
const char *start; /* First character in token. */
|
| 1909 |
+
int size; /* Number of bytes in token. */
|
| 1910 |
+
int numComponents; /* If this token is composed of other tokens,
|
| 1911 |
+
* this field tells how many of them there are
|
| 1912 |
+
* (including components of components, etc.).
|
| 1913 |
+
* The component tokens immediately follow
|
| 1914 |
+
* this one. */
|
| 1915 |
+
} Tcl_Token;
|
| 1916 |
+
|
| 1917 |
+
/*
|
| 1918 |
+
* Type values defined for Tcl_Token structures. These values are defined as
|
| 1919 |
+
* mask bits so that it's easy to check for collections of types.
|
| 1920 |
+
*
|
| 1921 |
+
* TCL_TOKEN_WORD - The token describes one word of a command,
|
| 1922 |
+
* from the first non-blank character of the word
|
| 1923 |
+
* (which may be " or {) up to but not including
|
| 1924 |
+
* the space, semicolon, or bracket that
|
| 1925 |
+
* terminates the word. NumComponents counts the
|
| 1926 |
+
* total number of sub-tokens that make up the
|
| 1927 |
+
* word. This includes, for example, sub-tokens
|
| 1928 |
+
* of TCL_TOKEN_VARIABLE tokens.
|
| 1929 |
+
* TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD except
|
| 1930 |
+
* that the word is guaranteed to consist of a
|
| 1931 |
+
* single TCL_TOKEN_TEXT sub-token.
|
| 1932 |
+
* TCL_TOKEN_TEXT - The token describes a range of literal text
|
| 1933 |
+
* that is part of a word. NumComponents is
|
| 1934 |
+
* always 0.
|
| 1935 |
+
* TCL_TOKEN_BS - The token describes a backslash sequence that
|
| 1936 |
+
* must be collapsed. NumComponents is always 0.
|
| 1937 |
+
* TCL_TOKEN_COMMAND - The token describes a command whose result
|
| 1938 |
+
* must be substituted into the word. The token
|
| 1939 |
+
* includes the enclosing brackets. NumComponents
|
| 1940 |
+
* is always 0.
|
| 1941 |
+
* TCL_TOKEN_VARIABLE - The token describes a variable substitution,
|
| 1942 |
+
* including the dollar sign, variable name, and
|
| 1943 |
+
* array index (if there is one) up through the
|
| 1944 |
+
* right parentheses. NumComponents tells how
|
| 1945 |
+
* many additional tokens follow to represent the
|
| 1946 |
+
* variable name. The first token will be a
|
| 1947 |
+
* TCL_TOKEN_TEXT token that describes the
|
| 1948 |
+
* variable name. If the variable is an array
|
| 1949 |
+
* reference then there will be one or more
|
| 1950 |
+
* additional tokens, of type TCL_TOKEN_TEXT,
|
| 1951 |
+
* TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
|
| 1952 |
+
* TCL_TOKEN_VARIABLE, that describe the array
|
| 1953 |
+
* index; numComponents counts the total number
|
| 1954 |
+
* of nested tokens that make up the variable
|
| 1955 |
+
* reference, including sub-tokens of
|
| 1956 |
+
* TCL_TOKEN_VARIABLE tokens.
|
| 1957 |
+
* TCL_TOKEN_SUB_EXPR - The token describes one subexpression of an
|
| 1958 |
+
* expression, from the first non-blank character
|
| 1959 |
+
* of the subexpression up to but not including
|
| 1960 |
+
* the space, brace, or bracket that terminates
|
| 1961 |
+
* the subexpression. NumComponents counts the
|
| 1962 |
+
* total number of following subtokens that make
|
| 1963 |
+
* up the subexpression; this includes all
|
| 1964 |
+
* subtokens for any nested TCL_TOKEN_SUB_EXPR
|
| 1965 |
+
* tokens. For example, a numeric value used as a
|
| 1966 |
+
* primitive operand is described by a
|
| 1967 |
+
* TCL_TOKEN_SUB_EXPR token followed by a
|
| 1968 |
+
* TCL_TOKEN_TEXT token. A binary subexpression
|
| 1969 |
+
* is described by a TCL_TOKEN_SUB_EXPR token
|
| 1970 |
+
* followed by the TCL_TOKEN_OPERATOR token for
|
| 1971 |
+
* the operator, then TCL_TOKEN_SUB_EXPR tokens
|
| 1972 |
+
* for the left then the right operands.
|
| 1973 |
+
* TCL_TOKEN_OPERATOR - The token describes one expression operator.
|
| 1974 |
+
* An operator might be the name of a math
|
| 1975 |
+
* function such as "abs". A TCL_TOKEN_OPERATOR
|
| 1976 |
+
* token is always preceded by one
|
| 1977 |
+
* TCL_TOKEN_SUB_EXPR token for the operator's
|
| 1978 |
+
* subexpression, and is followed by zero or more
|
| 1979 |
+
* TCL_TOKEN_SUB_EXPR tokens for the operator's
|
| 1980 |
+
* operands. NumComponents is always 0.
|
| 1981 |
+
* TCL_TOKEN_EXPAND_WORD - This token is just like TCL_TOKEN_WORD except
|
| 1982 |
+
* that it marks a word that began with the
|
| 1983 |
+
* literal character prefix "{*}". This word is
|
| 1984 |
+
* marked to be expanded - that is, broken into
|
| 1985 |
+
* words after substitution is complete.
|
| 1986 |
+
*/
|
| 1987 |
+
|
| 1988 |
+
#define TCL_TOKEN_WORD 1
|
| 1989 |
+
#define TCL_TOKEN_SIMPLE_WORD 2
|
| 1990 |
+
#define TCL_TOKEN_TEXT 4
|
| 1991 |
+
#define TCL_TOKEN_BS 8
|
| 1992 |
+
#define TCL_TOKEN_COMMAND 16
|
| 1993 |
+
#define TCL_TOKEN_VARIABLE 32
|
| 1994 |
+
#define TCL_TOKEN_SUB_EXPR 64
|
| 1995 |
+
#define TCL_TOKEN_OPERATOR 128
|
| 1996 |
+
#define TCL_TOKEN_EXPAND_WORD 256
|
| 1997 |
+
|
| 1998 |
+
/*
|
| 1999 |
+
* Parsing error types. On any parsing error, one of these values will be
|
| 2000 |
+
* stored in the error field of the Tcl_Parse structure defined below.
|
| 2001 |
+
*/
|
| 2002 |
+
|
| 2003 |
+
#define TCL_PARSE_SUCCESS 0
|
| 2004 |
+
#define TCL_PARSE_QUOTE_EXTRA 1
|
| 2005 |
+
#define TCL_PARSE_BRACE_EXTRA 2
|
| 2006 |
+
#define TCL_PARSE_MISSING_BRACE 3
|
| 2007 |
+
#define TCL_PARSE_MISSING_BRACKET 4
|
| 2008 |
+
#define TCL_PARSE_MISSING_PAREN 5
|
| 2009 |
+
#define TCL_PARSE_MISSING_QUOTE 6
|
| 2010 |
+
#define TCL_PARSE_MISSING_VAR_BRACE 7
|
| 2011 |
+
#define TCL_PARSE_SYNTAX 8
|
| 2012 |
+
#define TCL_PARSE_BAD_NUMBER 9
|
| 2013 |
+
|
| 2014 |
+
/*
|
| 2015 |
+
* A structure of the following type is filled in by Tcl_ParseCommand. It
|
| 2016 |
+
* describes a single command parsed from an input string.
|
| 2017 |
+
*/
|
| 2018 |
+
|
| 2019 |
+
#define NUM_STATIC_TOKENS 20
|
| 2020 |
+
|
| 2021 |
+
typedef struct Tcl_Parse {
|
| 2022 |
+
const char *commentStart; /* Pointer to # that begins the first of one
|
| 2023 |
+
* or more comments preceding the command. */
|
| 2024 |
+
int commentSize; /* Number of bytes in comments (up through
|
| 2025 |
+
* newline character that terminates the last
|
| 2026 |
+
* comment). If there were no comments, this
|
| 2027 |
+
* field is 0. */
|
| 2028 |
+
const char *commandStart; /* First character in first word of
|
| 2029 |
+
* command. */
|
| 2030 |
+
int commandSize; /* Number of bytes in command, including first
|
| 2031 |
+
* character of first word, up through the
|
| 2032 |
+
* terminating newline, close bracket, or
|
| 2033 |
+
* semicolon. */
|
| 2034 |
+
int numWords; /* Total number of words in command. May be
|
| 2035 |
+
* 0. */
|
| 2036 |
+
Tcl_Token *tokenPtr; /* Pointer to first token representing the
|
| 2037 |
+
* words of the command. Initially points to
|
| 2038 |
+
* staticTokens, but may change to point to
|
| 2039 |
+
* malloc-ed space if command exceeds space in
|
| 2040 |
+
* staticTokens. */
|
| 2041 |
+
int numTokens; /* Total number of tokens in command. */
|
| 2042 |
+
int tokensAvailable; /* Total number of tokens available at
|
| 2043 |
+
* *tokenPtr. */
|
| 2044 |
+
int errorType; /* One of the parsing error types defined
|
| 2045 |
+
* above. */
|
| 2046 |
+
|
| 2047 |
+
/*
|
| 2048 |
+
* The fields below are intended only for the private use of the parser.
|
| 2049 |
+
* They should not be used by functions that invoke Tcl_ParseCommand.
|
| 2050 |
+
*/
|
| 2051 |
+
|
| 2052 |
+
const char *string; /* The original command string passed to
|
| 2053 |
+
* Tcl_ParseCommand. */
|
| 2054 |
+
const char *end; /* Points to the character just after the last
|
| 2055 |
+
* one in the command string. */
|
| 2056 |
+
Tcl_Interp *interp; /* Interpreter to use for error reporting, or
|
| 2057 |
+
* NULL. */
|
| 2058 |
+
const char *term; /* Points to character in string that
|
| 2059 |
+
* terminated most recent token. Filled in by
|
| 2060 |
+
* ParseTokens. If an error occurs, points to
|
| 2061 |
+
* beginning of region where the error
|
| 2062 |
+
* occurred (e.g. the open brace if the close
|
| 2063 |
+
* brace is missing). */
|
| 2064 |
+
int incomplete; /* This field is set to 1 by Tcl_ParseCommand
|
| 2065 |
+
* if the command appears to be incomplete.
|
| 2066 |
+
* This information is used by
|
| 2067 |
+
* Tcl_CommandComplete. */
|
| 2068 |
+
Tcl_Token staticTokens[NUM_STATIC_TOKENS];
|
| 2069 |
+
/* Initial space for tokens for command. This
|
| 2070 |
+
* space should be large enough to accommodate
|
| 2071 |
+
* most commands; dynamic space is allocated
|
| 2072 |
+
* for very large commands that don't fit
|
| 2073 |
+
* here. */
|
| 2074 |
+
} Tcl_Parse;
|
| 2075 |
+
|
| 2076 |
+
/*
|
| 2077 |
+
*----------------------------------------------------------------------------
|
| 2078 |
+
* The following structure represents a user-defined encoding. It collects
|
| 2079 |
+
* together all the functions that are used by the specific encoding.
|
| 2080 |
+
*/
|
| 2081 |
+
|
| 2082 |
+
typedef struct Tcl_EncodingType {
|
| 2083 |
+
const char *encodingName; /* The name of the encoding, e.g. "euc-jp".
|
| 2084 |
+
* This name is the unique key for this
|
| 2085 |
+
* encoding type. */
|
| 2086 |
+
Tcl_EncodingConvertProc *toUtfProc;
|
| 2087 |
+
/* Function to convert from external encoding
|
| 2088 |
+
* into UTF-8. */
|
| 2089 |
+
Tcl_EncodingConvertProc *fromUtfProc;
|
| 2090 |
+
/* Function to convert from UTF-8 into
|
| 2091 |
+
* external encoding. */
|
| 2092 |
+
Tcl_EncodingFreeProc *freeProc;
|
| 2093 |
+
/* If non-NULL, function to call when this
|
| 2094 |
+
* encoding is deleted. */
|
| 2095 |
+
ClientData clientData; /* Arbitrary value associated with encoding
|
| 2096 |
+
* type. Passed to conversion functions. */
|
| 2097 |
+
int nullSize; /* Number of zero bytes that signify
|
| 2098 |
+
* end-of-string in this encoding. This number
|
| 2099 |
+
* is used to determine the source string
|
| 2100 |
+
* length when the srcLen argument is
|
| 2101 |
+
* negative. Must be 1 or 2. */
|
| 2102 |
+
} Tcl_EncodingType;
|
| 2103 |
+
|
| 2104 |
+
/*
|
| 2105 |
+
* The following definitions are used as values for the conversion control
|
| 2106 |
+
* flags argument when converting text from one character set to another:
|
| 2107 |
+
*
|
| 2108 |
+
* TCL_ENCODING_START - Signifies that the source buffer is the first
|
| 2109 |
+
* block in a (potentially multi-block) input
|
| 2110 |
+
* stream. Tells the conversion function to reset
|
| 2111 |
+
* to an initial state and perform any
|
| 2112 |
+
* initialization that needs to occur before the
|
| 2113 |
+
* first byte is converted. If the source buffer
|
| 2114 |
+
* contains the entire input stream to be
|
| 2115 |
+
* converted, this flag should be set.
|
| 2116 |
+
* TCL_ENCODING_END - Signifies that the source buffer is the last
|
| 2117 |
+
* block in a (potentially multi-block) input
|
| 2118 |
+
* stream. Tells the conversion routine to
|
| 2119 |
+
* perform any finalization that needs to occur
|
| 2120 |
+
* after the last byte is converted and then to
|
| 2121 |
+
* reset to an initial state. If the source
|
| 2122 |
+
* buffer contains the entire input stream to be
|
| 2123 |
+
* converted, this flag should be set.
|
| 2124 |
+
* TCL_ENCODING_STOPONERROR - If set, the converter returns immediately upon
|
| 2125 |
+
* encountering an invalid byte sequence or a
|
| 2126 |
+
* source character that has no mapping in the
|
| 2127 |
+
* target encoding. If clear, the converter
|
| 2128 |
+
* substitues the problematic character(s) with
|
| 2129 |
+
* one or more "close" characters in the
|
| 2130 |
+
* destination buffer and then continues to
|
| 2131 |
+
* convert the source.
|
| 2132 |
+
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf does not append a
|
| 2133 |
+
* terminating NUL byte. Since it does not need
|
| 2134 |
+
* an extra byte for a terminating NUL, it fills
|
| 2135 |
+
* all dstLen bytes with encoded UTF-8 content if
|
| 2136 |
+
* needed. If clear, a byte is reserved in the
|
| 2137 |
+
* dst space for NUL termination, and a
|
| 2138 |
+
* terminating NUL is appended.
|
| 2139 |
+
* TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
|
| 2140 |
+
* Tcl_ExternalToUtf takes the initial value of
|
| 2141 |
+
* *dstCharsPtr as a limit of the maximum number
|
| 2142 |
+
* of chars to produce in the encoded UTF-8
|
| 2143 |
+
* content. Otherwise, the number of chars
|
| 2144 |
+
* produced is controlled only by other limiting
|
| 2145 |
+
* factors.
|
| 2146 |
+
*/
|
| 2147 |
+
|
| 2148 |
+
#define TCL_ENCODING_START 0x01
|
| 2149 |
+
#define TCL_ENCODING_END 0x02
|
| 2150 |
+
#define TCL_ENCODING_STOPONERROR 0x04
|
| 2151 |
+
#define TCL_ENCODING_NO_TERMINATE 0x08
|
| 2152 |
+
#define TCL_ENCODING_CHAR_LIMIT 0x10
|
| 2153 |
+
|
| 2154 |
+
/*
|
| 2155 |
+
* The following definitions are the error codes returned by the conversion
|
| 2156 |
+
* routines:
|
| 2157 |
+
*
|
| 2158 |
+
* TCL_OK - All characters were converted.
|
| 2159 |
+
* TCL_CONVERT_NOSPACE - The output buffer would not have been large
|
| 2160 |
+
* enough for all of the converted data; as many
|
| 2161 |
+
* characters as could fit were converted though.
|
| 2162 |
+
* TCL_CONVERT_MULTIBYTE - The last few bytes in the source string were
|
| 2163 |
+
* the beginning of a multibyte sequence, but
|
| 2164 |
+
* more bytes were needed to complete this
|
| 2165 |
+
* sequence. A subsequent call to the conversion
|
| 2166 |
+
* routine should pass the beginning of this
|
| 2167 |
+
* unconverted sequence plus additional bytes
|
| 2168 |
+
* from the source stream to properly convert the
|
| 2169 |
+
* formerly split-up multibyte sequence.
|
| 2170 |
+
* TCL_CONVERT_SYNTAX - The source stream contained an invalid
|
| 2171 |
+
* character sequence. This may occur if the
|
| 2172 |
+
* input stream has been damaged or if the input
|
| 2173 |
+
* encoding method was misidentified. This error
|
| 2174 |
+
* is reported only if TCL_ENCODING_STOPONERROR
|
| 2175 |
+
* was specified.
|
| 2176 |
+
* TCL_CONVERT_UNKNOWN - The source string contained a character that
|
| 2177 |
+
* could not be represented in the target
|
| 2178 |
+
* encoding. This error is reported only if
|
| 2179 |
+
* TCL_ENCODING_STOPONERROR was specified.
|
| 2180 |
+
*/
|
| 2181 |
+
|
| 2182 |
+
#define TCL_CONVERT_MULTIBYTE (-1)
|
| 2183 |
+
#define TCL_CONVERT_SYNTAX (-2)
|
| 2184 |
+
#define TCL_CONVERT_UNKNOWN (-3)
|
| 2185 |
+
#define TCL_CONVERT_NOSPACE (-4)
|
| 2186 |
+
|
| 2187 |
+
/*
|
| 2188 |
+
* The maximum number of bytes that are necessary to represent a single
|
| 2189 |
+
* Unicode character in UTF-8. The valid values should be 3, 4 or 6. If 3 or
|
| 2190 |
+
* 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
|
| 2191 |
+
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
|
| 2192 |
+
* is the default and recommended mode. UCS-4 is experimental and not
|
| 2193 |
+
* recommended. It works for the core, but most extensions expect UCS-2.
|
| 2194 |
+
*/
|
| 2195 |
+
|
| 2196 |
+
#ifndef TCL_UTF_MAX
|
| 2197 |
+
#define TCL_UTF_MAX 3
|
| 2198 |
+
#endif
|
| 2199 |
+
|
| 2200 |
+
/*
|
| 2201 |
+
* This represents a Unicode character. Any changes to this should also be
|
| 2202 |
+
* reflected in regcustom.h.
|
| 2203 |
+
*/
|
| 2204 |
+
|
| 2205 |
+
#if TCL_UTF_MAX > 4
|
| 2206 |
+
/*
|
| 2207 |
+
* unsigned int isn't 100% accurate as it should be a strict 4-byte value.
|
| 2208 |
+
* The size of this value must be reflected correctly in regcustom.h.
|
| 2209 |
+
* XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
|
| 2210 |
+
* XXX: string rep that Tcl_UniChar represents. Changing the size
|
| 2211 |
+
* XXX: of Tcl_UniChar is /not/ supported.
|
| 2212 |
+
*/
|
| 2213 |
+
typedef unsigned int Tcl_UniChar;
|
| 2214 |
+
#else
|
| 2215 |
+
typedef unsigned short Tcl_UniChar;
|
| 2216 |
+
#endif
|
| 2217 |
+
|
| 2218 |
+
/*
|
| 2219 |
+
*----------------------------------------------------------------------------
|
| 2220 |
+
* TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
|
| 2221 |
+
* provide the system with the embedded configuration data.
|
| 2222 |
+
*/
|
| 2223 |
+
|
| 2224 |
+
typedef struct Tcl_Config {
|
| 2225 |
+
const char *key; /* Configuration key to register. ASCII
|
| 2226 |
+
* encoded, thus UTF-8. */
|
| 2227 |
+
const char *value; /* The value associated with the key. System
|
| 2228 |
+
* encoding. */
|
| 2229 |
+
} Tcl_Config;
|
| 2230 |
+
|
| 2231 |
+
/*
|
| 2232 |
+
*----------------------------------------------------------------------------
|
| 2233 |
+
* Flags for TIP#143 limits, detailing which limits are active in an
|
| 2234 |
+
* interpreter. Used for Tcl_{Add,Remove}LimitHandler type argument.
|
| 2235 |
+
*/
|
| 2236 |
+
|
| 2237 |
+
#define TCL_LIMIT_COMMANDS 0x01
|
| 2238 |
+
#define TCL_LIMIT_TIME 0x02
|
| 2239 |
+
|
| 2240 |
+
/*
|
| 2241 |
+
* Structure containing information about a limit handler to be called when a
|
| 2242 |
+
* command- or time-limit is exceeded by an interpreter.
|
| 2243 |
+
*/
|
| 2244 |
+
|
| 2245 |
+
typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
|
| 2246 |
+
typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
|
| 2247 |
+
|
| 2248 |
+
/*
|
| 2249 |
+
*----------------------------------------------------------------------------
|
| 2250 |
+
* Override definitions for libtommath.
|
| 2251 |
+
*/
|
| 2252 |
+
|
| 2253 |
+
typedef struct mp_int mp_int;
|
| 2254 |
+
#define MP_INT_DECLARED
|
| 2255 |
+
typedef unsigned int mp_digit;
|
| 2256 |
+
#define MP_DIGIT_DECLARED
|
| 2257 |
+
|
| 2258 |
+
/*
|
| 2259 |
+
*----------------------------------------------------------------------------
|
| 2260 |
+
* Definitions needed for Tcl_ParseArgvObj routines.
|
| 2261 |
+
* Based on tkArgv.c.
|
| 2262 |
+
* Modifications from the original are copyright (c) Sam Bromley 2006
|
| 2263 |
+
*/
|
| 2264 |
+
|
| 2265 |
+
typedef struct {
|
| 2266 |
+
int type; /* Indicates the option type; see below. */
|
| 2267 |
+
const char *keyStr; /* The key string that flags the option in the
|
| 2268 |
+
* argv array. */
|
| 2269 |
+
void *srcPtr; /* Value to be used in setting dst; usage
|
| 2270 |
+
* depends on type.*/
|
| 2271 |
+
void *dstPtr; /* Address of value to be modified; usage
|
| 2272 |
+
* depends on type.*/
|
| 2273 |
+
const char *helpStr; /* Documentation message describing this
|
| 2274 |
+
* option. */
|
| 2275 |
+
ClientData clientData; /* Word to pass to function callbacks. */
|
| 2276 |
+
} Tcl_ArgvInfo;
|
| 2277 |
+
|
| 2278 |
+
/*
|
| 2279 |
+
* Legal values for the type field of a Tcl_ArgInfo: see the user
|
| 2280 |
+
* documentation for details.
|
| 2281 |
+
*/
|
| 2282 |
+
|
| 2283 |
+
#define TCL_ARGV_CONSTANT 15
|
| 2284 |
+
#define TCL_ARGV_INT 16
|
| 2285 |
+
#define TCL_ARGV_STRING 17
|
| 2286 |
+
#define TCL_ARGV_REST 18
|
| 2287 |
+
#define TCL_ARGV_FLOAT 19
|
| 2288 |
+
#define TCL_ARGV_FUNC 20
|
| 2289 |
+
#define TCL_ARGV_GENFUNC 21
|
| 2290 |
+
#define TCL_ARGV_HELP 22
|
| 2291 |
+
#define TCL_ARGV_END 23
|
| 2292 |
+
|
| 2293 |
+
/*
|
| 2294 |
+
* Types of callback functions for the TCL_ARGV_FUNC and TCL_ARGV_GENFUNC
|
| 2295 |
+
* argument types:
|
| 2296 |
+
*/
|
| 2297 |
+
|
| 2298 |
+
typedef int (Tcl_ArgvFuncProc)(ClientData clientData, Tcl_Obj *objPtr,
|
| 2299 |
+
void *dstPtr);
|
| 2300 |
+
typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
|
| 2301 |
+
int objc, Tcl_Obj *const *objv, void *dstPtr);
|
| 2302 |
+
|
| 2303 |
+
/*
|
| 2304 |
+
* Shorthand for commonly used argTable entries.
|
| 2305 |
+
*/
|
| 2306 |
+
|
| 2307 |
+
#define TCL_ARGV_AUTO_HELP \
|
| 2308 |
+
{TCL_ARGV_HELP, "-help", NULL, NULL, \
|
| 2309 |
+
"Print summary of command-line options and abort", NULL}
|
| 2310 |
+
#define TCL_ARGV_AUTO_REST \
|
| 2311 |
+
{TCL_ARGV_REST, "--", NULL, NULL, \
|
| 2312 |
+
"Marks the end of the options", NULL}
|
| 2313 |
+
#define TCL_ARGV_TABLE_END \
|
| 2314 |
+
{TCL_ARGV_END, NULL, NULL, NULL, NULL, NULL}
|
| 2315 |
+
|
| 2316 |
+
/*
|
| 2317 |
+
*----------------------------------------------------------------------------
|
| 2318 |
+
* Definitions needed for Tcl_Zlib routines. [TIP #234]
|
| 2319 |
+
*
|
| 2320 |
+
* Constants for the format flags describing what sort of data format is
|
| 2321 |
+
* desired/expected for the Tcl_ZlibDeflate, Tcl_ZlibInflate and
|
| 2322 |
+
* Tcl_ZlibStreamInit functions.
|
| 2323 |
+
*/
|
| 2324 |
+
|
| 2325 |
+
#define TCL_ZLIB_FORMAT_RAW 1
|
| 2326 |
+
#define TCL_ZLIB_FORMAT_ZLIB 2
|
| 2327 |
+
#define TCL_ZLIB_FORMAT_GZIP 4
|
| 2328 |
+
#define TCL_ZLIB_FORMAT_AUTO 8
|
| 2329 |
+
|
| 2330 |
+
/*
|
| 2331 |
+
* Constants that describe whether the stream is to operate in compressing or
|
| 2332 |
+
* decompressing mode.
|
| 2333 |
+
*/
|
| 2334 |
+
|
| 2335 |
+
#define TCL_ZLIB_STREAM_DEFLATE 16
|
| 2336 |
+
#define TCL_ZLIB_STREAM_INFLATE 32
|
| 2337 |
+
|
| 2338 |
+
/*
|
| 2339 |
+
* Constants giving compression levels. Use of TCL_ZLIB_COMPRESS_DEFAULT is
|
| 2340 |
+
* recommended.
|
| 2341 |
+
*/
|
| 2342 |
+
|
| 2343 |
+
#define TCL_ZLIB_COMPRESS_NONE 0
|
| 2344 |
+
#define TCL_ZLIB_COMPRESS_FAST 1
|
| 2345 |
+
#define TCL_ZLIB_COMPRESS_BEST 9
|
| 2346 |
+
#define TCL_ZLIB_COMPRESS_DEFAULT (-1)
|
| 2347 |
+
|
| 2348 |
+
/*
|
| 2349 |
+
* Constants for types of flushing, used with Tcl_ZlibFlush.
|
| 2350 |
+
*/
|
| 2351 |
+
|
| 2352 |
+
#define TCL_ZLIB_NO_FLUSH 0
|
| 2353 |
+
#define TCL_ZLIB_FLUSH 2
|
| 2354 |
+
#define TCL_ZLIB_FULLFLUSH 3
|
| 2355 |
+
#define TCL_ZLIB_FINALIZE 4
|
| 2356 |
+
|
| 2357 |
+
/*
|
| 2358 |
+
*----------------------------------------------------------------------------
|
| 2359 |
+
* Definitions needed for the Tcl_LoadFile function. [TIP #416]
|
| 2360 |
+
*/
|
| 2361 |
+
|
| 2362 |
+
#define TCL_LOAD_GLOBAL 1
|
| 2363 |
+
#define TCL_LOAD_LAZY 2
|
| 2364 |
+
|
| 2365 |
+
/*
|
| 2366 |
+
*----------------------------------------------------------------------------
|
| 2367 |
+
* Single public declaration for NRE.
|
| 2368 |
+
*/
|
| 2369 |
+
|
| 2370 |
+
typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
|
| 2371 |
+
int result);
|
| 2372 |
+
|
| 2373 |
+
/*
|
| 2374 |
+
*----------------------------------------------------------------------------
|
| 2375 |
+
* The following constant is used to test for older versions of Tcl in the
|
| 2376 |
+
* stubs tables.
|
| 2377 |
+
*/
|
| 2378 |
+
|
| 2379 |
+
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
|
| 2380 |
+
|
| 2381 |
+
/*
|
| 2382 |
+
* The following function is required to be defined in all stubs aware
|
| 2383 |
+
* extensions. The function is actually implemented in the stub library, not
|
| 2384 |
+
* the main Tcl library, although there is a trivial implementation in the
|
| 2385 |
+
* main library in case an extension is statically linked into an application.
|
| 2386 |
+
*/
|
| 2387 |
+
|
| 2388 |
+
const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
|
| 2389 |
+
int exact);
|
| 2390 |
+
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
|
| 2391 |
+
const char *version, int epoch, int revision);
|
| 2392 |
+
|
| 2393 |
+
/*
|
| 2394 |
+
* When not using stubs, make it a macro.
|
| 2395 |
+
*/
|
| 2396 |
+
|
| 2397 |
+
#ifndef USE_TCL_STUBS
|
| 2398 |
+
#define Tcl_InitStubs(interp, version, exact) \
|
| 2399 |
+
Tcl_PkgInitStubsCheck(interp, version, exact)
|
| 2400 |
+
#endif
|
| 2401 |
+
|
| 2402 |
+
/*
|
| 2403 |
+
* Public functions that are not accessible via the stubs table.
|
| 2404 |
+
* Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
|
| 2405 |
+
*/
|
| 2406 |
+
|
| 2407 |
+
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
|
| 2408 |
+
((Tcl_CreateInterp)()))
|
| 2409 |
+
EXTERN void Tcl_MainEx(int argc, char **argv,
|
| 2410 |
+
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
| 2411 |
+
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
| 2412 |
+
const char *version, int exact);
|
| 2413 |
+
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
| 2414 |
+
|
| 2415 |
+
/*
|
| 2416 |
+
*----------------------------------------------------------------------------
|
| 2417 |
+
* Include the public function declarations that are accessible via the stubs
|
| 2418 |
+
* table.
|
| 2419 |
+
*/
|
| 2420 |
+
|
| 2421 |
+
#include "tclDecls.h"
|
| 2422 |
+
|
| 2423 |
+
/*
|
| 2424 |
+
* Include platform specific public function declarations that are accessible
|
| 2425 |
+
* via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only
|
| 2426 |
+
* has effect on building it as a shared library). See ticket [3010352].
|
| 2427 |
+
*/
|
| 2428 |
+
|
| 2429 |
+
#if defined(BUILD_tcl)
|
| 2430 |
+
# undef TCLAPI
|
| 2431 |
+
# define TCLAPI MODULE_SCOPE
|
| 2432 |
+
#endif
|
| 2433 |
+
|
| 2434 |
+
#include "tclPlatDecls.h"
|
| 2435 |
+
|
| 2436 |
+
/*
|
| 2437 |
+
*----------------------------------------------------------------------------
|
| 2438 |
+
* The following declarations either map ckalloc and ckfree to malloc and
|
| 2439 |
+
* free, or they map them to functions with all sorts of debugging hooks
|
| 2440 |
+
* defined in tclCkalloc.c.
|
| 2441 |
+
*/
|
| 2442 |
+
|
| 2443 |
+
#ifdef TCL_MEM_DEBUG
|
| 2444 |
+
|
| 2445 |
+
# define ckalloc(x) \
|
| 2446 |
+
((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
| 2447 |
+
# define ckfree(x) \
|
| 2448 |
+
Tcl_DbCkfree((char *)(x), __FILE__, __LINE__)
|
| 2449 |
+
# define ckrealloc(x,y) \
|
| 2450 |
+
((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
| 2451 |
+
# define attemptckalloc(x) \
|
| 2452 |
+
((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
| 2453 |
+
# define attemptckrealloc(x,y) \
|
| 2454 |
+
((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
| 2455 |
+
|
| 2456 |
+
#else /* !TCL_MEM_DEBUG */
|
| 2457 |
+
|
| 2458 |
+
/*
|
| 2459 |
+
* If we are not using the debugging allocator, we should call the Tcl_Alloc,
|
| 2460 |
+
* et al. routines in order to guarantee that every module is using the same
|
| 2461 |
+
* memory allocator both inside and outside of the Tcl library.
|
| 2462 |
+
*/
|
| 2463 |
+
|
| 2464 |
+
# define ckalloc(x) \
|
| 2465 |
+
((void *) Tcl_Alloc((unsigned)(x)))
|
| 2466 |
+
# define ckfree(x) \
|
| 2467 |
+
Tcl_Free((char *)(x))
|
| 2468 |
+
# define ckrealloc(x,y) \
|
| 2469 |
+
((void *) Tcl_Realloc((char *)(x), (unsigned)(y)))
|
| 2470 |
+
# define attemptckalloc(x) \
|
| 2471 |
+
((void *) Tcl_AttemptAlloc((unsigned)(x)))
|
| 2472 |
+
# define attemptckrealloc(x,y) \
|
| 2473 |
+
((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y)))
|
| 2474 |
+
# undef Tcl_InitMemory
|
| 2475 |
+
# define Tcl_InitMemory(x)
|
| 2476 |
+
# undef Tcl_DumpActiveMemory
|
| 2477 |
+
# define Tcl_DumpActiveMemory(x)
|
| 2478 |
+
# undef Tcl_ValidateAllMemory
|
| 2479 |
+
# define Tcl_ValidateAllMemory(x,y)
|
| 2480 |
+
|
| 2481 |
+
#endif /* !TCL_MEM_DEBUG */
|
| 2482 |
+
|
| 2483 |
+
#ifdef TCL_MEM_DEBUG
|
| 2484 |
+
# define Tcl_IncrRefCount(objPtr) \
|
| 2485 |
+
Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
|
| 2486 |
+
# define Tcl_DecrRefCount(objPtr) \
|
| 2487 |
+
Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
|
| 2488 |
+
# define Tcl_IsShared(objPtr) \
|
| 2489 |
+
Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
|
| 2490 |
+
#else
|
| 2491 |
+
# define Tcl_IncrRefCount(objPtr) \
|
| 2492 |
+
++(objPtr)->refCount
|
| 2493 |
+
/*
|
| 2494 |
+
* Use do/while0 idiom for optimum correctness without compiler warnings.
|
| 2495 |
+
* https://wiki.c2.com/?TrivialDoWhileLoop
|
| 2496 |
+
*/
|
| 2497 |
+
# define Tcl_DecrRefCount(objPtr) \
|
| 2498 |
+
do { \
|
| 2499 |
+
Tcl_Obj *_objPtr = (objPtr); \
|
| 2500 |
+
if (_objPtr->refCount-- <= 1) { \
|
| 2501 |
+
TclFreeObj(_objPtr); \
|
| 2502 |
+
} \
|
| 2503 |
+
} while(0)
|
| 2504 |
+
# define Tcl_IsShared(objPtr) \
|
| 2505 |
+
((objPtr)->refCount > 1)
|
| 2506 |
+
#endif
|
| 2507 |
+
|
| 2508 |
+
/*
|
| 2509 |
+
* Macros and definitions that help to debug the use of Tcl objects. When
|
| 2510 |
+
* TCL_MEM_DEBUG is defined, the Tcl_New declarations are overridden to call
|
| 2511 |
+
* debugging versions of the object creation functions.
|
| 2512 |
+
*/
|
| 2513 |
+
|
| 2514 |
+
#ifdef TCL_MEM_DEBUG
|
| 2515 |
+
# undef Tcl_NewBignumObj
|
| 2516 |
+
# define Tcl_NewBignumObj(val) \
|
| 2517 |
+
Tcl_DbNewBignumObj(val, __FILE__, __LINE__)
|
| 2518 |
+
# undef Tcl_NewBooleanObj
|
| 2519 |
+
# define Tcl_NewBooleanObj(val) \
|
| 2520 |
+
Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
|
| 2521 |
+
# undef Tcl_NewByteArrayObj
|
| 2522 |
+
# define Tcl_NewByteArrayObj(bytes, len) \
|
| 2523 |
+
Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
|
| 2524 |
+
# undef Tcl_NewDoubleObj
|
| 2525 |
+
# define Tcl_NewDoubleObj(val) \
|
| 2526 |
+
Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
|
| 2527 |
+
# undef Tcl_NewIntObj
|
| 2528 |
+
# define Tcl_NewIntObj(val) \
|
| 2529 |
+
Tcl_DbNewLongObj(val, __FILE__, __LINE__)
|
| 2530 |
+
# undef Tcl_NewListObj
|
| 2531 |
+
# define Tcl_NewListObj(objc, objv) \
|
| 2532 |
+
Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
|
| 2533 |
+
# undef Tcl_NewLongObj
|
| 2534 |
+
# define Tcl_NewLongObj(val) \
|
| 2535 |
+
Tcl_DbNewLongObj(val, __FILE__, __LINE__)
|
| 2536 |
+
# undef Tcl_NewObj
|
| 2537 |
+
# define Tcl_NewObj() \
|
| 2538 |
+
Tcl_DbNewObj(__FILE__, __LINE__)
|
| 2539 |
+
# undef Tcl_NewStringObj
|
| 2540 |
+
# define Tcl_NewStringObj(bytes, len) \
|
| 2541 |
+
Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
|
| 2542 |
+
# undef Tcl_NewWideIntObj
|
| 2543 |
+
# define Tcl_NewWideIntObj(val) \
|
| 2544 |
+
Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
|
| 2545 |
+
#endif /* TCL_MEM_DEBUG */
|
| 2546 |
+
|
| 2547 |
+
/*
|
| 2548 |
+
*----------------------------------------------------------------------------
|
| 2549 |
+
* Macros for clients to use to access fields of hash entries:
|
| 2550 |
+
*/
|
| 2551 |
+
|
| 2552 |
+
#define Tcl_GetHashValue(h) ((h)->clientData)
|
| 2553 |
+
#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
|
| 2554 |
+
#define Tcl_GetHashKey(tablePtr, h) \
|
| 2555 |
+
((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
|
| 2556 |
+
(tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
|
| 2557 |
+
? (h)->key.oneWordValue \
|
| 2558 |
+
: (h)->key.string))
|
| 2559 |
+
|
| 2560 |
+
/*
|
| 2561 |
+
* Macros to use for clients to use to invoke find and create functions for
|
| 2562 |
+
* hash tables:
|
| 2563 |
+
*/
|
| 2564 |
+
|
| 2565 |
+
#undef Tcl_FindHashEntry
|
| 2566 |
+
#define Tcl_FindHashEntry(tablePtr, key) \
|
| 2567 |
+
(*((tablePtr)->findProc))(tablePtr, (const char *)(key))
|
| 2568 |
+
#undef Tcl_CreateHashEntry
|
| 2569 |
+
#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
|
| 2570 |
+
(*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
|
| 2571 |
+
|
| 2572 |
+
/*
|
| 2573 |
+
*----------------------------------------------------------------------------
|
| 2574 |
+
* Macros that eliminate the overhead of the thread synchronization functions
|
| 2575 |
+
* when compiling without thread support.
|
| 2576 |
+
*/
|
| 2577 |
+
|
| 2578 |
+
#ifndef TCL_THREADS
|
| 2579 |
+
#undef Tcl_MutexLock
|
| 2580 |
+
#define Tcl_MutexLock(mutexPtr)
|
| 2581 |
+
#undef Tcl_MutexUnlock
|
| 2582 |
+
#define Tcl_MutexUnlock(mutexPtr)
|
| 2583 |
+
#undef Tcl_MutexFinalize
|
| 2584 |
+
#define Tcl_MutexFinalize(mutexPtr)
|
| 2585 |
+
#undef Tcl_ConditionNotify
|
| 2586 |
+
#define Tcl_ConditionNotify(condPtr)
|
| 2587 |
+
#undef Tcl_ConditionWait
|
| 2588 |
+
#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
|
| 2589 |
+
#undef Tcl_ConditionFinalize
|
| 2590 |
+
#define Tcl_ConditionFinalize(condPtr)
|
| 2591 |
+
#endif /* TCL_THREADS */
|
| 2592 |
+
|
| 2593 |
+
/*
|
| 2594 |
+
*----------------------------------------------------------------------------
|
| 2595 |
+
* Deprecated Tcl functions:
|
| 2596 |
+
*/
|
| 2597 |
+
|
| 2598 |
+
#ifndef TCL_NO_DEPRECATED
|
| 2599 |
+
/*
|
| 2600 |
+
* These function have been renamed. The old names are deprecated, but we
|
| 2601 |
+
* define these macros for backwards compatibility.
|
| 2602 |
+
*/
|
| 2603 |
+
|
| 2604 |
+
# define Tcl_Ckalloc Tcl_Alloc
|
| 2605 |
+
# define Tcl_Ckfree Tcl_Free
|
| 2606 |
+
# define Tcl_Ckrealloc Tcl_Realloc
|
| 2607 |
+
# define Tcl_Return Tcl_SetResult
|
| 2608 |
+
# define Tcl_TildeSubst Tcl_TranslateFileName
|
| 2609 |
+
#if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
|
| 2610 |
+
# define panic Tcl_Panic
|
| 2611 |
+
#endif
|
| 2612 |
+
# define panicVA Tcl_PanicVA
|
| 2613 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 2614 |
+
|
| 2615 |
+
/*
|
| 2616 |
+
*----------------------------------------------------------------------------
|
| 2617 |
+
* Convenience declaration of Tcl_AppInit for backwards compatibility. This
|
| 2618 |
+
* function is not *implemented* by the tcl library, so the storage class is
|
| 2619 |
+
* neither DLLEXPORT nor DLLIMPORT.
|
| 2620 |
+
*/
|
| 2621 |
+
|
| 2622 |
+
extern Tcl_AppInitProc Tcl_AppInit;
|
| 2623 |
+
|
| 2624 |
+
#endif /* RC_INVOKED */
|
| 2625 |
+
|
| 2626 |
+
/*
|
| 2627 |
+
* end block for C++
|
| 2628 |
+
*/
|
| 2629 |
+
|
| 2630 |
+
#ifdef __cplusplus
|
| 2631 |
+
}
|
| 2632 |
+
#endif
|
| 2633 |
+
|
| 2634 |
+
#endif /* _TCL */
|
| 2635 |
+
|
| 2636 |
+
/*
|
| 2637 |
+
* Local Variables:
|
| 2638 |
+
* mode: c
|
| 2639 |
+
* c-basic-offset: 4
|
| 2640 |
+
* fill-column: 78
|
| 2641 |
+
* End:
|
| 2642 |
+
*/
|
mantis_evalkit/include/tclPort.h
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tclPort.h --
|
| 3 |
+
*
|
| 4 |
+
* This header file handles porting issues that occur because
|
| 5 |
+
* of differences between systems. It reads in platform specific
|
| 6 |
+
* portability files.
|
| 7 |
+
*
|
| 8 |
+
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TCLPORT
|
| 15 |
+
#define _TCLPORT
|
| 16 |
+
|
| 17 |
+
#ifdef HAVE_TCL_CONFIG_H
|
| 18 |
+
#include "tclConfig.h"
|
| 19 |
+
#endif
|
| 20 |
+
#if defined(_WIN32)
|
| 21 |
+
# include "tclWinPort.h"
|
| 22 |
+
#else
|
| 23 |
+
# include "tclUnixPort.h"
|
| 24 |
+
#endif
|
| 25 |
+
#include "tcl.h"
|
| 26 |
+
|
| 27 |
+
#if !defined(LLONG_MIN)
|
| 28 |
+
# ifdef TCL_WIDE_INT_IS_LONG
|
| 29 |
+
# define LLONG_MIN LONG_MIN
|
| 30 |
+
# else
|
| 31 |
+
# ifdef LLONG_BIT
|
| 32 |
+
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<(LLONG_BIT-1)))
|
| 33 |
+
# else
|
| 34 |
+
/* Assume we're on a system with a 64-bit 'long long' type */
|
| 35 |
+
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<63))
|
| 36 |
+
# endif
|
| 37 |
+
# endif
|
| 38 |
+
/* Assume that if LLONG_MIN is undefined, then so is LLONG_MAX */
|
| 39 |
+
# define LLONG_MAX (~LLONG_MIN)
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
#define UWIDE_MAX ((Tcl_WideUInt)-1)
|
| 43 |
+
#define WIDE_MAX ((Tcl_WideInt)(UWIDE_MAX >> 1))
|
| 44 |
+
#define WIDE_MIN ((Tcl_WideInt)((Tcl_WideUInt)WIDE_MAX+1))
|
| 45 |
+
|
| 46 |
+
#endif /* _TCLPORT */
|
mantis_evalkit/include/tclTomMath.h
ADDED
|
@@ -0,0 +1,1131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
| 2 |
+
/* SPDX-License-Identifier: Unlicense */
|
| 3 |
+
|
| 4 |
+
#ifndef BN_H_
|
| 5 |
+
#define BN_H_
|
| 6 |
+
|
| 7 |
+
#ifndef MODULE_SCOPE
|
| 8 |
+
#define MODULE_SCOPE extern
|
| 9 |
+
#endif
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
#ifdef __cplusplus
|
| 14 |
+
extern "C" {
|
| 15 |
+
#endif
|
| 16 |
+
|
| 17 |
+
/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
|
| 18 |
+
#if (defined(_WIN32) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_64BIT)
|
| 19 |
+
# define MP_32BIT
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/* detect 64-bit mode if possible */
|
| 23 |
+
#if defined(NEVER)
|
| 24 |
+
# if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
|
| 25 |
+
# if defined(__GNUC__)
|
| 26 |
+
/* we support 128bit integers only via: __attribute__((mode(TI))) */
|
| 27 |
+
# define MP_64BIT
|
| 28 |
+
# else
|
| 29 |
+
/* otherwise we fall back to MP_32BIT even on 64bit platforms */
|
| 30 |
+
# define MP_32BIT
|
| 31 |
+
# endif
|
| 32 |
+
# endif
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
#ifdef MP_DIGIT_BIT
|
| 36 |
+
# error Defining MP_DIGIT_BIT is disallowed, use MP_8/16/31/32/64BIT
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/* some default configurations.
|
| 40 |
+
*
|
| 41 |
+
* A "mp_digit" must be able to hold MP_DIGIT_BIT + 1 bits
|
| 42 |
+
* A "mp_word" must be able to hold 2*MP_DIGIT_BIT + 1 bits
|
| 43 |
+
*
|
| 44 |
+
* At the very least a mp_digit must be able to hold 7 bits
|
| 45 |
+
* [any size beyond that is ok provided it doesn't overflow the data type]
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#ifdef MP_8BIT
|
| 49 |
+
#ifndef MP_DIGIT_DECLARED
|
| 50 |
+
typedef unsigned char mp_digit;
|
| 51 |
+
#define MP_DIGIT_DECLARED
|
| 52 |
+
#endif
|
| 53 |
+
#ifndef MP_WORD_DECLARED
|
| 54 |
+
typedef unsigned short private_mp_word;
|
| 55 |
+
#define MP_WORD_DECLARED
|
| 56 |
+
#endif
|
| 57 |
+
# define MP_SIZEOF_MP_DIGIT 1
|
| 58 |
+
# ifdef MP_DIGIT_BIT
|
| 59 |
+
# error You must not define MP_DIGIT_BIT when using MP_8BIT
|
| 60 |
+
# endif
|
| 61 |
+
#elif defined(MP_16BIT)
|
| 62 |
+
#ifndef MP_DIGIT_DECLARED
|
| 63 |
+
typedef unsigned short mp_digit;
|
| 64 |
+
#define MP_DIGIT_DECLARED
|
| 65 |
+
#endif
|
| 66 |
+
#ifndef MP_WORD_DECLARED
|
| 67 |
+
typedef unsigned int private_mp_word;
|
| 68 |
+
#define MP_WORD_DECLARED
|
| 69 |
+
#endif
|
| 70 |
+
# define MP_SIZEOF_MP_DIGIT 2
|
| 71 |
+
# ifdef MP_DIGIT_BIT
|
| 72 |
+
# error You must not define MP_DIGIT_BIT when using MP_16BIT
|
| 73 |
+
# endif
|
| 74 |
+
#elif defined(MP_64BIT)
|
| 75 |
+
/* for GCC only on supported platforms */
|
| 76 |
+
#ifndef MP_DIGIT_DECLARED
|
| 77 |
+
typedef unsigned long long mp_digit;
|
| 78 |
+
#define MP_DIGIT_DECLARED
|
| 79 |
+
#endif
|
| 80 |
+
typedef unsigned long private_mp_word __attribute__((mode(TI)));
|
| 81 |
+
# define MP_DIGIT_BIT 60
|
| 82 |
+
#else
|
| 83 |
+
/* this is the default case, 28-bit digits */
|
| 84 |
+
|
| 85 |
+
/* this is to make porting into LibTomCrypt easier :-) */
|
| 86 |
+
#ifndef MP_DIGIT_DECLARED
|
| 87 |
+
typedef unsigned int mp_digit;
|
| 88 |
+
#define MP_DIGIT_DECLARED
|
| 89 |
+
#endif
|
| 90 |
+
#ifndef MP_WORD_DECLARED
|
| 91 |
+
#ifdef _WIN32
|
| 92 |
+
typedef unsigned __int64 private_mp_word;
|
| 93 |
+
#else
|
| 94 |
+
typedef unsigned long long private_mp_word;
|
| 95 |
+
#endif
|
| 96 |
+
#define MP_WORD_DECLARED
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
# ifdef MP_31BIT
|
| 100 |
+
/*
|
| 101 |
+
* This is an extension that uses 31-bit digits.
|
| 102 |
+
* Please be aware that not all functions support this size, especially s_mp_mul_digs_fast
|
| 103 |
+
* will be reduced to work on small numbers only:
|
| 104 |
+
* Up to 8 limbs, 248 bits instead of up to 512 limbs, 15872 bits with MP_28BIT.
|
| 105 |
+
*/
|
| 106 |
+
# define MP_DIGIT_BIT 31
|
| 107 |
+
# else
|
| 108 |
+
/* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */
|
| 109 |
+
# define MP_DIGIT_BIT 28
|
| 110 |
+
# define MP_28BIT
|
| 111 |
+
# endif
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
|
| 115 |
+
#ifndef MP_DIGIT_BIT
|
| 116 |
+
# define MP_DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
|
| 117 |
+
#endif
|
| 118 |
+
|
| 119 |
+
#define MP_MASK ((((mp_digit)1)<<((mp_digit)MP_DIGIT_BIT))-((mp_digit)1))
|
| 120 |
+
#define MP_DIGIT_MAX MP_MASK
|
| 121 |
+
|
| 122 |
+
/* Primality generation flags */
|
| 123 |
+
#define MP_PRIME_BBS 0x0001 /* BBS style prime */
|
| 124 |
+
#define MP_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
|
| 125 |
+
#define MP_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
|
| 126 |
+
|
| 127 |
+
#define LTM_PRIME_BBS (MP_DEPRECATED_PRAGMA("LTM_PRIME_BBS has been deprecated, use MP_PRIME_BBS") MP_PRIME_BBS)
|
| 128 |
+
#define LTM_PRIME_SAFE (MP_DEPRECATED_PRAGMA("LTM_PRIME_SAFE has been deprecated, use MP_PRIME_SAFE") MP_PRIME_SAFE)
|
| 129 |
+
#define LTM_PRIME_2MSB_ON (MP_DEPRECATED_PRAGMA("LTM_PRIME_2MSB_ON has been deprecated, use MP_PRIME_2MSB_ON") MP_PRIME_2MSB_ON)
|
| 130 |
+
|
| 131 |
+
#ifdef MP_USE_ENUMS
|
| 132 |
+
typedef enum {
|
| 133 |
+
MP_ZPOS = 0, /* positive */
|
| 134 |
+
MP_NEG = 1 /* negative */
|
| 135 |
+
} mp_sign;
|
| 136 |
+
typedef enum {
|
| 137 |
+
MP_LT = -1, /* less than */
|
| 138 |
+
MP_EQ = 0, /* equal */
|
| 139 |
+
MP_GT = 1 /* greater than */
|
| 140 |
+
} mp_ord;
|
| 141 |
+
typedef enum {
|
| 142 |
+
MP_NO = 0,
|
| 143 |
+
MP_YES = 1
|
| 144 |
+
} mp_bool;
|
| 145 |
+
typedef enum {
|
| 146 |
+
MP_OKAY = 0, /* no error */
|
| 147 |
+
MP_ERR = -1, /* unknown error */
|
| 148 |
+
MP_MEM = -2, /* out of mem */
|
| 149 |
+
MP_VAL = -3, /* invalid input */
|
| 150 |
+
MP_ITER = -4, /* maximum iterations reached */
|
| 151 |
+
MP_BUF = -5 /* buffer overflow, supplied buffer too small */
|
| 152 |
+
} mp_err;
|
| 153 |
+
typedef enum {
|
| 154 |
+
MP_LSB_FIRST = -1,
|
| 155 |
+
MP_MSB_FIRST = 1
|
| 156 |
+
} mp_order;
|
| 157 |
+
typedef enum {
|
| 158 |
+
MP_LITTLE_ENDIAN = -1,
|
| 159 |
+
MP_NATIVE_ENDIAN = 0,
|
| 160 |
+
MP_BIG_ENDIAN = 1
|
| 161 |
+
} mp_endian;
|
| 162 |
+
#else
|
| 163 |
+
typedef int mp_sign;
|
| 164 |
+
#define MP_ZPOS 0 /* positive integer */
|
| 165 |
+
#define MP_NEG 1 /* negative */
|
| 166 |
+
typedef int mp_ord;
|
| 167 |
+
#define MP_LT -1 /* less than */
|
| 168 |
+
#define MP_EQ 0 /* equal to */
|
| 169 |
+
#define MP_GT 1 /* greater than */
|
| 170 |
+
typedef int mp_bool;
|
| 171 |
+
#define MP_YES 1
|
| 172 |
+
#define MP_NO 0
|
| 173 |
+
typedef int mp_err;
|
| 174 |
+
#define MP_OKAY 0 /* no error */
|
| 175 |
+
#define MP_ERR -1 /* unknown error */
|
| 176 |
+
#define MP_MEM -2 /* out of mem */
|
| 177 |
+
#define MP_VAL -3 /* invalid input */
|
| 178 |
+
#define MP_RANGE (MP_DEPRECATED_PRAGMA("MP_RANGE has been deprecated in favor of MP_VAL") MP_VAL)
|
| 179 |
+
#define MP_ITER -4 /* maximum iterations reached */
|
| 180 |
+
#define MP_BUF -5 /* buffer overflow, supplied buffer too small */
|
| 181 |
+
typedef int mp_order;
|
| 182 |
+
#define MP_LSB_FIRST -1
|
| 183 |
+
#define MP_MSB_FIRST 1
|
| 184 |
+
typedef int mp_endian;
|
| 185 |
+
#define MP_LITTLE_ENDIAN -1
|
| 186 |
+
#define MP_NATIVE_ENDIAN 0
|
| 187 |
+
#define MP_BIG_ENDIAN 1
|
| 188 |
+
#endif
|
| 189 |
+
|
| 190 |
+
/* tunable cutoffs */
|
| 191 |
+
|
| 192 |
+
#ifndef MP_FIXED_CUTOFFS
|
| 193 |
+
extern int
|
| 194 |
+
KARATSUBA_MUL_CUTOFF,
|
| 195 |
+
KARATSUBA_SQR_CUTOFF,
|
| 196 |
+
TOOM_MUL_CUTOFF,
|
| 197 |
+
TOOM_SQR_CUTOFF;
|
| 198 |
+
#endif
|
| 199 |
+
|
| 200 |
+
/* define this to use lower memory usage routines (exptmods mostly) */
|
| 201 |
+
/* #define MP_LOW_MEM */
|
| 202 |
+
|
| 203 |
+
/* default precision */
|
| 204 |
+
#ifndef MP_PREC
|
| 205 |
+
# ifndef MP_LOW_MEM
|
| 206 |
+
# define MP_PREC 32 /* default digits of precision */
|
| 207 |
+
# elif defined(MP_8BIT)
|
| 208 |
+
# define MP_PREC 16 /* default digits of precision */
|
| 209 |
+
# else
|
| 210 |
+
# define MP_PREC 8 /* default digits of precision */
|
| 211 |
+
# endif
|
| 212 |
+
#endif
|
| 213 |
+
|
| 214 |
+
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
|
| 215 |
+
#define PRIVATE_MP_WARRAY (int)(1 << (((CHAR_BIT * sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
|
| 216 |
+
|
| 217 |
+
#if defined(__GNUC__) && __GNUC__ >= 4
|
| 218 |
+
# define MP_NULL_TERMINATED __attribute__((sentinel))
|
| 219 |
+
#else
|
| 220 |
+
# define MP_NULL_TERMINATED
|
| 221 |
+
#endif
|
| 222 |
+
|
| 223 |
+
/*
|
| 224 |
+
* MP_WUR - warn unused result
|
| 225 |
+
* ---------------------------
|
| 226 |
+
*
|
| 227 |
+
* The result of functions annotated with MP_WUR must be
|
| 228 |
+
* checked and cannot be ignored.
|
| 229 |
+
*
|
| 230 |
+
* Most functions in libtommath return an error code.
|
| 231 |
+
* This error code must be checked in order to prevent crashes or invalid
|
| 232 |
+
* results.
|
| 233 |
+
*
|
| 234 |
+
* If you still want to avoid the error checks for quick and dirty programs
|
| 235 |
+
* without robustness guarantees, you can `#define MP_WUR` before including
|
| 236 |
+
* tommath.h, disabling the warnings.
|
| 237 |
+
*/
|
| 238 |
+
#ifndef MP_WUR
|
| 239 |
+
# if defined(__GNUC__) && __GNUC__ >= 4
|
| 240 |
+
# define MP_WUR __attribute__((warn_unused_result))
|
| 241 |
+
# else
|
| 242 |
+
# define MP_WUR
|
| 243 |
+
# endif
|
| 244 |
+
#endif
|
| 245 |
+
|
| 246 |
+
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
|
| 247 |
+
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
|
| 248 |
+
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
| 249 |
+
# define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x))
|
| 250 |
+
#else
|
| 251 |
+
# define MP_DEPRECATED(x)
|
| 252 |
+
#endif
|
| 253 |
+
|
| 254 |
+
#ifndef MP_NO_DEPRECATED_PRAGMA
|
| 255 |
+
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
|
| 256 |
+
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
|
| 257 |
+
# define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
|
| 258 |
+
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
| 259 |
+
# define MP_DEPRECATED_PRAGMA(s) __pragma(message(s))
|
| 260 |
+
#endif
|
| 261 |
+
#endif
|
| 262 |
+
|
| 263 |
+
#ifndef MP_DEPRECATED_PRAGMA
|
| 264 |
+
# define MP_DEPRECATED_PRAGMA(s)
|
| 265 |
+
#endif
|
| 266 |
+
|
| 267 |
+
#define DIGIT_BIT MP_DIGIT_BIT
|
| 268 |
+
#define USED(m) ((m)->used)
|
| 269 |
+
#define DIGIT(m,k) ((m)->dp[(k)])
|
| 270 |
+
#define SIGN(m) ((m)->sign)
|
| 271 |
+
|
| 272 |
+
/* the infamous mp_int structure */
|
| 273 |
+
#ifndef MP_INT_DECLARED
|
| 274 |
+
#define MP_INT_DECLARED
|
| 275 |
+
typedef struct mp_int mp_int;
|
| 276 |
+
#endif
|
| 277 |
+
struct mp_int {
|
| 278 |
+
int used, alloc;
|
| 279 |
+
mp_sign sign;
|
| 280 |
+
mp_digit *dp;
|
| 281 |
+
};
|
| 282 |
+
|
| 283 |
+
/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
|
| 284 |
+
typedef int private_mp_prime_callback(unsigned char *dst, int len, void *dat);
|
| 285 |
+
typedef private_mp_prime_callback MP_DEPRECATED(mp_rand_source) ltm_prime_callback;
|
| 286 |
+
|
| 287 |
+
/* error code to char* string */
|
| 288 |
+
/*
|
| 289 |
+
const char *mp_error_to_string(mp_err code) MP_WUR;
|
| 290 |
+
*/
|
| 291 |
+
|
| 292 |
+
/* ---> init and deinit bignum functions <--- */
|
| 293 |
+
/* init a bignum */
|
| 294 |
+
/*
|
| 295 |
+
mp_err mp_init(mp_int *a) MP_WUR;
|
| 296 |
+
*/
|
| 297 |
+
|
| 298 |
+
/* free a bignum */
|
| 299 |
+
/*
|
| 300 |
+
void mp_clear(mp_int *a);
|
| 301 |
+
*/
|
| 302 |
+
|
| 303 |
+
/* init a null terminated series of arguments */
|
| 304 |
+
/*
|
| 305 |
+
mp_err mp_init_multi(mp_int *mp, ...) MP_NULL_TERMINATED MP_WUR;
|
| 306 |
+
*/
|
| 307 |
+
|
| 308 |
+
/* clear a null terminated series of arguments */
|
| 309 |
+
/*
|
| 310 |
+
void mp_clear_multi(mp_int *mp, ...) MP_NULL_TERMINATED;
|
| 311 |
+
*/
|
| 312 |
+
|
| 313 |
+
/* exchange two ints */
|
| 314 |
+
/*
|
| 315 |
+
void mp_exch(mp_int *a, mp_int *b);
|
| 316 |
+
*/
|
| 317 |
+
|
| 318 |
+
/* shrink ram required for a bignum */
|
| 319 |
+
/*
|
| 320 |
+
mp_err mp_shrink(mp_int *a) MP_WUR;
|
| 321 |
+
*/
|
| 322 |
+
|
| 323 |
+
/* grow an int to a given size */
|
| 324 |
+
/*
|
| 325 |
+
mp_err mp_grow(mp_int *a, int size) MP_WUR;
|
| 326 |
+
*/
|
| 327 |
+
|
| 328 |
+
/* init to a given number of digits */
|
| 329 |
+
/*
|
| 330 |
+
mp_err mp_init_size(mp_int *a, int size) MP_WUR;
|
| 331 |
+
*/
|
| 332 |
+
|
| 333 |
+
/* ---> Basic Manipulations <--- */
|
| 334 |
+
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
|
| 335 |
+
#define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
|
| 336 |
+
#define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
|
| 337 |
+
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
|
| 338 |
+
|
| 339 |
+
/* set to zero */
|
| 340 |
+
/*
|
| 341 |
+
void mp_zero(mp_int *a);
|
| 342 |
+
*/
|
| 343 |
+
|
| 344 |
+
/* get and set doubles */
|
| 345 |
+
/*
|
| 346 |
+
double mp_get_double(const mp_int *a) MP_WUR;
|
| 347 |
+
*/
|
| 348 |
+
/*
|
| 349 |
+
mp_err mp_set_double(mp_int *a, double b) MP_WUR;
|
| 350 |
+
*/
|
| 351 |
+
|
| 352 |
+
/* get integer, set integer and init with integer (int32_t) */
|
| 353 |
+
#ifndef MP_NO_STDINT
|
| 354 |
+
/*
|
| 355 |
+
int32_t mp_get_i32(const mp_int *a) MP_WUR;
|
| 356 |
+
*/
|
| 357 |
+
/*
|
| 358 |
+
void mp_set_i32(mp_int *a, int32_t b);
|
| 359 |
+
*/
|
| 360 |
+
/*
|
| 361 |
+
mp_err mp_init_i32(mp_int *a, int32_t b) MP_WUR;
|
| 362 |
+
*/
|
| 363 |
+
|
| 364 |
+
/* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint32_t) */
|
| 365 |
+
#define mp_get_u32(a) ((uint32_t)mp_get_i32(a))
|
| 366 |
+
/*
|
| 367 |
+
void mp_set_u32(mp_int *a, uint32_t b);
|
| 368 |
+
*/
|
| 369 |
+
/*
|
| 370 |
+
mp_err mp_init_u32(mp_int *a, uint32_t b) MP_WUR;
|
| 371 |
+
*/
|
| 372 |
+
|
| 373 |
+
/* get integer, set integer and init with integer (int64_t) */
|
| 374 |
+
/*
|
| 375 |
+
int64_t mp_get_i64(const mp_int *a) MP_WUR;
|
| 376 |
+
*/
|
| 377 |
+
/*
|
| 378 |
+
void mp_set_i64(mp_int *a, int64_t b);
|
| 379 |
+
*/
|
| 380 |
+
/*
|
| 381 |
+
mp_err mp_init_i64(mp_int *a, int64_t b) MP_WUR;
|
| 382 |
+
*/
|
| 383 |
+
|
| 384 |
+
/* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint64_t) */
|
| 385 |
+
#define mp_get_u64(a) ((uint64_t)mp_get_i64(a))
|
| 386 |
+
/*
|
| 387 |
+
void mp_set_u64(mp_int *a, uint64_t b);
|
| 388 |
+
*/
|
| 389 |
+
/*
|
| 390 |
+
mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR;
|
| 391 |
+
*/
|
| 392 |
+
|
| 393 |
+
/* get magnitude */
|
| 394 |
+
/*
|
| 395 |
+
uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR;
|
| 396 |
+
*/
|
| 397 |
+
/*
|
| 398 |
+
uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR;
|
| 399 |
+
*/
|
| 400 |
+
#endif
|
| 401 |
+
/*
|
| 402 |
+
unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR;
|
| 403 |
+
*/
|
| 404 |
+
/*
|
| 405 |
+
Tcl_WideUInt mp_get_mag_ull(const mp_int *a) MP_WUR;
|
| 406 |
+
*/
|
| 407 |
+
|
| 408 |
+
/* get integer, set integer (long) */
|
| 409 |
+
/*
|
| 410 |
+
long mp_get_l(const mp_int *a) MP_WUR;
|
| 411 |
+
*/
|
| 412 |
+
/*
|
| 413 |
+
void mp_set_l(mp_int *a, long b);
|
| 414 |
+
*/
|
| 415 |
+
/*
|
| 416 |
+
mp_err mp_init_l(mp_int *a, long b) MP_WUR;
|
| 417 |
+
*/
|
| 418 |
+
|
| 419 |
+
/* get integer, set integer (unsigned long) */
|
| 420 |
+
#define mp_get_ul(a) ((unsigned long)mp_get_l(a))
|
| 421 |
+
/*
|
| 422 |
+
void mp_set_ul(mp_int *a, unsigned long b);
|
| 423 |
+
*/
|
| 424 |
+
/*
|
| 425 |
+
mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR;
|
| 426 |
+
*/
|
| 427 |
+
|
| 428 |
+
/* get integer, set integer (Tcl_WideInt) */
|
| 429 |
+
/*
|
| 430 |
+
Tcl_WideInt mp_get_ll(const mp_int *a) MP_WUR;
|
| 431 |
+
*/
|
| 432 |
+
/*
|
| 433 |
+
void mp_set_ll(mp_int *a, Tcl_WideInt b);
|
| 434 |
+
*/
|
| 435 |
+
/*
|
| 436 |
+
mp_err mp_init_ll(mp_int *a, Tcl_WideInt b) MP_WUR;
|
| 437 |
+
*/
|
| 438 |
+
|
| 439 |
+
/* get integer, set integer (Tcl_WideUInt) */
|
| 440 |
+
#define mp_get_ull(a) ((Tcl_WideUInt)mp_get_ll(a))
|
| 441 |
+
/*
|
| 442 |
+
void mp_set_ull(mp_int *a, Tcl_WideUInt b);
|
| 443 |
+
*/
|
| 444 |
+
/*
|
| 445 |
+
mp_err mp_init_ull(mp_int *a, Tcl_WideUInt b) MP_WUR;
|
| 446 |
+
*/
|
| 447 |
+
|
| 448 |
+
/* set to single unsigned digit, up to MP_DIGIT_MAX */
|
| 449 |
+
/*
|
| 450 |
+
void mp_set(mp_int *a, mp_digit b);
|
| 451 |
+
*/
|
| 452 |
+
/*
|
| 453 |
+
mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR;
|
| 454 |
+
*/
|
| 455 |
+
|
| 456 |
+
/* get integer, set integer and init with integer (deprecated) */
|
| 457 |
+
/*
|
| 458 |
+
MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR;
|
| 459 |
+
*/
|
| 460 |
+
/*
|
| 461 |
+
MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR;
|
| 462 |
+
*/
|
| 463 |
+
/*
|
| 464 |
+
MP_DEPRECATED(mp_get_mag_ull/mp_get_ull) Tcl_WideUInt mp_get_long_long(const mp_int *a) MP_WUR;
|
| 465 |
+
*/
|
| 466 |
+
/*
|
| 467 |
+
MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b);
|
| 468 |
+
*/
|
| 469 |
+
/*
|
| 470 |
+
MP_DEPRECATED(mp_set_ul) mp_err mp_set_long(mp_int *a, unsigned long b);
|
| 471 |
+
*/
|
| 472 |
+
/*
|
| 473 |
+
MP_DEPRECATED(mp_set_ull) mp_err mp_set_long_long(mp_int *a, Tcl_WideUInt b);
|
| 474 |
+
*/
|
| 475 |
+
/*
|
| 476 |
+
MP_DEPRECATED(mp_init_ul) mp_err mp_init_set_int(mp_int *a, unsigned long b) MP_WUR;
|
| 477 |
+
*/
|
| 478 |
+
|
| 479 |
+
/* copy, b = a */
|
| 480 |
+
/*
|
| 481 |
+
mp_err mp_copy(const mp_int *a, mp_int *b) MP_WUR;
|
| 482 |
+
*/
|
| 483 |
+
|
| 484 |
+
/* inits and copies, a = b */
|
| 485 |
+
/*
|
| 486 |
+
mp_err mp_init_copy(mp_int *a, const mp_int *b) MP_WUR;
|
| 487 |
+
*/
|
| 488 |
+
|
| 489 |
+
/* trim unused digits */
|
| 490 |
+
/*
|
| 491 |
+
void mp_clamp(mp_int *a);
|
| 492 |
+
*/
|
| 493 |
+
|
| 494 |
+
/* export binary data */
|
| 495 |
+
/*
|
| 496 |
+
MP_DEPRECATED(mp_pack) mp_err mp_export(void *rop, size_t *countp, int order, size_t size,
|
| 497 |
+
int endian, size_t nails, const mp_int *op) MP_WUR;
|
| 498 |
+
*/
|
| 499 |
+
|
| 500 |
+
/* import binary data */
|
| 501 |
+
/*
|
| 502 |
+
MP_DEPRECATED(mp_unpack) mp_err mp_import(mp_int *rop, size_t count, int order,
|
| 503 |
+
size_t size, int endian, size_t nails,
|
| 504 |
+
const void *op) MP_WUR;
|
| 505 |
+
*/
|
| 506 |
+
|
| 507 |
+
/* unpack binary data */
|
| 508 |
+
/*
|
| 509 |
+
mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian,
|
| 510 |
+
size_t nails, const void *op) MP_WUR;
|
| 511 |
+
*/
|
| 512 |
+
|
| 513 |
+
/* pack binary data */
|
| 514 |
+
/*
|
| 515 |
+
size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) MP_WUR;
|
| 516 |
+
*/
|
| 517 |
+
/*
|
| 518 |
+
mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size,
|
| 519 |
+
mp_endian endian, size_t nails, const mp_int *op) MP_WUR;
|
| 520 |
+
*/
|
| 521 |
+
|
| 522 |
+
/* ---> digit manipulation <--- */
|
| 523 |
+
|
| 524 |
+
/* right shift by "b" digits */
|
| 525 |
+
/*
|
| 526 |
+
void mp_rshd(mp_int *a, int b);
|
| 527 |
+
*/
|
| 528 |
+
|
| 529 |
+
/* left shift by "b" digits */
|
| 530 |
+
/*
|
| 531 |
+
mp_err mp_lshd(mp_int *a, int b) MP_WUR;
|
| 532 |
+
*/
|
| 533 |
+
|
| 534 |
+
/* c = a / 2**b, implemented as c = a >> b */
|
| 535 |
+
/*
|
| 536 |
+
mp_err mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d) MP_WUR;
|
| 537 |
+
*/
|
| 538 |
+
|
| 539 |
+
/* b = a/2 */
|
| 540 |
+
/*
|
| 541 |
+
mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR;
|
| 542 |
+
*/
|
| 543 |
+
|
| 544 |
+
/* a/3 => 3c + d == a */
|
| 545 |
+
/*
|
| 546 |
+
mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR;
|
| 547 |
+
*/
|
| 548 |
+
|
| 549 |
+
/* c = a * 2**b, implemented as c = a << b */
|
| 550 |
+
/*
|
| 551 |
+
mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 552 |
+
*/
|
| 553 |
+
|
| 554 |
+
/* b = a*2 */
|
| 555 |
+
/*
|
| 556 |
+
mp_err mp_mul_2(const mp_int *a, mp_int *b) MP_WUR;
|
| 557 |
+
*/
|
| 558 |
+
|
| 559 |
+
/* c = a mod 2**b */
|
| 560 |
+
/*
|
| 561 |
+
mp_err mp_mod_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 562 |
+
*/
|
| 563 |
+
|
| 564 |
+
/* computes a = 2**b */
|
| 565 |
+
/*
|
| 566 |
+
mp_err mp_2expt(mp_int *a, int b) MP_WUR;
|
| 567 |
+
*/
|
| 568 |
+
|
| 569 |
+
/* Counts the number of lsbs which are zero before the first zero bit */
|
| 570 |
+
/*
|
| 571 |
+
int mp_cnt_lsb(const mp_int *a) MP_WUR;
|
| 572 |
+
*/
|
| 573 |
+
|
| 574 |
+
/* I Love Earth! */
|
| 575 |
+
|
| 576 |
+
/* makes a pseudo-random mp_int of a given size */
|
| 577 |
+
/*
|
| 578 |
+
mp_err mp_rand(mp_int *a, int digits) MP_WUR;
|
| 579 |
+
*/
|
| 580 |
+
/* makes a pseudo-random small int of a given size */
|
| 581 |
+
/*
|
| 582 |
+
MP_DEPRECATED(mp_rand) mp_err mp_rand_digit(mp_digit *r) MP_WUR;
|
| 583 |
+
*/
|
| 584 |
+
/* use custom random data source instead of source provided the platform */
|
| 585 |
+
/*
|
| 586 |
+
void mp_rand_source(mp_err(*source)(void *out, size_t size));
|
| 587 |
+
*/
|
| 588 |
+
|
| 589 |
+
#ifdef MP_PRNG_ENABLE_LTM_RNG
|
| 590 |
+
/* A last resort to provide random data on systems without any of the other
|
| 591 |
+
* implemented ways to gather entropy.
|
| 592 |
+
* It is compatible with `rng_get_bytes()` from libtomcrypt so you could
|
| 593 |
+
* provide that one and then set `ltm_rng = rng_get_bytes;` */
|
| 594 |
+
extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
|
| 595 |
+
extern void (*ltm_rng_callback)(void);
|
| 596 |
+
#endif
|
| 597 |
+
|
| 598 |
+
/* ---> binary operations <--- */
|
| 599 |
+
|
| 600 |
+
/* Checks the bit at position b and returns MP_YES
|
| 601 |
+
* if the bit is 1, MP_NO if it is 0 and MP_VAL
|
| 602 |
+
* in case of error
|
| 603 |
+
*/
|
| 604 |
+
/*
|
| 605 |
+
MP_DEPRECATED(s_mp_get_bit) int mp_get_bit(const mp_int *a, int b) MP_WUR;
|
| 606 |
+
*/
|
| 607 |
+
|
| 608 |
+
/* c = a XOR b (two complement) */
|
| 609 |
+
/*
|
| 610 |
+
MP_DEPRECATED(mp_xor) mp_err mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 611 |
+
*/
|
| 612 |
+
/*
|
| 613 |
+
mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 614 |
+
*/
|
| 615 |
+
|
| 616 |
+
/* c = a OR b (two complement) */
|
| 617 |
+
/*
|
| 618 |
+
MP_DEPRECATED(mp_or) mp_err mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 619 |
+
*/
|
| 620 |
+
/*
|
| 621 |
+
mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 622 |
+
*/
|
| 623 |
+
|
| 624 |
+
/* c = a AND b (two complement) */
|
| 625 |
+
/*
|
| 626 |
+
MP_DEPRECATED(mp_and) mp_err mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 627 |
+
*/
|
| 628 |
+
/*
|
| 629 |
+
mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 630 |
+
*/
|
| 631 |
+
|
| 632 |
+
/* b = ~a (bitwise not, two complement) */
|
| 633 |
+
/*
|
| 634 |
+
mp_err mp_complement(const mp_int *a, mp_int *b) MP_WUR;
|
| 635 |
+
*/
|
| 636 |
+
|
| 637 |
+
/* right shift with sign extension */
|
| 638 |
+
/*
|
| 639 |
+
MP_DEPRECATED(mp_signed_rsh) mp_err mp_tc_div_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 640 |
+
*/
|
| 641 |
+
/*
|
| 642 |
+
mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 643 |
+
*/
|
| 644 |
+
|
| 645 |
+
/* ---> Basic arithmetic <--- */
|
| 646 |
+
|
| 647 |
+
/* b = -a */
|
| 648 |
+
/*
|
| 649 |
+
mp_err mp_neg(const mp_int *a, mp_int *b) MP_WUR;
|
| 650 |
+
*/
|
| 651 |
+
|
| 652 |
+
/* b = |a| */
|
| 653 |
+
/*
|
| 654 |
+
mp_err mp_abs(const mp_int *a, mp_int *b) MP_WUR;
|
| 655 |
+
*/
|
| 656 |
+
|
| 657 |
+
/* compare a to b */
|
| 658 |
+
/*
|
| 659 |
+
mp_ord mp_cmp(const mp_int *a, const mp_int *b) MP_WUR;
|
| 660 |
+
*/
|
| 661 |
+
|
| 662 |
+
/* compare |a| to |b| */
|
| 663 |
+
/*
|
| 664 |
+
mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b) MP_WUR;
|
| 665 |
+
*/
|
| 666 |
+
|
| 667 |
+
/* c = a + b */
|
| 668 |
+
/*
|
| 669 |
+
mp_err mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 670 |
+
*/
|
| 671 |
+
|
| 672 |
+
/* c = a - b */
|
| 673 |
+
/*
|
| 674 |
+
mp_err mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 675 |
+
*/
|
| 676 |
+
|
| 677 |
+
/* c = a * b */
|
| 678 |
+
/*
|
| 679 |
+
mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 680 |
+
*/
|
| 681 |
+
|
| 682 |
+
/* b = a*a */
|
| 683 |
+
/*
|
| 684 |
+
mp_err mp_sqr(const mp_int *a, mp_int *b) MP_WUR;
|
| 685 |
+
*/
|
| 686 |
+
|
| 687 |
+
/* a/b => cb + d == a */
|
| 688 |
+
/*
|
| 689 |
+
mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) MP_WUR;
|
| 690 |
+
*/
|
| 691 |
+
|
| 692 |
+
/* c = a mod b, 0 <= c < b */
|
| 693 |
+
/*
|
| 694 |
+
mp_err mp_mod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 695 |
+
*/
|
| 696 |
+
|
| 697 |
+
/* Increment "a" by one like "a++". Changes input! */
|
| 698 |
+
/*
|
| 699 |
+
mp_err mp_incr(mp_int *a) MP_WUR;
|
| 700 |
+
*/
|
| 701 |
+
|
| 702 |
+
/* Decrement "a" by one like "a--". Changes input! */
|
| 703 |
+
/*
|
| 704 |
+
mp_err mp_decr(mp_int *a) MP_WUR;
|
| 705 |
+
*/
|
| 706 |
+
|
| 707 |
+
/* ---> single digit functions <--- */
|
| 708 |
+
|
| 709 |
+
/* compare against a single digit */
|
| 710 |
+
/*
|
| 711 |
+
mp_ord mp_cmp_d(const mp_int *a, mp_digit b) MP_WUR;
|
| 712 |
+
*/
|
| 713 |
+
|
| 714 |
+
/* c = a + b */
|
| 715 |
+
/*
|
| 716 |
+
mp_err mp_add_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 717 |
+
*/
|
| 718 |
+
|
| 719 |
+
/* c = a - b */
|
| 720 |
+
/*
|
| 721 |
+
mp_err mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 722 |
+
*/
|
| 723 |
+
|
| 724 |
+
/* c = a * b */
|
| 725 |
+
/*
|
| 726 |
+
mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 727 |
+
*/
|
| 728 |
+
|
| 729 |
+
/* a/b => cb + d == a */
|
| 730 |
+
/*
|
| 731 |
+
mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) MP_WUR;
|
| 732 |
+
*/
|
| 733 |
+
|
| 734 |
+
/* c = a mod b, 0 <= c < b */
|
| 735 |
+
/*
|
| 736 |
+
mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) MP_WUR;
|
| 737 |
+
*/
|
| 738 |
+
|
| 739 |
+
/* ---> number theory <--- */
|
| 740 |
+
|
| 741 |
+
/* d = a + b (mod c) */
|
| 742 |
+
/*
|
| 743 |
+
mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 744 |
+
*/
|
| 745 |
+
|
| 746 |
+
/* d = a - b (mod c) */
|
| 747 |
+
/*
|
| 748 |
+
mp_err mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 749 |
+
*/
|
| 750 |
+
|
| 751 |
+
/* d = a * b (mod c) */
|
| 752 |
+
/*
|
| 753 |
+
mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 754 |
+
*/
|
| 755 |
+
|
| 756 |
+
/* c = a * a (mod b) */
|
| 757 |
+
/*
|
| 758 |
+
mp_err mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 759 |
+
*/
|
| 760 |
+
|
| 761 |
+
/* c = 1/a (mod b) */
|
| 762 |
+
/*
|
| 763 |
+
mp_err mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 764 |
+
*/
|
| 765 |
+
|
| 766 |
+
/* c = (a, b) */
|
| 767 |
+
/*
|
| 768 |
+
mp_err mp_gcd(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 769 |
+
*/
|
| 770 |
+
|
| 771 |
+
/* produces value such that U1*a + U2*b = U3 */
|
| 772 |
+
/*
|
| 773 |
+
mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) MP_WUR;
|
| 774 |
+
*/
|
| 775 |
+
|
| 776 |
+
/* c = [a, b] or (a*b)/(a, b) */
|
| 777 |
+
/*
|
| 778 |
+
mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 779 |
+
*/
|
| 780 |
+
|
| 781 |
+
/* finds one of the b'th root of a, such that |c|**b <= |a|
|
| 782 |
+
*
|
| 783 |
+
* returns error if a < 0 and b is even
|
| 784 |
+
*/
|
| 785 |
+
/*
|
| 786 |
+
mp_err mp_root_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
|
| 787 |
+
*/
|
| 788 |
+
/*
|
| 789 |
+
MP_DEPRECATED(mp_root_u32) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 790 |
+
*/
|
| 791 |
+
/*
|
| 792 |
+
MP_DEPRECATED(mp_root_u32) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
|
| 793 |
+
*/
|
| 794 |
+
|
| 795 |
+
/* special sqrt algo */
|
| 796 |
+
/*
|
| 797 |
+
mp_err mp_sqrt(const mp_int *arg, mp_int *ret) MP_WUR;
|
| 798 |
+
*/
|
| 799 |
+
|
| 800 |
+
/* special sqrt (mod prime) */
|
| 801 |
+
/*
|
| 802 |
+
mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret) MP_WUR;
|
| 803 |
+
*/
|
| 804 |
+
|
| 805 |
+
/* is number a square? */
|
| 806 |
+
/*
|
| 807 |
+
mp_err mp_is_square(const mp_int *arg, mp_bool *ret) MP_WUR;
|
| 808 |
+
*/
|
| 809 |
+
|
| 810 |
+
/* computes the jacobi c = (a | n) (or Legendre if b is prime) */
|
| 811 |
+
/*
|
| 812 |
+
MP_DEPRECATED(mp_kronecker) mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) MP_WUR;
|
| 813 |
+
*/
|
| 814 |
+
|
| 815 |
+
/* computes the Kronecker symbol c = (a | p) (like jacobi() but with {a,p} in Z */
|
| 816 |
+
/*
|
| 817 |
+
mp_err mp_kronecker(const mp_int *a, const mp_int *p, int *c) MP_WUR;
|
| 818 |
+
*/
|
| 819 |
+
|
| 820 |
+
/* used to setup the Barrett reduction for a given modulus b */
|
| 821 |
+
/*
|
| 822 |
+
mp_err mp_reduce_setup(mp_int *a, const mp_int *b) MP_WUR;
|
| 823 |
+
*/
|
| 824 |
+
|
| 825 |
+
/* Barrett Reduction, computes a (mod b) with a precomputed value c
|
| 826 |
+
*
|
| 827 |
+
* Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely
|
| 828 |
+
* compute the reduction as -1 * mp_reduce(mp_abs(x)) [pseudo code].
|
| 829 |
+
*/
|
| 830 |
+
/*
|
| 831 |
+
mp_err mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu) MP_WUR;
|
| 832 |
+
*/
|
| 833 |
+
|
| 834 |
+
/* setups the montgomery reduction */
|
| 835 |
+
/*
|
| 836 |
+
mp_err mp_montgomery_setup(const mp_int *n, mp_digit *rho) MP_WUR;
|
| 837 |
+
*/
|
| 838 |
+
|
| 839 |
+
/* computes a = B**n mod b without division or multiplication useful for
|
| 840 |
+
* normalizing numbers in a Montgomery system.
|
| 841 |
+
*/
|
| 842 |
+
/*
|
| 843 |
+
mp_err mp_montgomery_calc_normalization(mp_int *a, const mp_int *b) MP_WUR;
|
| 844 |
+
*/
|
| 845 |
+
|
| 846 |
+
/* computes x/R == x (mod N) via Montgomery Reduction */
|
| 847 |
+
/*
|
| 848 |
+
mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) MP_WUR;
|
| 849 |
+
*/
|
| 850 |
+
|
| 851 |
+
/* returns 1 if a is a valid DR modulus */
|
| 852 |
+
/*
|
| 853 |
+
mp_bool mp_dr_is_modulus(const mp_int *a) MP_WUR;
|
| 854 |
+
*/
|
| 855 |
+
|
| 856 |
+
/* sets the value of "d" required for mp_dr_reduce */
|
| 857 |
+
/*
|
| 858 |
+
void mp_dr_setup(const mp_int *a, mp_digit *d);
|
| 859 |
+
*/
|
| 860 |
+
|
| 861 |
+
/* reduces a modulo n using the Diminished Radix method */
|
| 862 |
+
/*
|
| 863 |
+
mp_err mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k) MP_WUR;
|
| 864 |
+
*/
|
| 865 |
+
|
| 866 |
+
/* returns true if a can be reduced with mp_reduce_2k */
|
| 867 |
+
/*
|
| 868 |
+
mp_bool mp_reduce_is_2k(const mp_int *a) MP_WUR;
|
| 869 |
+
*/
|
| 870 |
+
|
| 871 |
+
/* determines k value for 2k reduction */
|
| 872 |
+
/*
|
| 873 |
+
mp_err mp_reduce_2k_setup(const mp_int *a, mp_digit *d) MP_WUR;
|
| 874 |
+
*/
|
| 875 |
+
|
| 876 |
+
/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
|
| 877 |
+
/*
|
| 878 |
+
mp_err mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d) MP_WUR;
|
| 879 |
+
*/
|
| 880 |
+
|
| 881 |
+
/* returns true if a can be reduced with mp_reduce_2k_l */
|
| 882 |
+
/*
|
| 883 |
+
mp_bool mp_reduce_is_2k_l(const mp_int *a) MP_WUR;
|
| 884 |
+
*/
|
| 885 |
+
|
| 886 |
+
/* determines k value for 2k reduction */
|
| 887 |
+
/*
|
| 888 |
+
mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) MP_WUR;
|
| 889 |
+
*/
|
| 890 |
+
|
| 891 |
+
/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
|
| 892 |
+
/*
|
| 893 |
+
mp_err mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d) MP_WUR;
|
| 894 |
+
*/
|
| 895 |
+
|
| 896 |
+
/* Y = G**X (mod P) */
|
| 897 |
+
/*
|
| 898 |
+
mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y) MP_WUR;
|
| 899 |
+
*/
|
| 900 |
+
|
| 901 |
+
/* ---> Primes <--- */
|
| 902 |
+
|
| 903 |
+
/* number of primes */
|
| 904 |
+
#ifdef MP_8BIT
|
| 905 |
+
# define PRIVATE_MP_PRIME_TAB_SIZE 31
|
| 906 |
+
#else
|
| 907 |
+
# define PRIVATE_MP_PRIME_TAB_SIZE 256
|
| 908 |
+
#endif
|
| 909 |
+
#define PRIME_SIZE (MP_DEPRECATED_PRAGMA("PRIME_SIZE has been made internal") PRIVATE_MP_PRIME_TAB_SIZE)
|
| 910 |
+
|
| 911 |
+
/* table of first PRIME_SIZE primes */
|
| 912 |
+
#if defined(BUILD_tcl) || !defined(_WIN32)
|
| 913 |
+
MODULE_SCOPE const mp_digit ltm_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE];
|
| 914 |
+
#endif
|
| 915 |
+
|
| 916 |
+
/* result=1 if a is divisible by one of the first PRIME_SIZE primes */
|
| 917 |
+
/*
|
| 918 |
+
MP_DEPRECATED(mp_prime_is_prime) mp_err mp_prime_is_divisible(const mp_int *a, mp_bool *result) MP_WUR;
|
| 919 |
+
*/
|
| 920 |
+
|
| 921 |
+
/* performs one Fermat test of "a" using base "b".
|
| 922 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 923 |
+
*/
|
| 924 |
+
/*
|
| 925 |
+
mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
|
| 926 |
+
*/
|
| 927 |
+
|
| 928 |
+
/* performs one Miller-Rabin test of "a" using base "b".
|
| 929 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 930 |
+
*/
|
| 931 |
+
/*
|
| 932 |
+
mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
|
| 933 |
+
*/
|
| 934 |
+
|
| 935 |
+
/* This gives [for a given bit size] the number of trials required
|
| 936 |
+
* such that Miller-Rabin gives a prob of failure lower than 2^-96
|
| 937 |
+
*/
|
| 938 |
+
/*
|
| 939 |
+
int mp_prime_rabin_miller_trials(int size) MP_WUR;
|
| 940 |
+
*/
|
| 941 |
+
|
| 942 |
+
/* performs one strong Lucas-Selfridge test of "a".
|
| 943 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 944 |
+
*/
|
| 945 |
+
/*
|
| 946 |
+
mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result) MP_WUR;
|
| 947 |
+
*/
|
| 948 |
+
|
| 949 |
+
/* performs one Frobenius test of "a" as described by Paul Underwood.
|
| 950 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 951 |
+
*/
|
| 952 |
+
/*
|
| 953 |
+
mp_err mp_prime_frobenius_underwood(const mp_int *N, mp_bool *result) MP_WUR;
|
| 954 |
+
*/
|
| 955 |
+
|
| 956 |
+
/* performs t random rounds of Miller-Rabin on "a" additional to
|
| 957 |
+
* bases 2 and 3. Also performs an initial sieve of trial
|
| 958 |
+
* division. Determines if "a" is prime with probability
|
| 959 |
+
* of error no more than (1/4)**t.
|
| 960 |
+
* Both a strong Lucas-Selfridge to complete the BPSW test
|
| 961 |
+
* and a separate Frobenius test are available at compile time.
|
| 962 |
+
* With t<0 a deterministic test is run for primes up to
|
| 963 |
+
* 318665857834031151167461. With t<13 (abs(t)-13) additional
|
| 964 |
+
* tests with sequential small primes are run starting at 43.
|
| 965 |
+
* Is Fips 186.4 compliant if called with t as computed by
|
| 966 |
+
* mp_prime_rabin_miller_trials();
|
| 967 |
+
*
|
| 968 |
+
* Sets result to 1 if probably prime, 0 otherwise
|
| 969 |
+
*/
|
| 970 |
+
/*
|
| 971 |
+
mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result) MP_WUR;
|
| 972 |
+
*/
|
| 973 |
+
|
| 974 |
+
/* finds the next prime after the number "a" using "t" trials
|
| 975 |
+
* of Miller-Rabin.
|
| 976 |
+
*
|
| 977 |
+
* bbs_style = 1 means the prime must be congruent to 3 mod 4
|
| 978 |
+
*/
|
| 979 |
+
/*
|
| 980 |
+
mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style) MP_WUR;
|
| 981 |
+
*/
|
| 982 |
+
|
| 983 |
+
/* makes a truly random prime of a given size (bytes),
|
| 984 |
+
* call with bbs = 1 if you want it to be congruent to 3 mod 4
|
| 985 |
+
*
|
| 986 |
+
* You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
|
| 987 |
+
* have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
|
| 988 |
+
* so it can be NULL
|
| 989 |
+
*
|
| 990 |
+
* The prime generated will be larger than 2^(8*size).
|
| 991 |
+
*/
|
| 992 |
+
#define mp_prime_random(a, t, size, bbs, cb, dat) (MP_DEPRECATED_PRAGMA("mp_prime_random has been deprecated, use mp_prime_rand instead") mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?MP_PRIME_BBS:0, cb, dat))
|
| 993 |
+
|
| 994 |
+
/* makes a truly random prime of a given size (bits),
|
| 995 |
+
*
|
| 996 |
+
* Flags are as follows:
|
| 997 |
+
*
|
| 998 |
+
* MP_PRIME_BBS - make prime congruent to 3 mod 4
|
| 999 |
+
* MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS)
|
| 1000 |
+
* MP_PRIME_2MSB_ON - make the 2nd highest bit one
|
| 1001 |
+
*
|
| 1002 |
+
* You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
|
| 1003 |
+
* have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
|
| 1004 |
+
* so it can be NULL
|
| 1005 |
+
*
|
| 1006 |
+
*/
|
| 1007 |
+
/*
|
| 1008 |
+
MP_DEPRECATED(mp_prime_rand) mp_err mp_prime_random_ex(mp_int *a, int t, int size, int flags,
|
| 1009 |
+
private_mp_prime_callback cb, void *dat) MP_WUR;
|
| 1010 |
+
*/
|
| 1011 |
+
/*
|
| 1012 |
+
mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) MP_WUR;
|
| 1013 |
+
*/
|
| 1014 |
+
|
| 1015 |
+
/* Integer logarithm to integer base */
|
| 1016 |
+
/*
|
| 1017 |
+
mp_err mp_log_u32(const mp_int *a, unsigned int base, unsigned int *c) MP_WUR;
|
| 1018 |
+
*/
|
| 1019 |
+
|
| 1020 |
+
/* c = a**b */
|
| 1021 |
+
/*
|
| 1022 |
+
mp_err mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
|
| 1023 |
+
*/
|
| 1024 |
+
/*
|
| 1025 |
+
MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 1026 |
+
*/
|
| 1027 |
+
/*
|
| 1028 |
+
MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
|
| 1029 |
+
*/
|
| 1030 |
+
|
| 1031 |
+
/* ---> radix conversion <--- */
|
| 1032 |
+
/*
|
| 1033 |
+
int mp_count_bits(const mp_int *a) MP_WUR;
|
| 1034 |
+
*/
|
| 1035 |
+
|
| 1036 |
+
|
| 1037 |
+
/*
|
| 1038 |
+
MP_DEPRECATED(mp_ubin_size) int mp_unsigned_bin_size(const mp_int *a) MP_WUR;
|
| 1039 |
+
*/
|
| 1040 |
+
/*
|
| 1041 |
+
MP_DEPRECATED(mp_from_ubin) mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
|
| 1042 |
+
*/
|
| 1043 |
+
/*
|
| 1044 |
+
MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) MP_WUR;
|
| 1045 |
+
*/
|
| 1046 |
+
/*
|
| 1047 |
+
MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
|
| 1048 |
+
*/
|
| 1049 |
+
|
| 1050 |
+
/*
|
| 1051 |
+
MP_DEPRECATED(mp_sbin_size) int mp_signed_bin_size(const mp_int *a) MP_WUR;
|
| 1052 |
+
*/
|
| 1053 |
+
/*
|
| 1054 |
+
MP_DEPRECATED(mp_from_sbin) mp_err mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
|
| 1055 |
+
*/
|
| 1056 |
+
/*
|
| 1057 |
+
MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) MP_WUR;
|
| 1058 |
+
*/
|
| 1059 |
+
/*
|
| 1060 |
+
MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
|
| 1061 |
+
*/
|
| 1062 |
+
|
| 1063 |
+
/*
|
| 1064 |
+
size_t mp_ubin_size(const mp_int *a) MP_WUR;
|
| 1065 |
+
*/
|
| 1066 |
+
/*
|
| 1067 |
+
mp_err mp_from_ubin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
|
| 1068 |
+
*/
|
| 1069 |
+
/*
|
| 1070 |
+
mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
|
| 1071 |
+
*/
|
| 1072 |
+
|
| 1073 |
+
/*
|
| 1074 |
+
size_t mp_sbin_size(const mp_int *a) MP_WUR;
|
| 1075 |
+
*/
|
| 1076 |
+
/*
|
| 1077 |
+
mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
|
| 1078 |
+
*/
|
| 1079 |
+
/*
|
| 1080 |
+
mp_err mp_to_sbin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
|
| 1081 |
+
*/
|
| 1082 |
+
|
| 1083 |
+
/*
|
| 1084 |
+
mp_err mp_read_radix(mp_int *a, const char *str, int radix) MP_WUR;
|
| 1085 |
+
*/
|
| 1086 |
+
/*
|
| 1087 |
+
MP_DEPRECATED(mp_to_radix) mp_err mp_toradix(const mp_int *a, char *str, int radix) MP_WUR;
|
| 1088 |
+
*/
|
| 1089 |
+
/*
|
| 1090 |
+
MP_DEPRECATED(mp_to_radix) mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen) MP_WUR;
|
| 1091 |
+
*/
|
| 1092 |
+
/*
|
| 1093 |
+
mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR;
|
| 1094 |
+
*/
|
| 1095 |
+
/*
|
| 1096 |
+
mp_err mp_radix_size(const mp_int *a, int radix, int *size) MP_WUR;
|
| 1097 |
+
*/
|
| 1098 |
+
|
| 1099 |
+
#ifndef MP_NO_FILE
|
| 1100 |
+
/*
|
| 1101 |
+
mp_err mp_fread(mp_int *a, int radix, FILE *stream) MP_WUR;
|
| 1102 |
+
*/
|
| 1103 |
+
/*
|
| 1104 |
+
mp_err mp_fwrite(const mp_int *a, int radix, FILE *stream) MP_WUR;
|
| 1105 |
+
*/
|
| 1106 |
+
#endif
|
| 1107 |
+
|
| 1108 |
+
#define mp_read_raw(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_signed_bin") mp_read_signed_bin((mp), (str), (len)))
|
| 1109 |
+
#define mp_raw_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_signed_bin_size") mp_signed_bin_size(mp))
|
| 1110 |
+
#define mp_toraw(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_signed_bin") mp_to_signed_bin((mp), (str)))
|
| 1111 |
+
#define mp_read_mag(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_unsigned_bin") mp_read_unsigned_bin((mp), (str), (len))
|
| 1112 |
+
#define mp_mag_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_unsigned_bin_size") mp_unsigned_bin_size(mp))
|
| 1113 |
+
#define mp_tomag(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_unsigned_bin") mp_to_unsigned_bin((mp), (str)))
|
| 1114 |
+
|
| 1115 |
+
#define mp_tobinary(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_binary") mp_toradix((M), (S), 2))
|
| 1116 |
+
#define mp_tooctal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_octal") mp_toradix((M), (S), 8))
|
| 1117 |
+
#define mp_todecimal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_decimal") mp_toradix((M), (S), 10))
|
| 1118 |
+
#define mp_tohex(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_hex") mp_toradix((M), (S), 16))
|
| 1119 |
+
|
| 1120 |
+
#define mp_to_binary(M, S, N) mp_to_radix((M), (S), (N), NULL, 2)
|
| 1121 |
+
#define mp_to_octal(M, S, N) mp_to_radix((M), (S), (N), NULL, 8)
|
| 1122 |
+
#define mp_to_decimal(M, S, N) mp_to_radix((M), (S), (N), NULL, 10)
|
| 1123 |
+
#define mp_to_hex(M, S, N) mp_to_radix((M), (S), (N), NULL, 16)
|
| 1124 |
+
|
| 1125 |
+
#ifdef __cplusplus
|
| 1126 |
+
}
|
| 1127 |
+
#endif
|
| 1128 |
+
|
| 1129 |
+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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*----------------------------------------------------------------------
|
| 3 |
+
*
|
| 4 |
+
* tclTomMathDecls.h --
|
| 5 |
+
*
|
| 6 |
+
* This file contains the declarations for the 'libtommath'
|
| 7 |
+
* functions that are exported by the Tcl library.
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 12 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef _TCLTOMMATHDECLS
|
| 16 |
+
#define _TCLTOMMATHDECLS
|
| 17 |
+
|
| 18 |
+
#include "tcl.h"
|
| 19 |
+
#ifndef BN_H_
|
| 20 |
+
#include "tclTomMath.h"
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* Define the version of the Stubs table that's exported for tommath
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
#define TCLTOMMATH_EPOCH 0
|
| 28 |
+
#define TCLTOMMATH_REVISION 0
|
| 29 |
+
|
| 30 |
+
#define Tcl_TomMath_InitStubs(interp,version) \
|
| 31 |
+
(TclTomMathInitializeStubs((interp),(version),\
|
| 32 |
+
TCLTOMMATH_EPOCH,TCLTOMMATH_REVISION))
|
| 33 |
+
|
| 34 |
+
/* Define custom memory allocation for libtommath */
|
| 35 |
+
|
| 36 |
+
/* MODULE_SCOPE void* TclBNAlloc( size_t ); */
|
| 37 |
+
#define TclBNAlloc(s) ((void*)ckalloc((size_t)(s)))
|
| 38 |
+
/* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */
|
| 39 |
+
#define TclBNCalloc(m,s) memset(ckalloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s))
|
| 40 |
+
/* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */
|
| 41 |
+
#define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s)))
|
| 42 |
+
/* MODULE_SCOPE void TclBNFree( void* ); */
|
| 43 |
+
#define TclBNFree(x) (ckfree((char*)(x)))
|
| 44 |
+
|
| 45 |
+
#define MP_MALLOC(size) TclBNAlloc(size)
|
| 46 |
+
#define MP_CALLOC(nmemb, size) TclBNCalloc(nmemb, size)
|
| 47 |
+
#define MP_REALLOC(mem, oldsize, newsize) TclBNRealloc(mem, newsize)
|
| 48 |
+
#define MP_FREE(mem, size) TclBNFree(mem)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
/* Rename the global symbols in libtommath to avoid linkage conflicts */
|
| 52 |
+
|
| 53 |
+
#define bn_reverse TclBN_reverse
|
| 54 |
+
#define mp_add TclBN_mp_add
|
| 55 |
+
#define mp_add_d TclBN_mp_add_d
|
| 56 |
+
#define mp_and TclBN_mp_and
|
| 57 |
+
#define mp_clamp TclBN_mp_clamp
|
| 58 |
+
#define mp_clear TclBN_mp_clear
|
| 59 |
+
#define mp_clear_multi TclBN_mp_clear_multi
|
| 60 |
+
#define mp_cmp TclBN_mp_cmp
|
| 61 |
+
#define mp_cmp_d TclBN_mp_cmp_d
|
| 62 |
+
#define mp_cmp_mag TclBN_mp_cmp_mag
|
| 63 |
+
#define mp_cnt_lsb TclBN_mp_cnt_lsb
|
| 64 |
+
#define mp_copy TclBN_mp_copy
|
| 65 |
+
#define mp_count_bits TclBN_mp_count_bits
|
| 66 |
+
#define mp_div TclBN_mp_div
|
| 67 |
+
#define mp_div_2 TclBN_mp_div_2
|
| 68 |
+
#define mp_div_2d TclBN_mp_div_2d
|
| 69 |
+
#define mp_div_3 TclBN_mp_div_3
|
| 70 |
+
#define mp_div_d TclBN_mp_div_d
|
| 71 |
+
#define mp_exch TclBN_mp_exch
|
| 72 |
+
#define mp_expt_d TclBN_mp_expt_d
|
| 73 |
+
#define mp_expt_d_ex TclBN_mp_expt_d_ex
|
| 74 |
+
#define mp_expt_u32 TclBN_mp_expt_d
|
| 75 |
+
#define mp_get_mag_ull TclBN_mp_get_mag_ull
|
| 76 |
+
#define mp_grow TclBN_mp_grow
|
| 77 |
+
#define mp_init TclBN_mp_init
|
| 78 |
+
#define mp_init_copy TclBN_mp_init_copy
|
| 79 |
+
#define mp_init_multi TclBN_mp_init_multi
|
| 80 |
+
#define mp_init_set TclBN_mp_init_set
|
| 81 |
+
#define mp_init_set_int TclBN_mp_init_set_int
|
| 82 |
+
#define mp_init_size TclBN_mp_init_size
|
| 83 |
+
#define mp_lshd TclBN_mp_lshd
|
| 84 |
+
#define mp_mod TclBN_mp_mod
|
| 85 |
+
#define mp_mod_2d TclBN_mp_mod_2d
|
| 86 |
+
#define mp_mul TclBN_mp_mul
|
| 87 |
+
#define mp_mul_2 TclBN_mp_mul_2
|
| 88 |
+
#define mp_mul_2d TclBN_mp_mul_2d
|
| 89 |
+
#define mp_mul_d TclBN_mp_mul_d
|
| 90 |
+
#define mp_neg TclBN_mp_neg
|
| 91 |
+
#define mp_or TclBN_mp_or
|
| 92 |
+
#define mp_pack TclBN_mp_pack
|
| 93 |
+
#define mp_pack_count TclBN_mp_pack_count
|
| 94 |
+
#define mp_radix_size TclBN_mp_radix_size
|
| 95 |
+
#define mp_read_radix TclBN_mp_read_radix
|
| 96 |
+
#define mp_rshd TclBN_mp_rshd
|
| 97 |
+
#define mp_set TclBN_mp_set
|
| 98 |
+
#define mp_set_int(a,b) (TclBN_mp_set_int(a,(unsigned int)(b)),MP_OKAY)
|
| 99 |
+
#define mp_set_ll TclBN_mp_set_ll
|
| 100 |
+
#define mp_set_long(a,b) (TclBN_mp_set_int(a,b),MP_OKAY)
|
| 101 |
+
#define mp_set_ul(a,b) (void)TclBN_mp_set_int(a,b)
|
| 102 |
+
#define mp_set_ull TclBN_mp_set_ull
|
| 103 |
+
#define mp_set_u64 TclBN_mp_set_ull
|
| 104 |
+
#define mp_shrink TclBN_mp_shrink
|
| 105 |
+
#define mp_sqr TclBN_mp_sqr
|
| 106 |
+
#define mp_sqrt TclBN_mp_sqrt
|
| 107 |
+
#define mp_sub TclBN_mp_sub
|
| 108 |
+
#define mp_sub_d TclBN_mp_sub_d
|
| 109 |
+
#define mp_signed_rsh TclBN_mp_signed_rsh
|
| 110 |
+
#define mp_tc_and TclBN_mp_and
|
| 111 |
+
#define mp_tc_div_2d TclBN_mp_signed_rsh
|
| 112 |
+
#define mp_tc_or TclBN_mp_or
|
| 113 |
+
#define mp_tc_xor TclBN_mp_xor
|
| 114 |
+
#define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
|
| 115 |
+
#define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
|
| 116 |
+
#define mp_toradix_n TclBN_mp_toradix_n
|
| 117 |
+
#define mp_to_radix TclBN_mp_to_radix
|
| 118 |
+
#define mp_to_ubin TclBN_mp_to_ubin
|
| 119 |
+
#define mp_unpack TclBN_mp_unpack
|
| 120 |
+
#define mp_ubin_size TclBN_mp_unsigned_bin_size
|
| 121 |
+
#define mp_unsigned_bin_size(a) ((int)TclBN_mp_unsigned_bin_size(a))
|
| 122 |
+
#define mp_xor TclBN_mp_xor
|
| 123 |
+
#define mp_zero TclBN_mp_zero
|
| 124 |
+
#define s_mp_add TclBN_s_mp_add
|
| 125 |
+
#define s_mp_balance_mul TclBN_mp_balance_mul
|
| 126 |
+
#define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul
|
| 127 |
+
#define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
|
| 128 |
+
#define s_mp_mul_digs TclBN_s_mp_mul_digs
|
| 129 |
+
#define s_mp_mul_digs_fast TclBN_fast_s_mp_mul_digs
|
| 130 |
+
#define s_mp_reverse TclBN_s_mp_reverse
|
| 131 |
+
#define s_mp_sqr TclBN_s_mp_sqr
|
| 132 |
+
#define s_mp_sqr_fast TclBN_fast_s_mp_sqr
|
| 133 |
+
#define s_mp_sub TclBN_s_mp_sub
|
| 134 |
+
#define s_mp_toom_mul TclBN_mp_toom_mul
|
| 135 |
+
#define s_mp_toom_sqr TclBN_mp_toom_sqr
|
| 136 |
+
|
| 137 |
+
#undef TCL_STORAGE_CLASS
|
| 138 |
+
#ifdef BUILD_tcl
|
| 139 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 140 |
+
#else
|
| 141 |
+
# ifdef USE_TCL_STUBS
|
| 142 |
+
# define TCL_STORAGE_CLASS
|
| 143 |
+
# else
|
| 144 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 145 |
+
# endif
|
| 146 |
+
#endif
|
| 147 |
+
|
| 148 |
+
/*
|
| 149 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 150 |
+
* script. Any modifications to the function declarations below should be made
|
| 151 |
+
* in the generic/tclInt.decls script.
|
| 152 |
+
*/
|
| 153 |
+
|
| 154 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 155 |
+
|
| 156 |
+
#ifdef __cplusplus
|
| 157 |
+
extern "C" {
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
/*
|
| 161 |
+
* Exported function declarations:
|
| 162 |
+
*/
|
| 163 |
+
|
| 164 |
+
/* 0 */
|
| 165 |
+
EXTERN int TclBN_epoch(void);
|
| 166 |
+
/* 1 */
|
| 167 |
+
EXTERN int TclBN_revision(void);
|
| 168 |
+
/* 2 */
|
| 169 |
+
EXTERN mp_err TclBN_mp_add(const mp_int *a, const mp_int *b,
|
| 170 |
+
mp_int *c);
|
| 171 |
+
/* 3 */
|
| 172 |
+
EXTERN mp_err TclBN_mp_add_d(const mp_int *a, mp_digit b,
|
| 173 |
+
mp_int *c);
|
| 174 |
+
/* 4 */
|
| 175 |
+
EXTERN mp_err TclBN_mp_and(const mp_int *a, const mp_int *b,
|
| 176 |
+
mp_int *c);
|
| 177 |
+
/* 5 */
|
| 178 |
+
EXTERN void TclBN_mp_clamp(mp_int *a);
|
| 179 |
+
/* 6 */
|
| 180 |
+
EXTERN void TclBN_mp_clear(mp_int *a);
|
| 181 |
+
/* 7 */
|
| 182 |
+
EXTERN void TclBN_mp_clear_multi(mp_int *a, ...);
|
| 183 |
+
/* 8 */
|
| 184 |
+
EXTERN mp_ord TclBN_mp_cmp(const mp_int *a, const mp_int *b);
|
| 185 |
+
/* 9 */
|
| 186 |
+
EXTERN mp_ord TclBN_mp_cmp_d(const mp_int *a, mp_digit b);
|
| 187 |
+
/* 10 */
|
| 188 |
+
EXTERN mp_ord TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b);
|
| 189 |
+
/* 11 */
|
| 190 |
+
EXTERN mp_err TclBN_mp_copy(const mp_int *a, mp_int *b);
|
| 191 |
+
/* 12 */
|
| 192 |
+
EXTERN int TclBN_mp_count_bits(const mp_int *a);
|
| 193 |
+
/* 13 */
|
| 194 |
+
EXTERN mp_err TclBN_mp_div(const mp_int *a, const mp_int *b,
|
| 195 |
+
mp_int *q, mp_int *r);
|
| 196 |
+
/* 14 */
|
| 197 |
+
EXTERN mp_err TclBN_mp_div_d(const mp_int *a, mp_digit b,
|
| 198 |
+
mp_int *q, mp_digit *r);
|
| 199 |
+
/* 15 */
|
| 200 |
+
EXTERN mp_err TclBN_mp_div_2(const mp_int *a, mp_int *q);
|
| 201 |
+
/* 16 */
|
| 202 |
+
EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
|
| 203 |
+
mp_int *r);
|
| 204 |
+
/* 17 */
|
| 205 |
+
EXTERN mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q,
|
| 206 |
+
mp_digit *r);
|
| 207 |
+
/* 18 */
|
| 208 |
+
EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
|
| 209 |
+
/* 19 */
|
| 210 |
+
EXTERN mp_err TclBN_mp_expt_d(const mp_int *a, unsigned int b,
|
| 211 |
+
mp_int *c);
|
| 212 |
+
/* 20 */
|
| 213 |
+
EXTERN mp_err TclBN_mp_grow(mp_int *a, int size);
|
| 214 |
+
/* 21 */
|
| 215 |
+
EXTERN mp_err TclBN_mp_init(mp_int *a);
|
| 216 |
+
/* 22 */
|
| 217 |
+
EXTERN mp_err TclBN_mp_init_copy(mp_int *a, const mp_int *b);
|
| 218 |
+
/* 23 */
|
| 219 |
+
EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...);
|
| 220 |
+
/* 24 */
|
| 221 |
+
EXTERN mp_err TclBN_mp_init_set(mp_int *a, mp_digit b);
|
| 222 |
+
/* 25 */
|
| 223 |
+
EXTERN mp_err TclBN_mp_init_size(mp_int *a, int size);
|
| 224 |
+
/* 26 */
|
| 225 |
+
EXTERN mp_err TclBN_mp_lshd(mp_int *a, int shift);
|
| 226 |
+
/* 27 */
|
| 227 |
+
EXTERN mp_err TclBN_mp_mod(const mp_int *a, const mp_int *b,
|
| 228 |
+
mp_int *r);
|
| 229 |
+
/* 28 */
|
| 230 |
+
EXTERN mp_err TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r);
|
| 231 |
+
/* 29 */
|
| 232 |
+
EXTERN mp_err TclBN_mp_mul(const mp_int *a, const mp_int *b,
|
| 233 |
+
mp_int *p);
|
| 234 |
+
/* 30 */
|
| 235 |
+
EXTERN mp_err TclBN_mp_mul_d(const mp_int *a, mp_digit b,
|
| 236 |
+
mp_int *p);
|
| 237 |
+
/* 31 */
|
| 238 |
+
EXTERN mp_err TclBN_mp_mul_2(const mp_int *a, mp_int *p);
|
| 239 |
+
/* 32 */
|
| 240 |
+
EXTERN mp_err TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p);
|
| 241 |
+
/* 33 */
|
| 242 |
+
EXTERN mp_err TclBN_mp_neg(const mp_int *a, mp_int *b);
|
| 243 |
+
/* 34 */
|
| 244 |
+
EXTERN mp_err TclBN_mp_or(const mp_int *a, const mp_int *b,
|
| 245 |
+
mp_int *c);
|
| 246 |
+
/* 35 */
|
| 247 |
+
EXTERN mp_err TclBN_mp_radix_size(const mp_int *a, int radix,
|
| 248 |
+
int *size);
|
| 249 |
+
/* 36 */
|
| 250 |
+
EXTERN mp_err TclBN_mp_read_radix(mp_int *a, const char *str,
|
| 251 |
+
int radix);
|
| 252 |
+
/* 37 */
|
| 253 |
+
EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
|
| 254 |
+
/* 38 */
|
| 255 |
+
EXTERN mp_err TclBN_mp_shrink(mp_int *a);
|
| 256 |
+
/* 39 */
|
| 257 |
+
EXTERN void TclBN_mp_set(mp_int *a, mp_digit b);
|
| 258 |
+
/* 40 */
|
| 259 |
+
EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
|
| 260 |
+
/* 41 */
|
| 261 |
+
EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b);
|
| 262 |
+
/* 42 */
|
| 263 |
+
EXTERN mp_err TclBN_mp_sub(const mp_int *a, const mp_int *b,
|
| 264 |
+
mp_int *c);
|
| 265 |
+
/* 43 */
|
| 266 |
+
EXTERN mp_err TclBN_mp_sub_d(const mp_int *a, mp_digit b,
|
| 267 |
+
mp_int *c);
|
| 268 |
+
/* 44 */
|
| 269 |
+
EXTERN mp_err TclBN_mp_to_unsigned_bin(const mp_int *a,
|
| 270 |
+
unsigned char *b);
|
| 271 |
+
/* 45 */
|
| 272 |
+
EXTERN mp_err TclBN_mp_to_unsigned_bin_n(const mp_int *a,
|
| 273 |
+
unsigned char *b, unsigned long *outlen);
|
| 274 |
+
/* 46 */
|
| 275 |
+
EXTERN mp_err TclBN_mp_toradix_n(const mp_int *a, char *str,
|
| 276 |
+
int radix, int maxlen);
|
| 277 |
+
/* 47 */
|
| 278 |
+
EXTERN size_t TclBN_mp_unsigned_bin_size(const mp_int *a);
|
| 279 |
+
/* 48 */
|
| 280 |
+
EXTERN mp_err TclBN_mp_xor(const mp_int *a, const mp_int *b,
|
| 281 |
+
mp_int *c);
|
| 282 |
+
/* 49 */
|
| 283 |
+
EXTERN void TclBN_mp_zero(mp_int *a);
|
| 284 |
+
/* 50 */
|
| 285 |
+
EXTERN void TclBN_reverse(unsigned char *s, int len);
|
| 286 |
+
/* 51 */
|
| 287 |
+
EXTERN mp_err TclBN_fast_s_mp_mul_digs(const mp_int *a,
|
| 288 |
+
const mp_int *b, mp_int *c, int digs);
|
| 289 |
+
/* 52 */
|
| 290 |
+
EXTERN mp_err TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b);
|
| 291 |
+
/* 53 */
|
| 292 |
+
EXTERN mp_err TclBN_mp_karatsuba_mul(const mp_int *a,
|
| 293 |
+
const mp_int *b, mp_int *c);
|
| 294 |
+
/* 54 */
|
| 295 |
+
EXTERN mp_err TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
|
| 296 |
+
/* 55 */
|
| 297 |
+
EXTERN mp_err TclBN_mp_toom_mul(const mp_int *a, const mp_int *b,
|
| 298 |
+
mp_int *c);
|
| 299 |
+
/* 56 */
|
| 300 |
+
EXTERN mp_err TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
|
| 301 |
+
/* 57 */
|
| 302 |
+
EXTERN mp_err TclBN_s_mp_add(const mp_int *a, const mp_int *b,
|
| 303 |
+
mp_int *c);
|
| 304 |
+
/* 58 */
|
| 305 |
+
EXTERN mp_err TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b,
|
| 306 |
+
mp_int *c, int digs);
|
| 307 |
+
/* 59 */
|
| 308 |
+
EXTERN mp_err TclBN_s_mp_sqr(const mp_int *a, mp_int *b);
|
| 309 |
+
/* 60 */
|
| 310 |
+
EXTERN mp_err TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
|
| 311 |
+
mp_int *c);
|
| 312 |
+
/* 61 */
|
| 313 |
+
EXTERN mp_err TclBN_mp_init_set_int(mp_int *a, unsigned long i);
|
| 314 |
+
/* 62 */
|
| 315 |
+
EXTERN mp_err TclBN_mp_set_int(mp_int *a, unsigned long i);
|
| 316 |
+
/* 63 */
|
| 317 |
+
EXTERN int TclBN_mp_cnt_lsb(const mp_int *a);
|
| 318 |
+
/* 64 */
|
| 319 |
+
EXTERN int TclBNInitBignumFromLong(mp_int *bignum, long initVal);
|
| 320 |
+
/* 65 */
|
| 321 |
+
EXTERN int TclBNInitBignumFromWideInt(mp_int *bignum,
|
| 322 |
+
Tcl_WideInt initVal);
|
| 323 |
+
/* 66 */
|
| 324 |
+
EXTERN int TclBNInitBignumFromWideUInt(mp_int *bignum,
|
| 325 |
+
Tcl_WideUInt initVal);
|
| 326 |
+
/* 67 */
|
| 327 |
+
EXTERN mp_err TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
|
| 328 |
+
mp_int *c, int fast);
|
| 329 |
+
/* 68 */
|
| 330 |
+
EXTERN void TclBN_mp_set_ull(mp_int *a, Tcl_WideUInt i);
|
| 331 |
+
/* 69 */
|
| 332 |
+
EXTERN Tcl_WideUInt TclBN_mp_get_mag_ull(const mp_int *a);
|
| 333 |
+
/* 70 */
|
| 334 |
+
EXTERN void TclBN_mp_set_ll(mp_int *a, Tcl_WideInt i);
|
| 335 |
+
/* 71 */
|
| 336 |
+
EXTERN mp_err TclBN_mp_unpack(mp_int *rop, size_t count,
|
| 337 |
+
mp_order order, size_t size,
|
| 338 |
+
mp_endian endian, size_t nails,
|
| 339 |
+
const void *op);
|
| 340 |
+
/* 72 */
|
| 341 |
+
EXTERN mp_err TclBN_mp_pack(void *rop, size_t maxcount,
|
| 342 |
+
size_t *written, mp_order order, size_t size,
|
| 343 |
+
mp_endian endian, size_t nails,
|
| 344 |
+
const mp_int *op);
|
| 345 |
+
/* 73 */
|
| 346 |
+
EXTERN mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
|
| 347 |
+
mp_int *c);
|
| 348 |
+
/* 74 */
|
| 349 |
+
EXTERN mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b,
|
| 350 |
+
mp_int *c);
|
| 351 |
+
/* 75 */
|
| 352 |
+
EXTERN mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b,
|
| 353 |
+
mp_int *c);
|
| 354 |
+
/* 76 */
|
| 355 |
+
EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b,
|
| 356 |
+
mp_int *c);
|
| 357 |
+
/* 77 */
|
| 358 |
+
EXTERN size_t TclBN_mp_pack_count(const mp_int *a, size_t nails,
|
| 359 |
+
size_t size);
|
| 360 |
+
/* 78 */
|
| 361 |
+
EXTERN int TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf,
|
| 362 |
+
size_t maxlen, size_t *written);
|
| 363 |
+
/* 79 */
|
| 364 |
+
EXTERN mp_err TclBN_mp_div_ld(const mp_int *a, Tcl_WideUInt b,
|
| 365 |
+
mp_int *q, Tcl_WideUInt *r);
|
| 366 |
+
/* 80 */
|
| 367 |
+
EXTERN int TclBN_mp_to_radix(const mp_int *a, char *str,
|
| 368 |
+
size_t maxlen, size_t *written, int radix);
|
| 369 |
+
|
| 370 |
+
typedef struct TclTomMathStubs {
|
| 371 |
+
int magic;
|
| 372 |
+
void *hooks;
|
| 373 |
+
|
| 374 |
+
int (*tclBN_epoch) (void); /* 0 */
|
| 375 |
+
int (*tclBN_revision) (void); /* 1 */
|
| 376 |
+
mp_err (*tclBN_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 2 */
|
| 377 |
+
mp_err (*tclBN_mp_add_d) (const mp_int *a, mp_digit b, mp_int *c); /* 3 */
|
| 378 |
+
mp_err (*tclBN_mp_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 4 */
|
| 379 |
+
void (*tclBN_mp_clamp) (mp_int *a); /* 5 */
|
| 380 |
+
void (*tclBN_mp_clear) (mp_int *a); /* 6 */
|
| 381 |
+
void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */
|
| 382 |
+
mp_ord (*tclBN_mp_cmp) (const mp_int *a, const mp_int *b); /* 8 */
|
| 383 |
+
mp_ord (*tclBN_mp_cmp_d) (const mp_int *a, mp_digit b); /* 9 */
|
| 384 |
+
mp_ord (*tclBN_mp_cmp_mag) (const mp_int *a, const mp_int *b); /* 10 */
|
| 385 |
+
mp_err (*tclBN_mp_copy) (const mp_int *a, mp_int *b); /* 11 */
|
| 386 |
+
int (*tclBN_mp_count_bits) (const mp_int *a); /* 12 */
|
| 387 |
+
mp_err (*tclBN_mp_div) (const mp_int *a, const mp_int *b, mp_int *q, mp_int *r); /* 13 */
|
| 388 |
+
mp_err (*tclBN_mp_div_d) (const mp_int *a, mp_digit b, mp_int *q, mp_digit *r); /* 14 */
|
| 389 |
+
mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q); /* 15 */
|
| 390 |
+
mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r); /* 16 */
|
| 391 |
+
mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, mp_digit *r); /* 17 */
|
| 392 |
+
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
|
| 393 |
+
mp_err (*tclBN_mp_expt_d) (const mp_int *a, unsigned int b, mp_int *c); /* 19 */
|
| 394 |
+
mp_err (*tclBN_mp_grow) (mp_int *a, int size); /* 20 */
|
| 395 |
+
mp_err (*tclBN_mp_init) (mp_int *a); /* 21 */
|
| 396 |
+
mp_err (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b); /* 22 */
|
| 397 |
+
mp_err (*tclBN_mp_init_multi) (mp_int *a, ...); /* 23 */
|
| 398 |
+
mp_err (*tclBN_mp_init_set) (mp_int *a, mp_digit b); /* 24 */
|
| 399 |
+
mp_err (*tclBN_mp_init_size) (mp_int *a, int size); /* 25 */
|
| 400 |
+
mp_err (*tclBN_mp_lshd) (mp_int *a, int shift); /* 26 */
|
| 401 |
+
mp_err (*tclBN_mp_mod) (const mp_int *a, const mp_int *b, mp_int *r); /* 27 */
|
| 402 |
+
mp_err (*tclBN_mp_mod_2d) (const mp_int *a, int b, mp_int *r); /* 28 */
|
| 403 |
+
mp_err (*tclBN_mp_mul) (const mp_int *a, const mp_int *b, mp_int *p); /* 29 */
|
| 404 |
+
mp_err (*tclBN_mp_mul_d) (const mp_int *a, mp_digit b, mp_int *p); /* 30 */
|
| 405 |
+
mp_err (*tclBN_mp_mul_2) (const mp_int *a, mp_int *p); /* 31 */
|
| 406 |
+
mp_err (*tclBN_mp_mul_2d) (const mp_int *a, int d, mp_int *p); /* 32 */
|
| 407 |
+
mp_err (*tclBN_mp_neg) (const mp_int *a, mp_int *b); /* 33 */
|
| 408 |
+
mp_err (*tclBN_mp_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 34 */
|
| 409 |
+
mp_err (*tclBN_mp_radix_size) (const mp_int *a, int radix, int *size); /* 35 */
|
| 410 |
+
mp_err (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix); /* 36 */
|
| 411 |
+
void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
|
| 412 |
+
mp_err (*tclBN_mp_shrink) (mp_int *a); /* 38 */
|
| 413 |
+
void (*tclBN_mp_set) (mp_int *a, mp_digit b); /* 39 */
|
| 414 |
+
mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b); /* 40 */
|
| 415 |
+
mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b); /* 41 */
|
| 416 |
+
mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 42 */
|
| 417 |
+
mp_err (*tclBN_mp_sub_d) (const mp_int *a, mp_digit b, mp_int *c); /* 43 */
|
| 418 |
+
mp_err (*tclBN_mp_to_unsigned_bin) (const mp_int *a, unsigned char *b); /* 44 */
|
| 419 |
+
mp_err (*tclBN_mp_to_unsigned_bin_n) (const mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
|
| 420 |
+
mp_err (*tclBN_mp_toradix_n) (const mp_int *a, char *str, int radix, int maxlen); /* 46 */
|
| 421 |
+
size_t (*tclBN_mp_unsigned_bin_size) (const mp_int *a); /* 47 */
|
| 422 |
+
mp_err (*tclBN_mp_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 48 */
|
| 423 |
+
void (*tclBN_mp_zero) (mp_int *a); /* 49 */
|
| 424 |
+
void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
|
| 425 |
+
mp_err (*tclBN_fast_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 51 */
|
| 426 |
+
mp_err (*tclBN_fast_s_mp_sqr) (const mp_int *a, mp_int *b); /* 52 */
|
| 427 |
+
mp_err (*tclBN_mp_karatsuba_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 53 */
|
| 428 |
+
mp_err (*tclBN_mp_karatsuba_sqr) (const mp_int *a, mp_int *b); /* 54 */
|
| 429 |
+
mp_err (*tclBN_mp_toom_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 55 */
|
| 430 |
+
mp_err (*tclBN_mp_toom_sqr) (const mp_int *a, mp_int *b); /* 56 */
|
| 431 |
+
mp_err (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
|
| 432 |
+
mp_err (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
|
| 433 |
+
mp_err (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
|
| 434 |
+
mp_err (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
|
| 435 |
+
mp_err (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
|
| 436 |
+
mp_err (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
|
| 437 |
+
int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
|
| 438 |
+
int (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
|
| 439 |
+
int (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
|
| 440 |
+
int (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
|
| 441 |
+
mp_err (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
|
| 442 |
+
void (*tclBN_mp_set_ull) (mp_int *a, Tcl_WideUInt i); /* 68 */
|
| 443 |
+
Tcl_WideUInt (*tclBN_mp_get_mag_ull) (const mp_int *a); /* 69 */
|
| 444 |
+
void (*tclBN_mp_set_ll) (mp_int *a, Tcl_WideInt i); /* 70 */
|
| 445 |
+
mp_err (*tclBN_mp_unpack) (mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian, size_t nails, const void *op); /* 71 */
|
| 446 |
+
mp_err (*tclBN_mp_pack) (void *rop, size_t maxcount, size_t *written, mp_order order, size_t size, mp_endian endian, size_t nails, const mp_int *op); /* 72 */
|
| 447 |
+
mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
|
| 448 |
+
mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */
|
| 449 |
+
mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */
|
| 450 |
+
mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c); /* 76 */
|
| 451 |
+
size_t (*tclBN_mp_pack_count) (const mp_int *a, size_t nails, size_t size); /* 77 */
|
| 452 |
+
int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written); /* 78 */
|
| 453 |
+
mp_err (*tclBN_mp_div_ld) (const mp_int *a, Tcl_WideUInt b, mp_int *q, Tcl_WideUInt *r); /* 79 */
|
| 454 |
+
int (*tclBN_mp_to_radix) (const mp_int *a, char *str, size_t maxlen, size_t *written, int radix); /* 80 */
|
| 455 |
+
} TclTomMathStubs;
|
| 456 |
+
|
| 457 |
+
extern const TclTomMathStubs *tclTomMathStubsPtr;
|
| 458 |
+
|
| 459 |
+
#ifdef __cplusplus
|
| 460 |
+
}
|
| 461 |
+
#endif
|
| 462 |
+
|
| 463 |
+
#if defined(USE_TCL_STUBS)
|
| 464 |
+
|
| 465 |
+
/*
|
| 466 |
+
* Inline function declarations:
|
| 467 |
+
*/
|
| 468 |
+
|
| 469 |
+
#define TclBN_epoch \
|
| 470 |
+
(tclTomMathStubsPtr->tclBN_epoch) /* 0 */
|
| 471 |
+
#define TclBN_revision \
|
| 472 |
+
(tclTomMathStubsPtr->tclBN_revision) /* 1 */
|
| 473 |
+
#define TclBN_mp_add \
|
| 474 |
+
(tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
|
| 475 |
+
#define TclBN_mp_add_d \
|
| 476 |
+
(tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
|
| 477 |
+
#define TclBN_mp_and \
|
| 478 |
+
(tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
|
| 479 |
+
#define TclBN_mp_clamp \
|
| 480 |
+
(tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
|
| 481 |
+
#define TclBN_mp_clear \
|
| 482 |
+
(tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
|
| 483 |
+
#define TclBN_mp_clear_multi \
|
| 484 |
+
(tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
|
| 485 |
+
#define TclBN_mp_cmp \
|
| 486 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
|
| 487 |
+
#define TclBN_mp_cmp_d \
|
| 488 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
|
| 489 |
+
#define TclBN_mp_cmp_mag \
|
| 490 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
|
| 491 |
+
#define TclBN_mp_copy \
|
| 492 |
+
(tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
|
| 493 |
+
#define TclBN_mp_count_bits \
|
| 494 |
+
(tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
|
| 495 |
+
#define TclBN_mp_div \
|
| 496 |
+
(tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
|
| 497 |
+
#define TclBN_mp_div_d \
|
| 498 |
+
(tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
|
| 499 |
+
#define TclBN_mp_div_2 \
|
| 500 |
+
(tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
|
| 501 |
+
#define TclBN_mp_div_2d \
|
| 502 |
+
(tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
|
| 503 |
+
#define TclBN_mp_div_3 \
|
| 504 |
+
(tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
|
| 505 |
+
#define TclBN_mp_exch \
|
| 506 |
+
(tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
|
| 507 |
+
#define TclBN_mp_expt_d \
|
| 508 |
+
(tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
|
| 509 |
+
#define TclBN_mp_grow \
|
| 510 |
+
(tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
|
| 511 |
+
#define TclBN_mp_init \
|
| 512 |
+
(tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
|
| 513 |
+
#define TclBN_mp_init_copy \
|
| 514 |
+
(tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
|
| 515 |
+
#define TclBN_mp_init_multi \
|
| 516 |
+
(tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
|
| 517 |
+
#define TclBN_mp_init_set \
|
| 518 |
+
(tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
|
| 519 |
+
#define TclBN_mp_init_size \
|
| 520 |
+
(tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
|
| 521 |
+
#define TclBN_mp_lshd \
|
| 522 |
+
(tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
|
| 523 |
+
#define TclBN_mp_mod \
|
| 524 |
+
(tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
|
| 525 |
+
#define TclBN_mp_mod_2d \
|
| 526 |
+
(tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
|
| 527 |
+
#define TclBN_mp_mul \
|
| 528 |
+
(tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
|
| 529 |
+
#define TclBN_mp_mul_d \
|
| 530 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
|
| 531 |
+
#define TclBN_mp_mul_2 \
|
| 532 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
|
| 533 |
+
#define TclBN_mp_mul_2d \
|
| 534 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
|
| 535 |
+
#define TclBN_mp_neg \
|
| 536 |
+
(tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
|
| 537 |
+
#define TclBN_mp_or \
|
| 538 |
+
(tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
|
| 539 |
+
#define TclBN_mp_radix_size \
|
| 540 |
+
(tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
|
| 541 |
+
#define TclBN_mp_read_radix \
|
| 542 |
+
(tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
|
| 543 |
+
#define TclBN_mp_rshd \
|
| 544 |
+
(tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
|
| 545 |
+
#define TclBN_mp_shrink \
|
| 546 |
+
(tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
|
| 547 |
+
#define TclBN_mp_set \
|
| 548 |
+
(tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
|
| 549 |
+
#define TclBN_mp_sqr \
|
| 550 |
+
(tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
|
| 551 |
+
#define TclBN_mp_sqrt \
|
| 552 |
+
(tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
|
| 553 |
+
#define TclBN_mp_sub \
|
| 554 |
+
(tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
|
| 555 |
+
#define TclBN_mp_sub_d \
|
| 556 |
+
(tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
|
| 557 |
+
#define TclBN_mp_to_unsigned_bin \
|
| 558 |
+
(tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
|
| 559 |
+
#define TclBN_mp_to_unsigned_bin_n \
|
| 560 |
+
(tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin_n) /* 45 */
|
| 561 |
+
#define TclBN_mp_toradix_n \
|
| 562 |
+
(tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
|
| 563 |
+
#define TclBN_mp_unsigned_bin_size \
|
| 564 |
+
(tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
|
| 565 |
+
#define TclBN_mp_xor \
|
| 566 |
+
(tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
|
| 567 |
+
#define TclBN_mp_zero \
|
| 568 |
+
(tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
|
| 569 |
+
#define TclBN_reverse \
|
| 570 |
+
(tclTomMathStubsPtr->tclBN_reverse) /* 50 */
|
| 571 |
+
#define TclBN_fast_s_mp_mul_digs \
|
| 572 |
+
(tclTomMathStubsPtr->tclBN_fast_s_mp_mul_digs) /* 51 */
|
| 573 |
+
#define TclBN_fast_s_mp_sqr \
|
| 574 |
+
(tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
|
| 575 |
+
#define TclBN_mp_karatsuba_mul \
|
| 576 |
+
(tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
|
| 577 |
+
#define TclBN_mp_karatsuba_sqr \
|
| 578 |
+
(tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
|
| 579 |
+
#define TclBN_mp_toom_mul \
|
| 580 |
+
(tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
|
| 581 |
+
#define TclBN_mp_toom_sqr \
|
| 582 |
+
(tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
|
| 583 |
+
#define TclBN_s_mp_add \
|
| 584 |
+
(tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
|
| 585 |
+
#define TclBN_s_mp_mul_digs \
|
| 586 |
+
(tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
|
| 587 |
+
#define TclBN_s_mp_sqr \
|
| 588 |
+
(tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
|
| 589 |
+
#define TclBN_s_mp_sub \
|
| 590 |
+
(tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
|
| 591 |
+
#define TclBN_mp_init_set_int \
|
| 592 |
+
(tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
|
| 593 |
+
#define TclBN_mp_set_int \
|
| 594 |
+
(tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
|
| 595 |
+
#define TclBN_mp_cnt_lsb \
|
| 596 |
+
(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
|
| 597 |
+
#define TclBNInitBignumFromLong \
|
| 598 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
|
| 599 |
+
#define TclBNInitBignumFromWideInt \
|
| 600 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
|
| 601 |
+
#define TclBNInitBignumFromWideUInt \
|
| 602 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
|
| 603 |
+
#define TclBN_mp_expt_d_ex \
|
| 604 |
+
(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
|
| 605 |
+
#define TclBN_mp_set_ull \
|
| 606 |
+
(tclTomMathStubsPtr->tclBN_mp_set_ull) /* 68 */
|
| 607 |
+
#define TclBN_mp_get_mag_ull \
|
| 608 |
+
(tclTomMathStubsPtr->tclBN_mp_get_mag_ull) /* 69 */
|
| 609 |
+
#define TclBN_mp_set_ll \
|
| 610 |
+
(tclTomMathStubsPtr->tclBN_mp_set_ll) /* 70 */
|
| 611 |
+
#define TclBN_mp_unpack \
|
| 612 |
+
(tclTomMathStubsPtr->tclBN_mp_unpack) /* 71 */
|
| 613 |
+
#define TclBN_mp_pack \
|
| 614 |
+
(tclTomMathStubsPtr->tclBN_mp_pack) /* 72 */
|
| 615 |
+
#define TclBN_mp_tc_and \
|
| 616 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */
|
| 617 |
+
#define TclBN_mp_tc_or \
|
| 618 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_or) /* 74 */
|
| 619 |
+
#define TclBN_mp_tc_xor \
|
| 620 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */
|
| 621 |
+
#define TclBN_mp_signed_rsh \
|
| 622 |
+
(tclTomMathStubsPtr->tclBN_mp_signed_rsh) /* 76 */
|
| 623 |
+
#define TclBN_mp_pack_count \
|
| 624 |
+
(tclTomMathStubsPtr->tclBN_mp_pack_count) /* 77 */
|
| 625 |
+
#define TclBN_mp_to_ubin \
|
| 626 |
+
(tclTomMathStubsPtr->tclBN_mp_to_ubin) /* 78 */
|
| 627 |
+
#define TclBN_mp_div_ld \
|
| 628 |
+
(tclTomMathStubsPtr->tclBN_mp_div_ld) /* 79 */
|
| 629 |
+
#define TclBN_mp_to_radix \
|
| 630 |
+
(tclTomMathStubsPtr->tclBN_mp_to_radix) /* 80 */
|
| 631 |
+
|
| 632 |
+
#endif /* defined(USE_TCL_STUBS) */
|
| 633 |
+
|
| 634 |
+
/* !END!: Do not edit above this line. */
|
| 635 |
+
|
| 636 |
+
#undef TCL_STORAGE_CLASS
|
| 637 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 638 |
+
|
| 639 |
+
#ifdef USE_TCL_STUBS
|
| 640 |
+
#undef TclBNInitBignumFromLong
|
| 641 |
+
#define TclBNInitBignumFromLong(a,b) \
|
| 642 |
+
do { \
|
| 643 |
+
(a)->dp = NULL; \
|
| 644 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)); \
|
| 645 |
+
if ((a)->dp == NULL) { \
|
| 646 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); \
|
| 647 |
+
} \
|
| 648 |
+
} while (0)
|
| 649 |
+
#undef TclBNInitBignumFromWideInt
|
| 650 |
+
#define TclBNInitBignumFromWideInt(a,b) \
|
| 651 |
+
do { \
|
| 652 |
+
(a)->dp = NULL; \
|
| 653 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)); \
|
| 654 |
+
if ((a)->dp == NULL) { \
|
| 655 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt"); \
|
| 656 |
+
} \
|
| 657 |
+
} while (0)
|
| 658 |
+
#undef TclBNInitBignumFromWideUInt
|
| 659 |
+
#define TclBNInitBignumFromWideUInt(a,b) \
|
| 660 |
+
do { \
|
| 661 |
+
(a)->dp = NULL; \
|
| 662 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)); \
|
| 663 |
+
if ((a)->dp == NULL) { \
|
| 664 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); \
|
| 665 |
+
} \
|
| 666 |
+
} while (0)
|
| 667 |
+
#define mp_init_i32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 668 |
+
#define mp_init_l(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 669 |
+
#define mp_init_ll(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 670 |
+
#define mp_init_i64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 671 |
+
#define mp_init_u32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 672 |
+
#define mp_init_ul(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 673 |
+
#define mp_init_ull(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 674 |
+
#define mp_init_u64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 675 |
+
#else
|
| 676 |
+
#define mp_init_i32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 677 |
+
#define mp_init_l(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 678 |
+
#define mp_init_ll(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 679 |
+
#define mp_init_i64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 680 |
+
#define mp_init_u32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 681 |
+
#define mp_init_ul(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 682 |
+
#define mp_init_ull(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 683 |
+
#define mp_init_u64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tclUnixPort.h --
|
| 3 |
+
*
|
| 4 |
+
* This header file handles porting issues that occur because of
|
| 5 |
+
* differences between systems. It reads in UNIX-related header files and
|
| 6 |
+
* sets up UNIX-related macros for Tcl's UNIX core. It should be the only
|
| 7 |
+
* file that contains #ifdefs to handle different flavors of UNIX. This
|
| 8 |
+
* file sets up the union of all UNIX-related things needed by any of the
|
| 9 |
+
* Tcl core files. This file depends on configuration #defines such as
|
| 10 |
+
* NO_DIRENT_H that are set up by the "configure" script.
|
| 11 |
+
*
|
| 12 |
+
* Much of the material in this file was originally contributed by Karl
|
| 13 |
+
* Lehenbauer, Mark Diekhans and Peter da Silva.
|
| 14 |
+
*
|
| 15 |
+
* Copyright (c) 1991-1994 The Regents of the University of California.
|
| 16 |
+
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
| 17 |
+
*
|
| 18 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 19 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#ifndef _TCLUNIXPORT
|
| 23 |
+
#define _TCLUNIXPORT
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
*---------------------------------------------------------------------------
|
| 27 |
+
* The following sets of #includes and #ifdefs are required to get Tcl to
|
| 28 |
+
* compile under the various flavors of unix.
|
| 29 |
+
*---------------------------------------------------------------------------
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
#include <errno.h>
|
| 33 |
+
#include <fcntl.h>
|
| 34 |
+
#ifdef HAVE_NET_ERRNO_H
|
| 35 |
+
# include <net/errno.h>
|
| 36 |
+
#endif
|
| 37 |
+
#include <pwd.h>
|
| 38 |
+
#include <signal.h>
|
| 39 |
+
#ifdef HAVE_SYS_PARAM_H
|
| 40 |
+
# include <sys/param.h>
|
| 41 |
+
#endif
|
| 42 |
+
#include <sys/types.h>
|
| 43 |
+
#ifdef USE_DIRENT2_H
|
| 44 |
+
# include "../compat/dirent2.h"
|
| 45 |
+
#else
|
| 46 |
+
#ifdef NO_DIRENT_H
|
| 47 |
+
# include "../compat/dirent.h"
|
| 48 |
+
#else
|
| 49 |
+
# include <dirent.h>
|
| 50 |
+
#endif
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
/*
|
| 54 |
+
*---------------------------------------------------------------------------
|
| 55 |
+
* Parameterize for 64-bit filesystem support.
|
| 56 |
+
*---------------------------------------------------------------------------
|
| 57 |
+
*/
|
| 58 |
+
|
| 59 |
+
#ifdef HAVE_STRUCT_DIRENT64
|
| 60 |
+
typedef struct dirent64 Tcl_DirEntry;
|
| 61 |
+
# define TclOSreaddir readdir64
|
| 62 |
+
#else
|
| 63 |
+
typedef struct dirent Tcl_DirEntry;
|
| 64 |
+
# define TclOSreaddir readdir
|
| 65 |
+
#endif
|
| 66 |
+
#ifdef HAVE_DIR64
|
| 67 |
+
typedef DIR64 TclDIR;
|
| 68 |
+
# define TclOSopendir opendir64
|
| 69 |
+
# define TclOSrewinddir rewinddir64
|
| 70 |
+
# define TclOSclosedir closedir64
|
| 71 |
+
#else
|
| 72 |
+
typedef DIR TclDIR;
|
| 73 |
+
# define TclOSopendir opendir
|
| 74 |
+
# define TclOSrewinddir rewinddir
|
| 75 |
+
# define TclOSclosedir closedir
|
| 76 |
+
#endif
|
| 77 |
+
|
| 78 |
+
#ifdef HAVE_TYPE_OFF64_T
|
| 79 |
+
typedef off64_t Tcl_SeekOffset;
|
| 80 |
+
# define TclOSseek lseek64
|
| 81 |
+
# define TclOSopen open64
|
| 82 |
+
#else
|
| 83 |
+
typedef off_t Tcl_SeekOffset;
|
| 84 |
+
# define TclOSseek lseek
|
| 85 |
+
# define TclOSopen open
|
| 86 |
+
#endif
|
| 87 |
+
|
| 88 |
+
#ifdef __CYGWIN__
|
| 89 |
+
#ifdef __cplusplus
|
| 90 |
+
extern "C" {
|
| 91 |
+
#endif
|
| 92 |
+
/* Make some symbols available without including <windows.h> */
|
| 93 |
+
# define DWORD unsigned int
|
| 94 |
+
# define CP_UTF8 65001
|
| 95 |
+
# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
|
| 96 |
+
# define HANDLE void *
|
| 97 |
+
# define HINSTANCE void *
|
| 98 |
+
# define SOCKET unsigned int
|
| 99 |
+
# define WSAEWOULDBLOCK 10035
|
| 100 |
+
typedef unsigned short WCHAR;
|
| 101 |
+
#ifdef __clang__
|
| 102 |
+
#pragma clang diagnostic push
|
| 103 |
+
#pragma clang diagnostic ignored "-Wignored-attributes"
|
| 104 |
+
#endif
|
| 105 |
+
__declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *);
|
| 106 |
+
__declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int);
|
| 107 |
+
__declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int,
|
| 108 |
+
char *, int, const char *, void *);
|
| 109 |
+
__declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int,
|
| 110 |
+
WCHAR *, int);
|
| 111 |
+
__declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *);
|
| 112 |
+
__declspec(dllimport) extern __stdcall int IsDebuggerPresent(void);
|
| 113 |
+
__declspec(dllimport) extern __stdcall int GetLastError(void);
|
| 114 |
+
__declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *);
|
| 115 |
+
__declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int);
|
| 116 |
+
__declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int);
|
| 117 |
+
#ifdef __clang__
|
| 118 |
+
#pragma clang diagnostic pop
|
| 119 |
+
#endif
|
| 120 |
+
# define timezone _timezone
|
| 121 |
+
extern int TclOSstat(const char *name, void *statBuf);
|
| 122 |
+
extern int TclOSlstat(const char *name, void *statBuf);
|
| 123 |
+
#ifdef __cplusplus
|
| 124 |
+
}
|
| 125 |
+
#endif
|
| 126 |
+
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
|
| 127 |
+
# define TclOSstat(name, buf) stat64(name, (struct stat64 *)buf)
|
| 128 |
+
# define TclOSlstat(name,buf) lstat64(name, (struct stat64 *)buf)
|
| 129 |
+
#else
|
| 130 |
+
# define TclOSstat(name, buf) stat(name, (struct stat *)buf)
|
| 131 |
+
# define TclOSlstat(name, buf) lstat(name, (struct stat *)buf)
|
| 132 |
+
#endif
|
| 133 |
+
|
| 134 |
+
/*
|
| 135 |
+
*---------------------------------------------------------------------------
|
| 136 |
+
* Miscellaneous includes that might be missing.
|
| 137 |
+
*---------------------------------------------------------------------------
|
| 138 |
+
*/
|
| 139 |
+
|
| 140 |
+
#include <sys/file.h>
|
| 141 |
+
#ifdef HAVE_SYS_SELECT_H
|
| 142 |
+
# include <sys/select.h>
|
| 143 |
+
#endif
|
| 144 |
+
#include <sys/stat.h>
|
| 145 |
+
#ifdef TIME_WITH_SYS_TIME
|
| 146 |
+
# include <sys/time.h>
|
| 147 |
+
# include <time.h>
|
| 148 |
+
#else
|
| 149 |
+
#ifdef HAVE_SYS_TIME_H
|
| 150 |
+
# include <sys/time.h>
|
| 151 |
+
#else
|
| 152 |
+
# include <time.h>
|
| 153 |
+
#endif
|
| 154 |
+
#endif
|
| 155 |
+
#ifndef NO_SYS_WAIT_H
|
| 156 |
+
# include <sys/wait.h>
|
| 157 |
+
#endif
|
| 158 |
+
#ifdef HAVE_INTTYPES_H
|
| 159 |
+
# include <inttypes.h>
|
| 160 |
+
#endif
|
| 161 |
+
#include <limits.h>
|
| 162 |
+
#ifdef HAVE_STDINT_H
|
| 163 |
+
# include <stdint.h>
|
| 164 |
+
#endif
|
| 165 |
+
#ifdef HAVE_UNISTD_H
|
| 166 |
+
# include <unistd.h>
|
| 167 |
+
#else
|
| 168 |
+
# include "../compat/unistd.h"
|
| 169 |
+
#endif
|
| 170 |
+
|
| 171 |
+
extern int TclUnixSetBlockingMode(int fd, int mode);
|
| 172 |
+
|
| 173 |
+
#include <utime.h>
|
| 174 |
+
|
| 175 |
+
/*
|
| 176 |
+
*---------------------------------------------------------------------------
|
| 177 |
+
* Socket support stuff: This likely needs more work to parameterize for each
|
| 178 |
+
* system.
|
| 179 |
+
*---------------------------------------------------------------------------
|
| 180 |
+
*/
|
| 181 |
+
|
| 182 |
+
#include <sys/socket.h> /* struct sockaddr, SOCK_STREAM, ... */
|
| 183 |
+
#ifndef NO_UNAME
|
| 184 |
+
# include <sys/utsname.h> /* uname system call. */
|
| 185 |
+
#endif
|
| 186 |
+
#include <netinet/in.h> /* struct in_addr, struct sockaddr_in */
|
| 187 |
+
#include <arpa/inet.h> /* inet_ntoa() */
|
| 188 |
+
#include <netdb.h> /* getaddrinfo() */
|
| 189 |
+
#ifdef NEED_FAKE_RFC2553
|
| 190 |
+
# include "../compat/fake-rfc2553.h"
|
| 191 |
+
#endif
|
| 192 |
+
|
| 193 |
+
/*
|
| 194 |
+
*---------------------------------------------------------------------------
|
| 195 |
+
* Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look
|
| 196 |
+
* for an alternative definition. If no other alternative is available we use
|
| 197 |
+
* a reasonable guess.
|
| 198 |
+
*---------------------------------------------------------------------------
|
| 199 |
+
*/
|
| 200 |
+
|
| 201 |
+
#ifndef NO_FLOAT_H
|
| 202 |
+
# include <float.h>
|
| 203 |
+
#else
|
| 204 |
+
#ifndef NO_VALUES_H
|
| 205 |
+
# include <values.h>
|
| 206 |
+
#endif
|
| 207 |
+
#endif
|
| 208 |
+
|
| 209 |
+
#ifndef FLT_MAX
|
| 210 |
+
# ifdef MAXFLOAT
|
| 211 |
+
# define FLT_MAX MAXFLOAT
|
| 212 |
+
# else
|
| 213 |
+
# define FLT_MAX 3.402823466E+38F
|
| 214 |
+
# endif
|
| 215 |
+
#endif
|
| 216 |
+
#ifndef FLT_MIN
|
| 217 |
+
# ifdef MINFLOAT
|
| 218 |
+
# define FLT_MIN MINFLOAT
|
| 219 |
+
# else
|
| 220 |
+
# define FLT_MIN 1.175494351E-38F
|
| 221 |
+
# endif
|
| 222 |
+
#endif
|
| 223 |
+
|
| 224 |
+
/*
|
| 225 |
+
*---------------------------------------------------------------------------
|
| 226 |
+
* NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
|
| 227 |
+
*---------------------------------------------------------------------------
|
| 228 |
+
*/
|
| 229 |
+
|
| 230 |
+
#ifndef O_NONBLOCK
|
| 231 |
+
# define O_NONBLOCK 0x80
|
| 232 |
+
#endif
|
| 233 |
+
|
| 234 |
+
/*
|
| 235 |
+
*---------------------------------------------------------------------------
|
| 236 |
+
* The type of the status returned by wait varies from UNIX system to UNIX
|
| 237 |
+
* system. The macro below defines it:
|
| 238 |
+
*---------------------------------------------------------------------------
|
| 239 |
+
*/
|
| 240 |
+
|
| 241 |
+
#ifdef _AIX
|
| 242 |
+
# define WAIT_STATUS_TYPE pid_t
|
| 243 |
+
#else
|
| 244 |
+
#ifndef NO_UNION_WAIT
|
| 245 |
+
# define WAIT_STATUS_TYPE union wait
|
| 246 |
+
#else
|
| 247 |
+
# define WAIT_STATUS_TYPE int
|
| 248 |
+
#endif
|
| 249 |
+
#endif
|
| 250 |
+
|
| 251 |
+
/*
|
| 252 |
+
*---------------------------------------------------------------------------
|
| 253 |
+
* Supply definitions for macros to query wait status, if not already defined
|
| 254 |
+
* in header files above.
|
| 255 |
+
*---------------------------------------------------------------------------
|
| 256 |
+
*/
|
| 257 |
+
|
| 258 |
+
#ifndef WIFEXITED
|
| 259 |
+
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0)
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
#ifndef WEXITSTATUS
|
| 263 |
+
# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
| 264 |
+
#endif
|
| 265 |
+
|
| 266 |
+
#ifndef WIFSIGNALED
|
| 267 |
+
# define WIFSIGNALED(stat) \
|
| 268 |
+
(((*((int *) &(stat)))) && ((*((int *) &(stat))) \
|
| 269 |
+
== ((*((int *) &(stat))) & 0x00FF)))
|
| 270 |
+
#endif
|
| 271 |
+
|
| 272 |
+
#ifndef WTERMSIG
|
| 273 |
+
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
|
| 274 |
+
#endif
|
| 275 |
+
|
| 276 |
+
#ifndef WIFSTOPPED
|
| 277 |
+
# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177)
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
#ifndef WSTOPSIG
|
| 281 |
+
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
| 282 |
+
#endif
|
| 283 |
+
|
| 284 |
+
/*
|
| 285 |
+
*---------------------------------------------------------------------------
|
| 286 |
+
* Define constants for waitpid() system call if they aren't defined by a
|
| 287 |
+
* system header file.
|
| 288 |
+
*---------------------------------------------------------------------------
|
| 289 |
+
*/
|
| 290 |
+
|
| 291 |
+
#ifndef WNOHANG
|
| 292 |
+
# define WNOHANG 1
|
| 293 |
+
#endif
|
| 294 |
+
#ifndef WUNTRACED
|
| 295 |
+
# define WUNTRACED 2
|
| 296 |
+
#endif
|
| 297 |
+
|
| 298 |
+
/*
|
| 299 |
+
*---------------------------------------------------------------------------
|
| 300 |
+
* Supply macros for seek offsets, if they're not already provided by an
|
| 301 |
+
* include file.
|
| 302 |
+
*---------------------------------------------------------------------------
|
| 303 |
+
*/
|
| 304 |
+
|
| 305 |
+
#ifndef SEEK_SET
|
| 306 |
+
# define SEEK_SET 0
|
| 307 |
+
#endif
|
| 308 |
+
#ifndef SEEK_CUR
|
| 309 |
+
# define SEEK_CUR 1
|
| 310 |
+
#endif
|
| 311 |
+
#ifndef SEEK_END
|
| 312 |
+
# define SEEK_END 2
|
| 313 |
+
#endif
|
| 314 |
+
|
| 315 |
+
/*
|
| 316 |
+
*---------------------------------------------------------------------------
|
| 317 |
+
* The stuff below is needed by the "time" command. If this system has no
|
| 318 |
+
* gettimeofday call, then must use times() instead.
|
| 319 |
+
*---------------------------------------------------------------------------
|
| 320 |
+
*/
|
| 321 |
+
|
| 322 |
+
#ifdef NO_GETTOD
|
| 323 |
+
# include <sys/times.h>
|
| 324 |
+
#else
|
| 325 |
+
# ifdef HAVE_BSDGETTIMEOFDAY
|
| 326 |
+
# define gettimeofday BSDgettimeofday
|
| 327 |
+
# endif
|
| 328 |
+
#endif
|
| 329 |
+
|
| 330 |
+
#ifdef GETTOD_NOT_DECLARED
|
| 331 |
+
extern int gettimeofday(struct timeval *tp,
|
| 332 |
+
struct timezone *tzp);
|
| 333 |
+
#endif
|
| 334 |
+
|
| 335 |
+
/*
|
| 336 |
+
*---------------------------------------------------------------------------
|
| 337 |
+
* Define access mode constants if they aren't already defined.
|
| 338 |
+
*---------------------------------------------------------------------------
|
| 339 |
+
*/
|
| 340 |
+
|
| 341 |
+
#ifndef F_OK
|
| 342 |
+
# define F_OK 00
|
| 343 |
+
#endif
|
| 344 |
+
#ifndef X_OK
|
| 345 |
+
# define X_OK 01
|
| 346 |
+
#endif
|
| 347 |
+
#ifndef W_OK
|
| 348 |
+
# define W_OK 02
|
| 349 |
+
#endif
|
| 350 |
+
#ifndef R_OK
|
| 351 |
+
# define R_OK 04
|
| 352 |
+
#endif
|
| 353 |
+
|
| 354 |
+
/*
|
| 355 |
+
*---------------------------------------------------------------------------
|
| 356 |
+
* Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already
|
| 357 |
+
* defined.
|
| 358 |
+
*---------------------------------------------------------------------------
|
| 359 |
+
*/
|
| 360 |
+
|
| 361 |
+
#ifndef FD_CLOEXEC
|
| 362 |
+
# define FD_CLOEXEC 1
|
| 363 |
+
#endif
|
| 364 |
+
|
| 365 |
+
/*
|
| 366 |
+
*---------------------------------------------------------------------------
|
| 367 |
+
* On systems without symbolic links (i.e. S_IFLNK isn't defined) define
|
| 368 |
+
* "lstat" to use "stat" instead.
|
| 369 |
+
*---------------------------------------------------------------------------
|
| 370 |
+
*/
|
| 371 |
+
|
| 372 |
+
#ifndef S_IFLNK
|
| 373 |
+
# undef TclOSlstat
|
| 374 |
+
# define lstat stat
|
| 375 |
+
# define lstat64 stat64
|
| 376 |
+
# define TclOSlstat TclOSstat
|
| 377 |
+
#endif
|
| 378 |
+
|
| 379 |
+
/*
|
| 380 |
+
*---------------------------------------------------------------------------
|
| 381 |
+
* Define macros to query file type bits, if they're not already defined.
|
| 382 |
+
*---------------------------------------------------------------------------
|
| 383 |
+
*/
|
| 384 |
+
|
| 385 |
+
#ifndef S_ISREG
|
| 386 |
+
# ifdef S_IFREG
|
| 387 |
+
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
| 388 |
+
# else
|
| 389 |
+
# define S_ISREG(m) 0
|
| 390 |
+
# endif
|
| 391 |
+
#endif /* !S_ISREG */
|
| 392 |
+
#ifndef S_ISDIR
|
| 393 |
+
# ifdef S_IFDIR
|
| 394 |
+
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
| 395 |
+
# else
|
| 396 |
+
# define S_ISDIR(m) 0
|
| 397 |
+
# endif
|
| 398 |
+
#endif /* !S_ISDIR */
|
| 399 |
+
#ifndef S_ISCHR
|
| 400 |
+
# ifdef S_IFCHR
|
| 401 |
+
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
| 402 |
+
# else
|
| 403 |
+
# define S_ISCHR(m) 0
|
| 404 |
+
# endif
|
| 405 |
+
#endif /* !S_ISCHR */
|
| 406 |
+
|
| 407 |
+
#ifndef S_ISBLK
|
| 408 |
+
# ifdef S_IFBLK
|
| 409 |
+
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
| 410 |
+
# else
|
| 411 |
+
# define S_ISBLK(m) 0
|
| 412 |
+
# endif
|
| 413 |
+
#endif /* !S_ISBLK */
|
| 414 |
+
|
| 415 |
+
#ifndef S_ISFIFO
|
| 416 |
+
# ifdef S_IFIFO
|
| 417 |
+
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
| 418 |
+
# else
|
| 419 |
+
# define S_ISFIFO(m) 0
|
| 420 |
+
# endif
|
| 421 |
+
#endif /* !S_ISFIFO */
|
| 422 |
+
|
| 423 |
+
#ifndef S_ISLNK
|
| 424 |
+
# ifdef S_IFLNK
|
| 425 |
+
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
| 426 |
+
# else
|
| 427 |
+
# define S_ISLNK(m) 0
|
| 428 |
+
# endif
|
| 429 |
+
#endif /* !S_ISLNK */
|
| 430 |
+
|
| 431 |
+
#ifndef S_ISSOCK
|
| 432 |
+
# ifdef S_IFSOCK
|
| 433 |
+
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
| 434 |
+
# else
|
| 435 |
+
# define S_ISSOCK(m) 0
|
| 436 |
+
# endif
|
| 437 |
+
#endif /* !S_ISSOCK */
|
| 438 |
+
|
| 439 |
+
/*
|
| 440 |
+
*---------------------------------------------------------------------------
|
| 441 |
+
* Make sure that MAXPATHLEN and MAXNAMLEN are defined.
|
| 442 |
+
*---------------------------------------------------------------------------
|
| 443 |
+
*/
|
| 444 |
+
|
| 445 |
+
#ifndef MAXPATHLEN
|
| 446 |
+
# ifdef PATH_MAX
|
| 447 |
+
# define MAXPATHLEN PATH_MAX
|
| 448 |
+
# else
|
| 449 |
+
# define MAXPATHLEN 2048
|
| 450 |
+
# endif
|
| 451 |
+
#endif
|
| 452 |
+
|
| 453 |
+
#ifndef MAXNAMLEN
|
| 454 |
+
# ifdef NAME_MAX
|
| 455 |
+
# define MAXNAMLEN NAME_MAX
|
| 456 |
+
# else
|
| 457 |
+
# define MAXNAMLEN 255
|
| 458 |
+
# endif
|
| 459 |
+
#endif
|
| 460 |
+
|
| 461 |
+
/*
|
| 462 |
+
*---------------------------------------------------------------------------
|
| 463 |
+
* The following macro defines the type of the mask arguments to select:
|
| 464 |
+
*---------------------------------------------------------------------------
|
| 465 |
+
*/
|
| 466 |
+
|
| 467 |
+
#ifndef NO_FD_SET
|
| 468 |
+
# define SELECT_MASK fd_set
|
| 469 |
+
#else /* NO_FD_SET */
|
| 470 |
+
# ifndef _AIX
|
| 471 |
+
typedef long fd_mask;
|
| 472 |
+
# endif /* !AIX */
|
| 473 |
+
# if defined(_IBMR2)
|
| 474 |
+
# define SELECT_MASK void
|
| 475 |
+
# else /* !defined(_IBMR2) */
|
| 476 |
+
# define SELECT_MASK int
|
| 477 |
+
# endif /* defined(_IBMR2) */
|
| 478 |
+
#endif /* !NO_FD_SET */
|
| 479 |
+
|
| 480 |
+
/*
|
| 481 |
+
*---------------------------------------------------------------------------
|
| 482 |
+
* Define "NBBY" (number of bits per byte) if it's not already defined.
|
| 483 |
+
*---------------------------------------------------------------------------
|
| 484 |
+
*/
|
| 485 |
+
|
| 486 |
+
#ifndef NBBY
|
| 487 |
+
# define NBBY 8
|
| 488 |
+
#endif
|
| 489 |
+
|
| 490 |
+
/*
|
| 491 |
+
*---------------------------------------------------------------------------
|
| 492 |
+
* The following macro defines the number of fd_masks in an fd_set:
|
| 493 |
+
*---------------------------------------------------------------------------
|
| 494 |
+
*/
|
| 495 |
+
|
| 496 |
+
#ifndef FD_SETSIZE
|
| 497 |
+
# ifdef OPEN_MAX
|
| 498 |
+
# define FD_SETSIZE OPEN_MAX
|
| 499 |
+
# else
|
| 500 |
+
# define FD_SETSIZE 256
|
| 501 |
+
# endif
|
| 502 |
+
#endif /* FD_SETSIZE */
|
| 503 |
+
|
| 504 |
+
#ifndef howmany
|
| 505 |
+
# define howmany(x, y) (((x)+((y)-1))/(y))
|
| 506 |
+
#endif /* !defined(howmany) */
|
| 507 |
+
|
| 508 |
+
#ifndef NFDBITS
|
| 509 |
+
# define NFDBITS NBBY*sizeof(fd_mask)
|
| 510 |
+
#endif /* NFDBITS */
|
| 511 |
+
|
| 512 |
+
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
|
| 513 |
+
|
| 514 |
+
/*
|
| 515 |
+
*---------------------------------------------------------------------------
|
| 516 |
+
* Not all systems declare the errno variable in errno.h, so this file does it
|
| 517 |
+
* explicitly. The list of system error messages also isn't generally declared
|
| 518 |
+
* in a header file anywhere.
|
| 519 |
+
*---------------------------------------------------------------------------
|
| 520 |
+
*/
|
| 521 |
+
|
| 522 |
+
#ifdef NO_ERRNO
|
| 523 |
+
extern int errno;
|
| 524 |
+
#endif /* NO_ERRNO */
|
| 525 |
+
|
| 526 |
+
/*
|
| 527 |
+
*---------------------------------------------------------------------------
|
| 528 |
+
* Not all systems declare all the errors that Tcl uses! Provide some
|
| 529 |
+
* work-arounds...
|
| 530 |
+
*---------------------------------------------------------------------------
|
| 531 |
+
*/
|
| 532 |
+
|
| 533 |
+
#ifndef EOVERFLOW
|
| 534 |
+
# ifdef EFBIG
|
| 535 |
+
# define EOVERFLOW EFBIG
|
| 536 |
+
# else /* !EFBIG */
|
| 537 |
+
# define EOVERFLOW EINVAL
|
| 538 |
+
# endif /* EFBIG */
|
| 539 |
+
#endif /* EOVERFLOW */
|
| 540 |
+
|
| 541 |
+
/*
|
| 542 |
+
*---------------------------------------------------------------------------
|
| 543 |
+
* Variables provided by the C library:
|
| 544 |
+
*---------------------------------------------------------------------------
|
| 545 |
+
*/
|
| 546 |
+
|
| 547 |
+
#if defined(__APPLE__) && defined(__DYNAMIC__)
|
| 548 |
+
# include <crt_externs.h>
|
| 549 |
+
# define environ (*_NSGetEnviron())
|
| 550 |
+
# define USE_PUTENV 1
|
| 551 |
+
#else
|
| 552 |
+
# if defined(_sgi) || defined(__sgi)
|
| 553 |
+
# define environ _environ
|
| 554 |
+
# endif
|
| 555 |
+
extern char ** environ;
|
| 556 |
+
#endif
|
| 557 |
+
|
| 558 |
+
/*
|
| 559 |
+
*---------------------------------------------------------------------------
|
| 560 |
+
* Darwin specifc configure overrides.
|
| 561 |
+
*---------------------------------------------------------------------------
|
| 562 |
+
*/
|
| 563 |
+
|
| 564 |
+
#ifdef __APPLE__
|
| 565 |
+
|
| 566 |
+
/*
|
| 567 |
+
*---------------------------------------------------------------------------
|
| 568 |
+
* Support for fat compiles: configure runs only once for multiple architectures
|
| 569 |
+
*---------------------------------------------------------------------------
|
| 570 |
+
*/
|
| 571 |
+
|
| 572 |
+
# if defined(__LP64__) && defined (NO_COREFOUNDATION_64)
|
| 573 |
+
# undef HAVE_COREFOUNDATION
|
| 574 |
+
# endif /* __LP64__ && NO_COREFOUNDATION_64 */
|
| 575 |
+
# include <sys/cdefs.h>
|
| 576 |
+
# ifdef __DARWIN_UNIX03
|
| 577 |
+
# if __DARWIN_UNIX03
|
| 578 |
+
# undef HAVE_PUTENV_THAT_COPIES
|
| 579 |
+
# else
|
| 580 |
+
# define HAVE_PUTENV_THAT_COPIES 1
|
| 581 |
+
# endif
|
| 582 |
+
# endif /* __DARWIN_UNIX03 */
|
| 583 |
+
|
| 584 |
+
/*
|
| 585 |
+
*---------------------------------------------------------------------------
|
| 586 |
+
* Include AvailabilityMacros.h here (when available) to ensure any symbolic
|
| 587 |
+
* MAC_OS_X_VERSION_* constants passed on the command line are translated.
|
| 588 |
+
*---------------------------------------------------------------------------
|
| 589 |
+
*/
|
| 590 |
+
|
| 591 |
+
# ifdef HAVE_AVAILABILITYMACROS_H
|
| 592 |
+
# include <AvailabilityMacros.h>
|
| 593 |
+
# endif
|
| 594 |
+
|
| 595 |
+
/*
|
| 596 |
+
*---------------------------------------------------------------------------
|
| 597 |
+
* Support for weak import.
|
| 598 |
+
*---------------------------------------------------------------------------
|
| 599 |
+
*/
|
| 600 |
+
|
| 601 |
+
# ifdef HAVE_WEAK_IMPORT
|
| 602 |
+
# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
|
| 603 |
+
# undef HAVE_WEAK_IMPORT
|
| 604 |
+
# else
|
| 605 |
+
# ifndef WEAK_IMPORT_ATTRIBUTE
|
| 606 |
+
# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
| 607 |
+
# endif
|
| 608 |
+
# endif
|
| 609 |
+
# endif /* HAVE_WEAK_IMPORT */
|
| 610 |
+
|
| 611 |
+
/*
|
| 612 |
+
*---------------------------------------------------------------------------
|
| 613 |
+
* Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
|
| 614 |
+
* only use API available in the indicated OS version or earlier.
|
| 615 |
+
*---------------------------------------------------------------------------
|
| 616 |
+
*/
|
| 617 |
+
|
| 618 |
+
# ifdef MAC_OS_X_VERSION_MAX_ALLOWED
|
| 619 |
+
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
|
| 620 |
+
# undef HAVE_COREFOUNDATION
|
| 621 |
+
# endif
|
| 622 |
+
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
|
| 623 |
+
# undef HAVE_OSSPINLOCKLOCK
|
| 624 |
+
# undef HAVE_PTHREAD_ATFORK
|
| 625 |
+
# undef HAVE_COPYFILE
|
| 626 |
+
# endif
|
| 627 |
+
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
|
| 628 |
+
# ifdef TCL_THREADS
|
| 629 |
+
/* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
|
| 630 |
+
# define NO_REALPATH 1
|
| 631 |
+
# endif
|
| 632 |
+
# undef HAVE_LANGINFO
|
| 633 |
+
# endif
|
| 634 |
+
# endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
| 635 |
+
# if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
|
| 636 |
+
defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
| 637 |
+
# warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
|
| 638 |
+
# endif
|
| 639 |
+
/*
|
| 640 |
+
* For now, test exec-17.1 fails (I/O setup after closing stdout) with
|
| 641 |
+
* posix_spawnp(), but the classic implementation (based on fork()+execvp())
|
| 642 |
+
* works well under macOS.
|
| 643 |
+
*/
|
| 644 |
+
# undef HAVE_POSIX_SPAWNP
|
| 645 |
+
# undef HAVE_VFORK
|
| 646 |
+
#endif /* __APPLE__ */
|
| 647 |
+
|
| 648 |
+
/*
|
| 649 |
+
*---------------------------------------------------------------------------
|
| 650 |
+
* The following macros and declarations represent the interface between
|
| 651 |
+
* generic and unix-specific parts of Tcl. Some of the macros may override
|
| 652 |
+
* functions declared in tclInt.h.
|
| 653 |
+
*---------------------------------------------------------------------------
|
| 654 |
+
*/
|
| 655 |
+
|
| 656 |
+
/*
|
| 657 |
+
* The default platform eol translation on Unix is TCL_TRANSLATE_LF.
|
| 658 |
+
*/
|
| 659 |
+
|
| 660 |
+
#ifdef DJGPP
|
| 661 |
+
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
|
| 662 |
+
typedef int socklen_t;
|
| 663 |
+
#else
|
| 664 |
+
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
|
| 665 |
+
#endif
|
| 666 |
+
|
| 667 |
+
/*
|
| 668 |
+
*---------------------------------------------------------------------------
|
| 669 |
+
* The following macros have trivial definitions, allowing generic code to
|
| 670 |
+
* address platform-specific issues.
|
| 671 |
+
*---------------------------------------------------------------------------
|
| 672 |
+
*/
|
| 673 |
+
|
| 674 |
+
#define TclpReleaseFile(file) /* Nothing. */
|
| 675 |
+
|
| 676 |
+
/*
|
| 677 |
+
*---------------------------------------------------------------------------
|
| 678 |
+
* The following defines wrap the system memory allocation routines.
|
| 679 |
+
*---------------------------------------------------------------------------
|
| 680 |
+
*/
|
| 681 |
+
|
| 682 |
+
#define TclpSysAlloc(size, isBin) malloc((size_t)(size))
|
| 683 |
+
#define TclpSysFree(ptr) free((char *)(ptr))
|
| 684 |
+
#define TclpSysRealloc(ptr, size) realloc((char *)(ptr), (size_t)(size))
|
| 685 |
+
|
| 686 |
+
/*
|
| 687 |
+
*---------------------------------------------------------------------------
|
| 688 |
+
* The following macros and declaration wrap the C runtime library functions.
|
| 689 |
+
*---------------------------------------------------------------------------
|
| 690 |
+
*/
|
| 691 |
+
|
| 692 |
+
#define TclpExit exit
|
| 693 |
+
|
| 694 |
+
#ifdef TCL_THREADS
|
| 695 |
+
# include <pthread.h>
|
| 696 |
+
#endif /* TCL_THREADS */
|
| 697 |
+
|
| 698 |
+
/* FIXME - Hyper-enormous platform assumption! */
|
| 699 |
+
#ifndef AF_INET6
|
| 700 |
+
# define AF_INET6 10
|
| 701 |
+
#endif
|
| 702 |
+
|
| 703 |
+
/*
|
| 704 |
+
*---------------------------------------------------------------------------
|
| 705 |
+
* Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
|
| 706 |
+
* Instead of returning pointers to the static storage, those return pointers
|
| 707 |
+
* to the TSD data.
|
| 708 |
+
*---------------------------------------------------------------------------
|
| 709 |
+
*/
|
| 710 |
+
|
| 711 |
+
#include <pwd.h>
|
| 712 |
+
#include <grp.h>
|
| 713 |
+
|
| 714 |
+
extern struct passwd * TclpGetPwNam(const char *name);
|
| 715 |
+
extern struct group * TclpGetGrNam(const char *name);
|
| 716 |
+
extern struct passwd * TclpGetPwUid(uid_t uid);
|
| 717 |
+
extern struct group * TclpGetGrGid(gid_t gid);
|
| 718 |
+
extern struct hostent * TclpGetHostByName(const char *name);
|
| 719 |
+
extern struct hostent * TclpGetHostByAddr(const char *addr,
|
| 720 |
+
int length, int type);
|
| 721 |
+
extern void *TclpMakeTcpClientChannelMode(
|
| 722 |
+
void *tcpSocket, int mode);
|
| 723 |
+
|
| 724 |
+
#endif /* _TCLUNIXPORT */
|
| 725 |
+
|
| 726 |
+
/*
|
| 727 |
+
* Local Variables:
|
| 728 |
+
* mode: c
|
| 729 |
+
* c-basic-offset: 4
|
| 730 |
+
* fill-column: 78
|
| 731 |
+
* End:
|
| 732 |
+
*/
|
mantis_evalkit/include/tk.h
ADDED
|
@@ -0,0 +1,1635 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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c) 1989-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1994 The Australian National University.
|
| 9 |
+
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
| 10 |
+
* Copyright (c) 1998-2000 Ajuba Solutions.
|
| 11 |
+
*
|
| 12 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 13 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef _TK
|
| 17 |
+
#define _TK
|
| 18 |
+
|
| 19 |
+
#include <tcl.h>
|
| 20 |
+
#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6)
|
| 21 |
+
# error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
#ifndef CONST84
|
| 25 |
+
# define CONST84 const
|
| 26 |
+
# define CONST84_RETURN const
|
| 27 |
+
#endif
|
| 28 |
+
#ifndef CONST86
|
| 29 |
+
# define CONST86 CONST84
|
| 30 |
+
#endif
|
| 31 |
+
#ifndef EXTERN
|
| 32 |
+
# define EXTERN extern TCL_STORAGE_CLASS
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
/*
|
| 36 |
+
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
| 37 |
+
* quotation marks), JOIN joins two arguments.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef STRINGIFY
|
| 41 |
+
# define STRINGIFY(x) STRINGIFY1(x)
|
| 42 |
+
# define STRINGIFY1(x) #x
|
| 43 |
+
#endif
|
| 44 |
+
#ifndef JOIN
|
| 45 |
+
# define JOIN(a,b) JOIN1(a,b)
|
| 46 |
+
# define JOIN1(a,b) a##b
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
/*
|
| 50 |
+
* For C++ compilers, use extern "C"
|
| 51 |
+
*/
|
| 52 |
+
|
| 53 |
+
#ifdef __cplusplus
|
| 54 |
+
extern "C" {
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* When version numbers change here, you must also go into the following files
|
| 59 |
+
* and update the version numbers:
|
| 60 |
+
*
|
| 61 |
+
* library/tk.tcl (1 LOC patch)
|
| 62 |
+
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
|
| 63 |
+
* win/configure.in (as above)
|
| 64 |
+
* README (sections 0 and 1)
|
| 65 |
+
* macosx/Tk-Common.xcconfig (not patchlevel) 1 LOC
|
| 66 |
+
* win/README (not patchlevel)
|
| 67 |
+
* unix/README (not patchlevel)
|
| 68 |
+
* unix/tk.spec (1 LOC patch)
|
| 69 |
+
* win/tcl.m4 (not patchlevel)
|
| 70 |
+
*
|
| 71 |
+
* You may also need to update some of these files when the numbers change for
|
| 72 |
+
* the version of Tcl that this release of Tk is compiled against.
|
| 73 |
+
*/
|
| 74 |
+
|
| 75 |
+
#define TK_MAJOR_VERSION 8
|
| 76 |
+
#define TK_MINOR_VERSION 6
|
| 77 |
+
#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
|
| 78 |
+
#define TK_RELEASE_SERIAL 14
|
| 79 |
+
|
| 80 |
+
#define TK_VERSION "8.6"
|
| 81 |
+
#define TK_PATCH_LEVEL "8.6.14"
|
| 82 |
+
|
| 83 |
+
/*
|
| 84 |
+
* A special definition used to allow this header file to be included from
|
| 85 |
+
* windows or mac resource files so that they can obtain version information.
|
| 86 |
+
* RC_INVOKED is defined by default by the windows RC tool and manually set
|
| 87 |
+
* for macintosh.
|
| 88 |
+
*
|
| 89 |
+
* Resource compilers don't like all the C stuff, like typedefs and procedure
|
| 90 |
+
* declarations, that occur below, so block them out.
|
| 91 |
+
*/
|
| 92 |
+
|
| 93 |
+
#ifndef RC_INVOKED
|
| 94 |
+
|
| 95 |
+
#if !defined(_XLIB_H) && !defined(_X11_XLIB_H_)
|
| 96 |
+
#if defined(__GNUC__) && !defined(__cplusplus)
|
| 97 |
+
# pragma GCC diagnostic ignored "-Wc++-compat"
|
| 98 |
+
#endif
|
| 99 |
+
# include <X11/Xlib.h>
|
| 100 |
+
# ifdef MAC_OSX_TK
|
| 101 |
+
# include <X11/X.h>
|
| 102 |
+
# endif
|
| 103 |
+
#endif
|
| 104 |
+
#if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \
|
| 105 |
+
|| defined(__cplusplus) || defined(_MSC_VER) || defined(__ICC)
|
| 106 |
+
# include <stddef.h>
|
| 107 |
+
#endif
|
| 108 |
+
|
| 109 |
+
#ifdef BUILD_tk
|
| 110 |
+
#undef TCL_STORAGE_CLASS
|
| 111 |
+
#define TCL_STORAGE_CLASS DLLEXPORT
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
/*
|
| 115 |
+
*----------------------------------------------------------------------
|
| 116 |
+
*
|
| 117 |
+
* Decide whether or not to use input methods.
|
| 118 |
+
*/
|
| 119 |
+
|
| 120 |
+
#if defined(XNQueryInputStyle) && !defined(_WIN32) && !defined(MAC_OSX_TK)
|
| 121 |
+
#define TK_USE_INPUT_METHODS
|
| 122 |
+
#endif
|
| 123 |
+
|
| 124 |
+
/*
|
| 125 |
+
* Dummy types that are used by clients:
|
| 126 |
+
*/
|
| 127 |
+
|
| 128 |
+
#define Tk_ImageModel Tk_ImageMaster
|
| 129 |
+
typedef struct Tk_BindingTable_ *Tk_BindingTable;
|
| 130 |
+
typedef struct Tk_Canvas_ *Tk_Canvas;
|
| 131 |
+
typedef struct Tk_Cursor_ *Tk_Cursor;
|
| 132 |
+
typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler;
|
| 133 |
+
typedef struct Tk_Font_ *Tk_Font;
|
| 134 |
+
typedef struct Tk_Image__ *Tk_Image;
|
| 135 |
+
typedef struct Tk_ImageMaster_ *Tk_ImageMaster;
|
| 136 |
+
typedef struct Tk_OptionTable_ *Tk_OptionTable;
|
| 137 |
+
typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo;
|
| 138 |
+
typedef struct Tk_TextLayout_ *Tk_TextLayout;
|
| 139 |
+
typedef struct Tk_Window_ *Tk_Window;
|
| 140 |
+
typedef struct Tk_3DBorder_ *Tk_3DBorder;
|
| 141 |
+
typedef struct Tk_Style_ *Tk_Style;
|
| 142 |
+
typedef struct Tk_StyleEngine_ *Tk_StyleEngine;
|
| 143 |
+
typedef struct Tk_StyledElement_ *Tk_StyledElement;
|
| 144 |
+
|
| 145 |
+
/*
|
| 146 |
+
* Additional types exported to clients.
|
| 147 |
+
*/
|
| 148 |
+
|
| 149 |
+
typedef const char *Tk_Uid;
|
| 150 |
+
|
| 151 |
+
/*
|
| 152 |
+
*----------------------------------------------------------------------
|
| 153 |
+
*
|
| 154 |
+
* The enum below defines the valid types for Tk configuration options as
|
| 155 |
+
* implemented by Tk_InitOptions, Tk_SetOptions, etc.
|
| 156 |
+
*/
|
| 157 |
+
|
| 158 |
+
typedef enum {
|
| 159 |
+
TK_OPTION_BOOLEAN,
|
| 160 |
+
TK_OPTION_INT,
|
| 161 |
+
TK_OPTION_DOUBLE,
|
| 162 |
+
TK_OPTION_STRING,
|
| 163 |
+
TK_OPTION_STRING_TABLE,
|
| 164 |
+
TK_OPTION_COLOR,
|
| 165 |
+
TK_OPTION_FONT,
|
| 166 |
+
TK_OPTION_BITMAP,
|
| 167 |
+
TK_OPTION_BORDER,
|
| 168 |
+
TK_OPTION_RELIEF,
|
| 169 |
+
TK_OPTION_CURSOR,
|
| 170 |
+
TK_OPTION_JUSTIFY,
|
| 171 |
+
TK_OPTION_ANCHOR,
|
| 172 |
+
TK_OPTION_SYNONYM,
|
| 173 |
+
TK_OPTION_PIXELS,
|
| 174 |
+
TK_OPTION_WINDOW,
|
| 175 |
+
TK_OPTION_END,
|
| 176 |
+
TK_OPTION_CUSTOM,
|
| 177 |
+
TK_OPTION_STYLE
|
| 178 |
+
} Tk_OptionType;
|
| 179 |
+
|
| 180 |
+
/*
|
| 181 |
+
* Structures of the following type are used by widgets to specify their
|
| 182 |
+
* configuration options. Typically each widget has a static array of these
|
| 183 |
+
* structures, where each element of the array describes a single
|
| 184 |
+
* configuration option. The array is passed to Tk_CreateOptionTable.
|
| 185 |
+
*/
|
| 186 |
+
|
| 187 |
+
typedef struct Tk_OptionSpec {
|
| 188 |
+
Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR;
|
| 189 |
+
* see definitions above. Last option in table
|
| 190 |
+
* must have type TK_OPTION_END. */
|
| 191 |
+
const char *optionName; /* Name used to specify option in Tcl
|
| 192 |
+
* commands. */
|
| 193 |
+
const char *dbName; /* Name for option in option database. */
|
| 194 |
+
const char *dbClass; /* Class for option in database. */
|
| 195 |
+
const char *defValue; /* Default value for option if not specified
|
| 196 |
+
* in command line, the option database, or
|
| 197 |
+
* the system. */
|
| 198 |
+
int objOffset; /* Where in record to store a Tcl_Obj * that
|
| 199 |
+
* holds the value of this option, specified
|
| 200 |
+
* as an offset in bytes from the start of the
|
| 201 |
+
* record. Use the Tk_Offset macro to generate
|
| 202 |
+
* values for this. -1 means don't store the
|
| 203 |
+
* Tcl_Obj in the record. */
|
| 204 |
+
int internalOffset; /* Where in record to store the internal
|
| 205 |
+
* representation of the value of this option,
|
| 206 |
+
* such as an int or XColor *. This field is
|
| 207 |
+
* specified as an offset in bytes from the
|
| 208 |
+
* start of the record. Use the Tk_Offset
|
| 209 |
+
* macro to generate values for it. -1 means
|
| 210 |
+
* don't store the internal representation in
|
| 211 |
+
* the record. */
|
| 212 |
+
int flags; /* Any combination of the values defined
|
| 213 |
+
* below. */
|
| 214 |
+
const void *clientData; /* An alternate place to put option-specific
|
| 215 |
+
* data. Used for the monochrome default value
|
| 216 |
+
* for colors, etc. */
|
| 217 |
+
int typeMask; /* An arbitrary bit mask defined by the class
|
| 218 |
+
* manager; typically bits correspond to
|
| 219 |
+
* certain kinds of options such as all those
|
| 220 |
+
* that require a redisplay when they change.
|
| 221 |
+
* Tk_SetOptions returns the bit-wise OR of
|
| 222 |
+
* the typeMasks of all options that were
|
| 223 |
+
* changed. */
|
| 224 |
+
} Tk_OptionSpec;
|
| 225 |
+
|
| 226 |
+
/*
|
| 227 |
+
* Flag values for Tk_OptionSpec structures. These flags are shared by
|
| 228 |
+
* Tk_ConfigSpec structures, so be sure to coordinate any changes carefully.
|
| 229 |
+
*/
|
| 230 |
+
|
| 231 |
+
#define TK_OPTION_NULL_OK (1 << 0)
|
| 232 |
+
#define TK_OPTION_DONT_SET_DEFAULT (1 << 3)
|
| 233 |
+
|
| 234 |
+
/*
|
| 235 |
+
* The following structure and function types are used by TK_OPTION_CUSTOM
|
| 236 |
+
* options; the structure holds pointers to the functions needed by the Tk
|
| 237 |
+
* option config code to handle a custom option.
|
| 238 |
+
*/
|
| 239 |
+
|
| 240 |
+
typedef int (Tk_CustomOptionSetProc) (ClientData clientData,
|
| 241 |
+
Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec,
|
| 242 |
+
int offset, char *saveInternalPtr, int flags);
|
| 243 |
+
typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData,
|
| 244 |
+
Tk_Window tkwin, char *widgRec, int offset);
|
| 245 |
+
typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData,
|
| 246 |
+
Tk_Window tkwin, char *internalPtr, char *saveInternalPtr);
|
| 247 |
+
typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin,
|
| 248 |
+
char *internalPtr);
|
| 249 |
+
|
| 250 |
+
typedef struct Tk_ObjCustomOption {
|
| 251 |
+
const char *name; /* Name of the custom option. */
|
| 252 |
+
Tk_CustomOptionSetProc *setProc;
|
| 253 |
+
/* Function to use to set a record's option
|
| 254 |
+
* value from a Tcl_Obj */
|
| 255 |
+
Tk_CustomOptionGetProc *getProc;
|
| 256 |
+
/* Function to use to get a Tcl_Obj
|
| 257 |
+
* representation from an internal
|
| 258 |
+
* representation of an option. */
|
| 259 |
+
Tk_CustomOptionRestoreProc *restoreProc;
|
| 260 |
+
/* Function to use to restore a saved value
|
| 261 |
+
* for the internal representation. */
|
| 262 |
+
Tk_CustomOptionFreeProc *freeProc;
|
| 263 |
+
/* Function to use to free the internal
|
| 264 |
+
* representation of an option. */
|
| 265 |
+
ClientData clientData; /* Arbitrary one-word value passed to the
|
| 266 |
+
* handling procs. */
|
| 267 |
+
} Tk_ObjCustomOption;
|
| 268 |
+
|
| 269 |
+
/*
|
| 270 |
+
* Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
|
| 271 |
+
* Computes number of bytes from beginning of structure to a given field.
|
| 272 |
+
*/
|
| 273 |
+
|
| 274 |
+
#define Tk_Offset(type, field) ((int) offsetof(type, field))
|
| 275 |
+
/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
|
| 276 |
+
#ifndef offsetof
|
| 277 |
+
# define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field))
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
/*
|
| 281 |
+
* The following two structures are used for error handling. When config
|
| 282 |
+
* options are being modified, the old values are saved in a Tk_SavedOptions
|
| 283 |
+
* structure. If an error occurs, then the contents of the structure can be
|
| 284 |
+
* used to restore all of the old values. The contents of this structure are
|
| 285 |
+
* for the private use Tk. No-one outside Tk should ever read or write any of
|
| 286 |
+
* the fields of these structures.
|
| 287 |
+
*/
|
| 288 |
+
|
| 289 |
+
typedef struct Tk_SavedOption {
|
| 290 |
+
struct TkOption *optionPtr; /* Points to information that describes the
|
| 291 |
+
* option. */
|
| 292 |
+
Tcl_Obj *valuePtr; /* The old value of the option, in the form of
|
| 293 |
+
* a Tcl object; may be NULL if the value was
|
| 294 |
+
* not saved as an object. */
|
| 295 |
+
double internalForm; /* The old value of the option, in some
|
| 296 |
+
* internal representation such as an int or
|
| 297 |
+
* (XColor *). Valid only if the field
|
| 298 |
+
* optionPtr->specPtr->objOffset is < 0. The
|
| 299 |
+
* space must be large enough to accommodate a
|
| 300 |
+
* double, a long, or a pointer; right now it
|
| 301 |
+
* looks like a double (i.e., 8 bytes) is big
|
| 302 |
+
* enough. Also, using a double guarantees
|
| 303 |
+
* that the field is properly aligned for
|
| 304 |
+
* storing large values. */
|
| 305 |
+
} Tk_SavedOption;
|
| 306 |
+
|
| 307 |
+
#ifdef TCL_MEM_DEBUG
|
| 308 |
+
# define TK_NUM_SAVED_OPTIONS 2
|
| 309 |
+
#else
|
| 310 |
+
# define TK_NUM_SAVED_OPTIONS 20
|
| 311 |
+
#endif
|
| 312 |
+
|
| 313 |
+
typedef struct Tk_SavedOptions {
|
| 314 |
+
char *recordPtr; /* The data structure in which to restore
|
| 315 |
+
* configuration options. */
|
| 316 |
+
Tk_Window tkwin; /* Window associated with recordPtr; needed to
|
| 317 |
+
* restore certain options. */
|
| 318 |
+
int numItems; /* The number of valid items in items field. */
|
| 319 |
+
Tk_SavedOption items[TK_NUM_SAVED_OPTIONS];
|
| 320 |
+
/* Items used to hold old values. */
|
| 321 |
+
struct Tk_SavedOptions *nextPtr;
|
| 322 |
+
/* Points to next structure in list; needed if
|
| 323 |
+
* too many options changed to hold all the
|
| 324 |
+
* old values in a single structure. NULL
|
| 325 |
+
* means no more structures. */
|
| 326 |
+
} Tk_SavedOptions;
|
| 327 |
+
|
| 328 |
+
/*
|
| 329 |
+
* Structure used to describe application-specific configuration options:
|
| 330 |
+
* indicates procedures to call to parse an option and to return a text string
|
| 331 |
+
* describing an option. THESE ARE DEPRECATED; PLEASE USE THE NEW STRUCTURES
|
| 332 |
+
* LISTED ABOVE.
|
| 333 |
+
*/
|
| 334 |
+
|
| 335 |
+
/*
|
| 336 |
+
* This is a temporary flag used while tkObjConfig and new widgets are in
|
| 337 |
+
* development.
|
| 338 |
+
*/
|
| 339 |
+
|
| 340 |
+
#ifndef __NO_OLD_CONFIG
|
| 341 |
+
|
| 342 |
+
typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp,
|
| 343 |
+
Tk_Window tkwin, CONST84 char *value, char *widgRec, int offset);
|
| 344 |
+
typedef CONST86 char *(Tk_OptionPrintProc) (ClientData clientData,
|
| 345 |
+
Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr);
|
| 346 |
+
|
| 347 |
+
typedef struct Tk_CustomOption {
|
| 348 |
+
Tk_OptionParseProc *parseProc;
|
| 349 |
+
/* Procedure to call to parse an option and
|
| 350 |
+
* store it in converted form. */
|
| 351 |
+
Tk_OptionPrintProc *printProc;
|
| 352 |
+
/* Procedure to return a printable string
|
| 353 |
+
* describing an existing option. */
|
| 354 |
+
ClientData clientData; /* Arbitrary one-word value used by option
|
| 355 |
+
* parser: passed to parseProc and
|
| 356 |
+
* printProc. */
|
| 357 |
+
} Tk_CustomOption;
|
| 358 |
+
|
| 359 |
+
/*
|
| 360 |
+
* Structure used to specify information for Tk_ConfigureWidget. Each
|
| 361 |
+
* structure gives complete information for one option, including how the
|
| 362 |
+
* option is specified on the command line, where it appears in the option
|
| 363 |
+
* database, etc.
|
| 364 |
+
*/
|
| 365 |
+
|
| 366 |
+
typedef struct Tk_ConfigSpec {
|
| 367 |
+
int type; /* Type of option, such as TK_CONFIG_COLOR;
|
| 368 |
+
* see definitions below. Last option in table
|
| 369 |
+
* must have type TK_CONFIG_END. */
|
| 370 |
+
CONST86 char *argvName; /* Switch used to specify option in argv. NULL
|
| 371 |
+
* means this spec is part of a group. */
|
| 372 |
+
Tk_Uid dbName; /* Name for option in option database. */
|
| 373 |
+
Tk_Uid dbClass; /* Class for option in database. */
|
| 374 |
+
Tk_Uid defValue; /* Default value for option if not specified
|
| 375 |
+
* in command line or database. */
|
| 376 |
+
int offset; /* Where in widget record to store value; use
|
| 377 |
+
* Tk_Offset macro to generate values for
|
| 378 |
+
* this. */
|
| 379 |
+
int specFlags; /* Any combination of the values defined
|
| 380 |
+
* below; other bits are used internally by
|
| 381 |
+
* tkConfig.c. */
|
| 382 |
+
CONST86 Tk_CustomOption *customPtr;
|
| 383 |
+
/* If type is TK_CONFIG_CUSTOM then this is a
|
| 384 |
+
* pointer to info about how to parse and
|
| 385 |
+
* print the option. Otherwise it is
|
| 386 |
+
* irrelevant. */
|
| 387 |
+
} Tk_ConfigSpec;
|
| 388 |
+
|
| 389 |
+
/*
|
| 390 |
+
* Type values for Tk_ConfigSpec structures. See the user documentation for
|
| 391 |
+
* details.
|
| 392 |
+
*/
|
| 393 |
+
|
| 394 |
+
typedef enum {
|
| 395 |
+
TK_CONFIG_BOOLEAN, TK_CONFIG_INT, TK_CONFIG_DOUBLE, TK_CONFIG_STRING,
|
| 396 |
+
TK_CONFIG_UID, TK_CONFIG_COLOR, TK_CONFIG_FONT, TK_CONFIG_BITMAP,
|
| 397 |
+
TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR,
|
| 398 |
+
TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR,
|
| 399 |
+
TK_CONFIG_SYNONYM, TK_CONFIG_CAP_STYLE, TK_CONFIG_JOIN_STYLE,
|
| 400 |
+
TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM,
|
| 401 |
+
TK_CONFIG_END
|
| 402 |
+
} Tk_ConfigTypes;
|
| 403 |
+
|
| 404 |
+
/*
|
| 405 |
+
* Possible values for flags argument to Tk_ConfigureWidget:
|
| 406 |
+
*/
|
| 407 |
+
|
| 408 |
+
#define TK_CONFIG_ARGV_ONLY 1
|
| 409 |
+
#define TK_CONFIG_OBJS 0x80
|
| 410 |
+
|
| 411 |
+
/*
|
| 412 |
+
* Possible flag values for Tk_ConfigSpec structures. Any bits at or above
|
| 413 |
+
* TK_CONFIG_USER_BIT may be used by clients for selecting certain entries.
|
| 414 |
+
* Before changing any values here, coordinate with tkOldConfig.c
|
| 415 |
+
* (internal-use-only flags are defined there).
|
| 416 |
+
*/
|
| 417 |
+
|
| 418 |
+
#define TK_CONFIG_NULL_OK (1 << 0)
|
| 419 |
+
#define TK_CONFIG_COLOR_ONLY (1 << 1)
|
| 420 |
+
#define TK_CONFIG_MONO_ONLY (1 << 2)
|
| 421 |
+
#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3)
|
| 422 |
+
#define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
|
| 423 |
+
#define TK_CONFIG_USER_BIT 0x100
|
| 424 |
+
#endif /* __NO_OLD_CONFIG */
|
| 425 |
+
|
| 426 |
+
/*
|
| 427 |
+
* Structure used to specify how to handle argv options.
|
| 428 |
+
*/
|
| 429 |
+
|
| 430 |
+
typedef struct {
|
| 431 |
+
CONST86 char *key; /* The key string that flags the option in the
|
| 432 |
+
* argv array. */
|
| 433 |
+
int type; /* Indicates option type; see below. */
|
| 434 |
+
char *src; /* Value to be used in setting dst; usage
|
| 435 |
+
* depends on type. */
|
| 436 |
+
char *dst; /* Address of value to be modified; usage
|
| 437 |
+
* depends on type. */
|
| 438 |
+
CONST86 char *help; /* Documentation message describing this
|
| 439 |
+
* option. */
|
| 440 |
+
} Tk_ArgvInfo;
|
| 441 |
+
|
| 442 |
+
/*
|
| 443 |
+
* Legal values for the type field of a Tk_ArgvInfo: see the user
|
| 444 |
+
* documentation for details.
|
| 445 |
+
*/
|
| 446 |
+
|
| 447 |
+
#define TK_ARGV_CONSTANT 15
|
| 448 |
+
#define TK_ARGV_INT 16
|
| 449 |
+
#define TK_ARGV_STRING 17
|
| 450 |
+
#define TK_ARGV_UID 18
|
| 451 |
+
#define TK_ARGV_REST 19
|
| 452 |
+
#define TK_ARGV_FLOAT 20
|
| 453 |
+
#define TK_ARGV_FUNC 21
|
| 454 |
+
#define TK_ARGV_GENFUNC 22
|
| 455 |
+
#define TK_ARGV_HELP 23
|
| 456 |
+
#define TK_ARGV_CONST_OPTION 24
|
| 457 |
+
#define TK_ARGV_OPTION_VALUE 25
|
| 458 |
+
#define TK_ARGV_OPTION_NAME_VALUE 26
|
| 459 |
+
#define TK_ARGV_END 27
|
| 460 |
+
|
| 461 |
+
/*
|
| 462 |
+
* Flag bits for passing to Tk_ParseArgv:
|
| 463 |
+
*/
|
| 464 |
+
|
| 465 |
+
#define TK_ARGV_NO_DEFAULTS 0x1
|
| 466 |
+
#define TK_ARGV_NO_LEFTOVERS 0x2
|
| 467 |
+
#define TK_ARGV_NO_ABBREV 0x4
|
| 468 |
+
#define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8
|
| 469 |
+
|
| 470 |
+
/*
|
| 471 |
+
* Enumerated type for describing actions to be taken in response to a
|
| 472 |
+
* restrictProc established by Tk_RestrictEvents.
|
| 473 |
+
*/
|
| 474 |
+
|
| 475 |
+
typedef enum {
|
| 476 |
+
TK_DEFER_EVENT, TK_PROCESS_EVENT, TK_DISCARD_EVENT
|
| 477 |
+
} Tk_RestrictAction;
|
| 478 |
+
|
| 479 |
+
/*
|
| 480 |
+
* Priority levels to pass to Tk_AddOption:
|
| 481 |
+
*/
|
| 482 |
+
|
| 483 |
+
#define TK_WIDGET_DEFAULT_PRIO 20
|
| 484 |
+
#define TK_STARTUP_FILE_PRIO 40
|
| 485 |
+
#define TK_USER_DEFAULT_PRIO 60
|
| 486 |
+
#define TK_INTERACTIVE_PRIO 80
|
| 487 |
+
#define TK_MAX_PRIO 100
|
| 488 |
+
|
| 489 |
+
/*
|
| 490 |
+
* Relief values returned by Tk_GetRelief:
|
| 491 |
+
*/
|
| 492 |
+
|
| 493 |
+
#define TK_RELIEF_NULL -1
|
| 494 |
+
#define TK_RELIEF_FLAT 0
|
| 495 |
+
#define TK_RELIEF_GROOVE 1
|
| 496 |
+
#define TK_RELIEF_RAISED 2
|
| 497 |
+
#define TK_RELIEF_RIDGE 3
|
| 498 |
+
#define TK_RELIEF_SOLID 4
|
| 499 |
+
#define TK_RELIEF_SUNKEN 5
|
| 500 |
+
|
| 501 |
+
/*
|
| 502 |
+
* "Which" argument values for Tk_3DBorderGC:
|
| 503 |
+
*/
|
| 504 |
+
|
| 505 |
+
#define TK_3D_FLAT_GC 1
|
| 506 |
+
#define TK_3D_LIGHT_GC 2
|
| 507 |
+
#define TK_3D_DARK_GC 3
|
| 508 |
+
|
| 509 |
+
/*
|
| 510 |
+
* Special EnterNotify/LeaveNotify "mode" for use in events generated by
|
| 511 |
+
* tkShare.c. Pick a high enough value that it's unlikely to conflict with
|
| 512 |
+
* existing values (like NotifyNormal) or any new values defined in the
|
| 513 |
+
* future.
|
| 514 |
+
*/
|
| 515 |
+
|
| 516 |
+
#define TK_NOTIFY_SHARE 20
|
| 517 |
+
|
| 518 |
+
/*
|
| 519 |
+
* Enumerated type for describing a point by which to anchor something:
|
| 520 |
+
*/
|
| 521 |
+
|
| 522 |
+
typedef enum {
|
| 523 |
+
TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE,
|
| 524 |
+
TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW,
|
| 525 |
+
TK_ANCHOR_CENTER
|
| 526 |
+
} Tk_Anchor;
|
| 527 |
+
|
| 528 |
+
/*
|
| 529 |
+
* Enumerated type for describing a style of justification:
|
| 530 |
+
*/
|
| 531 |
+
|
| 532 |
+
typedef enum {
|
| 533 |
+
TK_JUSTIFY_LEFT, TK_JUSTIFY_RIGHT, TK_JUSTIFY_CENTER
|
| 534 |
+
} Tk_Justify;
|
| 535 |
+
|
| 536 |
+
/*
|
| 537 |
+
* The following structure is used by Tk_GetFontMetrics() to return
|
| 538 |
+
* information about the properties of a Tk_Font.
|
| 539 |
+
*/
|
| 540 |
+
|
| 541 |
+
typedef struct Tk_FontMetrics {
|
| 542 |
+
int ascent; /* The amount in pixels that the tallest
|
| 543 |
+
* letter sticks up above the baseline, plus
|
| 544 |
+
* any extra blank space added by the designer
|
| 545 |
+
* of the font. */
|
| 546 |
+
int descent; /* The largest amount in pixels that any
|
| 547 |
+
* letter sticks below the baseline, plus any
|
| 548 |
+
* extra blank space added by the designer of
|
| 549 |
+
* the font. */
|
| 550 |
+
int linespace; /* The sum of the ascent and descent. How far
|
| 551 |
+
* apart two lines of text in the same font
|
| 552 |
+
* should be placed so that none of the
|
| 553 |
+
* characters in one line overlap any of the
|
| 554 |
+
* characters in the other line. */
|
| 555 |
+
} Tk_FontMetrics;
|
| 556 |
+
|
| 557 |
+
/*
|
| 558 |
+
* Flags passed to Tk_MeasureChars:
|
| 559 |
+
*/
|
| 560 |
+
|
| 561 |
+
#define TK_WHOLE_WORDS 1
|
| 562 |
+
#define TK_AT_LEAST_ONE 2
|
| 563 |
+
#define TK_PARTIAL_OK 4
|
| 564 |
+
|
| 565 |
+
/*
|
| 566 |
+
* Flags passed to Tk_ComputeTextLayout:
|
| 567 |
+
*/
|
| 568 |
+
|
| 569 |
+
#define TK_IGNORE_TABS 8
|
| 570 |
+
#define TK_IGNORE_NEWLINES 16
|
| 571 |
+
|
| 572 |
+
/*
|
| 573 |
+
* Widget class procedures used to implement platform specific widget
|
| 574 |
+
* behavior.
|
| 575 |
+
*/
|
| 576 |
+
|
| 577 |
+
typedef Window (Tk_ClassCreateProc) (Tk_Window tkwin, Window parent,
|
| 578 |
+
ClientData instanceData);
|
| 579 |
+
typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData);
|
| 580 |
+
typedef void (Tk_ClassModalProc) (Tk_Window tkwin, XEvent *eventPtr);
|
| 581 |
+
|
| 582 |
+
typedef struct Tk_ClassProcs {
|
| 583 |
+
unsigned int size;
|
| 584 |
+
Tk_ClassWorldChangedProc *worldChangedProc;
|
| 585 |
+
/* Procedure to invoke when the widget needs
|
| 586 |
+
* to respond in some way to a change in the
|
| 587 |
+
* world (font changes, etc.) */
|
| 588 |
+
Tk_ClassCreateProc *createProc;
|
| 589 |
+
/* Procedure to invoke when the platform-
|
| 590 |
+
* dependent window needs to be created. */
|
| 591 |
+
Tk_ClassModalProc *modalProc;
|
| 592 |
+
/* Procedure to invoke after all bindings on a
|
| 593 |
+
* widget have been triggered in order to
|
| 594 |
+
* handle a modal loop. */
|
| 595 |
+
} Tk_ClassProcs;
|
| 596 |
+
|
| 597 |
+
/*
|
| 598 |
+
* Simple accessor for Tk_ClassProcs structure. Checks that the structure is
|
| 599 |
+
* not NULL, then checks the size field and returns either the requested
|
| 600 |
+
* field, if present, or NULL if the structure is too small to have the field
|
| 601 |
+
* (or NULL if the structure is NULL).
|
| 602 |
+
*
|
| 603 |
+
* A more general version of this function may be useful if other
|
| 604 |
+
* size-versioned structure pop up in the future:
|
| 605 |
+
*
|
| 606 |
+
* #define Tk_GetField(name, who, which) \
|
| 607 |
+
* (((who) == NULL) ? NULL :
|
| 608 |
+
* (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which))
|
| 609 |
+
*/
|
| 610 |
+
|
| 611 |
+
#define Tk_GetClassProc(procs, which) \
|
| 612 |
+
(((procs) == NULL) ? NULL : \
|
| 613 |
+
(((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which))
|
| 614 |
+
|
| 615 |
+
/*
|
| 616 |
+
* Each geometry manager (the packer, the placer, etc.) is represented by a
|
| 617 |
+
* structure of the following form, which indicates procedures to invoke in
|
| 618 |
+
* the geometry manager to carry out certain functions.
|
| 619 |
+
*/
|
| 620 |
+
|
| 621 |
+
#define Tk_GeomLostContentProc Tk_GeomLostSlaveProc
|
| 622 |
+
typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin);
|
| 623 |
+
typedef void (Tk_GeomLostContentProc) (ClientData clientData, Tk_Window tkwin);
|
| 624 |
+
|
| 625 |
+
typedef struct Tk_GeomMgr {
|
| 626 |
+
const char *name; /* Name of the geometry manager (command used
|
| 627 |
+
* to invoke it, or name of widget class that
|
| 628 |
+
* allows embedded widgets). */
|
| 629 |
+
Tk_GeomRequestProc *requestProc;
|
| 630 |
+
/* Procedure to invoke when a content's
|
| 631 |
+
* requested geometry changes. */
|
| 632 |
+
Tk_GeomLostContentProc *lostSlaveProc;
|
| 633 |
+
/* Procedure to invoke when content is taken
|
| 634 |
+
* away from one geometry manager by another.
|
| 635 |
+
* NULL means geometry manager doesn't care
|
| 636 |
+
* when content lost. */
|
| 637 |
+
} Tk_GeomMgr;
|
| 638 |
+
|
| 639 |
+
/*
|
| 640 |
+
* Result values returned by Tk_GetScrollInfo:
|
| 641 |
+
*/
|
| 642 |
+
|
| 643 |
+
#define TK_SCROLL_MOVETO 1
|
| 644 |
+
#define TK_SCROLL_PAGES 2
|
| 645 |
+
#define TK_SCROLL_UNITS 3
|
| 646 |
+
#define TK_SCROLL_ERROR 4
|
| 647 |
+
|
| 648 |
+
/*
|
| 649 |
+
*----------------------------------------------------------------------
|
| 650 |
+
*
|
| 651 |
+
* Extensions to the X event set
|
| 652 |
+
*
|
| 653 |
+
*----------------------------------------------------------------------
|
| 654 |
+
*/
|
| 655 |
+
|
| 656 |
+
#define VirtualEvent (MappingNotify + 1)
|
| 657 |
+
#define ActivateNotify (MappingNotify + 2)
|
| 658 |
+
#define DeactivateNotify (MappingNotify + 3)
|
| 659 |
+
#define MouseWheelEvent (MappingNotify + 4)
|
| 660 |
+
#define TK_LASTEVENT (MappingNotify + 5)
|
| 661 |
+
|
| 662 |
+
#define MouseWheelMask (1L << 28)
|
| 663 |
+
#define ActivateMask (1L << 29)
|
| 664 |
+
#define VirtualEventMask (1L << 30)
|
| 665 |
+
|
| 666 |
+
/*
|
| 667 |
+
* A virtual event shares most of its fields with the XKeyEvent and
|
| 668 |
+
* XButtonEvent structures. 99% of the time a virtual event will be an
|
| 669 |
+
* abstraction of a key or button event, so this structure provides the most
|
| 670 |
+
* information to the user. The only difference is the changing of the detail
|
| 671 |
+
* field for a virtual event so that it holds the name of the virtual event
|
| 672 |
+
* being triggered.
|
| 673 |
+
*
|
| 674 |
+
* When using this structure, you should ensure that you zero out all the
|
| 675 |
+
* fields first using memset() or bzero().
|
| 676 |
+
*/
|
| 677 |
+
|
| 678 |
+
typedef struct {
|
| 679 |
+
int type;
|
| 680 |
+
unsigned long serial; /* # of last request processed by server. */
|
| 681 |
+
Bool send_event; /* True if this came from a SendEvent
|
| 682 |
+
* request. */
|
| 683 |
+
Display *display; /* Display the event was read from. */
|
| 684 |
+
Window event; /* Window on which event was requested. */
|
| 685 |
+
Window root; /* Root window that the event occurred on. */
|
| 686 |
+
Window subwindow; /* Child window. */
|
| 687 |
+
Time time; /* Milliseconds. */
|
| 688 |
+
int x, y; /* Pointer x, y coordinates in event
|
| 689 |
+
* window. */
|
| 690 |
+
int x_root, y_root; /* Coordinates relative to root. */
|
| 691 |
+
unsigned int state; /* Key or button mask */
|
| 692 |
+
Tk_Uid name; /* Name of virtual event. */
|
| 693 |
+
Bool same_screen; /* Same screen flag. */
|
| 694 |
+
Tcl_Obj *user_data; /* Application-specific data reference; Tk
|
| 695 |
+
* will decrement the reference count *once*
|
| 696 |
+
* when it has finished processing the
|
| 697 |
+
* event. */
|
| 698 |
+
} XVirtualEvent;
|
| 699 |
+
|
| 700 |
+
typedef struct {
|
| 701 |
+
int type;
|
| 702 |
+
unsigned long serial; /* # of last request processed by server. */
|
| 703 |
+
Bool send_event; /* True if this came from a SendEvent
|
| 704 |
+
* request. */
|
| 705 |
+
Display *display; /* Display the event was read from. */
|
| 706 |
+
Window window; /* Window in which event occurred. */
|
| 707 |
+
} XActivateDeactivateEvent;
|
| 708 |
+
typedef XActivateDeactivateEvent XActivateEvent;
|
| 709 |
+
typedef XActivateDeactivateEvent XDeactivateEvent;
|
| 710 |
+
|
| 711 |
+
/*
|
| 712 |
+
*----------------------------------------------------------------------
|
| 713 |
+
*
|
| 714 |
+
* Macros for querying Tk_Window structures. See the manual entries for
|
| 715 |
+
* documentation.
|
| 716 |
+
*
|
| 717 |
+
*----------------------------------------------------------------------
|
| 718 |
+
*/
|
| 719 |
+
|
| 720 |
+
#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
|
| 721 |
+
#define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum)
|
| 722 |
+
#define Tk_Screen(tkwin) \
|
| 723 |
+
(ScreenOfDisplay(Tk_Display(tkwin), Tk_ScreenNumber(tkwin)))
|
| 724 |
+
#define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth)
|
| 725 |
+
#define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual)
|
| 726 |
+
#define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window)
|
| 727 |
+
#define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName)
|
| 728 |
+
#define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid)
|
| 729 |
+
#define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid)
|
| 730 |
+
#define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x)
|
| 731 |
+
#define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y)
|
| 732 |
+
#define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width)
|
| 733 |
+
#define Tk_Height(tkwin) \
|
| 734 |
+
(((Tk_FakeWin *) (tkwin))->changes.height)
|
| 735 |
+
#define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes)
|
| 736 |
+
#define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts)
|
| 737 |
+
#define Tk_IsEmbedded(tkwin) \
|
| 738 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED)
|
| 739 |
+
#define Tk_IsContainer(tkwin) \
|
| 740 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_CONTAINER)
|
| 741 |
+
#define Tk_IsMapped(tkwin) \
|
| 742 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED)
|
| 743 |
+
#define Tk_IsTopLevel(tkwin) \
|
| 744 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL)
|
| 745 |
+
#define Tk_HasWrapper(tkwin) \
|
| 746 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_HAS_WRAPPER)
|
| 747 |
+
#define Tk_WinManaged(tkwin) \
|
| 748 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED)
|
| 749 |
+
#define Tk_TopWinHierarchy(tkwin) \
|
| 750 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY)
|
| 751 |
+
#define Tk_IsManageable(tkwin) \
|
| 752 |
+
(((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE)
|
| 753 |
+
#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
|
| 754 |
+
#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
|
| 755 |
+
/* Tk_InternalBorderWidth is deprecated */
|
| 756 |
+
#define Tk_InternalBorderWidth(tkwin) \
|
| 757 |
+
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
|
| 758 |
+
#define Tk_InternalBorderLeft(tkwin) \
|
| 759 |
+
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
|
| 760 |
+
#define Tk_InternalBorderRight(tkwin) \
|
| 761 |
+
(((Tk_FakeWin *) (tkwin))->internalBorderRight)
|
| 762 |
+
#define Tk_InternalBorderTop(tkwin) \
|
| 763 |
+
(((Tk_FakeWin *) (tkwin))->internalBorderTop)
|
| 764 |
+
#define Tk_InternalBorderBottom(tkwin) \
|
| 765 |
+
(((Tk_FakeWin *) (tkwin))->internalBorderBottom)
|
| 766 |
+
#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth)
|
| 767 |
+
#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight)
|
| 768 |
+
#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr)
|
| 769 |
+
#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap)
|
| 770 |
+
|
| 771 |
+
/*
|
| 772 |
+
* The structure below is needed by the macros above so that they can access
|
| 773 |
+
* the fields of a Tk_Window. The fields not needed by the macros are declared
|
| 774 |
+
* as "dummyX". The structure has its own type in order to prevent apps from
|
| 775 |
+
* accessing Tk_Window fields except using official macros. WARNING!! The
|
| 776 |
+
* structure definition must be kept consistent with the TkWindow structure in
|
| 777 |
+
* tkInt.h. If you change one, then change the other. See the declaration in
|
| 778 |
+
* tkInt.h for documentation on what the fields are used for internally.
|
| 779 |
+
*/
|
| 780 |
+
|
| 781 |
+
typedef struct Tk_FakeWin {
|
| 782 |
+
Display *display;
|
| 783 |
+
char *dummy1; /* dispPtr */
|
| 784 |
+
int screenNum;
|
| 785 |
+
Visual *visual;
|
| 786 |
+
int depth;
|
| 787 |
+
Window window;
|
| 788 |
+
char *dummy2; /* childList */
|
| 789 |
+
char *dummy3; /* lastChildPtr */
|
| 790 |
+
Tk_Window parentPtr; /* parentPtr */
|
| 791 |
+
char *dummy4; /* nextPtr */
|
| 792 |
+
char *dummy5; /* mainPtr */
|
| 793 |
+
char *pathName;
|
| 794 |
+
Tk_Uid nameUid;
|
| 795 |
+
Tk_Uid classUid;
|
| 796 |
+
XWindowChanges changes;
|
| 797 |
+
unsigned int dummy6; /* dirtyChanges */
|
| 798 |
+
XSetWindowAttributes atts;
|
| 799 |
+
unsigned long dummy7; /* dirtyAtts */
|
| 800 |
+
unsigned int flags;
|
| 801 |
+
char *dummy8; /* handlerList */
|
| 802 |
+
#ifdef TK_USE_INPUT_METHODS
|
| 803 |
+
XIC dummy9; /* inputContext */
|
| 804 |
+
#endif /* TK_USE_INPUT_METHODS */
|
| 805 |
+
ClientData *dummy10; /* tagPtr */
|
| 806 |
+
int dummy11; /* numTags */
|
| 807 |
+
int dummy12; /* optionLevel */
|
| 808 |
+
char *dummy13; /* selHandlerList */
|
| 809 |
+
char *dummy14; /* geomMgrPtr */
|
| 810 |
+
ClientData dummy15; /* geomData */
|
| 811 |
+
int reqWidth, reqHeight;
|
| 812 |
+
int internalBorderLeft;
|
| 813 |
+
char *dummy16; /* wmInfoPtr */
|
| 814 |
+
char *dummy17; /* classProcPtr */
|
| 815 |
+
ClientData dummy18; /* instanceData */
|
| 816 |
+
char *dummy19; /* privatePtr */
|
| 817 |
+
int internalBorderRight;
|
| 818 |
+
int internalBorderTop;
|
| 819 |
+
int internalBorderBottom;
|
| 820 |
+
int minReqWidth;
|
| 821 |
+
int minReqHeight;
|
| 822 |
+
#ifdef TK_USE_INPUT_METHODS
|
| 823 |
+
int dummy20;
|
| 824 |
+
#endif /* TK_USE_INPUT_METHODS */
|
| 825 |
+
char *dummy21; /* geomMgrName */
|
| 826 |
+
Tk_Window dummy22; /* maintainerPtr */
|
| 827 |
+
} Tk_FakeWin;
|
| 828 |
+
|
| 829 |
+
/*
|
| 830 |
+
* Flag values for TkWindow (and Tk_FakeWin) structures are:
|
| 831 |
+
*
|
| 832 |
+
* TK_MAPPED: 1 means window is currently mapped,
|
| 833 |
+
* 0 means unmapped.
|
| 834 |
+
* TK_TOP_LEVEL: 1 means this is a top-level widget.
|
| 835 |
+
* TK_ALREADY_DEAD: 1 means the window is in the process of
|
| 836 |
+
* being destroyed already.
|
| 837 |
+
* TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured
|
| 838 |
+
* before it was made to exist. At the time of
|
| 839 |
+
* making it exist a ConfigureNotify event needs
|
| 840 |
+
* to be generated.
|
| 841 |
+
* TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for details
|
| 842 |
+
* TK_CHECKED_IC: 1 means we've already tried to get an input
|
| 843 |
+
* context for this window; if the ic field is
|
| 844 |
+
* NULL it means that there isn't a context for
|
| 845 |
+
* the field.
|
| 846 |
+
* TK_DONT_DESTROY_WINDOW: 1 means that Tk_DestroyWindow should not
|
| 847 |
+
* invoke XDestroyWindow to destroy this widget's
|
| 848 |
+
* X window. The flag is set when the window has
|
| 849 |
+
* already been destroyed elsewhere (e.g. by
|
| 850 |
+
* another application) or when it will be
|
| 851 |
+
* destroyed later (e.g. by destroying its parent)
|
| 852 |
+
* TK_WM_COLORMAP_WINDOW: 1 means that this window has at some time
|
| 853 |
+
* appeared in the WM_COLORMAP_WINDOWS property
|
| 854 |
+
* for its toplevel, so we have to remove it from
|
| 855 |
+
* that property if the window is deleted and the
|
| 856 |
+
* toplevel isn't.
|
| 857 |
+
* TK_EMBEDDED: 1 means that this window (which must be a
|
| 858 |
+
* toplevel) is not a free-standing window but
|
| 859 |
+
* rather is embedded in some other application.
|
| 860 |
+
* TK_CONTAINER: 1 means that this window is a container, and
|
| 861 |
+
* that some other application (either in this
|
| 862 |
+
* process or elsewhere) may be embedding itself
|
| 863 |
+
* inside the window.
|
| 864 |
+
* TK_BOTH_HALVES: 1 means that this window is used for
|
| 865 |
+
* application embedding (either as container or
|
| 866 |
+
* embedded application), and both the containing
|
| 867 |
+
* and embedded halves are associated with
|
| 868 |
+
* windows in this particular process.
|
| 869 |
+
* TK_WRAPPER: 1 means that this window is the extra wrapper
|
| 870 |
+
* window created around a toplevel to hold the
|
| 871 |
+
* menubar under Unix. See tkUnixWm.c for more
|
| 872 |
+
* information.
|
| 873 |
+
* TK_REPARENTED: 1 means that this window has been reparented
|
| 874 |
+
* so that as far as the window system is
|
| 875 |
+
* concerned it isn't a child of its Tk parent.
|
| 876 |
+
* Initially this is used only for special Unix
|
| 877 |
+
* menubar windows.
|
| 878 |
+
* TK_ANONYMOUS_WINDOW: 1 means that this window has no name, and is
|
| 879 |
+
* thus not accessible from Tk.
|
| 880 |
+
* TK_HAS_WRAPPER 1 means that this window has a wrapper window
|
| 881 |
+
* TK_WIN_MANAGED 1 means that this window is a child of the root
|
| 882 |
+
* window, and is managed by the window manager.
|
| 883 |
+
* TK_TOP_HIERARCHY 1 means this window is at the top of a physical
|
| 884 |
+
* window hierarchy within this process, i.e. the
|
| 885 |
+
* window's parent either doesn't exist or is not
|
| 886 |
+
* owned by this Tk application.
|
| 887 |
+
* TK_PROP_PROPCHANGE 1 means that PropertyNotify events in the
|
| 888 |
+
* window's children should propagate up to this
|
| 889 |
+
* window.
|
| 890 |
+
* TK_WM_MANAGEABLE 1 marks a window as capable of being converted
|
| 891 |
+
* into a toplevel using [wm manage].
|
| 892 |
+
* TK_CAN_INPUT_TEXT 1 means that this window accepts text input.
|
| 893 |
+
* Used on macOS to indicate that key events can be
|
| 894 |
+
* processed with the NSTextInputClient protocol.
|
| 895 |
+
* Not currently accessible through the public API.
|
| 896 |
+
*/
|
| 897 |
+
|
| 898 |
+
#define TK_MAPPED 1
|
| 899 |
+
#define TK_TOP_LEVEL 2
|
| 900 |
+
#define TK_ALREADY_DEAD 4
|
| 901 |
+
#define TK_NEED_CONFIG_NOTIFY 8
|
| 902 |
+
#define TK_GRAB_FLAG 0x10
|
| 903 |
+
#define TK_CHECKED_IC 0x20
|
| 904 |
+
#define TK_DONT_DESTROY_WINDOW 0x40
|
| 905 |
+
#define TK_WM_COLORMAP_WINDOW 0x80
|
| 906 |
+
#define TK_EMBEDDED 0x100
|
| 907 |
+
#define TK_CONTAINER 0x200
|
| 908 |
+
#define TK_BOTH_HALVES 0x400
|
| 909 |
+
|
| 910 |
+
#define TK_WRAPPER 0x1000
|
| 911 |
+
#define TK_REPARENTED 0x2000
|
| 912 |
+
#define TK_ANONYMOUS_WINDOW 0x4000
|
| 913 |
+
#define TK_HAS_WRAPPER 0x8000
|
| 914 |
+
#define TK_WIN_MANAGED 0x10000
|
| 915 |
+
#define TK_TOP_HIERARCHY 0x20000
|
| 916 |
+
#define TK_PROP_PROPCHANGE 0x40000
|
| 917 |
+
#define TK_WM_MANAGEABLE 0x80000
|
| 918 |
+
#define TK_CAN_INPUT_TEXT 0x100000
|
| 919 |
+
|
| 920 |
+
/*
|
| 921 |
+
*----------------------------------------------------------------------
|
| 922 |
+
*
|
| 923 |
+
* Procedure prototypes and structures used for defining new canvas items:
|
| 924 |
+
*
|
| 925 |
+
*----------------------------------------------------------------------
|
| 926 |
+
*/
|
| 927 |
+
|
| 928 |
+
typedef enum {
|
| 929 |
+
TK_STATE_NULL = -1, TK_STATE_ACTIVE, TK_STATE_DISABLED,
|
| 930 |
+
TK_STATE_NORMAL, TK_STATE_HIDDEN
|
| 931 |
+
} Tk_State;
|
| 932 |
+
|
| 933 |
+
typedef struct Tk_SmoothMethod {
|
| 934 |
+
CONST86 char *name;
|
| 935 |
+
int (*coordProc) (Tk_Canvas canvas, double *pointPtr, int numPoints,
|
| 936 |
+
int numSteps, XPoint xPoints[], double dblPoints[]);
|
| 937 |
+
void (*postscriptProc) (Tcl_Interp *interp, Tk_Canvas canvas,
|
| 938 |
+
double *coordPtr, int numPoints, int numSteps);
|
| 939 |
+
} Tk_SmoothMethod;
|
| 940 |
+
|
| 941 |
+
/*
|
| 942 |
+
* For each item in a canvas widget there exists one record with the following
|
| 943 |
+
* structure. Each actual item is represented by a record with the following
|
| 944 |
+
* stuff at its beginning, plus additional type-specific stuff after that.
|
| 945 |
+
*/
|
| 946 |
+
|
| 947 |
+
#define TK_TAG_SPACE 3
|
| 948 |
+
|
| 949 |
+
typedef struct Tk_Item {
|
| 950 |
+
int id; /* Unique identifier for this item (also
|
| 951 |
+
* serves as first tag for item). */
|
| 952 |
+
struct Tk_Item *nextPtr; /* Next in display list of all items in this
|
| 953 |
+
* canvas. Later items in list are drawn on
|
| 954 |
+
* top of earlier ones. */
|
| 955 |
+
Tk_Uid staticTagSpace[TK_TAG_SPACE];
|
| 956 |
+
/* Built-in space for limited # of tags. */
|
| 957 |
+
Tk_Uid *tagPtr; /* Pointer to array of tags. Usually points to
|
| 958 |
+
* staticTagSpace, but may point to malloc-ed
|
| 959 |
+
* space if there are lots of tags. */
|
| 960 |
+
int tagSpace; /* Total amount of tag space available at
|
| 961 |
+
* tagPtr. */
|
| 962 |
+
int numTags; /* Number of tag slots actually used at
|
| 963 |
+
* *tagPtr. */
|
| 964 |
+
struct Tk_ItemType *typePtr;/* Table of procedures that implement this
|
| 965 |
+
* type of item. */
|
| 966 |
+
int x1, y1, x2, y2; /* Bounding box for item, in integer canvas
|
| 967 |
+
* units. Set by item-specific code and
|
| 968 |
+
* guaranteed to contain every pixel drawn in
|
| 969 |
+
* item. Item area includes x1 and y1 but not
|
| 970 |
+
* x2 and y2. */
|
| 971 |
+
struct Tk_Item *prevPtr; /* Previous in display list of all items in
|
| 972 |
+
* this canvas. Later items in list are drawn
|
| 973 |
+
* just below earlier ones. */
|
| 974 |
+
Tk_State state; /* State of item. */
|
| 975 |
+
char *reserved1; /* reserved for future use */
|
| 976 |
+
int redraw_flags; /* Some flags used in the canvas */
|
| 977 |
+
|
| 978 |
+
/*
|
| 979 |
+
*------------------------------------------------------------------
|
| 980 |
+
* Starting here is additional type-specific stuff; see the declarations
|
| 981 |
+
* for individual types to see what is part of each type. The actual space
|
| 982 |
+
* below is determined by the "itemInfoSize" of the type's Tk_ItemType
|
| 983 |
+
* record.
|
| 984 |
+
*------------------------------------------------------------------
|
| 985 |
+
*/
|
| 986 |
+
} Tk_Item;
|
| 987 |
+
|
| 988 |
+
/*
|
| 989 |
+
* Flag bits for canvases (redraw_flags):
|
| 990 |
+
*
|
| 991 |
+
* TK_ITEM_STATE_DEPENDANT - 1 means that object needs to be redrawn if the
|
| 992 |
+
* canvas state changes.
|
| 993 |
+
* TK_ITEM_DONT_REDRAW - 1 means that the object redraw is already been
|
| 994 |
+
* prepared, so the general canvas code doesn't
|
| 995 |
+
* need to do that any more.
|
| 996 |
+
*/
|
| 997 |
+
|
| 998 |
+
#define TK_ITEM_STATE_DEPENDANT 1
|
| 999 |
+
#define TK_ITEM_DONT_REDRAW 2
|
| 1000 |
+
|
| 1001 |
+
/*
|
| 1002 |
+
* Records of the following type are used to describe a type of item (e.g.
|
| 1003 |
+
* lines, circles, etc.) that can form part of a canvas widget.
|
| 1004 |
+
*/
|
| 1005 |
+
|
| 1006 |
+
#ifdef USE_OLD_CANVAS
|
| 1007 |
+
typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1008 |
+
Tk_Item *itemPtr, int argc, char **argv);
|
| 1009 |
+
typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1010 |
+
Tk_Item *itemPtr, int argc, char **argv, int flags);
|
| 1011 |
+
typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1012 |
+
Tk_Item *itemPtr, int argc, char **argv);
|
| 1013 |
+
#else
|
| 1014 |
+
typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1015 |
+
Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
|
| 1016 |
+
typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1017 |
+
Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[],
|
| 1018 |
+
int flags);
|
| 1019 |
+
typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1020 |
+
Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
|
| 1021 |
+
#endif /* USE_OLD_CANVAS */
|
| 1022 |
+
typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1023 |
+
Display *display);
|
| 1024 |
+
typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1025 |
+
Display *display, Drawable dst, int x, int y, int width,
|
| 1026 |
+
int height);
|
| 1027 |
+
typedef double (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1028 |
+
double *pointPtr);
|
| 1029 |
+
typedef int (Tk_ItemAreaProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1030 |
+
double *rectPtr);
|
| 1031 |
+
typedef int (Tk_ItemPostscriptProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1032 |
+
Tk_Item *itemPtr, int prepass);
|
| 1033 |
+
typedef void (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1034 |
+
double originX, double originY, double scaleX,
|
| 1035 |
+
double scaleY);
|
| 1036 |
+
typedef void (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1037 |
+
double deltaX, double deltaY);
|
| 1038 |
+
#ifdef USE_OLD_CANVAS
|
| 1039 |
+
typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1040 |
+
Tk_Item *itemPtr, char *indexString, int *indexPtr);
|
| 1041 |
+
#else
|
| 1042 |
+
typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 1043 |
+
Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr);
|
| 1044 |
+
#endif /* USE_OLD_CANVAS */
|
| 1045 |
+
typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1046 |
+
int index);
|
| 1047 |
+
typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1048 |
+
int offset, char *buffer, int maxBytes);
|
| 1049 |
+
#ifdef USE_OLD_CANVAS
|
| 1050 |
+
typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1051 |
+
int beforeThis, char *string);
|
| 1052 |
+
#else
|
| 1053 |
+
typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1054 |
+
int beforeThis, Tcl_Obj *string);
|
| 1055 |
+
#endif /* USE_OLD_CANVAS */
|
| 1056 |
+
typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
|
| 1057 |
+
int first, int last);
|
| 1058 |
+
|
| 1059 |
+
#ifndef __NO_OLD_CONFIG
|
| 1060 |
+
|
| 1061 |
+
typedef struct Tk_ItemType {
|
| 1062 |
+
CONST86 char *name; /* The name of this type of item, such as
|
| 1063 |
+
* "line". */
|
| 1064 |
+
int itemSize; /* Total amount of space needed for item's
|
| 1065 |
+
* record. */
|
| 1066 |
+
Tk_ItemCreateProc *createProc;
|
| 1067 |
+
/* Procedure to create a new item of this
|
| 1068 |
+
* type. */
|
| 1069 |
+
CONST86 Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for
|
| 1070 |
+
* this type. Used for returning configuration
|
| 1071 |
+
* info. */
|
| 1072 |
+
Tk_ItemConfigureProc *configProc;
|
| 1073 |
+
/* Procedure to call to change configuration
|
| 1074 |
+
* options. */
|
| 1075 |
+
Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's
|
| 1076 |
+
* coordinates. */
|
| 1077 |
+
Tk_ItemDeleteProc *deleteProc;
|
| 1078 |
+
/* Procedure to delete existing item of this
|
| 1079 |
+
* type. */
|
| 1080 |
+
Tk_ItemDisplayProc *displayProc;
|
| 1081 |
+
/* Procedure to display items of this type. */
|
| 1082 |
+
int alwaysRedraw; /* Non-zero means displayProc should be called
|
| 1083 |
+
* even when the item has been moved
|
| 1084 |
+
* off-screen. */
|
| 1085 |
+
Tk_ItemPointProc *pointProc;/* Computes distance from item to a given
|
| 1086 |
+
* point. */
|
| 1087 |
+
Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside,
|
| 1088 |
+
* or overlapping an area. */
|
| 1089 |
+
Tk_ItemPostscriptProc *postscriptProc;
|
| 1090 |
+
/* Procedure to write a Postscript description
|
| 1091 |
+
* for items of this type. */
|
| 1092 |
+
Tk_ItemScaleProc *scaleProc;/* Procedure to rescale items of this type. */
|
| 1093 |
+
Tk_ItemTranslateProc *translateProc;
|
| 1094 |
+
/* Procedure to translate items of this
|
| 1095 |
+
* type. */
|
| 1096 |
+
Tk_ItemIndexProc *indexProc;/* Procedure to determine index of indicated
|
| 1097 |
+
* character. NULL if item doesn't support
|
| 1098 |
+
* indexing. */
|
| 1099 |
+
Tk_ItemCursorProc *icursorProc;
|
| 1100 |
+
/* Procedure to set insert cursor posn to just
|
| 1101 |
+
* before a given position. */
|
| 1102 |
+
Tk_ItemSelectionProc *selectionProc;
|
| 1103 |
+
/* Procedure to return selection (in STRING
|
| 1104 |
+
* format) when it is in this item. */
|
| 1105 |
+
Tk_ItemInsertProc *insertProc;
|
| 1106 |
+
/* Procedure to insert something into an
|
| 1107 |
+
* item. */
|
| 1108 |
+
Tk_ItemDCharsProc *dCharsProc;
|
| 1109 |
+
/* Procedure to delete characters from an
|
| 1110 |
+
* item. */
|
| 1111 |
+
struct Tk_ItemType *nextPtr;/* Used to link types together into a list. */
|
| 1112 |
+
char *reserved1; /* Reserved for future extension. */
|
| 1113 |
+
int reserved2; /* Carefully compatible with */
|
| 1114 |
+
char *reserved3; /* Jan Nijtmans dash patch */
|
| 1115 |
+
char *reserved4;
|
| 1116 |
+
} Tk_ItemType;
|
| 1117 |
+
|
| 1118 |
+
/*
|
| 1119 |
+
* Flag (used in the alwaysRedraw field) to say whether an item supports
|
| 1120 |
+
* point-level manipulation like the line and polygon items.
|
| 1121 |
+
*/
|
| 1122 |
+
|
| 1123 |
+
#define TK_MOVABLE_POINTS 2
|
| 1124 |
+
|
| 1125 |
+
#endif /* __NO_OLD_CONFIG */
|
| 1126 |
+
|
| 1127 |
+
/*
|
| 1128 |
+
* The following structure provides information about the selection and the
|
| 1129 |
+
* insertion cursor. It is needed by only a few items, such as those that
|
| 1130 |
+
* display text. It is shared by the generic canvas code and the item-specific
|
| 1131 |
+
* code, but most of the fields should be written only by the canvas generic
|
| 1132 |
+
* code.
|
| 1133 |
+
*/
|
| 1134 |
+
|
| 1135 |
+
typedef struct Tk_CanvasTextInfo {
|
| 1136 |
+
Tk_3DBorder selBorder; /* Border and background for selected
|
| 1137 |
+
* characters. Read-only to items.*/
|
| 1138 |
+
int selBorderWidth; /* Width of border around selection. Read-only
|
| 1139 |
+
* to items. */
|
| 1140 |
+
XColor *selFgColorPtr; /* Foreground color for selected text.
|
| 1141 |
+
* Read-only to items. */
|
| 1142 |
+
Tk_Item *selItemPtr; /* Pointer to selected item. NULL means
|
| 1143 |
+
* selection isn't in this canvas. Writable by
|
| 1144 |
+
* items. */
|
| 1145 |
+
int selectFirst; /* Character index of first selected
|
| 1146 |
+
* character. Writable by items. */
|
| 1147 |
+
int selectLast; /* Character index of last selected character.
|
| 1148 |
+
* Writable by items. */
|
| 1149 |
+
Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not
|
| 1150 |
+
* necessarily selItemPtr. Read-only to
|
| 1151 |
+
* items. */
|
| 1152 |
+
int selectAnchor; /* Character index of fixed end of selection
|
| 1153 |
+
* (i.e. "select to" operation will use this
|
| 1154 |
+
* as one end of the selection). Writable by
|
| 1155 |
+
* items. */
|
| 1156 |
+
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
|
| 1157 |
+
* cursor. Read-only to items. */
|
| 1158 |
+
int insertWidth; /* Total width of insertion cursor. Read-only
|
| 1159 |
+
* to items. */
|
| 1160 |
+
int insertBorderWidth; /* Width of 3-D border around insert cursor.
|
| 1161 |
+
* Read-only to items. */
|
| 1162 |
+
Tk_Item *focusItemPtr; /* Item that currently has the input focus, or
|
| 1163 |
+
* NULL if no such item. Read-only to items. */
|
| 1164 |
+
int gotFocus; /* Non-zero means that the canvas widget has
|
| 1165 |
+
* the input focus. Read-only to items.*/
|
| 1166 |
+
int cursorOn; /* Non-zero means that an insertion cursor
|
| 1167 |
+
* should be displayed in focusItemPtr.
|
| 1168 |
+
* Read-only to items.*/
|
| 1169 |
+
} Tk_CanvasTextInfo;
|
| 1170 |
+
|
| 1171 |
+
/*
|
| 1172 |
+
* Structures used for Dashing and Outline.
|
| 1173 |
+
*/
|
| 1174 |
+
|
| 1175 |
+
typedef struct Tk_Dash {
|
| 1176 |
+
int number;
|
| 1177 |
+
union {
|
| 1178 |
+
char *pt;
|
| 1179 |
+
char array[sizeof(char *)];
|
| 1180 |
+
} pattern;
|
| 1181 |
+
} Tk_Dash;
|
| 1182 |
+
|
| 1183 |
+
typedef struct Tk_TSOffset {
|
| 1184 |
+
int flags; /* Flags; see below for possible values */
|
| 1185 |
+
int xoffset; /* x offset */
|
| 1186 |
+
int yoffset; /* y offset */
|
| 1187 |
+
} Tk_TSOffset;
|
| 1188 |
+
|
| 1189 |
+
/*
|
| 1190 |
+
* Bit fields in Tk_TSOffset->flags:
|
| 1191 |
+
*/
|
| 1192 |
+
|
| 1193 |
+
#define TK_OFFSET_INDEX 1
|
| 1194 |
+
#define TK_OFFSET_RELATIVE 2
|
| 1195 |
+
#define TK_OFFSET_LEFT 4
|
| 1196 |
+
#define TK_OFFSET_CENTER 8
|
| 1197 |
+
#define TK_OFFSET_RIGHT 16
|
| 1198 |
+
#define TK_OFFSET_TOP 32
|
| 1199 |
+
#define TK_OFFSET_MIDDLE 64
|
| 1200 |
+
#define TK_OFFSET_BOTTOM 128
|
| 1201 |
+
|
| 1202 |
+
typedef struct Tk_Outline {
|
| 1203 |
+
GC gc; /* Graphics context. */
|
| 1204 |
+
double width; /* Width of outline. */
|
| 1205 |
+
double activeWidth; /* Width of outline. */
|
| 1206 |
+
double disabledWidth; /* Width of outline. */
|
| 1207 |
+
int offset; /* Dash offset. */
|
| 1208 |
+
Tk_Dash dash; /* Dash pattern. */
|
| 1209 |
+
Tk_Dash activeDash; /* Dash pattern if state is active. */
|
| 1210 |
+
Tk_Dash disabledDash; /* Dash pattern if state is disabled. */
|
| 1211 |
+
void *reserved1; /* Reserved for future expansion. */
|
| 1212 |
+
void *reserved2;
|
| 1213 |
+
void *reserved3;
|
| 1214 |
+
Tk_TSOffset tsoffset; /* Stipple offset for outline. */
|
| 1215 |
+
XColor *color; /* Outline color. */
|
| 1216 |
+
XColor *activeColor; /* Outline color if state is active. */
|
| 1217 |
+
XColor *disabledColor; /* Outline color if state is disabled. */
|
| 1218 |
+
Pixmap stipple; /* Outline Stipple pattern. */
|
| 1219 |
+
Pixmap activeStipple; /* Outline Stipple pattern if state is
|
| 1220 |
+
* active. */
|
| 1221 |
+
Pixmap disabledStipple; /* Outline Stipple pattern if state is
|
| 1222 |
+
* disabled. */
|
| 1223 |
+
} Tk_Outline;
|
| 1224 |
+
|
| 1225 |
+
/*
|
| 1226 |
+
*----------------------------------------------------------------------
|
| 1227 |
+
*
|
| 1228 |
+
* Procedure prototypes and structures used for managing images:
|
| 1229 |
+
*
|
| 1230 |
+
*----------------------------------------------------------------------
|
| 1231 |
+
*/
|
| 1232 |
+
|
| 1233 |
+
typedef struct Tk_ImageType Tk_ImageType;
|
| 1234 |
+
#ifdef USE_OLD_IMAGE
|
| 1235 |
+
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
|
| 1236 |
+
char **argv, Tk_ImageType *typePtr, Tk_ImageMaster model,
|
| 1237 |
+
ClientData *clientDataPtr);
|
| 1238 |
+
#else
|
| 1239 |
+
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc,
|
| 1240 |
+
Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster model,
|
| 1241 |
+
ClientData *clientDataPtr);
|
| 1242 |
+
#endif /* USE_OLD_IMAGE */
|
| 1243 |
+
typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData clientData);
|
| 1244 |
+
typedef void (Tk_ImageDisplayProc) (ClientData clientData, Display *display,
|
| 1245 |
+
Drawable drawable, int imageX, int imageY, int width, int height,
|
| 1246 |
+
int drawableX, int drawableY);
|
| 1247 |
+
typedef void (Tk_ImageFreeProc) (ClientData clientData, Display *display);
|
| 1248 |
+
typedef void (Tk_ImageDeleteProc) (ClientData clientData);
|
| 1249 |
+
typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y,
|
| 1250 |
+
int width, int height, int imageWidth, int imageHeight);
|
| 1251 |
+
typedef int (Tk_ImagePostscriptProc) (ClientData clientData,
|
| 1252 |
+
Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo,
|
| 1253 |
+
int x, int y, int width, int height, int prepass);
|
| 1254 |
+
|
| 1255 |
+
/*
|
| 1256 |
+
* The following structure represents a particular type of image (bitmap, xpm
|
| 1257 |
+
* image, etc.). It provides information common to all images of that type,
|
| 1258 |
+
* such as the type name and a collection of procedures in the image manager
|
| 1259 |
+
* that respond to various events. Each image manager is represented by one of
|
| 1260 |
+
* these structures.
|
| 1261 |
+
*/
|
| 1262 |
+
|
| 1263 |
+
struct Tk_ImageType {
|
| 1264 |
+
CONST86 char *name; /* Name of image type. */
|
| 1265 |
+
Tk_ImageCreateProc *createProc;
|
| 1266 |
+
/* Procedure to call to create a new image of
|
| 1267 |
+
* this type. */
|
| 1268 |
+
Tk_ImageGetProc *getProc; /* Procedure to call the first time
|
| 1269 |
+
* Tk_GetImage is called in a new way (new
|
| 1270 |
+
* visual or screen). */
|
| 1271 |
+
Tk_ImageDisplayProc *displayProc;
|
| 1272 |
+
/* Call to draw image, in response to
|
| 1273 |
+
* Tk_RedrawImage calls. */
|
| 1274 |
+
Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage is
|
| 1275 |
+
* called to release an instance of an
|
| 1276 |
+
* image. */
|
| 1277 |
+
Tk_ImageDeleteProc *deleteProc;
|
| 1278 |
+
/* Procedure to call to delete image. It will
|
| 1279 |
+
* not be called until after freeProc has been
|
| 1280 |
+
* called for each instance of the image. */
|
| 1281 |
+
Tk_ImagePostscriptProc *postscriptProc;
|
| 1282 |
+
/* Procedure to call to produce postscript
|
| 1283 |
+
* output for the image. */
|
| 1284 |
+
struct Tk_ImageType *nextPtr;
|
| 1285 |
+
/* Next in list of all image types currently
|
| 1286 |
+
* known. Filled in by Tk, not by image
|
| 1287 |
+
* manager. */
|
| 1288 |
+
char *reserved; /* reserved for future expansion */
|
| 1289 |
+
};
|
| 1290 |
+
|
| 1291 |
+
/*
|
| 1292 |
+
*----------------------------------------------------------------------
|
| 1293 |
+
*
|
| 1294 |
+
* Additional definitions used to manage images of type "photo".
|
| 1295 |
+
*
|
| 1296 |
+
*----------------------------------------------------------------------
|
| 1297 |
+
*/
|
| 1298 |
+
|
| 1299 |
+
/*
|
| 1300 |
+
* The following type is used to identify a particular photo image to be
|
| 1301 |
+
* manipulated:
|
| 1302 |
+
*/
|
| 1303 |
+
|
| 1304 |
+
typedef void *Tk_PhotoHandle;
|
| 1305 |
+
|
| 1306 |
+
/*
|
| 1307 |
+
* The following structure describes a block of pixels in memory:
|
| 1308 |
+
*/
|
| 1309 |
+
|
| 1310 |
+
typedef struct Tk_PhotoImageBlock {
|
| 1311 |
+
unsigned char *pixelPtr; /* Pointer to the first pixel. */
|
| 1312 |
+
int width; /* Width of block, in pixels. */
|
| 1313 |
+
int height; /* Height of block, in pixels. */
|
| 1314 |
+
int pitch; /* Address difference between corresponding
|
| 1315 |
+
* pixels in successive lines. */
|
| 1316 |
+
int pixelSize; /* Address difference between successive
|
| 1317 |
+
* pixels in the same line. */
|
| 1318 |
+
int offset[4]; /* Address differences between the red, green,
|
| 1319 |
+
* blue and alpha components of the pixel and
|
| 1320 |
+
* the pixel as a whole. */
|
| 1321 |
+
} Tk_PhotoImageBlock;
|
| 1322 |
+
|
| 1323 |
+
/*
|
| 1324 |
+
* The following values control how blocks are combined into photo images when
|
| 1325 |
+
* the alpha component of a pixel is not 255, a.k.a. the compositing rule.
|
| 1326 |
+
*/
|
| 1327 |
+
|
| 1328 |
+
#define TK_PHOTO_COMPOSITE_OVERLAY 0
|
| 1329 |
+
#define TK_PHOTO_COMPOSITE_SET 1
|
| 1330 |
+
|
| 1331 |
+
/*
|
| 1332 |
+
* Procedure prototypes and structures used in reading and writing photo
|
| 1333 |
+
* images:
|
| 1334 |
+
*/
|
| 1335 |
+
|
| 1336 |
+
typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
|
| 1337 |
+
#ifdef USE_OLD_IMAGE
|
| 1338 |
+
typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName,
|
| 1339 |
+
char *formatString, int *widthPtr, int *heightPtr);
|
| 1340 |
+
typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString,
|
| 1341 |
+
int *widthPtr, int *heightPtr);
|
| 1342 |
+
typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan,
|
| 1343 |
+
char *fileName, char *formatString, Tk_PhotoHandle imageHandle,
|
| 1344 |
+
int destX, int destY, int width, int height, int srcX, int srcY);
|
| 1345 |
+
typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string,
|
| 1346 |
+
char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY,
|
| 1347 |
+
int width, int height, int srcX, int srcY);
|
| 1348 |
+
typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName,
|
| 1349 |
+
char *formatString, Tk_PhotoImageBlock *blockPtr);
|
| 1350 |
+
typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp,
|
| 1351 |
+
Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr);
|
| 1352 |
+
#else
|
| 1353 |
+
typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName,
|
| 1354 |
+
Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp);
|
| 1355 |
+
typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format,
|
| 1356 |
+
int *widthPtr, int *heightPtr, Tcl_Interp *interp);
|
| 1357 |
+
typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan,
|
| 1358 |
+
const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle,
|
| 1359 |
+
int destX, int destY, int width, int height, int srcX, int srcY);
|
| 1360 |
+
typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj,
|
| 1361 |
+
Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY,
|
| 1362 |
+
int width, int height, int srcX, int srcY);
|
| 1363 |
+
typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName,
|
| 1364 |
+
Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
|
| 1365 |
+
typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format,
|
| 1366 |
+
Tk_PhotoImageBlock *blockPtr);
|
| 1367 |
+
#endif /* USE_OLD_IMAGE */
|
| 1368 |
+
|
| 1369 |
+
/*
|
| 1370 |
+
* The following structure represents a particular file format for storing
|
| 1371 |
+
* images (e.g., PPM, GIF, JPEG, etc.). It provides information to allow image
|
| 1372 |
+
* files of that format to be recognized and read into a photo image.
|
| 1373 |
+
*/
|
| 1374 |
+
|
| 1375 |
+
struct Tk_PhotoImageFormat {
|
| 1376 |
+
CONST86 char *name; /* Name of image file format */
|
| 1377 |
+
Tk_ImageFileMatchProc *fileMatchProc;
|
| 1378 |
+
/* Procedure to call to determine whether an
|
| 1379 |
+
* image file matches this format. */
|
| 1380 |
+
Tk_ImageStringMatchProc *stringMatchProc;
|
| 1381 |
+
/* Procedure to call to determine whether the
|
| 1382 |
+
* data in a string matches this format. */
|
| 1383 |
+
Tk_ImageFileReadProc *fileReadProc;
|
| 1384 |
+
/* Procedure to call to read data from an
|
| 1385 |
+
* image file into a photo image. */
|
| 1386 |
+
Tk_ImageStringReadProc *stringReadProc;
|
| 1387 |
+
/* Procedure to call to read data from a
|
| 1388 |
+
* string into a photo image. */
|
| 1389 |
+
Tk_ImageFileWriteProc *fileWriteProc;
|
| 1390 |
+
/* Procedure to call to write data from a
|
| 1391 |
+
* photo image to a file. */
|
| 1392 |
+
Tk_ImageStringWriteProc *stringWriteProc;
|
| 1393 |
+
/* Procedure to call to obtain a string
|
| 1394 |
+
* representation of the data in a photo
|
| 1395 |
+
* image.*/
|
| 1396 |
+
struct Tk_PhotoImageFormat *nextPtr;
|
| 1397 |
+
/* Next in list of all photo image formats
|
| 1398 |
+
* currently known. Filled in by Tk, not by
|
| 1399 |
+
* image format handler. */
|
| 1400 |
+
};
|
| 1401 |
+
|
| 1402 |
+
/*
|
| 1403 |
+
*----------------------------------------------------------------------
|
| 1404 |
+
*
|
| 1405 |
+
* Procedure prototypes and structures used for managing styles:
|
| 1406 |
+
*
|
| 1407 |
+
*----------------------------------------------------------------------
|
| 1408 |
+
*/
|
| 1409 |
+
|
| 1410 |
+
/*
|
| 1411 |
+
* Style support version tag.
|
| 1412 |
+
*/
|
| 1413 |
+
|
| 1414 |
+
#define TK_STYLE_VERSION_1 0x1
|
| 1415 |
+
#define TK_STYLE_VERSION TK_STYLE_VERSION_1
|
| 1416 |
+
|
| 1417 |
+
/*
|
| 1418 |
+
* The following structures and prototypes are used as static templates to
|
| 1419 |
+
* declare widget elements.
|
| 1420 |
+
*/
|
| 1421 |
+
|
| 1422 |
+
typedef void (Tk_GetElementSizeProc) (ClientData clientData, char *recordPtr,
|
| 1423 |
+
const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int width,
|
| 1424 |
+
int height, int inner, int *widthPtr, int *heightPtr);
|
| 1425 |
+
typedef void (Tk_GetElementBoxProc) (ClientData clientData, char *recordPtr,
|
| 1426 |
+
const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int x, int y,
|
| 1427 |
+
int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr,
|
| 1428 |
+
int *heightPtr);
|
| 1429 |
+
typedef int (Tk_GetElementBorderWidthProc) (ClientData clientData,
|
| 1430 |
+
char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin);
|
| 1431 |
+
typedef void (Tk_DrawElementProc) (ClientData clientData, char *recordPtr,
|
| 1432 |
+
const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, Drawable d, int x,
|
| 1433 |
+
int y, int width, int height, int state);
|
| 1434 |
+
|
| 1435 |
+
typedef struct Tk_ElementOptionSpec {
|
| 1436 |
+
char *name; /* Name of the required option. */
|
| 1437 |
+
Tk_OptionType type; /* Accepted option type. TK_OPTION_END means
|
| 1438 |
+
* any. */
|
| 1439 |
+
} Tk_ElementOptionSpec;
|
| 1440 |
+
|
| 1441 |
+
typedef struct Tk_ElementSpec {
|
| 1442 |
+
int version; /* Version of the style support. */
|
| 1443 |
+
char *name; /* Name of element. */
|
| 1444 |
+
Tk_ElementOptionSpec *options;
|
| 1445 |
+
/* List of required options. Last one's name
|
| 1446 |
+
* must be NULL. */
|
| 1447 |
+
Tk_GetElementSizeProc *getSize;
|
| 1448 |
+
/* Compute the external (resp. internal) size
|
| 1449 |
+
* of the element from its desired internal
|
| 1450 |
+
* (resp. external) size. */
|
| 1451 |
+
Tk_GetElementBoxProc *getBox;
|
| 1452 |
+
/* Compute the inscribed or bounding boxes
|
| 1453 |
+
* within a given area. */
|
| 1454 |
+
Tk_GetElementBorderWidthProc *getBorderWidth;
|
| 1455 |
+
/* Return the element's internal border width.
|
| 1456 |
+
* Mostly useful for widgets. */
|
| 1457 |
+
Tk_DrawElementProc *draw; /* Draw the element in the given bounding
|
| 1458 |
+
* box. */
|
| 1459 |
+
} Tk_ElementSpec;
|
| 1460 |
+
|
| 1461 |
+
/*
|
| 1462 |
+
* Element state flags. Can be OR'ed.
|
| 1463 |
+
*/
|
| 1464 |
+
|
| 1465 |
+
#define TK_ELEMENT_STATE_ACTIVE 1<<0
|
| 1466 |
+
#define TK_ELEMENT_STATE_DISABLED 1<<1
|
| 1467 |
+
#define TK_ELEMENT_STATE_FOCUS 1<<2
|
| 1468 |
+
#define TK_ELEMENT_STATE_PRESSED 1<<3
|
| 1469 |
+
|
| 1470 |
+
/*
|
| 1471 |
+
*----------------------------------------------------------------------
|
| 1472 |
+
*
|
| 1473 |
+
* The definitions below provide backward compatibility for functions and
|
| 1474 |
+
* types related to event handling that used to be in Tk but have moved to
|
| 1475 |
+
* Tcl.
|
| 1476 |
+
*
|
| 1477 |
+
*----------------------------------------------------------------------
|
| 1478 |
+
*/
|
| 1479 |
+
|
| 1480 |
+
#define TK_READABLE TCL_READABLE
|
| 1481 |
+
#define TK_WRITABLE TCL_WRITABLE
|
| 1482 |
+
#define TK_EXCEPTION TCL_EXCEPTION
|
| 1483 |
+
|
| 1484 |
+
#define TK_DONT_WAIT TCL_DONT_WAIT
|
| 1485 |
+
#define TK_X_EVENTS TCL_WINDOW_EVENTS
|
| 1486 |
+
#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS
|
| 1487 |
+
#define TK_FILE_EVENTS TCL_FILE_EVENTS
|
| 1488 |
+
#define TK_TIMER_EVENTS TCL_TIMER_EVENTS
|
| 1489 |
+
#define TK_IDLE_EVENTS TCL_IDLE_EVENTS
|
| 1490 |
+
#define TK_ALL_EVENTS TCL_ALL_EVENTS
|
| 1491 |
+
|
| 1492 |
+
#define Tk_IdleProc Tcl_IdleProc
|
| 1493 |
+
#define Tk_FileProc Tcl_FileProc
|
| 1494 |
+
#define Tk_TimerProc Tcl_TimerProc
|
| 1495 |
+
#define Tk_TimerToken Tcl_TimerToken
|
| 1496 |
+
|
| 1497 |
+
#define Tk_BackgroundError Tcl_BackgroundError
|
| 1498 |
+
#define Tk_CancelIdleCall Tcl_CancelIdleCall
|
| 1499 |
+
#define Tk_CreateFileHandler Tcl_CreateFileHandler
|
| 1500 |
+
#define Tk_CreateTimerHandler Tcl_CreateTimerHandler
|
| 1501 |
+
#define Tk_DeleteFileHandler Tcl_DeleteFileHandler
|
| 1502 |
+
#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler
|
| 1503 |
+
#define Tk_DoOneEvent Tcl_DoOneEvent
|
| 1504 |
+
#define Tk_DoWhenIdle Tcl_DoWhenIdle
|
| 1505 |
+
#define Tk_Sleep Tcl_Sleep
|
| 1506 |
+
|
| 1507 |
+
/* Additional stuff that has moved to Tcl: */
|
| 1508 |
+
|
| 1509 |
+
#define Tk_EventuallyFree Tcl_EventuallyFree
|
| 1510 |
+
#define Tk_FreeProc Tcl_FreeProc
|
| 1511 |
+
#define Tk_Preserve Tcl_Preserve
|
| 1512 |
+
#define Tk_Release Tcl_Release
|
| 1513 |
+
|
| 1514 |
+
/* Removed Tk_Main, use macro instead */
|
| 1515 |
+
#if defined(_WIN32) || defined(__CYGWIN__)
|
| 1516 |
+
#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
|
| 1517 |
+
(Tcl_FindExecutable(0), (Tcl_CreateInterp)()))
|
| 1518 |
+
#else
|
| 1519 |
+
#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
|
| 1520 |
+
(Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
|
| 1521 |
+
#endif
|
| 1522 |
+
const char * Tk_InitStubs(Tcl_Interp *interp, const char *version,
|
| 1523 |
+
int exact);
|
| 1524 |
+
EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp,
|
| 1525 |
+
const char *version, int exact);
|
| 1526 |
+
|
| 1527 |
+
#ifndef USE_TK_STUBS
|
| 1528 |
+
#define Tk_InitStubs(interp, version, exact) \
|
| 1529 |
+
Tk_PkgInitStubsCheck(interp, version, exact)
|
| 1530 |
+
#endif /* USE_TK_STUBS */
|
| 1531 |
+
|
| 1532 |
+
#define Tk_InitImageArgs(interp, argc, argv) /**/
|
| 1533 |
+
|
| 1534 |
+
/*
|
| 1535 |
+
*----------------------------------------------------------------------
|
| 1536 |
+
*
|
| 1537 |
+
* Additional procedure types defined by Tk.
|
| 1538 |
+
*
|
| 1539 |
+
*----------------------------------------------------------------------
|
| 1540 |
+
*/
|
| 1541 |
+
|
| 1542 |
+
typedef int (Tk_ErrorProc) (ClientData clientData, XErrorEvent *errEventPtr);
|
| 1543 |
+
typedef void (Tk_EventProc) (ClientData clientData, XEvent *eventPtr);
|
| 1544 |
+
typedef int (Tk_GenericProc) (ClientData clientData, XEvent *eventPtr);
|
| 1545 |
+
typedef int (Tk_ClientMessageProc) (Tk_Window tkwin, XEvent *eventPtr);
|
| 1546 |
+
typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp,
|
| 1547 |
+
CONST86 char *portion);
|
| 1548 |
+
typedef void (Tk_LostSelProc) (ClientData clientData);
|
| 1549 |
+
typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData,
|
| 1550 |
+
XEvent *eventPtr);
|
| 1551 |
+
typedef int (Tk_SelectionProc) (ClientData clientData, int offset,
|
| 1552 |
+
char *buffer, int maxBytes);
|
| 1553 |
+
|
| 1554 |
+
/*
|
| 1555 |
+
*----------------------------------------------------------------------
|
| 1556 |
+
*
|
| 1557 |
+
* Platform independent exported procedures and variables.
|
| 1558 |
+
*
|
| 1559 |
+
*----------------------------------------------------------------------
|
| 1560 |
+
*/
|
| 1561 |
+
|
| 1562 |
+
#include "tkDecls.h"
|
| 1563 |
+
|
| 1564 |
+
#ifdef USE_OLD_IMAGE
|
| 1565 |
+
#undef Tk_CreateImageType
|
| 1566 |
+
#define Tk_CreateImageType Tk_CreateOldImageType
|
| 1567 |
+
#undef Tk_CreatePhotoImageFormat
|
| 1568 |
+
#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
|
| 1569 |
+
#endif /* USE_OLD_IMAGE */
|
| 1570 |
+
|
| 1571 |
+
/*
|
| 1572 |
+
*----------------------------------------------------------------------
|
| 1573 |
+
*
|
| 1574 |
+
* Allow users to say that they don't want to alter their source to add extra
|
| 1575 |
+
* arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK.
|
| 1576 |
+
*
|
| 1577 |
+
* This goes after the inclusion of the stubbed-decls so that the declarations
|
| 1578 |
+
* of what is actually there can be correct.
|
| 1579 |
+
*/
|
| 1580 |
+
|
| 1581 |
+
#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
|
| 1582 |
+
# ifdef Tk_PhotoPutBlock
|
| 1583 |
+
# undef Tk_PhotoPutBlock
|
| 1584 |
+
# endif
|
| 1585 |
+
# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite
|
| 1586 |
+
# ifdef Tk_PhotoPutZoomedBlock
|
| 1587 |
+
# undef Tk_PhotoPutZoomedBlock
|
| 1588 |
+
# endif
|
| 1589 |
+
# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite
|
| 1590 |
+
# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE
|
| 1591 |
+
#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
|
| 1592 |
+
# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
|
| 1593 |
+
# ifdef Tk_PhotoPutBlock
|
| 1594 |
+
# undef Tk_PhotoPutBlock
|
| 1595 |
+
# endif
|
| 1596 |
+
# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic
|
| 1597 |
+
# ifdef Tk_PhotoPutZoomedBlock
|
| 1598 |
+
# undef Tk_PhotoPutZoomedBlock
|
| 1599 |
+
# endif
|
| 1600 |
+
# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic
|
| 1601 |
+
# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
|
| 1602 |
+
#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
|
| 1603 |
+
#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
|
| 1604 |
+
# ifdef Tk_PhotoExpand
|
| 1605 |
+
# undef Tk_PhotoExpand
|
| 1606 |
+
# endif
|
| 1607 |
+
# define Tk_PhotoExpand Tk_PhotoExpand_Panic
|
| 1608 |
+
# ifdef Tk_PhotoSetSize
|
| 1609 |
+
# undef Tk_PhotoSetSize
|
| 1610 |
+
# endif
|
| 1611 |
+
# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic
|
| 1612 |
+
#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
|
| 1613 |
+
|
| 1614 |
+
#undef TCL_STORAGE_CLASS
|
| 1615 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 1616 |
+
|
| 1617 |
+
#endif /* RC_INVOKED */
|
| 1618 |
+
|
| 1619 |
+
/*
|
| 1620 |
+
* end block for C++
|
| 1621 |
+
*/
|
| 1622 |
+
|
| 1623 |
+
#ifdef __cplusplus
|
| 1624 |
+
}
|
| 1625 |
+
#endif
|
| 1626 |
+
|
| 1627 |
+
#endif /* _TK */
|
| 1628 |
+
|
| 1629 |
+
/*
|
| 1630 |
+
* Local Variables:
|
| 1631 |
+
* mode: c
|
| 1632 |
+
* c-basic-offset: 4
|
| 1633 |
+
* fill-column: 78
|
| 1634 |
+
* End:
|
| 1635 |
+
*/
|
mantis_evalkit/include/tkBusy.h
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkBusy.h --
|
| 3 |
+
*
|
| 4 |
+
* This file defines the type of the structure describing a busy window.
|
| 5 |
+
*
|
| 6 |
+
* Copyright 1993-1998 Lucent Technologies, Inc.
|
| 7 |
+
*
|
| 8 |
+
* The "busy" command was created by George Howlett. Adapted for
|
| 9 |
+
* integration into Tk by Jos Decoster and Donal K. Fellows.
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 12 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
typedef struct Busy {
|
| 16 |
+
Display *display; /* Display of busy window */
|
| 17 |
+
Tcl_Interp *interp; /* Interpreter where "busy" command was
|
| 18 |
+
* created. It's used to key the searches in
|
| 19 |
+
* the window hierarchy. See the "windows"
|
| 20 |
+
* command. */
|
| 21 |
+
Tk_Window tkBusy; /* Busy window: Transparent window used to
|
| 22 |
+
* block delivery of events to windows
|
| 23 |
+
* underneath it. */
|
| 24 |
+
Tk_Window tkParent; /* Parent window of the busy window. It may be
|
| 25 |
+
* the reference window (if the reference is a
|
| 26 |
+
* toplevel) or a mutual ancestor of the
|
| 27 |
+
* reference window */
|
| 28 |
+
Tk_Window tkRef; /* Reference window of the busy window. It is
|
| 29 |
+
* used to manage the size and position of the
|
| 30 |
+
* busy window. */
|
| 31 |
+
int x, y; /* Position of the reference window */
|
| 32 |
+
int width, height; /* Size of the reference window. Retained to
|
| 33 |
+
* know if the reference window has been
|
| 34 |
+
* reconfigured to a new size. */
|
| 35 |
+
int menuBar; /* Menu bar flag. */
|
| 36 |
+
Tk_Cursor cursor; /* Cursor for the busy window. */
|
| 37 |
+
Tcl_HashEntry *hashPtr; /* Used the delete the busy window entry out
|
| 38 |
+
* of the global hash table. */
|
| 39 |
+
Tcl_HashTable *tablePtr;
|
| 40 |
+
Tk_OptionTable optionTable;
|
| 41 |
+
} Busy;
|
mantis_evalkit/include/tkButton.h
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkButton.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of types and functions used to implement button-like
|
| 5 |
+
* widgets.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1996-1998 by Sun Microsystems, Inc.
|
| 8 |
+
*
|
| 9 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef _TKBUTTON
|
| 14 |
+
#define _TKBUTTON
|
| 15 |
+
|
| 16 |
+
#ifndef _TKINT
|
| 17 |
+
#include "tkInt.h"
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* Legal values for the "compound" field of TkButton records.
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
enum compound {
|
| 25 |
+
COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
|
| 26 |
+
COMPOUND_RIGHT, COMPOUND_TOP
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Legal values for the "state" field of TkButton records.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
enum state {
|
| 34 |
+
STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* Legal values for the "defaultState" field of TkButton records.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
enum defaultState {
|
| 42 |
+
DEFAULT_ACTIVE, DEFAULT_DISABLED, DEFAULT_NORMAL
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
/*
|
| 46 |
+
* A data structure of the following type is kept for each widget managed by
|
| 47 |
+
* this file:
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
typedef struct {
|
| 51 |
+
Tk_Window tkwin; /* Window that embodies the button. NULL means
|
| 52 |
+
* that the window has been destroyed. */
|
| 53 |
+
Display *display; /* Display containing widget. Needed to free
|
| 54 |
+
* up resources after tkwin is gone. */
|
| 55 |
+
Tcl_Interp *interp; /* Interpreter associated with button. */
|
| 56 |
+
Tcl_Command widgetCmd; /* Token for button's widget command. */
|
| 57 |
+
int type; /* Type of widget, such as TYPE_LABEL:
|
| 58 |
+
* restricts operations that may be performed
|
| 59 |
+
* on widget. See below for legal values. */
|
| 60 |
+
Tk_OptionTable optionTable; /* Table that defines configuration options
|
| 61 |
+
* available for this widget. */
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Information about what's in the button.
|
| 65 |
+
*/
|
| 66 |
+
|
| 67 |
+
Tcl_Obj *textPtr; /* Value of -text option: specifies text to
|
| 68 |
+
* display in button. */
|
| 69 |
+
int underline; /* Value of -underline option: specifies index
|
| 70 |
+
* of character to underline. < 0 means don't
|
| 71 |
+
* underline anything. */
|
| 72 |
+
Tcl_Obj *textVarNamePtr; /* Value of -textvariable option: specifies
|
| 73 |
+
* name of variable or NULL. If non-NULL,
|
| 74 |
+
* button displays the contents of this
|
| 75 |
+
* variable. */
|
| 76 |
+
Pixmap bitmap; /* Value of -bitmap option. If not None,
|
| 77 |
+
* specifies bitmap to display and text and
|
| 78 |
+
* textVar are ignored. */
|
| 79 |
+
Tcl_Obj *imagePtr; /* Value of -image option: specifies image to
|
| 80 |
+
* display in window, or NULL if none. If
|
| 81 |
+
* non-NULL, bitmap, text, and textVarName are
|
| 82 |
+
* ignored.*/
|
| 83 |
+
Tk_Image image; /* Derived from imagePtr by calling
|
| 84 |
+
* Tk_GetImage, or NULL if imagePtr is
|
| 85 |
+
* NULL. */
|
| 86 |
+
Tcl_Obj *selectImagePtr; /* Value of -selectimage option: specifies
|
| 87 |
+
* image to display in window when selected,
|
| 88 |
+
* or NULL if none. Ignored if imagePtr is
|
| 89 |
+
* NULL. */
|
| 90 |
+
Tk_Image selectImage; /* Derived from selectImagePtr by calling
|
| 91 |
+
* Tk_GetImage, or NULL if selectImagePtr is
|
| 92 |
+
* NULL. */
|
| 93 |
+
Tcl_Obj *tristateImagePtr; /* Value of -tristateimage option: specifies
|
| 94 |
+
* image to display in window when selected,
|
| 95 |
+
* or NULL if none. Ignored if imagePtr is
|
| 96 |
+
* NULL. */
|
| 97 |
+
Tk_Image tristateImage; /* Derived from tristateImagePtr by calling
|
| 98 |
+
* Tk_GetImage, or NULL if tristateImagePtr is
|
| 99 |
+
* NULL. */
|
| 100 |
+
|
| 101 |
+
/*
|
| 102 |
+
* Information used when displaying widget:
|
| 103 |
+
*/
|
| 104 |
+
|
| 105 |
+
enum state state; /* Value of -state option: specifies state of
|
| 106 |
+
* button for display purposes.*/
|
| 107 |
+
Tk_3DBorder normalBorder; /* Value of -background option: specifies
|
| 108 |
+
* color for background (and border) when
|
| 109 |
+
* window isn't active. */
|
| 110 |
+
Tk_3DBorder activeBorder; /* Value of -activebackground option: this is
|
| 111 |
+
* the color used to draw 3-D border and
|
| 112 |
+
* background when widget is active. */
|
| 113 |
+
Tcl_Obj *borderWidthPtr; /* Value of -borderWidth option: specifies
|
| 114 |
+
* width of border in pixels. */
|
| 115 |
+
int borderWidth; /* Integer value corresponding to
|
| 116 |
+
* borderWidthPtr. Always >= 0. */
|
| 117 |
+
int relief; /* Value of -relief option: specifies 3-d
|
| 118 |
+
* effect for border, such as
|
| 119 |
+
* TK_RELIEF_RAISED. */
|
| 120 |
+
int overRelief; /* Value of -overrelief option: specifies a
|
| 121 |
+
* 3-d effect for the border, such as
|
| 122 |
+
* TK_RELIEF_RAISED, to be used when the mouse
|
| 123 |
+
* is over the button. */
|
| 124 |
+
int offRelief; /* Value of -offrelief option: specifies a 3-d
|
| 125 |
+
* effect for the border, such as
|
| 126 |
+
* TK_RELIEF_RAISED, to be used when a
|
| 127 |
+
* checkbutton or radiobutton without
|
| 128 |
+
* indicator is off. */
|
| 129 |
+
Tcl_Obj *highlightWidthPtr; /* Value of -highlightthickness option:
|
| 130 |
+
* specifies width in pixels of highlight to
|
| 131 |
+
* draw around widget when it has the focus.
|
| 132 |
+
* <= 0 means don't draw a highlight. */
|
| 133 |
+
int highlightWidth; /* Integer value corresponding to
|
| 134 |
+
* highlightWidthPtr. Always >= 0. */
|
| 135 |
+
Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
|
| 136 |
+
* specifies background with which to draw 3-D
|
| 137 |
+
* default ring and focus highlight area when
|
| 138 |
+
* highlight is off. */
|
| 139 |
+
XColor *highlightColorPtr; /* Value of -highlightcolor option: specifies
|
| 140 |
+
* color for drawing traversal highlight. */
|
| 141 |
+
int inset; /* Total width of all borders, including
|
| 142 |
+
* traversal highlight and 3-D border.
|
| 143 |
+
* Indicates how much interior stuff must be
|
| 144 |
+
* offset from outside edges to leave room for
|
| 145 |
+
* borders. */
|
| 146 |
+
Tk_Font tkfont; /* Value of -font option: specifies font to
|
| 147 |
+
* use for display text. */
|
| 148 |
+
XColor *normalFg; /* Value of -font option: specifies foreground
|
| 149 |
+
* color in normal mode. */
|
| 150 |
+
XColor *activeFg; /* Value of -activeforeground option:
|
| 151 |
+
* foreground color in active mode. NULL means
|
| 152 |
+
* use -foreground instead. */
|
| 153 |
+
XColor *disabledFg; /* Value of -disabledforeground option:
|
| 154 |
+
* foreground color when disabled. NULL means
|
| 155 |
+
* use normalFg with a 50% stipple instead. */
|
| 156 |
+
GC normalTextGC; /* GC for drawing text in normal mode. Also
|
| 157 |
+
* used to copy from off-screen pixmap onto
|
| 158 |
+
* screen. */
|
| 159 |
+
GC activeTextGC; /* GC for drawing text in active mode (NULL
|
| 160 |
+
* means use normalTextGC). */
|
| 161 |
+
GC disabledGC; /* Used to produce disabled effect for text
|
| 162 |
+
* and check/radio marks. */
|
| 163 |
+
GC stippleGC; /* Used to produce disabled stipple effect for
|
| 164 |
+
* images when disabled. */
|
| 165 |
+
Pixmap gray; /* Pixmap for displaying disabled text if
|
| 166 |
+
* disabledFg is NULL. */
|
| 167 |
+
GC copyGC; /* Used for copying information from an
|
| 168 |
+
* off-screen pixmap to the screen. */
|
| 169 |
+
Tcl_Obj *widthPtr; /* Value of -width option. */
|
| 170 |
+
int width; /* Integer value corresponding to widthPtr. */
|
| 171 |
+
Tcl_Obj *heightPtr; /* Value of -height option. */
|
| 172 |
+
int height; /* Integer value corresponding to heightPtr. */
|
| 173 |
+
Tcl_Obj *wrapLengthPtr; /* Value of -wraplength option: specifies line
|
| 174 |
+
* length (in pixels) at which to wrap onto
|
| 175 |
+
* next line. <= 0 means don't wrap except at
|
| 176 |
+
* newlines. */
|
| 177 |
+
int wrapLength; /* Integer value corresponding to
|
| 178 |
+
* wrapLengthPtr. */
|
| 179 |
+
Tcl_Obj *padXPtr; /* Value of -padx option: specifies how many
|
| 180 |
+
* pixels of extra space to leave on left and
|
| 181 |
+
* right of text. Ignored for bitmaps and
|
| 182 |
+
* images. */
|
| 183 |
+
int padX; /* Integer value corresponding to padXPtr. */
|
| 184 |
+
Tcl_Obj *padYPtr; /* Value of -padx option: specifies how many
|
| 185 |
+
* pixels of extra space to leave above and
|
| 186 |
+
* below text. Ignored for bitmaps and
|
| 187 |
+
* images. */
|
| 188 |
+
int padY; /* Integer value corresponding to padYPtr. */
|
| 189 |
+
Tk_Anchor anchor; /* Value of -anchor option: specifies where
|
| 190 |
+
* text/bitmap should be displayed inside
|
| 191 |
+
* button region. */
|
| 192 |
+
Tk_Justify justify; /* Value of -justify option: specifies how to
|
| 193 |
+
* align lines of multi-line text. */
|
| 194 |
+
int indicatorOn; /* Value of -indicatoron option: 1 means draw
|
| 195 |
+
* indicator in checkbuttons and radiobuttons,
|
| 196 |
+
* 0 means don't draw it. */
|
| 197 |
+
Tk_3DBorder selectBorder; /* Value of -selectcolor option: specifies
|
| 198 |
+
* color for drawing indicator background, or
|
| 199 |
+
* perhaps widget background, when
|
| 200 |
+
* selected. */
|
| 201 |
+
int textWidth; /* Width needed to display text as requested,
|
| 202 |
+
* in pixels. */
|
| 203 |
+
int textHeight; /* Height needed to display text as requested,
|
| 204 |
+
* in pixels. */
|
| 205 |
+
Tk_TextLayout textLayout; /* Saved text layout information. */
|
| 206 |
+
int indicatorSpace; /* Horizontal space (in pixels) allocated for
|
| 207 |
+
* display of indicator. */
|
| 208 |
+
int indicatorDiameter; /* Diameter of indicator, in pixels. */
|
| 209 |
+
enum defaultState defaultState;
|
| 210 |
+
/* Value of -default option, such as
|
| 211 |
+
* DEFAULT_NORMAL: specifies state of default
|
| 212 |
+
* ring for buttons (normal, active, or
|
| 213 |
+
* disabled). NULL for other classes. */
|
| 214 |
+
|
| 215 |
+
/*
|
| 216 |
+
* For check and radio buttons, the fields below are used to manage the
|
| 217 |
+
* variable indicating the button's state.
|
| 218 |
+
*/
|
| 219 |
+
|
| 220 |
+
Tcl_Obj *selVarNamePtr; /* Value of -variable option: specifies name
|
| 221 |
+
* of variable used to control selected state
|
| 222 |
+
* of button. */
|
| 223 |
+
Tcl_Obj *onValuePtr; /* Value of -offvalue option: specifies value
|
| 224 |
+
* to store in variable when this button is
|
| 225 |
+
* selected. */
|
| 226 |
+
Tcl_Obj *offValuePtr; /* Value of -offvalue option: specifies value
|
| 227 |
+
* to store in variable when this button isn't
|
| 228 |
+
* selected. Used only by checkbuttons. */
|
| 229 |
+
Tcl_Obj *tristateValuePtr; /* Value of -tristatevalue option: specifies
|
| 230 |
+
* value to display Tristate or Multivalue
|
| 231 |
+
* mode when variable matches this value.
|
| 232 |
+
* Used by check- buttons. */
|
| 233 |
+
|
| 234 |
+
/*
|
| 235 |
+
* Miscellaneous information:
|
| 236 |
+
*/
|
| 237 |
+
|
| 238 |
+
Tk_Cursor cursor; /* Value of -cursor option: if not NULL,
|
| 239 |
+
* specifies current cursor for window. */
|
| 240 |
+
Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
|
| 241 |
+
* C code, but used by keyboard traversal
|
| 242 |
+
* scripts. */
|
| 243 |
+
Tcl_Obj *commandPtr; /* Value of -command option: specifies script
|
| 244 |
+
* to execute when button is invoked. If
|
| 245 |
+
* widget is label or has no command, this is
|
| 246 |
+
* NULL. */
|
| 247 |
+
int compound; /* Value of -compound option; specifies
|
| 248 |
+
* whether the button should show both an
|
| 249 |
+
* image and text, and, if so, how. */
|
| 250 |
+
int repeatDelay; /* Value of -repeatdelay option; specifies the
|
| 251 |
+
* number of ms after which the button will
|
| 252 |
+
* start to auto-repeat its command. */
|
| 253 |
+
int repeatInterval; /* Value of -repeatinterval option; specifies
|
| 254 |
+
* the number of ms between auto-repeat
|
| 255 |
+
* invocataions of the button command. */
|
| 256 |
+
int flags; /* Various flags; see below for
|
| 257 |
+
* definitions. */
|
| 258 |
+
} TkButton;
|
| 259 |
+
|
| 260 |
+
/*
|
| 261 |
+
* Possible "type" values for buttons. These are the kinds of widgets
|
| 262 |
+
* supported by this file. The ordering of the type numbers is significant:
|
| 263 |
+
* greater means more features and is used in the code.
|
| 264 |
+
*/
|
| 265 |
+
|
| 266 |
+
#define TYPE_LABEL 0
|
| 267 |
+
#define TYPE_BUTTON 1
|
| 268 |
+
#define TYPE_CHECK_BUTTON 2
|
| 269 |
+
#define TYPE_RADIO_BUTTON 3
|
| 270 |
+
|
| 271 |
+
/*
|
| 272 |
+
* Flag bits for buttons:
|
| 273 |
+
*
|
| 274 |
+
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
|
| 275 |
+
* already been queued to redraw this window.
|
| 276 |
+
* SELECTED: Non-zero means this button is selected, so
|
| 277 |
+
* special highlight should be drawn.
|
| 278 |
+
* GOT_FOCUS: Non-zero means this button currently has the
|
| 279 |
+
* input focus.
|
| 280 |
+
* BUTTON_DELETED: Non-zero needs that this button has been
|
| 281 |
+
* deleted, or is in the process of being deleted
|
| 282 |
+
*/
|
| 283 |
+
|
| 284 |
+
#define REDRAW_PENDING (1 << 0)
|
| 285 |
+
#define SELECTED (1 << 1)
|
| 286 |
+
#define GOT_FOCUS (1 << 2)
|
| 287 |
+
#define BUTTON_DELETED (1 << 3)
|
| 288 |
+
#define TRISTATED (1 << 4)
|
| 289 |
+
|
| 290 |
+
/*
|
| 291 |
+
* Declaration of button class functions structure
|
| 292 |
+
* and button/label defaults, for use in optionSpecs.
|
| 293 |
+
*/
|
| 294 |
+
|
| 295 |
+
MODULE_SCOPE const Tk_ClassProcs tkpButtonProcs;
|
| 296 |
+
MODULE_SCOPE char tkDefButtonHighlightWidth[TCL_INTEGER_SPACE];
|
| 297 |
+
MODULE_SCOPE char tkDefButtonPadx[TCL_INTEGER_SPACE];
|
| 298 |
+
MODULE_SCOPE char tkDefButtonPady[TCL_INTEGER_SPACE];
|
| 299 |
+
MODULE_SCOPE char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
|
| 300 |
+
MODULE_SCOPE char tkDefLabelHighlightWidth[TCL_INTEGER_SPACE];
|
| 301 |
+
MODULE_SCOPE char tkDefLabelPadx[TCL_INTEGER_SPACE];
|
| 302 |
+
MODULE_SCOPE char tkDefLabelPady[TCL_INTEGER_SPACE];
|
| 303 |
+
|
| 304 |
+
/*
|
| 305 |
+
* Declaration of functions used in the implementation of the button widget.
|
| 306 |
+
*/
|
| 307 |
+
|
| 308 |
+
#ifndef TkpButtonSetDefaults
|
| 309 |
+
MODULE_SCOPE void TkpButtonSetDefaults(void);
|
| 310 |
+
#endif
|
| 311 |
+
MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData);
|
| 312 |
+
MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr);
|
| 313 |
+
MODULE_SCOPE TkButton *TkpCreateButton(Tk_Window tkwin);
|
| 314 |
+
#ifndef TkpDestroyButton
|
| 315 |
+
MODULE_SCOPE void TkpDestroyButton(TkButton *butPtr);
|
| 316 |
+
#endif
|
| 317 |
+
#ifndef TkpDisplayButton
|
| 318 |
+
MODULE_SCOPE void TkpDisplayButton(ClientData clientData);
|
| 319 |
+
#endif
|
| 320 |
+
MODULE_SCOPE int TkInvokeButton(TkButton *butPtr);
|
| 321 |
+
|
| 322 |
+
#endif /* _TKBUTTON */
|
mantis_evalkit/include/tkDecls.h
ADDED
|
@@ -0,0 +1,1791 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkDecls.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of functions in the platform independent public Tcl API.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
| 7 |
+
*
|
| 8 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 9 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef _TKDECLS
|
| 13 |
+
#define _TKDECLS
|
| 14 |
+
|
| 15 |
+
#ifdef BUILD_tk
|
| 16 |
+
#undef TCL_STORAGE_CLASS
|
| 17 |
+
#define TCL_STORAGE_CLASS DLLEXPORT
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 22 |
+
* script. Any modifications to the function declarations below should be made
|
| 23 |
+
* in the generic/tk.decls script.
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 27 |
+
|
| 28 |
+
#ifdef __cplusplus
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
/*
|
| 33 |
+
* Exported function declarations:
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
/* 0 */
|
| 37 |
+
EXTERN void Tk_MainLoop(void);
|
| 38 |
+
/* 1 */
|
| 39 |
+
EXTERN XColor * Tk_3DBorderColor(Tk_3DBorder border);
|
| 40 |
+
/* 2 */
|
| 41 |
+
EXTERN GC Tk_3DBorderGC(Tk_Window tkwin, Tk_3DBorder border,
|
| 42 |
+
int which);
|
| 43 |
+
/* 3 */
|
| 44 |
+
EXTERN void Tk_3DHorizontalBevel(Tk_Window tkwin,
|
| 45 |
+
Drawable drawable, Tk_3DBorder border, int x,
|
| 46 |
+
int y, int width, int height, int leftIn,
|
| 47 |
+
int rightIn, int topBevel, int relief);
|
| 48 |
+
/* 4 */
|
| 49 |
+
EXTERN void Tk_3DVerticalBevel(Tk_Window tkwin,
|
| 50 |
+
Drawable drawable, Tk_3DBorder border, int x,
|
| 51 |
+
int y, int width, int height, int leftBevel,
|
| 52 |
+
int relief);
|
| 53 |
+
/* 5 */
|
| 54 |
+
EXTERN void Tk_AddOption(Tk_Window tkwin, const char *name,
|
| 55 |
+
const char *value, int priority);
|
| 56 |
+
/* 6 */
|
| 57 |
+
EXTERN void Tk_BindEvent(Tk_BindingTable bindingTable,
|
| 58 |
+
XEvent *eventPtr, Tk_Window tkwin,
|
| 59 |
+
int numObjects, ClientData *objectPtr);
|
| 60 |
+
/* 7 */
|
| 61 |
+
EXTERN void Tk_CanvasDrawableCoords(Tk_Canvas canvas, double x,
|
| 62 |
+
double y, short *drawableXPtr,
|
| 63 |
+
short *drawableYPtr);
|
| 64 |
+
/* 8 */
|
| 65 |
+
EXTERN void Tk_CanvasEventuallyRedraw(Tk_Canvas canvas, int x1,
|
| 66 |
+
int y1, int x2, int y2);
|
| 67 |
+
/* 9 */
|
| 68 |
+
EXTERN int Tk_CanvasGetCoord(Tcl_Interp *interp,
|
| 69 |
+
Tk_Canvas canvas, const char *str,
|
| 70 |
+
double *doublePtr);
|
| 71 |
+
/* 10 */
|
| 72 |
+
EXTERN Tk_CanvasTextInfo * Tk_CanvasGetTextInfo(Tk_Canvas canvas);
|
| 73 |
+
/* 11 */
|
| 74 |
+
EXTERN int Tk_CanvasPsBitmap(Tcl_Interp *interp,
|
| 75 |
+
Tk_Canvas canvas, Pixmap bitmap, int x,
|
| 76 |
+
int y, int width, int height);
|
| 77 |
+
/* 12 */
|
| 78 |
+
EXTERN int Tk_CanvasPsColor(Tcl_Interp *interp,
|
| 79 |
+
Tk_Canvas canvas, XColor *colorPtr);
|
| 80 |
+
/* 13 */
|
| 81 |
+
EXTERN int Tk_CanvasPsFont(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 82 |
+
Tk_Font font);
|
| 83 |
+
/* 14 */
|
| 84 |
+
EXTERN void Tk_CanvasPsPath(Tcl_Interp *interp, Tk_Canvas canvas,
|
| 85 |
+
double *coordPtr, int numPoints);
|
| 86 |
+
/* 15 */
|
| 87 |
+
EXTERN int Tk_CanvasPsStipple(Tcl_Interp *interp,
|
| 88 |
+
Tk_Canvas canvas, Pixmap bitmap);
|
| 89 |
+
/* 16 */
|
| 90 |
+
EXTERN double Tk_CanvasPsY(Tk_Canvas canvas, double y);
|
| 91 |
+
/* 17 */
|
| 92 |
+
EXTERN void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc);
|
| 93 |
+
/* 18 */
|
| 94 |
+
EXTERN int Tk_CanvasTagsParseProc(ClientData clientData,
|
| 95 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 96 |
+
const char *value, char *widgRec, int offset);
|
| 97 |
+
/* 19 */
|
| 98 |
+
EXTERN CONST86 char * Tk_CanvasTagsPrintProc(ClientData clientData,
|
| 99 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 100 |
+
Tcl_FreeProc **freeProcPtr);
|
| 101 |
+
/* 20 */
|
| 102 |
+
EXTERN Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas);
|
| 103 |
+
/* 21 */
|
| 104 |
+
EXTERN void Tk_CanvasWindowCoords(Tk_Canvas canvas, double x,
|
| 105 |
+
double y, short *screenXPtr,
|
| 106 |
+
short *screenYPtr);
|
| 107 |
+
/* 22 */
|
| 108 |
+
EXTERN void Tk_ChangeWindowAttributes(Tk_Window tkwin,
|
| 109 |
+
unsigned long valueMask,
|
| 110 |
+
XSetWindowAttributes *attsPtr);
|
| 111 |
+
/* 23 */
|
| 112 |
+
EXTERN int Tk_CharBbox(Tk_TextLayout layout, int index,
|
| 113 |
+
int *xPtr, int *yPtr, int *widthPtr,
|
| 114 |
+
int *heightPtr);
|
| 115 |
+
/* 24 */
|
| 116 |
+
EXTERN void Tk_ClearSelection(Tk_Window tkwin, Atom selection);
|
| 117 |
+
/* 25 */
|
| 118 |
+
EXTERN int Tk_ClipboardAppend(Tcl_Interp *interp,
|
| 119 |
+
Tk_Window tkwin, Atom target, Atom format,
|
| 120 |
+
const char *buffer);
|
| 121 |
+
/* 26 */
|
| 122 |
+
EXTERN int Tk_ClipboardClear(Tcl_Interp *interp,
|
| 123 |
+
Tk_Window tkwin);
|
| 124 |
+
/* 27 */
|
| 125 |
+
EXTERN int Tk_ConfigureInfo(Tcl_Interp *interp, Tk_Window tkwin,
|
| 126 |
+
const Tk_ConfigSpec *specs, char *widgRec,
|
| 127 |
+
const char *argvName, int flags);
|
| 128 |
+
/* 28 */
|
| 129 |
+
EXTERN int Tk_ConfigureValue(Tcl_Interp *interp,
|
| 130 |
+
Tk_Window tkwin, const Tk_ConfigSpec *specs,
|
| 131 |
+
char *widgRec, const char *argvName,
|
| 132 |
+
int flags);
|
| 133 |
+
/* 29 */
|
| 134 |
+
EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp,
|
| 135 |
+
Tk_Window tkwin, const Tk_ConfigSpec *specs,
|
| 136 |
+
int argc, CONST84 char **argv, char *widgRec,
|
| 137 |
+
int flags);
|
| 138 |
+
/* 30 */
|
| 139 |
+
EXTERN void Tk_ConfigureWindow(Tk_Window tkwin,
|
| 140 |
+
unsigned int valueMask,
|
| 141 |
+
XWindowChanges *valuePtr);
|
| 142 |
+
/* 31 */
|
| 143 |
+
EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, const char *str,
|
| 144 |
+
int numChars, int wrapLength,
|
| 145 |
+
Tk_Justify justify, int flags, int *widthPtr,
|
| 146 |
+
int *heightPtr);
|
| 147 |
+
/* 32 */
|
| 148 |
+
EXTERN Tk_Window Tk_CoordsToWindow(int rootX, int rootY,
|
| 149 |
+
Tk_Window tkwin);
|
| 150 |
+
/* 33 */
|
| 151 |
+
EXTERN unsigned long Tk_CreateBinding(Tcl_Interp *interp,
|
| 152 |
+
Tk_BindingTable bindingTable,
|
| 153 |
+
ClientData object, const char *eventStr,
|
| 154 |
+
const char *script, int append);
|
| 155 |
+
/* 34 */
|
| 156 |
+
EXTERN Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp);
|
| 157 |
+
/* 35 */
|
| 158 |
+
EXTERN Tk_ErrorHandler Tk_CreateErrorHandler(Display *display, int errNum,
|
| 159 |
+
int request, int minorCode,
|
| 160 |
+
Tk_ErrorProc *errorProc,
|
| 161 |
+
ClientData clientData);
|
| 162 |
+
/* 36 */
|
| 163 |
+
EXTERN void Tk_CreateEventHandler(Tk_Window token,
|
| 164 |
+
unsigned long mask, Tk_EventProc *proc,
|
| 165 |
+
ClientData clientData);
|
| 166 |
+
/* 37 */
|
| 167 |
+
EXTERN void Tk_CreateGenericHandler(Tk_GenericProc *proc,
|
| 168 |
+
ClientData clientData);
|
| 169 |
+
/* 38 */
|
| 170 |
+
EXTERN void Tk_CreateImageType(const Tk_ImageType *typePtr);
|
| 171 |
+
/* 39 */
|
| 172 |
+
EXTERN void Tk_CreateItemType(Tk_ItemType *typePtr);
|
| 173 |
+
/* 40 */
|
| 174 |
+
EXTERN void Tk_CreatePhotoImageFormat(
|
| 175 |
+
const Tk_PhotoImageFormat *formatPtr);
|
| 176 |
+
/* 41 */
|
| 177 |
+
EXTERN void Tk_CreateSelHandler(Tk_Window tkwin, Atom selection,
|
| 178 |
+
Atom target, Tk_SelectionProc *proc,
|
| 179 |
+
ClientData clientData, Atom format);
|
| 180 |
+
/* 42 */
|
| 181 |
+
EXTERN Tk_Window Tk_CreateWindow(Tcl_Interp *interp, Tk_Window parent,
|
| 182 |
+
const char *name, const char *screenName);
|
| 183 |
+
/* 43 */
|
| 184 |
+
EXTERN Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp,
|
| 185 |
+
Tk_Window tkwin, const char *pathName,
|
| 186 |
+
const char *screenName);
|
| 187 |
+
/* 44 */
|
| 188 |
+
EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name,
|
| 189 |
+
const void *source, int width, int height);
|
| 190 |
+
/* 45 */
|
| 191 |
+
EXTERN void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor);
|
| 192 |
+
/* 46 */
|
| 193 |
+
EXTERN void Tk_DeleteAllBindings(Tk_BindingTable bindingTable,
|
| 194 |
+
ClientData object);
|
| 195 |
+
/* 47 */
|
| 196 |
+
EXTERN int Tk_DeleteBinding(Tcl_Interp *interp,
|
| 197 |
+
Tk_BindingTable bindingTable,
|
| 198 |
+
ClientData object, const char *eventStr);
|
| 199 |
+
/* 48 */
|
| 200 |
+
EXTERN void Tk_DeleteBindingTable(Tk_BindingTable bindingTable);
|
| 201 |
+
/* 49 */
|
| 202 |
+
EXTERN void Tk_DeleteErrorHandler(Tk_ErrorHandler handler);
|
| 203 |
+
/* 50 */
|
| 204 |
+
EXTERN void Tk_DeleteEventHandler(Tk_Window token,
|
| 205 |
+
unsigned long mask, Tk_EventProc *proc,
|
| 206 |
+
ClientData clientData);
|
| 207 |
+
/* 51 */
|
| 208 |
+
EXTERN void Tk_DeleteGenericHandler(Tk_GenericProc *proc,
|
| 209 |
+
ClientData clientData);
|
| 210 |
+
/* 52 */
|
| 211 |
+
EXTERN void Tk_DeleteImage(Tcl_Interp *interp, const char *name);
|
| 212 |
+
/* 53 */
|
| 213 |
+
EXTERN void Tk_DeleteSelHandler(Tk_Window tkwin, Atom selection,
|
| 214 |
+
Atom target);
|
| 215 |
+
/* 54 */
|
| 216 |
+
EXTERN void Tk_DestroyWindow(Tk_Window tkwin);
|
| 217 |
+
/* 55 */
|
| 218 |
+
EXTERN CONST84_RETURN char * Tk_DisplayName(Tk_Window tkwin);
|
| 219 |
+
/* 56 */
|
| 220 |
+
EXTERN int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x,
|
| 221 |
+
int y);
|
| 222 |
+
/* 57 */
|
| 223 |
+
EXTERN void Tk_Draw3DPolygon(Tk_Window tkwin, Drawable drawable,
|
| 224 |
+
Tk_3DBorder border, XPoint *pointPtr,
|
| 225 |
+
int numPoints, int borderWidth,
|
| 226 |
+
int leftRelief);
|
| 227 |
+
/* 58 */
|
| 228 |
+
EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin,
|
| 229 |
+
Drawable drawable, Tk_3DBorder border, int x,
|
| 230 |
+
int y, int width, int height,
|
| 231 |
+
int borderWidth, int relief);
|
| 232 |
+
/* 59 */
|
| 233 |
+
EXTERN void Tk_DrawChars(Display *display, Drawable drawable,
|
| 234 |
+
GC gc, Tk_Font tkfont, const char *source,
|
| 235 |
+
int numBytes, int x, int y);
|
| 236 |
+
/* 60 */
|
| 237 |
+
EXTERN void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc,
|
| 238 |
+
int width, Drawable drawable);
|
| 239 |
+
/* 61 */
|
| 240 |
+
EXTERN void Tk_DrawTextLayout(Display *display,
|
| 241 |
+
Drawable drawable, GC gc,
|
| 242 |
+
Tk_TextLayout layout, int x, int y,
|
| 243 |
+
int firstChar, int lastChar);
|
| 244 |
+
/* 62 */
|
| 245 |
+
EXTERN void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable,
|
| 246 |
+
Tk_3DBorder border, XPoint *pointPtr,
|
| 247 |
+
int numPoints, int borderWidth,
|
| 248 |
+
int leftRelief);
|
| 249 |
+
/* 63 */
|
| 250 |
+
EXTERN void Tk_Fill3DRectangle(Tk_Window tkwin,
|
| 251 |
+
Drawable drawable, Tk_3DBorder border, int x,
|
| 252 |
+
int y, int width, int height,
|
| 253 |
+
int borderWidth, int relief);
|
| 254 |
+
/* 64 */
|
| 255 |
+
EXTERN Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp,
|
| 256 |
+
const char *imageName);
|
| 257 |
+
/* 65 */
|
| 258 |
+
EXTERN Font Tk_FontId(Tk_Font font);
|
| 259 |
+
/* 66 */
|
| 260 |
+
EXTERN void Tk_Free3DBorder(Tk_3DBorder border);
|
| 261 |
+
/* 67 */
|
| 262 |
+
EXTERN void Tk_FreeBitmap(Display *display, Pixmap bitmap);
|
| 263 |
+
/* 68 */
|
| 264 |
+
EXTERN void Tk_FreeColor(XColor *colorPtr);
|
| 265 |
+
/* 69 */
|
| 266 |
+
EXTERN void Tk_FreeColormap(Display *display, Colormap colormap);
|
| 267 |
+
/* 70 */
|
| 268 |
+
EXTERN void Tk_FreeCursor(Display *display, Tk_Cursor cursor);
|
| 269 |
+
/* 71 */
|
| 270 |
+
EXTERN void Tk_FreeFont(Tk_Font f);
|
| 271 |
+
/* 72 */
|
| 272 |
+
EXTERN void Tk_FreeGC(Display *display, GC gc);
|
| 273 |
+
/* 73 */
|
| 274 |
+
EXTERN void Tk_FreeImage(Tk_Image image);
|
| 275 |
+
/* 74 */
|
| 276 |
+
EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs,
|
| 277 |
+
char *widgRec, Display *display,
|
| 278 |
+
int needFlags);
|
| 279 |
+
/* 75 */
|
| 280 |
+
EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap);
|
| 281 |
+
/* 76 */
|
| 282 |
+
EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout);
|
| 283 |
+
/* 77 */
|
| 284 |
+
EXTERN void Tk_FreeXId(Display *display, XID xid);
|
| 285 |
+
/* 78 */
|
| 286 |
+
EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable);
|
| 287 |
+
/* 79 */
|
| 288 |
+
EXTERN void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth,
|
| 289 |
+
int reqHeight);
|
| 290 |
+
/* 80 */
|
| 291 |
+
EXTERN Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
|
| 292 |
+
Tk_Uid colorName);
|
| 293 |
+
/* 81 */
|
| 294 |
+
EXTERN void Tk_GetAllBindings(Tcl_Interp *interp,
|
| 295 |
+
Tk_BindingTable bindingTable,
|
| 296 |
+
ClientData object);
|
| 297 |
+
/* 82 */
|
| 298 |
+
EXTERN int Tk_GetAnchor(Tcl_Interp *interp, const char *str,
|
| 299 |
+
Tk_Anchor *anchorPtr);
|
| 300 |
+
/* 83 */
|
| 301 |
+
EXTERN CONST84_RETURN char * Tk_GetAtomName(Tk_Window tkwin, Atom atom);
|
| 302 |
+
/* 84 */
|
| 303 |
+
EXTERN CONST84_RETURN char * Tk_GetBinding(Tcl_Interp *interp,
|
| 304 |
+
Tk_BindingTable bindingTable,
|
| 305 |
+
ClientData object, const char *eventStr);
|
| 306 |
+
/* 85 */
|
| 307 |
+
EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin,
|
| 308 |
+
const char *str);
|
| 309 |
+
/* 86 */
|
| 310 |
+
EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
|
| 311 |
+
Tk_Window tkwin, const void *source,
|
| 312 |
+
int width, int height);
|
| 313 |
+
/* 87 */
|
| 314 |
+
EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, const char *str,
|
| 315 |
+
int *capPtr);
|
| 316 |
+
/* 88 */
|
| 317 |
+
EXTERN XColor * Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin,
|
| 318 |
+
Tk_Uid name);
|
| 319 |
+
/* 89 */
|
| 320 |
+
EXTERN XColor * Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr);
|
| 321 |
+
/* 90 */
|
| 322 |
+
EXTERN Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
|
| 323 |
+
const char *str);
|
| 324 |
+
/* 91 */
|
| 325 |
+
EXTERN Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
|
| 326 |
+
Tk_Uid str);
|
| 327 |
+
/* 92 */
|
| 328 |
+
EXTERN Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
|
| 329 |
+
Tk_Window tkwin, const char *source,
|
| 330 |
+
const char *mask, int width, int height,
|
| 331 |
+
int xHot, int yHot, Tk_Uid fg, Tk_Uid bg);
|
| 332 |
+
/* 93 */
|
| 333 |
+
EXTERN Tk_Font Tk_GetFont(Tcl_Interp *interp, Tk_Window tkwin,
|
| 334 |
+
const char *str);
|
| 335 |
+
/* 94 */
|
| 336 |
+
EXTERN Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 337 |
+
/* 95 */
|
| 338 |
+
EXTERN void Tk_GetFontMetrics(Tk_Font font,
|
| 339 |
+
Tk_FontMetrics *fmPtr);
|
| 340 |
+
/* 96 */
|
| 341 |
+
EXTERN GC Tk_GetGC(Tk_Window tkwin, unsigned long valueMask,
|
| 342 |
+
XGCValues *valuePtr);
|
| 343 |
+
/* 97 */
|
| 344 |
+
EXTERN Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin,
|
| 345 |
+
const char *name,
|
| 346 |
+
Tk_ImageChangedProc *changeProc,
|
| 347 |
+
ClientData clientData);
|
| 348 |
+
/* 98 */
|
| 349 |
+
EXTERN ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
|
| 350 |
+
const char *name,
|
| 351 |
+
CONST86 Tk_ImageType **typePtrPtr);
|
| 352 |
+
/* 99 */
|
| 353 |
+
EXTERN Tk_ItemType * Tk_GetItemTypes(void);
|
| 354 |
+
/* 100 */
|
| 355 |
+
EXTERN int Tk_GetJoinStyle(Tcl_Interp *interp, const char *str,
|
| 356 |
+
int *joinPtr);
|
| 357 |
+
/* 101 */
|
| 358 |
+
EXTERN int Tk_GetJustify(Tcl_Interp *interp, const char *str,
|
| 359 |
+
Tk_Justify *justifyPtr);
|
| 360 |
+
/* 102 */
|
| 361 |
+
EXTERN int Tk_GetNumMainWindows(void);
|
| 362 |
+
/* 103 */
|
| 363 |
+
EXTERN Tk_Uid Tk_GetOption(Tk_Window tkwin, const char *name,
|
| 364 |
+
const char *className);
|
| 365 |
+
/* 104 */
|
| 366 |
+
EXTERN int Tk_GetPixels(Tcl_Interp *interp, Tk_Window tkwin,
|
| 367 |
+
const char *str, int *intPtr);
|
| 368 |
+
/* 105 */
|
| 369 |
+
EXTERN Pixmap Tk_GetPixmap(Display *display, Drawable d, int width,
|
| 370 |
+
int height, int depth);
|
| 371 |
+
/* 106 */
|
| 372 |
+
EXTERN int Tk_GetRelief(Tcl_Interp *interp, const char *name,
|
| 373 |
+
int *reliefPtr);
|
| 374 |
+
/* 107 */
|
| 375 |
+
EXTERN void Tk_GetRootCoords(Tk_Window tkwin, int *xPtr,
|
| 376 |
+
int *yPtr);
|
| 377 |
+
/* 108 */
|
| 378 |
+
EXTERN int Tk_GetScrollInfo(Tcl_Interp *interp, int argc,
|
| 379 |
+
CONST84 char **argv, double *dblPtr,
|
| 380 |
+
int *intPtr);
|
| 381 |
+
/* 109 */
|
| 382 |
+
EXTERN int Tk_GetScreenMM(Tcl_Interp *interp, Tk_Window tkwin,
|
| 383 |
+
const char *str, double *doublePtr);
|
| 384 |
+
/* 110 */
|
| 385 |
+
EXTERN int Tk_GetSelection(Tcl_Interp *interp, Tk_Window tkwin,
|
| 386 |
+
Atom selection, Atom target,
|
| 387 |
+
Tk_GetSelProc *proc, ClientData clientData);
|
| 388 |
+
/* 111 */
|
| 389 |
+
EXTERN Tk_Uid Tk_GetUid(const char *str);
|
| 390 |
+
/* 112 */
|
| 391 |
+
EXTERN Visual * Tk_GetVisual(Tcl_Interp *interp, Tk_Window tkwin,
|
| 392 |
+
const char *str, int *depthPtr,
|
| 393 |
+
Colormap *colormapPtr);
|
| 394 |
+
/* 113 */
|
| 395 |
+
EXTERN void Tk_GetVRootGeometry(Tk_Window tkwin, int *xPtr,
|
| 396 |
+
int *yPtr, int *widthPtr, int *heightPtr);
|
| 397 |
+
/* 114 */
|
| 398 |
+
EXTERN int Tk_Grab(Tcl_Interp *interp, Tk_Window tkwin,
|
| 399 |
+
int grabGlobal);
|
| 400 |
+
/* 115 */
|
| 401 |
+
EXTERN void Tk_HandleEvent(XEvent *eventPtr);
|
| 402 |
+
/* 116 */
|
| 403 |
+
EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window);
|
| 404 |
+
/* 117 */
|
| 405 |
+
EXTERN void Tk_ImageChanged(Tk_ImageMaster model, int x, int y,
|
| 406 |
+
int width, int height, int imageWidth,
|
| 407 |
+
int imageHeight);
|
| 408 |
+
/* 118 */
|
| 409 |
+
EXTERN int Tk_Init(Tcl_Interp *interp);
|
| 410 |
+
/* 119 */
|
| 411 |
+
EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name);
|
| 412 |
+
/* 120 */
|
| 413 |
+
EXTERN int Tk_IntersectTextLayout(Tk_TextLayout layout, int x,
|
| 414 |
+
int y, int width, int height);
|
| 415 |
+
/* 121 */
|
| 416 |
+
EXTERN void Tk_MaintainGeometry(Tk_Window window,
|
| 417 |
+
Tk_Window container, int x, int y, int width,
|
| 418 |
+
int height);
|
| 419 |
+
/* 122 */
|
| 420 |
+
EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp);
|
| 421 |
+
/* 123 */
|
| 422 |
+
EXTERN void Tk_MakeWindowExist(Tk_Window tkwin);
|
| 423 |
+
/* 124 */
|
| 424 |
+
EXTERN void Tk_ManageGeometry(Tk_Window tkwin,
|
| 425 |
+
const Tk_GeomMgr *mgrPtr,
|
| 426 |
+
ClientData clientData);
|
| 427 |
+
/* 125 */
|
| 428 |
+
EXTERN void Tk_MapWindow(Tk_Window tkwin);
|
| 429 |
+
/* 126 */
|
| 430 |
+
EXTERN int Tk_MeasureChars(Tk_Font tkfont, const char *source,
|
| 431 |
+
int numBytes, int maxPixels, int flags,
|
| 432 |
+
int *lengthPtr);
|
| 433 |
+
/* 127 */
|
| 434 |
+
EXTERN void Tk_MoveResizeWindow(Tk_Window tkwin, int x, int y,
|
| 435 |
+
int width, int height);
|
| 436 |
+
/* 128 */
|
| 437 |
+
EXTERN void Tk_MoveWindow(Tk_Window tkwin, int x, int y);
|
| 438 |
+
/* 129 */
|
| 439 |
+
EXTERN void Tk_MoveToplevelWindow(Tk_Window tkwin, int x, int y);
|
| 440 |
+
/* 130 */
|
| 441 |
+
EXTERN CONST84_RETURN char * Tk_NameOf3DBorder(Tk_3DBorder border);
|
| 442 |
+
/* 131 */
|
| 443 |
+
EXTERN CONST84_RETURN char * Tk_NameOfAnchor(Tk_Anchor anchor);
|
| 444 |
+
/* 132 */
|
| 445 |
+
EXTERN CONST84_RETURN char * Tk_NameOfBitmap(Display *display, Pixmap bitmap);
|
| 446 |
+
/* 133 */
|
| 447 |
+
EXTERN CONST84_RETURN char * Tk_NameOfCapStyle(int cap);
|
| 448 |
+
/* 134 */
|
| 449 |
+
EXTERN CONST84_RETURN char * Tk_NameOfColor(XColor *colorPtr);
|
| 450 |
+
/* 135 */
|
| 451 |
+
EXTERN CONST84_RETURN char * Tk_NameOfCursor(Display *display,
|
| 452 |
+
Tk_Cursor cursor);
|
| 453 |
+
/* 136 */
|
| 454 |
+
EXTERN CONST84_RETURN char * Tk_NameOfFont(Tk_Font font);
|
| 455 |
+
/* 137 */
|
| 456 |
+
EXTERN CONST84_RETURN char * Tk_NameOfImage(Tk_ImageMaster model);
|
| 457 |
+
/* 138 */
|
| 458 |
+
EXTERN CONST84_RETURN char * Tk_NameOfJoinStyle(int join);
|
| 459 |
+
/* 139 */
|
| 460 |
+
EXTERN CONST84_RETURN char * Tk_NameOfJustify(Tk_Justify justify);
|
| 461 |
+
/* 140 */
|
| 462 |
+
EXTERN CONST84_RETURN char * Tk_NameOfRelief(int relief);
|
| 463 |
+
/* 141 */
|
| 464 |
+
EXTERN Tk_Window Tk_NameToWindow(Tcl_Interp *interp,
|
| 465 |
+
const char *pathName, Tk_Window tkwin);
|
| 466 |
+
/* 142 */
|
| 467 |
+
EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection,
|
| 468 |
+
Tk_LostSelProc *proc, ClientData clientData);
|
| 469 |
+
/* 143 */
|
| 470 |
+
EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin,
|
| 471 |
+
int *argcPtr, CONST84 char **argv,
|
| 472 |
+
const Tk_ArgvInfo *argTable, int flags);
|
| 473 |
+
/* 144 */
|
| 474 |
+
EXTERN void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
|
| 475 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 476 |
+
int width, int height);
|
| 477 |
+
/* 145 */
|
| 478 |
+
EXTERN void Tk_PhotoPutZoomedBlock_NoComposite(
|
| 479 |
+
Tk_PhotoHandle handle,
|
| 480 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 481 |
+
int width, int height, int zoomX, int zoomY,
|
| 482 |
+
int subsampleX, int subsampleY);
|
| 483 |
+
/* 146 */
|
| 484 |
+
EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle,
|
| 485 |
+
Tk_PhotoImageBlock *blockPtr);
|
| 486 |
+
/* 147 */
|
| 487 |
+
EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle);
|
| 488 |
+
/* 148 */
|
| 489 |
+
EXTERN void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle,
|
| 490 |
+
int width, int height);
|
| 491 |
+
/* 149 */
|
| 492 |
+
EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr,
|
| 493 |
+
int *heightPtr);
|
| 494 |
+
/* 150 */
|
| 495 |
+
EXTERN void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle,
|
| 496 |
+
int width, int height);
|
| 497 |
+
/* 151 */
|
| 498 |
+
EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y);
|
| 499 |
+
/* 152 */
|
| 500 |
+
EXTERN int Tk_PostscriptFontName(Tk_Font tkfont,
|
| 501 |
+
Tcl_DString *dsPtr);
|
| 502 |
+
/* 153 */
|
| 503 |
+
EXTERN void Tk_PreserveColormap(Display *display,
|
| 504 |
+
Colormap colormap);
|
| 505 |
+
/* 154 */
|
| 506 |
+
EXTERN void Tk_QueueWindowEvent(XEvent *eventPtr,
|
| 507 |
+
Tcl_QueuePosition position);
|
| 508 |
+
/* 155 */
|
| 509 |
+
EXTERN void Tk_RedrawImage(Tk_Image image, int imageX,
|
| 510 |
+
int imageY, int width, int height,
|
| 511 |
+
Drawable drawable, int drawableX,
|
| 512 |
+
int drawableY);
|
| 513 |
+
/* 156 */
|
| 514 |
+
EXTERN void Tk_ResizeWindow(Tk_Window tkwin, int width,
|
| 515 |
+
int height);
|
| 516 |
+
/* 157 */
|
| 517 |
+
EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow,
|
| 518 |
+
Tk_Window other);
|
| 519 |
+
/* 158 */
|
| 520 |
+
EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc,
|
| 521 |
+
ClientData arg, ClientData *prevArgPtr);
|
| 522 |
+
/* 159 */
|
| 523 |
+
EXTERN int Tk_SafeInit(Tcl_Interp *interp);
|
| 524 |
+
/* 160 */
|
| 525 |
+
EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name);
|
| 526 |
+
/* 161 */
|
| 527 |
+
EXTERN void Tk_SetBackgroundFromBorder(Tk_Window tkwin,
|
| 528 |
+
Tk_3DBorder border);
|
| 529 |
+
/* 162 */
|
| 530 |
+
EXTERN void Tk_SetClass(Tk_Window tkwin, const char *className);
|
| 531 |
+
/* 163 */
|
| 532 |
+
EXTERN void Tk_SetGrid(Tk_Window tkwin, int reqWidth,
|
| 533 |
+
int reqHeight, int gridWidth, int gridHeight);
|
| 534 |
+
/* 164 */
|
| 535 |
+
EXTERN void Tk_SetInternalBorder(Tk_Window tkwin, int width);
|
| 536 |
+
/* 165 */
|
| 537 |
+
EXTERN void Tk_SetWindowBackground(Tk_Window tkwin,
|
| 538 |
+
unsigned long pixel);
|
| 539 |
+
/* 166 */
|
| 540 |
+
EXTERN void Tk_SetWindowBackgroundPixmap(Tk_Window tkwin,
|
| 541 |
+
Pixmap pixmap);
|
| 542 |
+
/* 167 */
|
| 543 |
+
EXTERN void Tk_SetWindowBorder(Tk_Window tkwin,
|
| 544 |
+
unsigned long pixel);
|
| 545 |
+
/* 168 */
|
| 546 |
+
EXTERN void Tk_SetWindowBorderWidth(Tk_Window tkwin, int width);
|
| 547 |
+
/* 169 */
|
| 548 |
+
EXTERN void Tk_SetWindowBorderPixmap(Tk_Window tkwin,
|
| 549 |
+
Pixmap pixmap);
|
| 550 |
+
/* 170 */
|
| 551 |
+
EXTERN void Tk_SetWindowColormap(Tk_Window tkwin,
|
| 552 |
+
Colormap colormap);
|
| 553 |
+
/* 171 */
|
| 554 |
+
EXTERN int Tk_SetWindowVisual(Tk_Window tkwin, Visual *visual,
|
| 555 |
+
int depth, Colormap colormap);
|
| 556 |
+
/* 172 */
|
| 557 |
+
EXTERN void Tk_SizeOfBitmap(Display *display, Pixmap bitmap,
|
| 558 |
+
int *widthPtr, int *heightPtr);
|
| 559 |
+
/* 173 */
|
| 560 |
+
EXTERN void Tk_SizeOfImage(Tk_Image image, int *widthPtr,
|
| 561 |
+
int *heightPtr);
|
| 562 |
+
/* 174 */
|
| 563 |
+
EXTERN int Tk_StrictMotif(Tk_Window tkwin);
|
| 564 |
+
/* 175 */
|
| 565 |
+
EXTERN void Tk_TextLayoutToPostscript(Tcl_Interp *interp,
|
| 566 |
+
Tk_TextLayout layout);
|
| 567 |
+
/* 176 */
|
| 568 |
+
EXTERN int Tk_TextWidth(Tk_Font font, const char *str,
|
| 569 |
+
int numBytes);
|
| 570 |
+
/* 177 */
|
| 571 |
+
EXTERN void Tk_UndefineCursor(Tk_Window window);
|
| 572 |
+
/* 178 */
|
| 573 |
+
EXTERN void Tk_UnderlineChars(Display *display,
|
| 574 |
+
Drawable drawable, GC gc, Tk_Font tkfont,
|
| 575 |
+
const char *source, int x, int y,
|
| 576 |
+
int firstByte, int lastByte);
|
| 577 |
+
/* 179 */
|
| 578 |
+
EXTERN void Tk_UnderlineTextLayout(Display *display,
|
| 579 |
+
Drawable drawable, GC gc,
|
| 580 |
+
Tk_TextLayout layout, int x, int y,
|
| 581 |
+
int underline);
|
| 582 |
+
/* 180 */
|
| 583 |
+
EXTERN void Tk_Ungrab(Tk_Window tkwin);
|
| 584 |
+
/* 181 */
|
| 585 |
+
EXTERN void Tk_UnmaintainGeometry(Tk_Window window,
|
| 586 |
+
Tk_Window container);
|
| 587 |
+
/* 182 */
|
| 588 |
+
EXTERN void Tk_UnmapWindow(Tk_Window tkwin);
|
| 589 |
+
/* 183 */
|
| 590 |
+
EXTERN void Tk_UnsetGrid(Tk_Window tkwin);
|
| 591 |
+
/* 184 */
|
| 592 |
+
EXTERN void Tk_UpdatePointer(Tk_Window tkwin, int x, int y,
|
| 593 |
+
int state);
|
| 594 |
+
/* 185 */
|
| 595 |
+
EXTERN Pixmap Tk_AllocBitmapFromObj(Tcl_Interp *interp,
|
| 596 |
+
Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 597 |
+
/* 186 */
|
| 598 |
+
EXTERN Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp,
|
| 599 |
+
Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 600 |
+
/* 187 */
|
| 601 |
+
EXTERN XColor * Tk_AllocColorFromObj(Tcl_Interp *interp,
|
| 602 |
+
Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 603 |
+
/* 188 */
|
| 604 |
+
EXTERN Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp,
|
| 605 |
+
Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 606 |
+
/* 189 */
|
| 607 |
+
EXTERN Tk_Font Tk_AllocFontFromObj(Tcl_Interp *interp,
|
| 608 |
+
Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 609 |
+
/* 190 */
|
| 610 |
+
EXTERN Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
|
| 611 |
+
const Tk_OptionSpec *templatePtr);
|
| 612 |
+
/* 191 */
|
| 613 |
+
EXTERN void Tk_DeleteOptionTable(Tk_OptionTable optionTable);
|
| 614 |
+
/* 192 */
|
| 615 |
+
EXTERN void Tk_Free3DBorderFromObj(Tk_Window tkwin,
|
| 616 |
+
Tcl_Obj *objPtr);
|
| 617 |
+
/* 193 */
|
| 618 |
+
EXTERN void Tk_FreeBitmapFromObj(Tk_Window tkwin,
|
| 619 |
+
Tcl_Obj *objPtr);
|
| 620 |
+
/* 194 */
|
| 621 |
+
EXTERN void Tk_FreeColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 622 |
+
/* 195 */
|
| 623 |
+
EXTERN void Tk_FreeConfigOptions(char *recordPtr,
|
| 624 |
+
Tk_OptionTable optionToken, Tk_Window tkwin);
|
| 625 |
+
/* 196 */
|
| 626 |
+
EXTERN void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr);
|
| 627 |
+
/* 197 */
|
| 628 |
+
EXTERN void Tk_FreeCursorFromObj(Tk_Window tkwin,
|
| 629 |
+
Tcl_Obj *objPtr);
|
| 630 |
+
/* 198 */
|
| 631 |
+
EXTERN void Tk_FreeFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 632 |
+
/* 199 */
|
| 633 |
+
EXTERN Tk_3DBorder Tk_Get3DBorderFromObj(Tk_Window tkwin,
|
| 634 |
+
Tcl_Obj *objPtr);
|
| 635 |
+
/* 200 */
|
| 636 |
+
EXTERN int Tk_GetAnchorFromObj(Tcl_Interp *interp,
|
| 637 |
+
Tcl_Obj *objPtr, Tk_Anchor *anchorPtr);
|
| 638 |
+
/* 201 */
|
| 639 |
+
EXTERN Pixmap Tk_GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 640 |
+
/* 202 */
|
| 641 |
+
EXTERN XColor * Tk_GetColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 642 |
+
/* 203 */
|
| 643 |
+
EXTERN Tk_Cursor Tk_GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
|
| 644 |
+
/* 204 */
|
| 645 |
+
EXTERN Tcl_Obj * Tk_GetOptionInfo(Tcl_Interp *interp, char *recordPtr,
|
| 646 |
+
Tk_OptionTable optionTable, Tcl_Obj *namePtr,
|
| 647 |
+
Tk_Window tkwin);
|
| 648 |
+
/* 205 */
|
| 649 |
+
EXTERN Tcl_Obj * Tk_GetOptionValue(Tcl_Interp *interp,
|
| 650 |
+
char *recordPtr, Tk_OptionTable optionTable,
|
| 651 |
+
Tcl_Obj *namePtr, Tk_Window tkwin);
|
| 652 |
+
/* 206 */
|
| 653 |
+
EXTERN int Tk_GetJustifyFromObj(Tcl_Interp *interp,
|
| 654 |
+
Tcl_Obj *objPtr, Tk_Justify *justifyPtr);
|
| 655 |
+
/* 207 */
|
| 656 |
+
EXTERN int Tk_GetMMFromObj(Tcl_Interp *interp, Tk_Window tkwin,
|
| 657 |
+
Tcl_Obj *objPtr, double *doublePtr);
|
| 658 |
+
/* 208 */
|
| 659 |
+
EXTERN int Tk_GetPixelsFromObj(Tcl_Interp *interp,
|
| 660 |
+
Tk_Window tkwin, Tcl_Obj *objPtr,
|
| 661 |
+
int *intPtr);
|
| 662 |
+
/* 209 */
|
| 663 |
+
EXTERN int Tk_GetReliefFromObj(Tcl_Interp *interp,
|
| 664 |
+
Tcl_Obj *objPtr, int *resultPtr);
|
| 665 |
+
/* 210 */
|
| 666 |
+
EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, int objc,
|
| 667 |
+
Tcl_Obj *const objv[], double *dblPtr,
|
| 668 |
+
int *intPtr);
|
| 669 |
+
/* 211 */
|
| 670 |
+
EXTERN int Tk_InitOptions(Tcl_Interp *interp, char *recordPtr,
|
| 671 |
+
Tk_OptionTable optionToken, Tk_Window tkwin);
|
| 672 |
+
/* 212 */
|
| 673 |
+
EXTERN void Tk_MainEx(int argc, char **argv,
|
| 674 |
+
Tcl_AppInitProc *appInitProc,
|
| 675 |
+
Tcl_Interp *interp);
|
| 676 |
+
/* 213 */
|
| 677 |
+
EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr);
|
| 678 |
+
/* 214 */
|
| 679 |
+
EXTERN int Tk_SetOptions(Tcl_Interp *interp, char *recordPtr,
|
| 680 |
+
Tk_OptionTable optionTable, int objc,
|
| 681 |
+
Tcl_Obj *const objv[], Tk_Window tkwin,
|
| 682 |
+
Tk_SavedOptions *savePtr, int *maskPtr);
|
| 683 |
+
/* 215 */
|
| 684 |
+
EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp);
|
| 685 |
+
/* 216 */
|
| 686 |
+
EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
|
| 687 |
+
/* 217 */
|
| 688 |
+
EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp,
|
| 689 |
+
const Tk_SmoothMethod *method);
|
| 690 |
+
/* Slot 218 is reserved */
|
| 691 |
+
/* Slot 219 is reserved */
|
| 692 |
+
/* 220 */
|
| 693 |
+
EXTERN int Tk_GetDash(Tcl_Interp *interp, const char *value,
|
| 694 |
+
Tk_Dash *dash);
|
| 695 |
+
/* 221 */
|
| 696 |
+
EXTERN void Tk_CreateOutline(Tk_Outline *outline);
|
| 697 |
+
/* 222 */
|
| 698 |
+
EXTERN void Tk_DeleteOutline(Display *display,
|
| 699 |
+
Tk_Outline *outline);
|
| 700 |
+
/* 223 */
|
| 701 |
+
EXTERN int Tk_ConfigOutlineGC(XGCValues *gcValues,
|
| 702 |
+
Tk_Canvas canvas, Tk_Item *item,
|
| 703 |
+
Tk_Outline *outline);
|
| 704 |
+
/* 224 */
|
| 705 |
+
EXTERN int Tk_ChangeOutlineGC(Tk_Canvas canvas, Tk_Item *item,
|
| 706 |
+
Tk_Outline *outline);
|
| 707 |
+
/* 225 */
|
| 708 |
+
EXTERN int Tk_ResetOutlineGC(Tk_Canvas canvas, Tk_Item *item,
|
| 709 |
+
Tk_Outline *outline);
|
| 710 |
+
/* 226 */
|
| 711 |
+
EXTERN int Tk_CanvasPsOutline(Tk_Canvas canvas, Tk_Item *item,
|
| 712 |
+
Tk_Outline *outline);
|
| 713 |
+
/* 227 */
|
| 714 |
+
EXTERN void Tk_SetTSOrigin(Tk_Window tkwin, GC gc, int x, int y);
|
| 715 |
+
/* 228 */
|
| 716 |
+
EXTERN int Tk_CanvasGetCoordFromObj(Tcl_Interp *interp,
|
| 717 |
+
Tk_Canvas canvas, Tcl_Obj *obj,
|
| 718 |
+
double *doublePtr);
|
| 719 |
+
/* 229 */
|
| 720 |
+
EXTERN void Tk_CanvasSetOffset(Tk_Canvas canvas, GC gc,
|
| 721 |
+
Tk_TSOffset *offset);
|
| 722 |
+
/* 230 */
|
| 723 |
+
EXTERN void Tk_DitherPhoto(Tk_PhotoHandle handle, int x, int y,
|
| 724 |
+
int width, int height);
|
| 725 |
+
/* 231 */
|
| 726 |
+
EXTERN int Tk_PostscriptBitmap(Tcl_Interp *interp,
|
| 727 |
+
Tk_Window tkwin, Tk_PostscriptInfo psInfo,
|
| 728 |
+
Pixmap bitmap, int startX, int startY,
|
| 729 |
+
int width, int height);
|
| 730 |
+
/* 232 */
|
| 731 |
+
EXTERN int Tk_PostscriptColor(Tcl_Interp *interp,
|
| 732 |
+
Tk_PostscriptInfo psInfo, XColor *colorPtr);
|
| 733 |
+
/* 233 */
|
| 734 |
+
EXTERN int Tk_PostscriptFont(Tcl_Interp *interp,
|
| 735 |
+
Tk_PostscriptInfo psInfo, Tk_Font font);
|
| 736 |
+
/* 234 */
|
| 737 |
+
EXTERN int Tk_PostscriptImage(Tk_Image image,
|
| 738 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 739 |
+
Tk_PostscriptInfo psinfo, int x, int y,
|
| 740 |
+
int width, int height, int prepass);
|
| 741 |
+
/* 235 */
|
| 742 |
+
EXTERN void Tk_PostscriptPath(Tcl_Interp *interp,
|
| 743 |
+
Tk_PostscriptInfo psInfo, double *coordPtr,
|
| 744 |
+
int numPoints);
|
| 745 |
+
/* 236 */
|
| 746 |
+
EXTERN int Tk_PostscriptStipple(Tcl_Interp *interp,
|
| 747 |
+
Tk_Window tkwin, Tk_PostscriptInfo psInfo,
|
| 748 |
+
Pixmap bitmap);
|
| 749 |
+
/* 237 */
|
| 750 |
+
EXTERN double Tk_PostscriptY(double y, Tk_PostscriptInfo psInfo);
|
| 751 |
+
/* 238 */
|
| 752 |
+
EXTERN int Tk_PostscriptPhoto(Tcl_Interp *interp,
|
| 753 |
+
Tk_PhotoImageBlock *blockPtr,
|
| 754 |
+
Tk_PostscriptInfo psInfo, int width,
|
| 755 |
+
int height);
|
| 756 |
+
/* 239 */
|
| 757 |
+
EXTERN void Tk_CreateClientMessageHandler(
|
| 758 |
+
Tk_ClientMessageProc *proc);
|
| 759 |
+
/* 240 */
|
| 760 |
+
EXTERN void Tk_DeleteClientMessageHandler(
|
| 761 |
+
Tk_ClientMessageProc *proc);
|
| 762 |
+
/* 241 */
|
| 763 |
+
EXTERN Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp,
|
| 764 |
+
Tk_Window parent, const char *screenName);
|
| 765 |
+
/* 242 */
|
| 766 |
+
EXTERN void Tk_SetClassProcs(Tk_Window tkwin,
|
| 767 |
+
const Tk_ClassProcs *procs,
|
| 768 |
+
ClientData instanceData);
|
| 769 |
+
/* 243 */
|
| 770 |
+
EXTERN void Tk_SetInternalBorderEx(Tk_Window tkwin, int left,
|
| 771 |
+
int right, int top, int bottom);
|
| 772 |
+
/* 244 */
|
| 773 |
+
EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin,
|
| 774 |
+
int minWidth, int minHeight);
|
| 775 |
+
/* 245 */
|
| 776 |
+
EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y,
|
| 777 |
+
int height);
|
| 778 |
+
/* 246 */
|
| 779 |
+
EXTERN void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
|
| 780 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 781 |
+
int width, int height, int compRule);
|
| 782 |
+
/* 247 */
|
| 783 |
+
EXTERN void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle,
|
| 784 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 785 |
+
int width, int height, int zoomX, int zoomY,
|
| 786 |
+
int subsampleX, int subsampleY, int compRule);
|
| 787 |
+
/* 248 */
|
| 788 |
+
EXTERN int Tk_CollapseMotionEvents(Display *display,
|
| 789 |
+
int collapse);
|
| 790 |
+
/* 249 */
|
| 791 |
+
EXTERN Tk_StyleEngine Tk_RegisterStyleEngine(const char *name,
|
| 792 |
+
Tk_StyleEngine parent);
|
| 793 |
+
/* 250 */
|
| 794 |
+
EXTERN Tk_StyleEngine Tk_GetStyleEngine(const char *name);
|
| 795 |
+
/* 251 */
|
| 796 |
+
EXTERN int Tk_RegisterStyledElement(Tk_StyleEngine engine,
|
| 797 |
+
Tk_ElementSpec *templatePtr);
|
| 798 |
+
/* 252 */
|
| 799 |
+
EXTERN int Tk_GetElementId(const char *name);
|
| 800 |
+
/* 253 */
|
| 801 |
+
EXTERN Tk_Style Tk_CreateStyle(const char *name,
|
| 802 |
+
Tk_StyleEngine engine, ClientData clientData);
|
| 803 |
+
/* 254 */
|
| 804 |
+
EXTERN Tk_Style Tk_GetStyle(Tcl_Interp *interp, const char *name);
|
| 805 |
+
/* 255 */
|
| 806 |
+
EXTERN void Tk_FreeStyle(Tk_Style style);
|
| 807 |
+
/* 256 */
|
| 808 |
+
EXTERN const char * Tk_NameOfStyle(Tk_Style style);
|
| 809 |
+
/* 257 */
|
| 810 |
+
EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp,
|
| 811 |
+
Tcl_Obj *objPtr);
|
| 812 |
+
/* 258 */
|
| 813 |
+
EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr);
|
| 814 |
+
/* 259 */
|
| 815 |
+
EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr);
|
| 816 |
+
/* 260 */
|
| 817 |
+
EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style, int elementId,
|
| 818 |
+
Tk_OptionTable optionTable);
|
| 819 |
+
/* 261 */
|
| 820 |
+
EXTERN void Tk_GetElementSize(Tk_Style style,
|
| 821 |
+
Tk_StyledElement element, char *recordPtr,
|
| 822 |
+
Tk_Window tkwin, int width, int height,
|
| 823 |
+
int inner, int *widthPtr, int *heightPtr);
|
| 824 |
+
/* 262 */
|
| 825 |
+
EXTERN void Tk_GetElementBox(Tk_Style style,
|
| 826 |
+
Tk_StyledElement element, char *recordPtr,
|
| 827 |
+
Tk_Window tkwin, int x, int y, int width,
|
| 828 |
+
int height, int inner, int *xPtr, int *yPtr,
|
| 829 |
+
int *widthPtr, int *heightPtr);
|
| 830 |
+
/* 263 */
|
| 831 |
+
EXTERN int Tk_GetElementBorderWidth(Tk_Style style,
|
| 832 |
+
Tk_StyledElement element, char *recordPtr,
|
| 833 |
+
Tk_Window tkwin);
|
| 834 |
+
/* 264 */
|
| 835 |
+
EXTERN void Tk_DrawElement(Tk_Style style,
|
| 836 |
+
Tk_StyledElement element, char *recordPtr,
|
| 837 |
+
Tk_Window tkwin, Drawable d, int x, int y,
|
| 838 |
+
int width, int height, int state);
|
| 839 |
+
/* 265 */
|
| 840 |
+
EXTERN int Tk_PhotoExpand(Tcl_Interp *interp,
|
| 841 |
+
Tk_PhotoHandle handle, int width, int height);
|
| 842 |
+
/* 266 */
|
| 843 |
+
EXTERN int Tk_PhotoPutBlock(Tcl_Interp *interp,
|
| 844 |
+
Tk_PhotoHandle handle,
|
| 845 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 846 |
+
int width, int height, int compRule);
|
| 847 |
+
/* 267 */
|
| 848 |
+
EXTERN int Tk_PhotoPutZoomedBlock(Tcl_Interp *interp,
|
| 849 |
+
Tk_PhotoHandle handle,
|
| 850 |
+
Tk_PhotoImageBlock *blockPtr, int x, int y,
|
| 851 |
+
int width, int height, int zoomX, int zoomY,
|
| 852 |
+
int subsampleX, int subsampleY, int compRule);
|
| 853 |
+
/* 268 */
|
| 854 |
+
EXTERN int Tk_PhotoSetSize(Tcl_Interp *interp,
|
| 855 |
+
Tk_PhotoHandle handle, int width, int height);
|
| 856 |
+
/* 269 */
|
| 857 |
+
EXTERN long Tk_GetUserInactiveTime(Display *dpy);
|
| 858 |
+
/* 270 */
|
| 859 |
+
EXTERN void Tk_ResetUserInactiveTime(Display *dpy);
|
| 860 |
+
/* 271 */
|
| 861 |
+
EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin);
|
| 862 |
+
/* 272 */
|
| 863 |
+
EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr);
|
| 864 |
+
/* 273 */
|
| 865 |
+
EXTERN void Tk_CreateOldPhotoImageFormat(
|
| 866 |
+
const Tk_PhotoImageFormat *formatPtr);
|
| 867 |
+
/* Slot 274 is reserved */
|
| 868 |
+
/* Slot 275 is reserved */
|
| 869 |
+
/* Slot 276 is reserved */
|
| 870 |
+
/* Slot 277 is reserved */
|
| 871 |
+
/* Slot 278 is reserved */
|
| 872 |
+
/* Slot 279 is reserved */
|
| 873 |
+
/* Slot 280 is reserved */
|
| 874 |
+
/* Slot 281 is reserved */
|
| 875 |
+
/* Slot 282 is reserved */
|
| 876 |
+
/* Slot 283 is reserved */
|
| 877 |
+
/* Slot 284 is reserved */
|
| 878 |
+
/* Slot 285 is reserved */
|
| 879 |
+
/* Slot 286 is reserved */
|
| 880 |
+
/* Slot 287 is reserved */
|
| 881 |
+
/* Slot 288 is reserved */
|
| 882 |
+
/* Slot 289 is reserved */
|
| 883 |
+
/* 290 */
|
| 884 |
+
EXTERN void TkUnusedStubEntry(void);
|
| 885 |
+
|
| 886 |
+
typedef struct {
|
| 887 |
+
const struct TkPlatStubs *tkPlatStubs;
|
| 888 |
+
const struct TkIntStubs *tkIntStubs;
|
| 889 |
+
const struct TkIntPlatStubs *tkIntPlatStubs;
|
| 890 |
+
const struct TkIntXlibStubs *tkIntXlibStubs;
|
| 891 |
+
} TkStubHooks;
|
| 892 |
+
|
| 893 |
+
typedef struct TkStubs {
|
| 894 |
+
int magic;
|
| 895 |
+
const TkStubHooks *hooks;
|
| 896 |
+
|
| 897 |
+
void (*tk_MainLoop) (void); /* 0 */
|
| 898 |
+
XColor * (*tk_3DBorderColor) (Tk_3DBorder border); /* 1 */
|
| 899 |
+
GC (*tk_3DBorderGC) (Tk_Window tkwin, Tk_3DBorder border, int which); /* 2 */
|
| 900 |
+
void (*tk_3DHorizontalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief); /* 3 */
|
| 901 |
+
void (*tk_3DVerticalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief); /* 4 */
|
| 902 |
+
void (*tk_AddOption) (Tk_Window tkwin, const char *name, const char *value, int priority); /* 5 */
|
| 903 |
+
void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, int numObjects, ClientData *objectPtr); /* 6 */
|
| 904 |
+
void (*tk_CanvasDrawableCoords) (Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr); /* 7 */
|
| 905 |
+
void (*tk_CanvasEventuallyRedraw) (Tk_Canvas canvas, int x1, int y1, int x2, int y2); /* 8 */
|
| 906 |
+
int (*tk_CanvasGetCoord) (Tcl_Interp *interp, Tk_Canvas canvas, const char *str, double *doublePtr); /* 9 */
|
| 907 |
+
Tk_CanvasTextInfo * (*tk_CanvasGetTextInfo) (Tk_Canvas canvas); /* 10 */
|
| 908 |
+
int (*tk_CanvasPsBitmap) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height); /* 11 */
|
| 909 |
+
int (*tk_CanvasPsColor) (Tcl_Interp *interp, Tk_Canvas canvas, XColor *colorPtr); /* 12 */
|
| 910 |
+
int (*tk_CanvasPsFont) (Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 13 */
|
| 911 |
+
void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, int numPoints); /* 14 */
|
| 912 |
+
int (*tk_CanvasPsStipple) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); /* 15 */
|
| 913 |
+
double (*tk_CanvasPsY) (Tk_Canvas canvas, double y); /* 16 */
|
| 914 |
+
void (*tk_CanvasSetStippleOrigin) (Tk_Canvas canvas, GC gc); /* 17 */
|
| 915 |
+
int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 18 */
|
| 916 |
+
CONST86 char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 19 */
|
| 917 |
+
Tk_Window (*tk_CanvasTkwin) (Tk_Canvas canvas); /* 20 */
|
| 918 |
+
void (*tk_CanvasWindowCoords) (Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr); /* 21 */
|
| 919 |
+
void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */
|
| 920 |
+
int (*tk_CharBbox) (Tk_TextLayout layout, int index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */
|
| 921 |
+
void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */
|
| 922 |
+
int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */
|
| 923 |
+
int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */
|
| 924 |
+
int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 27 */
|
| 925 |
+
int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 28 */
|
| 926 |
+
int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, int argc, CONST84 char **argv, char *widgRec, int flags); /* 29 */
|
| 927 |
+
void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */
|
| 928 |
+
Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */
|
| 929 |
+
Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */
|
| 930 |
+
unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *script, int append); /* 33 */
|
| 931 |
+
Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */
|
| 932 |
+
Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, ClientData clientData); /* 35 */
|
| 933 |
+
void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 36 */
|
| 934 |
+
void (*tk_CreateGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 37 */
|
| 935 |
+
void (*tk_CreateImageType) (const Tk_ImageType *typePtr); /* 38 */
|
| 936 |
+
void (*tk_CreateItemType) (Tk_ItemType *typePtr); /* 39 */
|
| 937 |
+
void (*tk_CreatePhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 40 */
|
| 938 |
+
void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format); /* 41 */
|
| 939 |
+
Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); /* 42 */
|
| 940 |
+
Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 43 */
|
| 941 |
+
int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 44 */
|
| 942 |
+
void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */
|
| 943 |
+
void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */
|
| 944 |
+
int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 47 */
|
| 945 |
+
void (*tk_DeleteBindingTable) (Tk_BindingTable bindingTable); /* 48 */
|
| 946 |
+
void (*tk_DeleteErrorHandler) (Tk_ErrorHandler handler); /* 49 */
|
| 947 |
+
void (*tk_DeleteEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 50 */
|
| 948 |
+
void (*tk_DeleteGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 51 */
|
| 949 |
+
void (*tk_DeleteImage) (Tcl_Interp *interp, const char *name); /* 52 */
|
| 950 |
+
void (*tk_DeleteSelHandler) (Tk_Window tkwin, Atom selection, Atom target); /* 53 */
|
| 951 |
+
void (*tk_DestroyWindow) (Tk_Window tkwin); /* 54 */
|
| 952 |
+
CONST84_RETURN char * (*tk_DisplayName) (Tk_Window tkwin); /* 55 */
|
| 953 |
+
int (*tk_DistanceToTextLayout) (Tk_TextLayout layout, int x, int y); /* 56 */
|
| 954 |
+
void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 57 */
|
| 955 |
+
void (*tk_Draw3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 58 */
|
| 956 |
+
void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, int x, int y); /* 59 */
|
| 957 |
+
void (*tk_DrawFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable); /* 60 */
|
| 958 |
+
void (*tk_DrawTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar); /* 61 */
|
| 959 |
+
void (*tk_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 62 */
|
| 960 |
+
void (*tk_Fill3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 63 */
|
| 961 |
+
Tk_PhotoHandle (*tk_FindPhoto) (Tcl_Interp *interp, const char *imageName); /* 64 */
|
| 962 |
+
Font (*tk_FontId) (Tk_Font font); /* 65 */
|
| 963 |
+
void (*tk_Free3DBorder) (Tk_3DBorder border); /* 66 */
|
| 964 |
+
void (*tk_FreeBitmap) (Display *display, Pixmap bitmap); /* 67 */
|
| 965 |
+
void (*tk_FreeColor) (XColor *colorPtr); /* 68 */
|
| 966 |
+
void (*tk_FreeColormap) (Display *display, Colormap colormap); /* 69 */
|
| 967 |
+
void (*tk_FreeCursor) (Display *display, Tk_Cursor cursor); /* 70 */
|
| 968 |
+
void (*tk_FreeFont) (Tk_Font f); /* 71 */
|
| 969 |
+
void (*tk_FreeGC) (Display *display, GC gc); /* 72 */
|
| 970 |
+
void (*tk_FreeImage) (Tk_Image image); /* 73 */
|
| 971 |
+
void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags); /* 74 */
|
| 972 |
+
void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */
|
| 973 |
+
void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */
|
| 974 |
+
void (*tk_FreeXId) (Display *display, XID xid); /* 77 */
|
| 975 |
+
GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */
|
| 976 |
+
void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */
|
| 977 |
+
Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */
|
| 978 |
+
void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object); /* 81 */
|
| 979 |
+
int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */
|
| 980 |
+
CONST84_RETURN char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */
|
| 981 |
+
CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 84 */
|
| 982 |
+
Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */
|
| 983 |
+
Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 86 */
|
| 984 |
+
int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */
|
| 985 |
+
XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name); /* 88 */
|
| 986 |
+
XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */
|
| 987 |
+
Colormap (*tk_GetColormap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 90 */
|
| 988 |
+
Tk_Cursor (*tk_GetCursor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid str); /* 91 */
|
| 989 |
+
Tk_Cursor (*tk_GetCursorFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg); /* 92 */
|
| 990 |
+
Tk_Font (*tk_GetFont) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 93 */
|
| 991 |
+
Tk_Font (*tk_GetFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 94 */
|
| 992 |
+
void (*tk_GetFontMetrics) (Tk_Font font, Tk_FontMetrics *fmPtr); /* 95 */
|
| 993 |
+
GC (*tk_GetGC) (Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr); /* 96 */
|
| 994 |
+
Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, ClientData clientData); /* 97 */
|
| 995 |
+
ClientData (*tk_GetImageMasterData) (Tcl_Interp *interp, const char *name, CONST86 Tk_ImageType **typePtrPtr); /* 98 */
|
| 996 |
+
Tk_ItemType * (*tk_GetItemTypes) (void); /* 99 */
|
| 997 |
+
int (*tk_GetJoinStyle) (Tcl_Interp *interp, const char *str, int *joinPtr); /* 100 */
|
| 998 |
+
int (*tk_GetJustify) (Tcl_Interp *interp, const char *str, Tk_Justify *justifyPtr); /* 101 */
|
| 999 |
+
int (*tk_GetNumMainWindows) (void); /* 102 */
|
| 1000 |
+
Tk_Uid (*tk_GetOption) (Tk_Window tkwin, const char *name, const char *className); /* 103 */
|
| 1001 |
+
int (*tk_GetPixels) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *intPtr); /* 104 */
|
| 1002 |
+
Pixmap (*tk_GetPixmap) (Display *display, Drawable d, int width, int height, int depth); /* 105 */
|
| 1003 |
+
int (*tk_GetRelief) (Tcl_Interp *interp, const char *name, int *reliefPtr); /* 106 */
|
| 1004 |
+
void (*tk_GetRootCoords) (Tk_Window tkwin, int *xPtr, int *yPtr); /* 107 */
|
| 1005 |
+
int (*tk_GetScrollInfo) (Tcl_Interp *interp, int argc, CONST84 char **argv, double *dblPtr, int *intPtr); /* 108 */
|
| 1006 |
+
int (*tk_GetScreenMM) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, double *doublePtr); /* 109 */
|
| 1007 |
+
int (*tk_GetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 110 */
|
| 1008 |
+
Tk_Uid (*tk_GetUid) (const char *str); /* 111 */
|
| 1009 |
+
Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */
|
| 1010 |
+
void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */
|
| 1011 |
+
int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */
|
| 1012 |
+
void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */
|
| 1013 |
+
Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */
|
| 1014 |
+
void (*tk_ImageChanged) (Tk_ImageMaster model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
|
| 1015 |
+
int (*tk_Init) (Tcl_Interp *interp); /* 118 */
|
| 1016 |
+
Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */
|
| 1017 |
+
int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */
|
| 1018 |
+
void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */
|
| 1019 |
+
Tk_Window (*tk_MainWindow) (Tcl_Interp *interp); /* 122 */
|
| 1020 |
+
void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */
|
| 1021 |
+
void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */
|
| 1022 |
+
void (*tk_MapWindow) (Tk_Window tkwin); /* 125 */
|
| 1023 |
+
int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, int numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */
|
| 1024 |
+
void (*tk_MoveResizeWindow) (Tk_Window tkwin, int x, int y, int width, int height); /* 127 */
|
| 1025 |
+
void (*tk_MoveWindow) (Tk_Window tkwin, int x, int y); /* 128 */
|
| 1026 |
+
void (*tk_MoveToplevelWindow) (Tk_Window tkwin, int x, int y); /* 129 */
|
| 1027 |
+
CONST84_RETURN char * (*tk_NameOf3DBorder) (Tk_3DBorder border); /* 130 */
|
| 1028 |
+
CONST84_RETURN char * (*tk_NameOfAnchor) (Tk_Anchor anchor); /* 131 */
|
| 1029 |
+
CONST84_RETURN char * (*tk_NameOfBitmap) (Display *display, Pixmap bitmap); /* 132 */
|
| 1030 |
+
CONST84_RETURN char * (*tk_NameOfCapStyle) (int cap); /* 133 */
|
| 1031 |
+
CONST84_RETURN char * (*tk_NameOfColor) (XColor *colorPtr); /* 134 */
|
| 1032 |
+
CONST84_RETURN char * (*tk_NameOfCursor) (Display *display, Tk_Cursor cursor); /* 135 */
|
| 1033 |
+
CONST84_RETURN char * (*tk_NameOfFont) (Tk_Font font); /* 136 */
|
| 1034 |
+
CONST84_RETURN char * (*tk_NameOfImage) (Tk_ImageMaster model); /* 137 */
|
| 1035 |
+
CONST84_RETURN char * (*tk_NameOfJoinStyle) (int join); /* 138 */
|
| 1036 |
+
CONST84_RETURN char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */
|
| 1037 |
+
CONST84_RETURN char * (*tk_NameOfRelief) (int relief); /* 140 */
|
| 1038 |
+
Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */
|
| 1039 |
+
void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, ClientData clientData); /* 142 */
|
| 1040 |
+
int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, CONST84 char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */
|
| 1041 |
+
void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */
|
| 1042 |
+
void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */
|
| 1043 |
+
int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */
|
| 1044 |
+
void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */
|
| 1045 |
+
void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */
|
| 1046 |
+
void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */
|
| 1047 |
+
void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */
|
| 1048 |
+
int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */
|
| 1049 |
+
int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */
|
| 1050 |
+
void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */
|
| 1051 |
+
void (*tk_QueueWindowEvent) (XEvent *eventPtr, Tcl_QueuePosition position); /* 154 */
|
| 1052 |
+
void (*tk_RedrawImage) (Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY); /* 155 */
|
| 1053 |
+
void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */
|
| 1054 |
+
int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */
|
| 1055 |
+
Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, ClientData arg, ClientData *prevArgPtr); /* 158 */
|
| 1056 |
+
int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */
|
| 1057 |
+
const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */
|
| 1058 |
+
void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */
|
| 1059 |
+
void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */
|
| 1060 |
+
void (*tk_SetGrid) (Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight); /* 163 */
|
| 1061 |
+
void (*tk_SetInternalBorder) (Tk_Window tkwin, int width); /* 164 */
|
| 1062 |
+
void (*tk_SetWindowBackground) (Tk_Window tkwin, unsigned long pixel); /* 165 */
|
| 1063 |
+
void (*tk_SetWindowBackgroundPixmap) (Tk_Window tkwin, Pixmap pixmap); /* 166 */
|
| 1064 |
+
void (*tk_SetWindowBorder) (Tk_Window tkwin, unsigned long pixel); /* 167 */
|
| 1065 |
+
void (*tk_SetWindowBorderWidth) (Tk_Window tkwin, int width); /* 168 */
|
| 1066 |
+
void (*tk_SetWindowBorderPixmap) (Tk_Window tkwin, Pixmap pixmap); /* 169 */
|
| 1067 |
+
void (*tk_SetWindowColormap) (Tk_Window tkwin, Colormap colormap); /* 170 */
|
| 1068 |
+
int (*tk_SetWindowVisual) (Tk_Window tkwin, Visual *visual, int depth, Colormap colormap); /* 171 */
|
| 1069 |
+
void (*tk_SizeOfBitmap) (Display *display, Pixmap bitmap, int *widthPtr, int *heightPtr); /* 172 */
|
| 1070 |
+
void (*tk_SizeOfImage) (Tk_Image image, int *widthPtr, int *heightPtr); /* 173 */
|
| 1071 |
+
int (*tk_StrictMotif) (Tk_Window tkwin); /* 174 */
|
| 1072 |
+
void (*tk_TextLayoutToPostscript) (Tcl_Interp *interp, Tk_TextLayout layout); /* 175 */
|
| 1073 |
+
int (*tk_TextWidth) (Tk_Font font, const char *str, int numBytes); /* 176 */
|
| 1074 |
+
void (*tk_UndefineCursor) (Tk_Window window); /* 177 */
|
| 1075 |
+
void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, int firstByte, int lastByte); /* 178 */
|
| 1076 |
+
void (*tk_UnderlineTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline); /* 179 */
|
| 1077 |
+
void (*tk_Ungrab) (Tk_Window tkwin); /* 180 */
|
| 1078 |
+
void (*tk_UnmaintainGeometry) (Tk_Window window, Tk_Window container); /* 181 */
|
| 1079 |
+
void (*tk_UnmapWindow) (Tk_Window tkwin); /* 182 */
|
| 1080 |
+
void (*tk_UnsetGrid) (Tk_Window tkwin); /* 183 */
|
| 1081 |
+
void (*tk_UpdatePointer) (Tk_Window tkwin, int x, int y, int state); /* 184 */
|
| 1082 |
+
Pixmap (*tk_AllocBitmapFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 185 */
|
| 1083 |
+
Tk_3DBorder (*tk_Alloc3DBorderFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 186 */
|
| 1084 |
+
XColor * (*tk_AllocColorFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 187 */
|
| 1085 |
+
Tk_Cursor (*tk_AllocCursorFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 188 */
|
| 1086 |
+
Tk_Font (*tk_AllocFontFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 189 */
|
| 1087 |
+
Tk_OptionTable (*tk_CreateOptionTable) (Tcl_Interp *interp, const Tk_OptionSpec *templatePtr); /* 190 */
|
| 1088 |
+
void (*tk_DeleteOptionTable) (Tk_OptionTable optionTable); /* 191 */
|
| 1089 |
+
void (*tk_Free3DBorderFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 192 */
|
| 1090 |
+
void (*tk_FreeBitmapFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 193 */
|
| 1091 |
+
void (*tk_FreeColorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 194 */
|
| 1092 |
+
void (*tk_FreeConfigOptions) (char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 195 */
|
| 1093 |
+
void (*tk_FreeSavedOptions) (Tk_SavedOptions *savePtr); /* 196 */
|
| 1094 |
+
void (*tk_FreeCursorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 197 */
|
| 1095 |
+
void (*tk_FreeFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 198 */
|
| 1096 |
+
Tk_3DBorder (*tk_Get3DBorderFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 199 */
|
| 1097 |
+
int (*tk_GetAnchorFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Anchor *anchorPtr); /* 200 */
|
| 1098 |
+
Pixmap (*tk_GetBitmapFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 201 */
|
| 1099 |
+
XColor * (*tk_GetColorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 202 */
|
| 1100 |
+
Tk_Cursor (*tk_GetCursorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 203 */
|
| 1101 |
+
Tcl_Obj * (*tk_GetOptionInfo) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 204 */
|
| 1102 |
+
Tcl_Obj * (*tk_GetOptionValue) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 205 */
|
| 1103 |
+
int (*tk_GetJustifyFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Justify *justifyPtr); /* 206 */
|
| 1104 |
+
int (*tk_GetMMFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 207 */
|
| 1105 |
+
int (*tk_GetPixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr); /* 208 */
|
| 1106 |
+
int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */
|
| 1107 |
+
int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */
|
| 1108 |
+
int (*tk_InitOptions) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */
|
| 1109 |
+
void (*tk_MainEx) (int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */
|
| 1110 |
+
void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */
|
| 1111 |
+
int (*tk_SetOptions) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */
|
| 1112 |
+
void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */
|
| 1113 |
+
int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */
|
| 1114 |
+
void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */
|
| 1115 |
+
void (*reserved218)(void);
|
| 1116 |
+
void (*reserved219)(void);
|
| 1117 |
+
int (*tk_GetDash) (Tcl_Interp *interp, const char *value, Tk_Dash *dash); /* 220 */
|
| 1118 |
+
void (*tk_CreateOutline) (Tk_Outline *outline); /* 221 */
|
| 1119 |
+
void (*tk_DeleteOutline) (Display *display, Tk_Outline *outline); /* 222 */
|
| 1120 |
+
int (*tk_ConfigOutlineGC) (XGCValues *gcValues, Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 223 */
|
| 1121 |
+
int (*tk_ChangeOutlineGC) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 224 */
|
| 1122 |
+
int (*tk_ResetOutlineGC) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 225 */
|
| 1123 |
+
int (*tk_CanvasPsOutline) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 226 */
|
| 1124 |
+
void (*tk_SetTSOrigin) (Tk_Window tkwin, GC gc, int x, int y); /* 227 */
|
| 1125 |
+
int (*tk_CanvasGetCoordFromObj) (Tcl_Interp *interp, Tk_Canvas canvas, Tcl_Obj *obj, double *doublePtr); /* 228 */
|
| 1126 |
+
void (*tk_CanvasSetOffset) (Tk_Canvas canvas, GC gc, Tk_TSOffset *offset); /* 229 */
|
| 1127 |
+
void (*tk_DitherPhoto) (Tk_PhotoHandle handle, int x, int y, int width, int height); /* 230 */
|
| 1128 |
+
int (*tk_PostscriptBitmap) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, int startY, int width, int height); /* 231 */
|
| 1129 |
+
int (*tk_PostscriptColor) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, XColor *colorPtr); /* 232 */
|
| 1130 |
+
int (*tk_PostscriptFont) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font); /* 233 */
|
| 1131 |
+
int (*tk_PostscriptImage) (Tk_Image image, Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass); /* 234 */
|
| 1132 |
+
void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints); /* 235 */
|
| 1133 |
+
int (*tk_PostscriptStipple) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap); /* 236 */
|
| 1134 |
+
double (*tk_PostscriptY) (double y, Tk_PostscriptInfo psInfo); /* 237 */
|
| 1135 |
+
int (*tk_PostscriptPhoto) (Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, int width, int height); /* 238 */
|
| 1136 |
+
void (*tk_CreateClientMessageHandler) (Tk_ClientMessageProc *proc); /* 239 */
|
| 1137 |
+
void (*tk_DeleteClientMessageHandler) (Tk_ClientMessageProc *proc); /* 240 */
|
| 1138 |
+
Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */
|
| 1139 |
+
void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, ClientData instanceData); /* 242 */
|
| 1140 |
+
void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */
|
| 1141 |
+
void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */
|
| 1142 |
+
void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */
|
| 1143 |
+
void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */
|
| 1144 |
+
void (*tk_PhotoPutZoomedBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 247 */
|
| 1145 |
+
int (*tk_CollapseMotionEvents) (Display *display, int collapse); /* 248 */
|
| 1146 |
+
Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */
|
| 1147 |
+
Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */
|
| 1148 |
+
int (*tk_RegisterStyledElement) (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr); /* 251 */
|
| 1149 |
+
int (*tk_GetElementId) (const char *name); /* 252 */
|
| 1150 |
+
Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, ClientData clientData); /* 253 */
|
| 1151 |
+
Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, const char *name); /* 254 */
|
| 1152 |
+
void (*tk_FreeStyle) (Tk_Style style); /* 255 */
|
| 1153 |
+
const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */
|
| 1154 |
+
Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */
|
| 1155 |
+
Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */
|
| 1156 |
+
void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */
|
| 1157 |
+
Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, int elementId, Tk_OptionTable optionTable); /* 260 */
|
| 1158 |
+
void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */
|
| 1159 |
+
void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */
|
| 1160 |
+
int (*tk_GetElementBorderWidth) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin); /* 263 */
|
| 1161 |
+
void (*tk_DrawElement) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state); /* 264 */
|
| 1162 |
+
int (*tk_PhotoExpand) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 265 */
|
| 1163 |
+
int (*tk_PhotoPutBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 266 */
|
| 1164 |
+
int (*tk_PhotoPutZoomedBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 267 */
|
| 1165 |
+
int (*tk_PhotoSetSize) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 268 */
|
| 1166 |
+
long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */
|
| 1167 |
+
void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */
|
| 1168 |
+
Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */
|
| 1169 |
+
void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */
|
| 1170 |
+
void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */
|
| 1171 |
+
void (*reserved274)(void);
|
| 1172 |
+
void (*reserved275)(void);
|
| 1173 |
+
void (*reserved276)(void);
|
| 1174 |
+
void (*reserved277)(void);
|
| 1175 |
+
void (*reserved278)(void);
|
| 1176 |
+
void (*reserved279)(void);
|
| 1177 |
+
void (*reserved280)(void);
|
| 1178 |
+
void (*reserved281)(void);
|
| 1179 |
+
void (*reserved282)(void);
|
| 1180 |
+
void (*reserved283)(void);
|
| 1181 |
+
void (*reserved284)(void);
|
| 1182 |
+
void (*reserved285)(void);
|
| 1183 |
+
void (*reserved286)(void);
|
| 1184 |
+
void (*reserved287)(void);
|
| 1185 |
+
void (*reserved288)(void);
|
| 1186 |
+
void (*reserved289)(void);
|
| 1187 |
+
void (*tkUnusedStubEntry) (void); /* 290 */
|
| 1188 |
+
} TkStubs;
|
| 1189 |
+
|
| 1190 |
+
extern const TkStubs *tkStubsPtr;
|
| 1191 |
+
|
| 1192 |
+
#ifdef __cplusplus
|
| 1193 |
+
}
|
| 1194 |
+
#endif
|
| 1195 |
+
|
| 1196 |
+
#if defined(USE_TK_STUBS)
|
| 1197 |
+
|
| 1198 |
+
/*
|
| 1199 |
+
* Inline function declarations:
|
| 1200 |
+
*/
|
| 1201 |
+
|
| 1202 |
+
#define Tk_MainLoop \
|
| 1203 |
+
(tkStubsPtr->tk_MainLoop) /* 0 */
|
| 1204 |
+
#define Tk_3DBorderColor \
|
| 1205 |
+
(tkStubsPtr->tk_3DBorderColor) /* 1 */
|
| 1206 |
+
#define Tk_3DBorderGC \
|
| 1207 |
+
(tkStubsPtr->tk_3DBorderGC) /* 2 */
|
| 1208 |
+
#define Tk_3DHorizontalBevel \
|
| 1209 |
+
(tkStubsPtr->tk_3DHorizontalBevel) /* 3 */
|
| 1210 |
+
#define Tk_3DVerticalBevel \
|
| 1211 |
+
(tkStubsPtr->tk_3DVerticalBevel) /* 4 */
|
| 1212 |
+
#define Tk_AddOption \
|
| 1213 |
+
(tkStubsPtr->tk_AddOption) /* 5 */
|
| 1214 |
+
#define Tk_BindEvent \
|
| 1215 |
+
(tkStubsPtr->tk_BindEvent) /* 6 */
|
| 1216 |
+
#define Tk_CanvasDrawableCoords \
|
| 1217 |
+
(tkStubsPtr->tk_CanvasDrawableCoords) /* 7 */
|
| 1218 |
+
#define Tk_CanvasEventuallyRedraw \
|
| 1219 |
+
(tkStubsPtr->tk_CanvasEventuallyRedraw) /* 8 */
|
| 1220 |
+
#define Tk_CanvasGetCoord \
|
| 1221 |
+
(tkStubsPtr->tk_CanvasGetCoord) /* 9 */
|
| 1222 |
+
#define Tk_CanvasGetTextInfo \
|
| 1223 |
+
(tkStubsPtr->tk_CanvasGetTextInfo) /* 10 */
|
| 1224 |
+
#define Tk_CanvasPsBitmap \
|
| 1225 |
+
(tkStubsPtr->tk_CanvasPsBitmap) /* 11 */
|
| 1226 |
+
#define Tk_CanvasPsColor \
|
| 1227 |
+
(tkStubsPtr->tk_CanvasPsColor) /* 12 */
|
| 1228 |
+
#define Tk_CanvasPsFont \
|
| 1229 |
+
(tkStubsPtr->tk_CanvasPsFont) /* 13 */
|
| 1230 |
+
#define Tk_CanvasPsPath \
|
| 1231 |
+
(tkStubsPtr->tk_CanvasPsPath) /* 14 */
|
| 1232 |
+
#define Tk_CanvasPsStipple \
|
| 1233 |
+
(tkStubsPtr->tk_CanvasPsStipple) /* 15 */
|
| 1234 |
+
#define Tk_CanvasPsY \
|
| 1235 |
+
(tkStubsPtr->tk_CanvasPsY) /* 16 */
|
| 1236 |
+
#define Tk_CanvasSetStippleOrigin \
|
| 1237 |
+
(tkStubsPtr->tk_CanvasSetStippleOrigin) /* 17 */
|
| 1238 |
+
#define Tk_CanvasTagsParseProc \
|
| 1239 |
+
(tkStubsPtr->tk_CanvasTagsParseProc) /* 18 */
|
| 1240 |
+
#define Tk_CanvasTagsPrintProc \
|
| 1241 |
+
(tkStubsPtr->tk_CanvasTagsPrintProc) /* 19 */
|
| 1242 |
+
#define Tk_CanvasTkwin \
|
| 1243 |
+
(tkStubsPtr->tk_CanvasTkwin) /* 20 */
|
| 1244 |
+
#define Tk_CanvasWindowCoords \
|
| 1245 |
+
(tkStubsPtr->tk_CanvasWindowCoords) /* 21 */
|
| 1246 |
+
#define Tk_ChangeWindowAttributes \
|
| 1247 |
+
(tkStubsPtr->tk_ChangeWindowAttributes) /* 22 */
|
| 1248 |
+
#define Tk_CharBbox \
|
| 1249 |
+
(tkStubsPtr->tk_CharBbox) /* 23 */
|
| 1250 |
+
#define Tk_ClearSelection \
|
| 1251 |
+
(tkStubsPtr->tk_ClearSelection) /* 24 */
|
| 1252 |
+
#define Tk_ClipboardAppend \
|
| 1253 |
+
(tkStubsPtr->tk_ClipboardAppend) /* 25 */
|
| 1254 |
+
#define Tk_ClipboardClear \
|
| 1255 |
+
(tkStubsPtr->tk_ClipboardClear) /* 26 */
|
| 1256 |
+
#define Tk_ConfigureInfo \
|
| 1257 |
+
(tkStubsPtr->tk_ConfigureInfo) /* 27 */
|
| 1258 |
+
#define Tk_ConfigureValue \
|
| 1259 |
+
(tkStubsPtr->tk_ConfigureValue) /* 28 */
|
| 1260 |
+
#define Tk_ConfigureWidget \
|
| 1261 |
+
(tkStubsPtr->tk_ConfigureWidget) /* 29 */
|
| 1262 |
+
#define Tk_ConfigureWindow \
|
| 1263 |
+
(tkStubsPtr->tk_ConfigureWindow) /* 30 */
|
| 1264 |
+
#define Tk_ComputeTextLayout \
|
| 1265 |
+
(tkStubsPtr->tk_ComputeTextLayout) /* 31 */
|
| 1266 |
+
#define Tk_CoordsToWindow \
|
| 1267 |
+
(tkStubsPtr->tk_CoordsToWindow) /* 32 */
|
| 1268 |
+
#define Tk_CreateBinding \
|
| 1269 |
+
(tkStubsPtr->tk_CreateBinding) /* 33 */
|
| 1270 |
+
#define Tk_CreateBindingTable \
|
| 1271 |
+
(tkStubsPtr->tk_CreateBindingTable) /* 34 */
|
| 1272 |
+
#define Tk_CreateErrorHandler \
|
| 1273 |
+
(tkStubsPtr->tk_CreateErrorHandler) /* 35 */
|
| 1274 |
+
#define Tk_CreateEventHandler \
|
| 1275 |
+
(tkStubsPtr->tk_CreateEventHandler) /* 36 */
|
| 1276 |
+
#define Tk_CreateGenericHandler \
|
| 1277 |
+
(tkStubsPtr->tk_CreateGenericHandler) /* 37 */
|
| 1278 |
+
#define Tk_CreateImageType \
|
| 1279 |
+
(tkStubsPtr->tk_CreateImageType) /* 38 */
|
| 1280 |
+
#define Tk_CreateItemType \
|
| 1281 |
+
(tkStubsPtr->tk_CreateItemType) /* 39 */
|
| 1282 |
+
#define Tk_CreatePhotoImageFormat \
|
| 1283 |
+
(tkStubsPtr->tk_CreatePhotoImageFormat) /* 40 */
|
| 1284 |
+
#define Tk_CreateSelHandler \
|
| 1285 |
+
(tkStubsPtr->tk_CreateSelHandler) /* 41 */
|
| 1286 |
+
#define Tk_CreateWindow \
|
| 1287 |
+
(tkStubsPtr->tk_CreateWindow) /* 42 */
|
| 1288 |
+
#define Tk_CreateWindowFromPath \
|
| 1289 |
+
(tkStubsPtr->tk_CreateWindowFromPath) /* 43 */
|
| 1290 |
+
#define Tk_DefineBitmap \
|
| 1291 |
+
(tkStubsPtr->tk_DefineBitmap) /* 44 */
|
| 1292 |
+
#define Tk_DefineCursor \
|
| 1293 |
+
(tkStubsPtr->tk_DefineCursor) /* 45 */
|
| 1294 |
+
#define Tk_DeleteAllBindings \
|
| 1295 |
+
(tkStubsPtr->tk_DeleteAllBindings) /* 46 */
|
| 1296 |
+
#define Tk_DeleteBinding \
|
| 1297 |
+
(tkStubsPtr->tk_DeleteBinding) /* 47 */
|
| 1298 |
+
#define Tk_DeleteBindingTable \
|
| 1299 |
+
(tkStubsPtr->tk_DeleteBindingTable) /* 48 */
|
| 1300 |
+
#define Tk_DeleteErrorHandler \
|
| 1301 |
+
(tkStubsPtr->tk_DeleteErrorHandler) /* 49 */
|
| 1302 |
+
#define Tk_DeleteEventHandler \
|
| 1303 |
+
(tkStubsPtr->tk_DeleteEventHandler) /* 50 */
|
| 1304 |
+
#define Tk_DeleteGenericHandler \
|
| 1305 |
+
(tkStubsPtr->tk_DeleteGenericHandler) /* 51 */
|
| 1306 |
+
#define Tk_DeleteImage \
|
| 1307 |
+
(tkStubsPtr->tk_DeleteImage) /* 52 */
|
| 1308 |
+
#define Tk_DeleteSelHandler \
|
| 1309 |
+
(tkStubsPtr->tk_DeleteSelHandler) /* 53 */
|
| 1310 |
+
#define Tk_DestroyWindow \
|
| 1311 |
+
(tkStubsPtr->tk_DestroyWindow) /* 54 */
|
| 1312 |
+
#define Tk_DisplayName \
|
| 1313 |
+
(tkStubsPtr->tk_DisplayName) /* 55 */
|
| 1314 |
+
#define Tk_DistanceToTextLayout \
|
| 1315 |
+
(tkStubsPtr->tk_DistanceToTextLayout) /* 56 */
|
| 1316 |
+
#define Tk_Draw3DPolygon \
|
| 1317 |
+
(tkStubsPtr->tk_Draw3DPolygon) /* 57 */
|
| 1318 |
+
#define Tk_Draw3DRectangle \
|
| 1319 |
+
(tkStubsPtr->tk_Draw3DRectangle) /* 58 */
|
| 1320 |
+
#define Tk_DrawChars \
|
| 1321 |
+
(tkStubsPtr->tk_DrawChars) /* 59 */
|
| 1322 |
+
#define Tk_DrawFocusHighlight \
|
| 1323 |
+
(tkStubsPtr->tk_DrawFocusHighlight) /* 60 */
|
| 1324 |
+
#define Tk_DrawTextLayout \
|
| 1325 |
+
(tkStubsPtr->tk_DrawTextLayout) /* 61 */
|
| 1326 |
+
#define Tk_Fill3DPolygon \
|
| 1327 |
+
(tkStubsPtr->tk_Fill3DPolygon) /* 62 */
|
| 1328 |
+
#define Tk_Fill3DRectangle \
|
| 1329 |
+
(tkStubsPtr->tk_Fill3DRectangle) /* 63 */
|
| 1330 |
+
#define Tk_FindPhoto \
|
| 1331 |
+
(tkStubsPtr->tk_FindPhoto) /* 64 */
|
| 1332 |
+
#define Tk_FontId \
|
| 1333 |
+
(tkStubsPtr->tk_FontId) /* 65 */
|
| 1334 |
+
#define Tk_Free3DBorder \
|
| 1335 |
+
(tkStubsPtr->tk_Free3DBorder) /* 66 */
|
| 1336 |
+
#define Tk_FreeBitmap \
|
| 1337 |
+
(tkStubsPtr->tk_FreeBitmap) /* 67 */
|
| 1338 |
+
#define Tk_FreeColor \
|
| 1339 |
+
(tkStubsPtr->tk_FreeColor) /* 68 */
|
| 1340 |
+
#define Tk_FreeColormap \
|
| 1341 |
+
(tkStubsPtr->tk_FreeColormap) /* 69 */
|
| 1342 |
+
#define Tk_FreeCursor \
|
| 1343 |
+
(tkStubsPtr->tk_FreeCursor) /* 70 */
|
| 1344 |
+
#define Tk_FreeFont \
|
| 1345 |
+
(tkStubsPtr->tk_FreeFont) /* 71 */
|
| 1346 |
+
#define Tk_FreeGC \
|
| 1347 |
+
(tkStubsPtr->tk_FreeGC) /* 72 */
|
| 1348 |
+
#define Tk_FreeImage \
|
| 1349 |
+
(tkStubsPtr->tk_FreeImage) /* 73 */
|
| 1350 |
+
#define Tk_FreeOptions \
|
| 1351 |
+
(tkStubsPtr->tk_FreeOptions) /* 74 */
|
| 1352 |
+
#define Tk_FreePixmap \
|
| 1353 |
+
(tkStubsPtr->tk_FreePixmap) /* 75 */
|
| 1354 |
+
#define Tk_FreeTextLayout \
|
| 1355 |
+
(tkStubsPtr->tk_FreeTextLayout) /* 76 */
|
| 1356 |
+
#define Tk_FreeXId \
|
| 1357 |
+
(tkStubsPtr->tk_FreeXId) /* 77 */
|
| 1358 |
+
#define Tk_GCForColor \
|
| 1359 |
+
(tkStubsPtr->tk_GCForColor) /* 78 */
|
| 1360 |
+
#define Tk_GeometryRequest \
|
| 1361 |
+
(tkStubsPtr->tk_GeometryRequest) /* 79 */
|
| 1362 |
+
#define Tk_Get3DBorder \
|
| 1363 |
+
(tkStubsPtr->tk_Get3DBorder) /* 80 */
|
| 1364 |
+
#define Tk_GetAllBindings \
|
| 1365 |
+
(tkStubsPtr->tk_GetAllBindings) /* 81 */
|
| 1366 |
+
#define Tk_GetAnchor \
|
| 1367 |
+
(tkStubsPtr->tk_GetAnchor) /* 82 */
|
| 1368 |
+
#define Tk_GetAtomName \
|
| 1369 |
+
(tkStubsPtr->tk_GetAtomName) /* 83 */
|
| 1370 |
+
#define Tk_GetBinding \
|
| 1371 |
+
(tkStubsPtr->tk_GetBinding) /* 84 */
|
| 1372 |
+
#define Tk_GetBitmap \
|
| 1373 |
+
(tkStubsPtr->tk_GetBitmap) /* 85 */
|
| 1374 |
+
#define Tk_GetBitmapFromData \
|
| 1375 |
+
(tkStubsPtr->tk_GetBitmapFromData) /* 86 */
|
| 1376 |
+
#define Tk_GetCapStyle \
|
| 1377 |
+
(tkStubsPtr->tk_GetCapStyle) /* 87 */
|
| 1378 |
+
#define Tk_GetColor \
|
| 1379 |
+
(tkStubsPtr->tk_GetColor) /* 88 */
|
| 1380 |
+
#define Tk_GetColorByValue \
|
| 1381 |
+
(tkStubsPtr->tk_GetColorByValue) /* 89 */
|
| 1382 |
+
#define Tk_GetColormap \
|
| 1383 |
+
(tkStubsPtr->tk_GetColormap) /* 90 */
|
| 1384 |
+
#define Tk_GetCursor \
|
| 1385 |
+
(tkStubsPtr->tk_GetCursor) /* 91 */
|
| 1386 |
+
#define Tk_GetCursorFromData \
|
| 1387 |
+
(tkStubsPtr->tk_GetCursorFromData) /* 92 */
|
| 1388 |
+
#define Tk_GetFont \
|
| 1389 |
+
(tkStubsPtr->tk_GetFont) /* 93 */
|
| 1390 |
+
#define Tk_GetFontFromObj \
|
| 1391 |
+
(tkStubsPtr->tk_GetFontFromObj) /* 94 */
|
| 1392 |
+
#define Tk_GetFontMetrics \
|
| 1393 |
+
(tkStubsPtr->tk_GetFontMetrics) /* 95 */
|
| 1394 |
+
#define Tk_GetGC \
|
| 1395 |
+
(tkStubsPtr->tk_GetGC) /* 96 */
|
| 1396 |
+
#define Tk_GetImage \
|
| 1397 |
+
(tkStubsPtr->tk_GetImage) /* 97 */
|
| 1398 |
+
#define Tk_GetImageMasterData \
|
| 1399 |
+
(tkStubsPtr->tk_GetImageMasterData) /* 98 */
|
| 1400 |
+
#define Tk_GetItemTypes \
|
| 1401 |
+
(tkStubsPtr->tk_GetItemTypes) /* 99 */
|
| 1402 |
+
#define Tk_GetJoinStyle \
|
| 1403 |
+
(tkStubsPtr->tk_GetJoinStyle) /* 100 */
|
| 1404 |
+
#define Tk_GetJustify \
|
| 1405 |
+
(tkStubsPtr->tk_GetJustify) /* 101 */
|
| 1406 |
+
#define Tk_GetNumMainWindows \
|
| 1407 |
+
(tkStubsPtr->tk_GetNumMainWindows) /* 102 */
|
| 1408 |
+
#define Tk_GetOption \
|
| 1409 |
+
(tkStubsPtr->tk_GetOption) /* 103 */
|
| 1410 |
+
#define Tk_GetPixels \
|
| 1411 |
+
(tkStubsPtr->tk_GetPixels) /* 104 */
|
| 1412 |
+
#define Tk_GetPixmap \
|
| 1413 |
+
(tkStubsPtr->tk_GetPixmap) /* 105 */
|
| 1414 |
+
#define Tk_GetRelief \
|
| 1415 |
+
(tkStubsPtr->tk_GetRelief) /* 106 */
|
| 1416 |
+
#define Tk_GetRootCoords \
|
| 1417 |
+
(tkStubsPtr->tk_GetRootCoords) /* 107 */
|
| 1418 |
+
#define Tk_GetScrollInfo \
|
| 1419 |
+
(tkStubsPtr->tk_GetScrollInfo) /* 108 */
|
| 1420 |
+
#define Tk_GetScreenMM \
|
| 1421 |
+
(tkStubsPtr->tk_GetScreenMM) /* 109 */
|
| 1422 |
+
#define Tk_GetSelection \
|
| 1423 |
+
(tkStubsPtr->tk_GetSelection) /* 110 */
|
| 1424 |
+
#define Tk_GetUid \
|
| 1425 |
+
(tkStubsPtr->tk_GetUid) /* 111 */
|
| 1426 |
+
#define Tk_GetVisual \
|
| 1427 |
+
(tkStubsPtr->tk_GetVisual) /* 112 */
|
| 1428 |
+
#define Tk_GetVRootGeometry \
|
| 1429 |
+
(tkStubsPtr->tk_GetVRootGeometry) /* 113 */
|
| 1430 |
+
#define Tk_Grab \
|
| 1431 |
+
(tkStubsPtr->tk_Grab) /* 114 */
|
| 1432 |
+
#define Tk_HandleEvent \
|
| 1433 |
+
(tkStubsPtr->tk_HandleEvent) /* 115 */
|
| 1434 |
+
#define Tk_IdToWindow \
|
| 1435 |
+
(tkStubsPtr->tk_IdToWindow) /* 116 */
|
| 1436 |
+
#define Tk_ImageChanged \
|
| 1437 |
+
(tkStubsPtr->tk_ImageChanged) /* 117 */
|
| 1438 |
+
#define Tk_Init \
|
| 1439 |
+
(tkStubsPtr->tk_Init) /* 118 */
|
| 1440 |
+
#define Tk_InternAtom \
|
| 1441 |
+
(tkStubsPtr->tk_InternAtom) /* 119 */
|
| 1442 |
+
#define Tk_IntersectTextLayout \
|
| 1443 |
+
(tkStubsPtr->tk_IntersectTextLayout) /* 120 */
|
| 1444 |
+
#define Tk_MaintainGeometry \
|
| 1445 |
+
(tkStubsPtr->tk_MaintainGeometry) /* 121 */
|
| 1446 |
+
#define Tk_MainWindow \
|
| 1447 |
+
(tkStubsPtr->tk_MainWindow) /* 122 */
|
| 1448 |
+
#define Tk_MakeWindowExist \
|
| 1449 |
+
(tkStubsPtr->tk_MakeWindowExist) /* 123 */
|
| 1450 |
+
#define Tk_ManageGeometry \
|
| 1451 |
+
(tkStubsPtr->tk_ManageGeometry) /* 124 */
|
| 1452 |
+
#define Tk_MapWindow \
|
| 1453 |
+
(tkStubsPtr->tk_MapWindow) /* 125 */
|
| 1454 |
+
#define Tk_MeasureChars \
|
| 1455 |
+
(tkStubsPtr->tk_MeasureChars) /* 126 */
|
| 1456 |
+
#define Tk_MoveResizeWindow \
|
| 1457 |
+
(tkStubsPtr->tk_MoveResizeWindow) /* 127 */
|
| 1458 |
+
#define Tk_MoveWindow \
|
| 1459 |
+
(tkStubsPtr->tk_MoveWindow) /* 128 */
|
| 1460 |
+
#define Tk_MoveToplevelWindow \
|
| 1461 |
+
(tkStubsPtr->tk_MoveToplevelWindow) /* 129 */
|
| 1462 |
+
#define Tk_NameOf3DBorder \
|
| 1463 |
+
(tkStubsPtr->tk_NameOf3DBorder) /* 130 */
|
| 1464 |
+
#define Tk_NameOfAnchor \
|
| 1465 |
+
(tkStubsPtr->tk_NameOfAnchor) /* 131 */
|
| 1466 |
+
#define Tk_NameOfBitmap \
|
| 1467 |
+
(tkStubsPtr->tk_NameOfBitmap) /* 132 */
|
| 1468 |
+
#define Tk_NameOfCapStyle \
|
| 1469 |
+
(tkStubsPtr->tk_NameOfCapStyle) /* 133 */
|
| 1470 |
+
#define Tk_NameOfColor \
|
| 1471 |
+
(tkStubsPtr->tk_NameOfColor) /* 134 */
|
| 1472 |
+
#define Tk_NameOfCursor \
|
| 1473 |
+
(tkStubsPtr->tk_NameOfCursor) /* 135 */
|
| 1474 |
+
#define Tk_NameOfFont \
|
| 1475 |
+
(tkStubsPtr->tk_NameOfFont) /* 136 */
|
| 1476 |
+
#define Tk_NameOfImage \
|
| 1477 |
+
(tkStubsPtr->tk_NameOfImage) /* 137 */
|
| 1478 |
+
#define Tk_NameOfJoinStyle \
|
| 1479 |
+
(tkStubsPtr->tk_NameOfJoinStyle) /* 138 */
|
| 1480 |
+
#define Tk_NameOfJustify \
|
| 1481 |
+
(tkStubsPtr->tk_NameOfJustify) /* 139 */
|
| 1482 |
+
#define Tk_NameOfRelief \
|
| 1483 |
+
(tkStubsPtr->tk_NameOfRelief) /* 140 */
|
| 1484 |
+
#define Tk_NameToWindow \
|
| 1485 |
+
(tkStubsPtr->tk_NameToWindow) /* 141 */
|
| 1486 |
+
#define Tk_OwnSelection \
|
| 1487 |
+
(tkStubsPtr->tk_OwnSelection) /* 142 */
|
| 1488 |
+
#define Tk_ParseArgv \
|
| 1489 |
+
(tkStubsPtr->tk_ParseArgv) /* 143 */
|
| 1490 |
+
#define Tk_PhotoPutBlock_NoComposite \
|
| 1491 |
+
(tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */
|
| 1492 |
+
#define Tk_PhotoPutZoomedBlock_NoComposite \
|
| 1493 |
+
(tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */
|
| 1494 |
+
#define Tk_PhotoGetImage \
|
| 1495 |
+
(tkStubsPtr->tk_PhotoGetImage) /* 146 */
|
| 1496 |
+
#define Tk_PhotoBlank \
|
| 1497 |
+
(tkStubsPtr->tk_PhotoBlank) /* 147 */
|
| 1498 |
+
#define Tk_PhotoExpand_Panic \
|
| 1499 |
+
(tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */
|
| 1500 |
+
#define Tk_PhotoGetSize \
|
| 1501 |
+
(tkStubsPtr->tk_PhotoGetSize) /* 149 */
|
| 1502 |
+
#define Tk_PhotoSetSize_Panic \
|
| 1503 |
+
(tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */
|
| 1504 |
+
#define Tk_PointToChar \
|
| 1505 |
+
(tkStubsPtr->tk_PointToChar) /* 151 */
|
| 1506 |
+
#define Tk_PostscriptFontName \
|
| 1507 |
+
(tkStubsPtr->tk_PostscriptFontName) /* 152 */
|
| 1508 |
+
#define Tk_PreserveColormap \
|
| 1509 |
+
(tkStubsPtr->tk_PreserveColormap) /* 153 */
|
| 1510 |
+
#define Tk_QueueWindowEvent \
|
| 1511 |
+
(tkStubsPtr->tk_QueueWindowEvent) /* 154 */
|
| 1512 |
+
#define Tk_RedrawImage \
|
| 1513 |
+
(tkStubsPtr->tk_RedrawImage) /* 155 */
|
| 1514 |
+
#define Tk_ResizeWindow \
|
| 1515 |
+
(tkStubsPtr->tk_ResizeWindow) /* 156 */
|
| 1516 |
+
#define Tk_RestackWindow \
|
| 1517 |
+
(tkStubsPtr->tk_RestackWindow) /* 157 */
|
| 1518 |
+
#define Tk_RestrictEvents \
|
| 1519 |
+
(tkStubsPtr->tk_RestrictEvents) /* 158 */
|
| 1520 |
+
#define Tk_SafeInit \
|
| 1521 |
+
(tkStubsPtr->tk_SafeInit) /* 159 */
|
| 1522 |
+
#define Tk_SetAppName \
|
| 1523 |
+
(tkStubsPtr->tk_SetAppName) /* 160 */
|
| 1524 |
+
#define Tk_SetBackgroundFromBorder \
|
| 1525 |
+
(tkStubsPtr->tk_SetBackgroundFromBorder) /* 161 */
|
| 1526 |
+
#define Tk_SetClass \
|
| 1527 |
+
(tkStubsPtr->tk_SetClass) /* 162 */
|
| 1528 |
+
#define Tk_SetGrid \
|
| 1529 |
+
(tkStubsPtr->tk_SetGrid) /* 163 */
|
| 1530 |
+
#define Tk_SetInternalBorder \
|
| 1531 |
+
(tkStubsPtr->tk_SetInternalBorder) /* 164 */
|
| 1532 |
+
#define Tk_SetWindowBackground \
|
| 1533 |
+
(tkStubsPtr->tk_SetWindowBackground) /* 165 */
|
| 1534 |
+
#define Tk_SetWindowBackgroundPixmap \
|
| 1535 |
+
(tkStubsPtr->tk_SetWindowBackgroundPixmap) /* 166 */
|
| 1536 |
+
#define Tk_SetWindowBorder \
|
| 1537 |
+
(tkStubsPtr->tk_SetWindowBorder) /* 167 */
|
| 1538 |
+
#define Tk_SetWindowBorderWidth \
|
| 1539 |
+
(tkStubsPtr->tk_SetWindowBorderWidth) /* 168 */
|
| 1540 |
+
#define Tk_SetWindowBorderPixmap \
|
| 1541 |
+
(tkStubsPtr->tk_SetWindowBorderPixmap) /* 169 */
|
| 1542 |
+
#define Tk_SetWindowColormap \
|
| 1543 |
+
(tkStubsPtr->tk_SetWindowColormap) /* 170 */
|
| 1544 |
+
#define Tk_SetWindowVisual \
|
| 1545 |
+
(tkStubsPtr->tk_SetWindowVisual) /* 171 */
|
| 1546 |
+
#define Tk_SizeOfBitmap \
|
| 1547 |
+
(tkStubsPtr->tk_SizeOfBitmap) /* 172 */
|
| 1548 |
+
#define Tk_SizeOfImage \
|
| 1549 |
+
(tkStubsPtr->tk_SizeOfImage) /* 173 */
|
| 1550 |
+
#define Tk_StrictMotif \
|
| 1551 |
+
(tkStubsPtr->tk_StrictMotif) /* 174 */
|
| 1552 |
+
#define Tk_TextLayoutToPostscript \
|
| 1553 |
+
(tkStubsPtr->tk_TextLayoutToPostscript) /* 175 */
|
| 1554 |
+
#define Tk_TextWidth \
|
| 1555 |
+
(tkStubsPtr->tk_TextWidth) /* 176 */
|
| 1556 |
+
#define Tk_UndefineCursor \
|
| 1557 |
+
(tkStubsPtr->tk_UndefineCursor) /* 177 */
|
| 1558 |
+
#define Tk_UnderlineChars \
|
| 1559 |
+
(tkStubsPtr->tk_UnderlineChars) /* 178 */
|
| 1560 |
+
#define Tk_UnderlineTextLayout \
|
| 1561 |
+
(tkStubsPtr->tk_UnderlineTextLayout) /* 179 */
|
| 1562 |
+
#define Tk_Ungrab \
|
| 1563 |
+
(tkStubsPtr->tk_Ungrab) /* 180 */
|
| 1564 |
+
#define Tk_UnmaintainGeometry \
|
| 1565 |
+
(tkStubsPtr->tk_UnmaintainGeometry) /* 181 */
|
| 1566 |
+
#define Tk_UnmapWindow \
|
| 1567 |
+
(tkStubsPtr->tk_UnmapWindow) /* 182 */
|
| 1568 |
+
#define Tk_UnsetGrid \
|
| 1569 |
+
(tkStubsPtr->tk_UnsetGrid) /* 183 */
|
| 1570 |
+
#define Tk_UpdatePointer \
|
| 1571 |
+
(tkStubsPtr->tk_UpdatePointer) /* 184 */
|
| 1572 |
+
#define Tk_AllocBitmapFromObj \
|
| 1573 |
+
(tkStubsPtr->tk_AllocBitmapFromObj) /* 185 */
|
| 1574 |
+
#define Tk_Alloc3DBorderFromObj \
|
| 1575 |
+
(tkStubsPtr->tk_Alloc3DBorderFromObj) /* 186 */
|
| 1576 |
+
#define Tk_AllocColorFromObj \
|
| 1577 |
+
(tkStubsPtr->tk_AllocColorFromObj) /* 187 */
|
| 1578 |
+
#define Tk_AllocCursorFromObj \
|
| 1579 |
+
(tkStubsPtr->tk_AllocCursorFromObj) /* 188 */
|
| 1580 |
+
#define Tk_AllocFontFromObj \
|
| 1581 |
+
(tkStubsPtr->tk_AllocFontFromObj) /* 189 */
|
| 1582 |
+
#define Tk_CreateOptionTable \
|
| 1583 |
+
(tkStubsPtr->tk_CreateOptionTable) /* 190 */
|
| 1584 |
+
#define Tk_DeleteOptionTable \
|
| 1585 |
+
(tkStubsPtr->tk_DeleteOptionTable) /* 191 */
|
| 1586 |
+
#define Tk_Free3DBorderFromObj \
|
| 1587 |
+
(tkStubsPtr->tk_Free3DBorderFromObj) /* 192 */
|
| 1588 |
+
#define Tk_FreeBitmapFromObj \
|
| 1589 |
+
(tkStubsPtr->tk_FreeBitmapFromObj) /* 193 */
|
| 1590 |
+
#define Tk_FreeColorFromObj \
|
| 1591 |
+
(tkStubsPtr->tk_FreeColorFromObj) /* 194 */
|
| 1592 |
+
#define Tk_FreeConfigOptions \
|
| 1593 |
+
(tkStubsPtr->tk_FreeConfigOptions) /* 195 */
|
| 1594 |
+
#define Tk_FreeSavedOptions \
|
| 1595 |
+
(tkStubsPtr->tk_FreeSavedOptions) /* 196 */
|
| 1596 |
+
#define Tk_FreeCursorFromObj \
|
| 1597 |
+
(tkStubsPtr->tk_FreeCursorFromObj) /* 197 */
|
| 1598 |
+
#define Tk_FreeFontFromObj \
|
| 1599 |
+
(tkStubsPtr->tk_FreeFontFromObj) /* 198 */
|
| 1600 |
+
#define Tk_Get3DBorderFromObj \
|
| 1601 |
+
(tkStubsPtr->tk_Get3DBorderFromObj) /* 199 */
|
| 1602 |
+
#define Tk_GetAnchorFromObj \
|
| 1603 |
+
(tkStubsPtr->tk_GetAnchorFromObj) /* 200 */
|
| 1604 |
+
#define Tk_GetBitmapFromObj \
|
| 1605 |
+
(tkStubsPtr->tk_GetBitmapFromObj) /* 201 */
|
| 1606 |
+
#define Tk_GetColorFromObj \
|
| 1607 |
+
(tkStubsPtr->tk_GetColorFromObj) /* 202 */
|
| 1608 |
+
#define Tk_GetCursorFromObj \
|
| 1609 |
+
(tkStubsPtr->tk_GetCursorFromObj) /* 203 */
|
| 1610 |
+
#define Tk_GetOptionInfo \
|
| 1611 |
+
(tkStubsPtr->tk_GetOptionInfo) /* 204 */
|
| 1612 |
+
#define Tk_GetOptionValue \
|
| 1613 |
+
(tkStubsPtr->tk_GetOptionValue) /* 205 */
|
| 1614 |
+
#define Tk_GetJustifyFromObj \
|
| 1615 |
+
(tkStubsPtr->tk_GetJustifyFromObj) /* 206 */
|
| 1616 |
+
#define Tk_GetMMFromObj \
|
| 1617 |
+
(tkStubsPtr->tk_GetMMFromObj) /* 207 */
|
| 1618 |
+
#define Tk_GetPixelsFromObj \
|
| 1619 |
+
(tkStubsPtr->tk_GetPixelsFromObj) /* 208 */
|
| 1620 |
+
#define Tk_GetReliefFromObj \
|
| 1621 |
+
(tkStubsPtr->tk_GetReliefFromObj) /* 209 */
|
| 1622 |
+
#define Tk_GetScrollInfoObj \
|
| 1623 |
+
(tkStubsPtr->tk_GetScrollInfoObj) /* 210 */
|
| 1624 |
+
#define Tk_InitOptions \
|
| 1625 |
+
(tkStubsPtr->tk_InitOptions) /* 211 */
|
| 1626 |
+
#define Tk_MainEx \
|
| 1627 |
+
(tkStubsPtr->tk_MainEx) /* 212 */
|
| 1628 |
+
#define Tk_RestoreSavedOptions \
|
| 1629 |
+
(tkStubsPtr->tk_RestoreSavedOptions) /* 213 */
|
| 1630 |
+
#define Tk_SetOptions \
|
| 1631 |
+
(tkStubsPtr->tk_SetOptions) /* 214 */
|
| 1632 |
+
#define Tk_InitConsoleChannels \
|
| 1633 |
+
(tkStubsPtr->tk_InitConsoleChannels) /* 215 */
|
| 1634 |
+
#define Tk_CreateConsoleWindow \
|
| 1635 |
+
(tkStubsPtr->tk_CreateConsoleWindow) /* 216 */
|
| 1636 |
+
#define Tk_CreateSmoothMethod \
|
| 1637 |
+
(tkStubsPtr->tk_CreateSmoothMethod) /* 217 */
|
| 1638 |
+
/* Slot 218 is reserved */
|
| 1639 |
+
/* Slot 219 is reserved */
|
| 1640 |
+
#define Tk_GetDash \
|
| 1641 |
+
(tkStubsPtr->tk_GetDash) /* 220 */
|
| 1642 |
+
#define Tk_CreateOutline \
|
| 1643 |
+
(tkStubsPtr->tk_CreateOutline) /* 221 */
|
| 1644 |
+
#define Tk_DeleteOutline \
|
| 1645 |
+
(tkStubsPtr->tk_DeleteOutline) /* 222 */
|
| 1646 |
+
#define Tk_ConfigOutlineGC \
|
| 1647 |
+
(tkStubsPtr->tk_ConfigOutlineGC) /* 223 */
|
| 1648 |
+
#define Tk_ChangeOutlineGC \
|
| 1649 |
+
(tkStubsPtr->tk_ChangeOutlineGC) /* 224 */
|
| 1650 |
+
#define Tk_ResetOutlineGC \
|
| 1651 |
+
(tkStubsPtr->tk_ResetOutlineGC) /* 225 */
|
| 1652 |
+
#define Tk_CanvasPsOutline \
|
| 1653 |
+
(tkStubsPtr->tk_CanvasPsOutline) /* 226 */
|
| 1654 |
+
#define Tk_SetTSOrigin \
|
| 1655 |
+
(tkStubsPtr->tk_SetTSOrigin) /* 227 */
|
| 1656 |
+
#define Tk_CanvasGetCoordFromObj \
|
| 1657 |
+
(tkStubsPtr->tk_CanvasGetCoordFromObj) /* 228 */
|
| 1658 |
+
#define Tk_CanvasSetOffset \
|
| 1659 |
+
(tkStubsPtr->tk_CanvasSetOffset) /* 229 */
|
| 1660 |
+
#define Tk_DitherPhoto \
|
| 1661 |
+
(tkStubsPtr->tk_DitherPhoto) /* 230 */
|
| 1662 |
+
#define Tk_PostscriptBitmap \
|
| 1663 |
+
(tkStubsPtr->tk_PostscriptBitmap) /* 231 */
|
| 1664 |
+
#define Tk_PostscriptColor \
|
| 1665 |
+
(tkStubsPtr->tk_PostscriptColor) /* 232 */
|
| 1666 |
+
#define Tk_PostscriptFont \
|
| 1667 |
+
(tkStubsPtr->tk_PostscriptFont) /* 233 */
|
| 1668 |
+
#define Tk_PostscriptImage \
|
| 1669 |
+
(tkStubsPtr->tk_PostscriptImage) /* 234 */
|
| 1670 |
+
#define Tk_PostscriptPath \
|
| 1671 |
+
(tkStubsPtr->tk_PostscriptPath) /* 235 */
|
| 1672 |
+
#define Tk_PostscriptStipple \
|
| 1673 |
+
(tkStubsPtr->tk_PostscriptStipple) /* 236 */
|
| 1674 |
+
#define Tk_PostscriptY \
|
| 1675 |
+
(tkStubsPtr->tk_PostscriptY) /* 237 */
|
| 1676 |
+
#define Tk_PostscriptPhoto \
|
| 1677 |
+
(tkStubsPtr->tk_PostscriptPhoto) /* 238 */
|
| 1678 |
+
#define Tk_CreateClientMessageHandler \
|
| 1679 |
+
(tkStubsPtr->tk_CreateClientMessageHandler) /* 239 */
|
| 1680 |
+
#define Tk_DeleteClientMessageHandler \
|
| 1681 |
+
(tkStubsPtr->tk_DeleteClientMessageHandler) /* 240 */
|
| 1682 |
+
#define Tk_CreateAnonymousWindow \
|
| 1683 |
+
(tkStubsPtr->tk_CreateAnonymousWindow) /* 241 */
|
| 1684 |
+
#define Tk_SetClassProcs \
|
| 1685 |
+
(tkStubsPtr->tk_SetClassProcs) /* 242 */
|
| 1686 |
+
#define Tk_SetInternalBorderEx \
|
| 1687 |
+
(tkStubsPtr->tk_SetInternalBorderEx) /* 243 */
|
| 1688 |
+
#define Tk_SetMinimumRequestSize \
|
| 1689 |
+
(tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */
|
| 1690 |
+
#define Tk_SetCaretPos \
|
| 1691 |
+
(tkStubsPtr->tk_SetCaretPos) /* 245 */
|
| 1692 |
+
#define Tk_PhotoPutBlock_Panic \
|
| 1693 |
+
(tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */
|
| 1694 |
+
#define Tk_PhotoPutZoomedBlock_Panic \
|
| 1695 |
+
(tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */
|
| 1696 |
+
#define Tk_CollapseMotionEvents \
|
| 1697 |
+
(tkStubsPtr->tk_CollapseMotionEvents) /* 248 */
|
| 1698 |
+
#define Tk_RegisterStyleEngine \
|
| 1699 |
+
(tkStubsPtr->tk_RegisterStyleEngine) /* 249 */
|
| 1700 |
+
#define Tk_GetStyleEngine \
|
| 1701 |
+
(tkStubsPtr->tk_GetStyleEngine) /* 250 */
|
| 1702 |
+
#define Tk_RegisterStyledElement \
|
| 1703 |
+
(tkStubsPtr->tk_RegisterStyledElement) /* 251 */
|
| 1704 |
+
#define Tk_GetElementId \
|
| 1705 |
+
(tkStubsPtr->tk_GetElementId) /* 252 */
|
| 1706 |
+
#define Tk_CreateStyle \
|
| 1707 |
+
(tkStubsPtr->tk_CreateStyle) /* 253 */
|
| 1708 |
+
#define Tk_GetStyle \
|
| 1709 |
+
(tkStubsPtr->tk_GetStyle) /* 254 */
|
| 1710 |
+
#define Tk_FreeStyle \
|
| 1711 |
+
(tkStubsPtr->tk_FreeStyle) /* 255 */
|
| 1712 |
+
#define Tk_NameOfStyle \
|
| 1713 |
+
(tkStubsPtr->tk_NameOfStyle) /* 256 */
|
| 1714 |
+
#define Tk_AllocStyleFromObj \
|
| 1715 |
+
(tkStubsPtr->tk_AllocStyleFromObj) /* 257 */
|
| 1716 |
+
#define Tk_GetStyleFromObj \
|
| 1717 |
+
(tkStubsPtr->tk_GetStyleFromObj) /* 258 */
|
| 1718 |
+
#define Tk_FreeStyleFromObj \
|
| 1719 |
+
(tkStubsPtr->tk_FreeStyleFromObj) /* 259 */
|
| 1720 |
+
#define Tk_GetStyledElement \
|
| 1721 |
+
(tkStubsPtr->tk_GetStyledElement) /* 260 */
|
| 1722 |
+
#define Tk_GetElementSize \
|
| 1723 |
+
(tkStubsPtr->tk_GetElementSize) /* 261 */
|
| 1724 |
+
#define Tk_GetElementBox \
|
| 1725 |
+
(tkStubsPtr->tk_GetElementBox) /* 262 */
|
| 1726 |
+
#define Tk_GetElementBorderWidth \
|
| 1727 |
+
(tkStubsPtr->tk_GetElementBorderWidth) /* 263 */
|
| 1728 |
+
#define Tk_DrawElement \
|
| 1729 |
+
(tkStubsPtr->tk_DrawElement) /* 264 */
|
| 1730 |
+
#define Tk_PhotoExpand \
|
| 1731 |
+
(tkStubsPtr->tk_PhotoExpand) /* 265 */
|
| 1732 |
+
#define Tk_PhotoPutBlock \
|
| 1733 |
+
(tkStubsPtr->tk_PhotoPutBlock) /* 266 */
|
| 1734 |
+
#define Tk_PhotoPutZoomedBlock \
|
| 1735 |
+
(tkStubsPtr->tk_PhotoPutZoomedBlock) /* 267 */
|
| 1736 |
+
#define Tk_PhotoSetSize \
|
| 1737 |
+
(tkStubsPtr->tk_PhotoSetSize) /* 268 */
|
| 1738 |
+
#define Tk_GetUserInactiveTime \
|
| 1739 |
+
(tkStubsPtr->tk_GetUserInactiveTime) /* 269 */
|
| 1740 |
+
#define Tk_ResetUserInactiveTime \
|
| 1741 |
+
(tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */
|
| 1742 |
+
#define Tk_Interp \
|
| 1743 |
+
(tkStubsPtr->tk_Interp) /* 271 */
|
| 1744 |
+
#define Tk_CreateOldImageType \
|
| 1745 |
+
(tkStubsPtr->tk_CreateOldImageType) /* 272 */
|
| 1746 |
+
#define Tk_CreateOldPhotoImageFormat \
|
| 1747 |
+
(tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */
|
| 1748 |
+
/* Slot 274 is reserved */
|
| 1749 |
+
/* Slot 275 is reserved */
|
| 1750 |
+
/* Slot 276 is reserved */
|
| 1751 |
+
/* Slot 277 is reserved */
|
| 1752 |
+
/* Slot 278 is reserved */
|
| 1753 |
+
/* Slot 279 is reserved */
|
| 1754 |
+
/* Slot 280 is reserved */
|
| 1755 |
+
/* Slot 281 is reserved */
|
| 1756 |
+
/* Slot 282 is reserved */
|
| 1757 |
+
/* Slot 283 is reserved */
|
| 1758 |
+
/* Slot 284 is reserved */
|
| 1759 |
+
/* Slot 285 is reserved */
|
| 1760 |
+
/* Slot 286 is reserved */
|
| 1761 |
+
/* Slot 287 is reserved */
|
| 1762 |
+
/* Slot 288 is reserved */
|
| 1763 |
+
/* Slot 289 is reserved */
|
| 1764 |
+
#define TkUnusedStubEntry \
|
| 1765 |
+
(tkStubsPtr->tkUnusedStubEntry) /* 290 */
|
| 1766 |
+
|
| 1767 |
+
#endif /* defined(USE_TK_STUBS) */
|
| 1768 |
+
|
| 1769 |
+
/* !END!: Do not edit above this line. */
|
| 1770 |
+
|
| 1771 |
+
/* Functions that don't belong in the stub table */
|
| 1772 |
+
#undef Tk_MainEx
|
| 1773 |
+
#undef Tk_Init
|
| 1774 |
+
#undef Tk_SafeInit
|
| 1775 |
+
#undef Tk_CreateConsoleWindow
|
| 1776 |
+
#define Tk_GetImageModelData Tk_GetImageMasterData
|
| 1777 |
+
|
| 1778 |
+
#if defined(_WIN32) && defined(UNICODE)
|
| 1779 |
+
# define Tk_MainEx Tk_MainExW
|
| 1780 |
+
EXTERN void Tk_MainExW(int argc, wchar_t **argv,
|
| 1781 |
+
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
| 1782 |
+
#endif
|
| 1783 |
+
#undef Tk_FreeStyleFromObj
|
| 1784 |
+
#define Tk_FreeStyleFromObj(objPtr) ((void)(objPtr))
|
| 1785 |
+
|
| 1786 |
+
#undef TCL_STORAGE_CLASS
|
| 1787 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 1788 |
+
|
| 1789 |
+
#undef TkUnusedStubEntry
|
| 1790 |
+
|
| 1791 |
+
#endif /* _TKDECLS */
|