Skip to content

Commit ddaae46

Browse files
Add auto-py-to-exe library to venv
1 parent 7541f58 commit ddaae46

File tree

1,453 files changed

+204892
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,453 files changed

+204892
-0
lines changed
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
2+
3+
/* Greenlet object interface */
4+
5+
#ifndef Py_GREENLETOBJECT_H
6+
#define Py_GREENLETOBJECT_H
7+
8+
9+
#include <Python.h>
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/* This is deprecated and undocumented. It does not change. */
16+
#define GREENLET_VERSION "1.0.0"
17+
18+
#ifndef GREENLET_MODULE
19+
#define implementation_ptr_t void*
20+
#endif
21+
22+
typedef struct _greenlet {
23+
PyObject_HEAD
24+
PyObject* weakreflist;
25+
PyObject* dict;
26+
implementation_ptr_t pimpl;
27+
} PyGreenlet;
28+
29+
#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type))
30+
31+
32+
/* C API functions */
33+
34+
/* Total number of symbols that are exported */
35+
#define PyGreenlet_API_pointers 12
36+
37+
#define PyGreenlet_Type_NUM 0
38+
#define PyExc_GreenletError_NUM 1
39+
#define PyExc_GreenletExit_NUM 2
40+
41+
#define PyGreenlet_New_NUM 3
42+
#define PyGreenlet_GetCurrent_NUM 4
43+
#define PyGreenlet_Throw_NUM 5
44+
#define PyGreenlet_Switch_NUM 6
45+
#define PyGreenlet_SetParent_NUM 7
46+
47+
#define PyGreenlet_MAIN_NUM 8
48+
#define PyGreenlet_STARTED_NUM 9
49+
#define PyGreenlet_ACTIVE_NUM 10
50+
#define PyGreenlet_GET_PARENT_NUM 11
51+
52+
#ifndef GREENLET_MODULE
53+
/* This section is used by modules that uses the greenlet C API */
54+
static void** _PyGreenlet_API = NULL;
55+
56+
# define PyGreenlet_Type \
57+
(*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM])
58+
59+
# define PyExc_GreenletError \
60+
((PyObject*)_PyGreenlet_API[PyExc_GreenletError_NUM])
61+
62+
# define PyExc_GreenletExit \
63+
((PyObject*)_PyGreenlet_API[PyExc_GreenletExit_NUM])
64+
65+
/*
66+
* PyGreenlet_New(PyObject *args)
67+
*
68+
* greenlet.greenlet(run, parent=None)
69+
*/
70+
# define PyGreenlet_New \
71+
(*(PyGreenlet * (*)(PyObject * run, PyGreenlet * parent)) \
72+
_PyGreenlet_API[PyGreenlet_New_NUM])
73+
74+
/*
75+
* PyGreenlet_GetCurrent(void)
76+
*
77+
* greenlet.getcurrent()
78+
*/
79+
# define PyGreenlet_GetCurrent \
80+
(*(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
81+
82+
/*
83+
* PyGreenlet_Throw(
84+
* PyGreenlet *greenlet,
85+
* PyObject *typ,
86+
* PyObject *val,
87+
* PyObject *tb)
88+
*
89+
* g.throw(...)
90+
*/
91+
# define PyGreenlet_Throw \
92+
(*(PyObject * (*)(PyGreenlet * self, \
93+
PyObject * typ, \
94+
PyObject * val, \
95+
PyObject * tb)) \
96+
_PyGreenlet_API[PyGreenlet_Throw_NUM])
97+
98+
/*
99+
* PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args)
100+
*
101+
* g.switch(*args, **kwargs)
102+
*/
103+
# define PyGreenlet_Switch \
104+
(*(PyObject * \
105+
(*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \
106+
_PyGreenlet_API[PyGreenlet_Switch_NUM])
107+
108+
/*
109+
* PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent)
110+
*
111+
* g.parent = new_parent
112+
*/
113+
# define PyGreenlet_SetParent \
114+
(*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \
115+
_PyGreenlet_API[PyGreenlet_SetParent_NUM])
116+
117+
/*
118+
* PyGreenlet_GetParent(PyObject* greenlet)
119+
*
120+
* return greenlet.parent;
121+
*
122+
* This could return NULL even if there is no exception active.
123+
* If it does not return NULL, you are responsible for decrementing the
124+
* reference count.
125+
*/
126+
# define PyGreenlet_GetParent \
127+
(*(PyGreenlet* (*)(PyGreenlet*)) \
128+
_PyGreenlet_API[PyGreenlet_GET_PARENT_NUM])
129+
130+
/*
131+
* deprecated, undocumented alias.
132+
*/
133+
# define PyGreenlet_GET_PARENT PyGreenlet_GetParent
134+
135+
# define PyGreenlet_MAIN \
136+
(*(int (*)(PyGreenlet*)) \
137+
_PyGreenlet_API[PyGreenlet_MAIN_NUM])
138+
139+
# define PyGreenlet_STARTED \
140+
(*(int (*)(PyGreenlet*)) \
141+
_PyGreenlet_API[PyGreenlet_STARTED_NUM])
142+
143+
# define PyGreenlet_ACTIVE \
144+
(*(int (*)(PyGreenlet*)) \
145+
_PyGreenlet_API[PyGreenlet_ACTIVE_NUM])
146+
147+
148+
149+
150+
/* Macro that imports greenlet and initializes C API */
151+
/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we
152+
keep the older definition to be sure older code that might have a copy of
153+
the header still works. */
154+
# define PyGreenlet_Import() \
155+
{ \
156+
_PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
157+
}
158+
159+
#endif /* GREENLET_MODULE */
160+
161+
#ifdef __cplusplus
162+
}
163+
#endif
164+
#endif /* !Py_GREENLETOBJECT_H */

0 commit comments

Comments
 (0)