8000 Update HPy inlined files: 1ee0fcc · oracle/graalpython@bd2983b · GitHub
[go: up one dir, main page]

Skip to content

Commit bd2983b

Browse files
committed
Update HPy inlined files: 1ee0fcc
1 parent d794620 commit bd2983b

Some content is hidden

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

41 files changed

+3160
-381
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
/*
3+
DO NOT EDIT THIS FILE!
4+
5+
This file is automatically generated by tools/autogen.py from tools/public_api.h.
6+
Run this to regenerate:
7+
make autogen
8+
9+
*/
10+
11+
#define _HPyFunc_DECLARE_HPyFunc_NOARGS(SYM) static HPy SYM(HPyContext ctx, HPy self)
12+
#define _HPyFunc_DECLARE_HPyFunc_O(SYM) static HPy SYM(HPyContext ctx, HPy self, HPy arg)
13+
#define _HPyFunc_DECLARE_HPyFunc_VARARGS(SYM) static HPy SYM(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs)
14+
#define _HPyFunc_DECLARE_HPyFunc_KEYWORDS(SYM) static HPy SYM(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs, HPy kw)
15+
#define _HPyFunc_DECLARE_HPyFunc_UNARYFUNC(SYM) static HPy SYM(HPyContext ctx, HPy)
16+
#define _HPyFunc_DECLARE_HPyFunc_BINARYFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy)
17+
#define _HPyFunc_DECLARE_HPyFunc_TERNARYFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy, HPy)
18+
#define _HPyFunc_DECLARE_HPyFunc_INQUIRY(SYM) static int SYM(HPyContext ctx, HPy)
19+
#define _HPyFunc_DECLARE_HPyFunc_LENFUNC(SYM) static HPy_ssize_t SYM(HPyContext ctx, HPy)
20+
#define _HPyFunc_DECLARE_HPyFunc_SSIZEARGFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy_ssize_t)
21+
#define _HPyFunc_DECLARE_HPyFunc_SSIZESSIZEARGFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy_ssize_t, HPy_ssize_t)
22+
#define _HPyFunc_DECLARE_HPyFunc_SSIZEOBJARGPROC(SYM) static int SYM(HPyContext ctx, HPy, HPy_ssize_t, HPy)
23+
#define _HPyFunc_DECLARE_HPyFunc_SSIZESSIZEOBJARGPROC(SYM) static int SYM(HPyContext ctx, HPy, HPy_ssize_t, HPy_ssize_t, HPy)
24+
#define _HPyFunc_DECLARE_HPyFunc_OBJOBJARGPROC(SYM) static int SYM(HPyContext ctx, HPy, HPy, HPy)
25+
#define _HPyFunc_DECLARE_HPyFunc_FREEFUNC(SYM) static void SYM(HPyContext ctx, void *)
26+
#define _HPyFunc_DECLARE_HPyFunc_GETATTRFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, char *)
27+
#define _HPyFunc_DECLARE_HPyFunc_GETATTROFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy)
28+
#define _HPyFunc_DECLARE_HPyFunc_SETATTRFUNC(SYM) static int SYM(HPyContext ctx, HPy, char *, HPy)
29+
#define _HPyFunc_DECLARE_HPyFunc_SETATTROFUNC(SYM) static int SYM(HPyContext ctx, HPy, HPy, HPy)
30+
#define _HPyFunc_DECLARE_HPyFunc_REPRFUNC(SYM) static HPy SYM(HPyContext ctx, HPy)
31+
#define _HPyFunc_DECLARE_HPyFunc_HASHFUNC(SYM) static HPy_hash_t SYM(HPyContext ctx, HPy)
32+
#define _HPyFunc_DECLARE_HPyFunc_RICHCMPFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy, int)
33+
#define _HPyFunc_DECLARE_HPyFunc_GETITERFUNC(SYM) static HPy SYM(HPyContext ctx, HPy)
34+
#define _HPyFunc_DECLARE_HPyFunc_ITERNEXTFUNC(SYM) static HPy SYM(HPyContext ctx, HPy)
35+
#define _HPyFunc_DECLARE_HPyFunc_DESCRGETFUNC(SYM) static HPy SYM(HPyContext ctx, HPy, HPy, HPy)
36+
#define _HPyFunc_DECLARE_HPyFunc_DESCRSETFUNC(SYM) static int SYM(HPyContext ctx, HPy, HPy, HPy)
37+
#define _HPyFunc_DECLARE_HPyFunc_INITPROC(SYM) static int SYM(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs, HPy kw)
38+
#define _HPyFunc_DECLARE_HPyFunc_GETTER(SYM) static HPy SYM(HPyContext ctx, HPy, void *)
39+
#define _HPyFunc_DECLARE_HPyFunc_SETTER(SYM) static int SYM(HPyContext ctx, HPy, HPy, void *)
40+
#define _HPyFunc_DECLARE_HPyFunc_DESTROYFUNC(SYM) static void SYM(void *)
41+
42+
typedef HPy (*HPyFunc_noargs)(HPyContext ctx, HPy self);
43+
typedef HPy (*HPyFunc_o)(HPyContext ctx, HPy self, HPy arg);
44+
typedef HPy (*HPyFunc_varargs)(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs);
45+
typedef HPy (*HPyFunc_keywords)(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs, HPy kw);
46+
typedef HPy (*HPyFunc_unaryfunc)(HPyContext ctx, HPy);
47+
typedef HPy (*HPyFunc_binaryfunc)(HPyContext ctx, HPy, HPy);
48+
typedef HPy (*HPyFunc_ternaryfunc)(HPyContext ctx, HPy, HPy, HPy);
49+
typedef int (*HPyFunc_inquiry)(HPyContext ctx, HPy);
50+
typedef HPy_ssize_t (*HPyFunc_lenfunc)(HPyContext ctx, HPy);
51+
typedef HPy (*HPyFunc_ssizeargfunc)(HPyContext ctx, HPy, HPy_ssize_t);
52+
typedef HPy (*HPyFunc_ssizessizeargfunc)(HPyContext ctx, HPy, HPy_ssize_t, HPy_ssize_t);
53+
typedef int (*HPyFunc_ssizeobjargproc)(HPyContext ctx, HPy, HPy_ssize_t, HPy);
54+
typedef int (*HPyFunc_ssizessizeobjargproc)(HPyContext ctx, HPy, HPy_ssize_t, HPy_ssize_t, HPy);
55+
typedef int (*HPyFunc_objobjargproc)(HPyContext ctx, HPy, HPy, HPy);
56+
typedef void (*HPyFunc_freefunc)(HPyContext ctx, void *);
57+
typedef HPy (*HPyFunc_getattrfunc)(HPyContext ctx, HPy, char *);
58+
typedef HPy (*HPyFunc_getattrofunc)(HPyContext ctx, HPy, HPy);
59+
typedef int (*HPyFunc_setattrfunc)(HPyContext ctx, HPy, char *, HPy);
60+
typedef int (*HPyFunc_setattrofunc)(HPyContext ctx, HPy, HPy, HPy);
61+
typedef HPy (*HPyFunc_reprfunc)(HPyContext ctx, HPy);
62+
typedef HPy_hash_t (*HPyFunc_hashfunc)(HPyContext ctx, HPy);
63+
typedef HPy (*HPyFunc_richcmpfunc)(HPyContext ctx, HPy, HPy, int);
64+
typedef HPy (*HPyFunc_getiterfunc)(HPyContext ctx, HPy);
65+
typedef HPy (*HPyFunc_iternextfunc)(HPyContext ctx, HPy);
66+
typedef HPy (*HPyFunc_descrgetfunc)(HPyContext ctx, HPy, HPy, HPy);
67+
typedef int (*HPyFunc_descrsetfunc)(HPyContext ctx, HPy, HPy, HPy);
68+
typedef int (*HPyFunc_initproc)(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t nargs, HPy kw);
69+
typedef HPy (*HPyFunc_getter)(HPyContext ctx, HPy, void *);
70+
typedef int (*HPyFunc_setter)(HPyContext ctx, HPy, HPy, void *);
71+
typedef void (*HPyFunc_destroyfunc)(void *);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
/*
3+
DO NOT EDIT THIS FILE!
4+
5+
This file is automatically generated by tools/autogen.py from tools/public_api.h.
6+
Run this to regenerate:
7+
make autogen
8+
9+
*/
10+
11+
typedef enum {
12+
HPy_nb_absolute = 6,
13+
HPy_nb_add = 7,
14+
HPy_nb_and = 8,
15+
HPy_nb_bool = 9,
16+
HPy_nb_divmod = 10,
17+
HPy_nb_float = 11,
18+
HPy_nb_floor_divide = 12,
19+
HPy_nb_index = 13,
20+
HPy_nb_inplace_add = 14,
21+
HPy_nb_inplace_and = 15,
22+
HPy_nb_inplace_floor_divide = 16,
23+
HPy_nb_inplace_lshift = 17,
24+
HPy_nb_inplace_multiply = 18,
25+
HPy_nb_inplace_or = 19,
26+
HPy_nb_inplace_power = 20,
27+
HPy_nb_inplace_remainder = 21,
28+
HPy_nb_inplace_rshift = 22,
29+
HPy_nb_inplace_subtract = 23,
30+
HPy_nb_inplace_true_divide = 24,
31+
HPy_nb_inplace_xor = 25,
32+
HPy_nb_int = 26,
33+
HPy_nb_invert = 27,
34+
HPy_nb_lshift = 28,
35+
HPy_nb_multiply = 29,
36+
HPy_nb_negative = 30,
37+
HPy_nb_or = 31,
38+
HPy_nb_positive = 32,
39+
HPy_nb_power = 33,
40+
HPy_nb_remainder = 34,
41+
HPy_nb_rshift = 35,
42+
HPy_nb_subtract = 36,
43+
HPy_nb_true_divide = 37,
44+
HPy_nb_xor = 38,
45+
HPy_sq_item = 44,
46+
HPy_tp_init = 60,
47+
HPy_tp_new = 65,
48+
HPy_tp_repr = 66,
49+
HPy_nb_matrix_multiply = 75,
50+
HPy_nb_inplace_matrix_multiply = 76,
51+
HPy_tp_destroy = 1000,
52+
} HPySlot_Slot;
53+
54+
#define _HPySlot_SIG__HPy_nb_absolute HPyFunc_UNARYFUNC
55+
#define _HPySlot_SIG__HPy_nb_add HPyFunc_BINARYFUNC
56+
#define _HPySlot_SIG__HPy_nb_and HPyFunc_BINARYFUNC
57+
#define _HPySlot_SIG__HPy_nb_bool HPyFunc_INQUIRY
58+
#define _HPySlot_SIG__HPy_nb_divmod HPyFunc_BINARYFUNC
59+
#define _HPySlot_SIG__HPy_nb_float HPyFunc_UNARYFUNC
60+
#define _HPySlot_SIG__HPy_nb_floor_divide HPyFunc_BINARYFUNC
61+
#define _HPySlot_SIG__HPy_nb_index HPyFunc_UNARYFUNC
62+
#define _HPySlot_SIG__HPy_nb_inplace_add HPyFunc_BINARYFUNC
63+
#define _HPySlot_SIG__HPy_nb_inplace_and HPyFunc_BINARYFUNC
64+
#define _HPySlot_SIG__HPy_nb_inplace_floor_divide HPyFunc_BINARYFUNC
65+
#define _HPySlot_SIG__HPy_nb_inplace_lshift HPyFunc_BINARYFUNC
66+
#define _HPySlot_SIG__HPy_nb_inplace_multiply HPyFunc_BINARYFUNC
67+
#define _HPySlot_SIG__HPy_nb_inplace_or HPyFunc_BINARYFUNC
68+
#define _HPySlot_SIG__HPy_nb_inplace_power HPyFunc_TERNARYFUNC
69+
#define _HPySlot_SIG__HPy_nb_inplace_remainder HPyFunc_BINARYFUNC
70+
#define _HPySlot_SIG__HPy_nb_inplace_rshift HPyFunc_BINARYFUNC
71+
#define _HPySlot_SIG__HPy_nb_inplace_subtract HPyFunc_BINARYFUNC
72+
#define _HPySlot_SIG__HPy_nb_inplace_true_divide HPyFunc_BINARYFUNC
73+
#define _HPySlot_SIG__HPy_nb_inplace_xor HPyFunc_BINARYFUNC
74+
#define _HPySlot_SIG__HPy_nb_int HPyFunc_UNARYFUNC
75+
#define _HPySlot_SIG__HPy_nb_invert HPyFunc_UNARYFUNC
76+
#define _HPySlot_SIG__HPy_nb_lshift HPyFunc_BINARYFUNC
77+
#define _HPySlot_SIG__HPy_nb_multiply HPyFunc_BINARYFUNC
78+
#define _HPySlot_SIG__HPy_nb_negative HPyFunc_UNARYFUNC
79+
#define _HPySlot_SIG__HPy_nb_or HPyFunc_BINARYFUNC
80+
#define _HPySlot_SIG__HPy_nb_positive HPyFunc_UNARYFUNC
81+
#define _HPySlot_SIG__HPy_nb_power HPyFunc_TERNARYFUNC
82+
#define _HPySlot_SIG__HPy_nb_remainder HPyFunc_BINARYFUNC
83+
#define _HPySlot_SIG__HPy_nb_rshift HPyFunc_BINARYFUNC
84+
#define _HPySlot_SIG__HPy_nb_subtract HPyFunc_BINARYFUNC
85+
#define _HPySlot_SIG__HPy_nb_true_divide HPyFunc_BINARYFUNC
86+
#define _HPySlot_SIG__HPy_nb_xor HPyFunc_BINARYFUNC
87+
#define _HPySlot_SIG__HPy_sq_item HPyFunc_SSIZEARGFUNC
88+
#define _HPySlot_SIG__HPy_tp_init HPyFunc_INITPROC
89+
#define _HPySlot_SIG__HPy_tp_new HPyFunc_KEYWORDS
90+
#define _HPySlot_SIG__HPy_tp_repr HPyFunc_REPRFUNC
91+
#define _HPySlot_SIG__HPy_nb_matrix_multiply HPyFunc_BINARYFUNC
92+
#define _HPySlot_SIG__HPy_nb_inplace_matrix_multiply HPyFunc_BINARYFUNC
93+
#define _HPySlot_SIG__HPy_tp_destroy HPyFunc_DESTROYFUNC

graalpython/com.oracle.graal.python.cext/include/common/autogen_impl.h

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromLong)(HPyContext ctx, long value)
1313
return _py2h(PyLong_FromLong(value));
1414
}
1515

16+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromUnsignedLong)(HPyContext ctx, unsigned long value)
17+
{
18+
return _py2h(PyLong_FromUnsignedLong(value));
19+
}
20+
1621
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromLongLong)(HPyContext ctx, long long v)
1722
{
1823
return _py2h(PyLong_FromLongLong(v));
@@ -23,6 +28,16 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromUnsignedLongLong)(HPyContext ctx, uns
2328
return _py2h(PyLong_FromUnsignedLongLong(v));
2429
}
2530

31+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromSize_t)(HPyContext ctx, size_t value)
32+
{
33+
return _py2h(PyLong_FromSize_t(value));
34+
}
35+
36+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Long_FromSsize_t)(HPyContext ctx, HPy_ssize_t value)
37+
{
38+
return _py2h(PyLong_FromSsize_t(value));
39+
}
40+
2641
HPyAPI_STORAGE long _HPy_IMPL_NAME(Long_AsLong)(HPyContext ctx, HPy h)
2742
{
2843
return PyLong_AsLong(_h2py(h));
@@ -33,6 +48,21 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Float_FromDouble)(HPyContext ctx, double v)
3348
return _py2h(PyFloat_FromDouble(v));
3449
}
3550

51+
HPyAPI_STORAGE double _HPy_IMPL_NAME(Float_AsDouble)(HPyContext ctx, HPy h)
52+
{
53+
return PyFloat_AsDouble(_h2py(h));
54+
}
55+
56+
HPyAPI_STORAGE HPy_ssize_t _HPy_IMPL_NAME_NOPREFIX(Length)(HPyContext ctx, HPy h)
57+
{
58+
return PyObject_Length(_h2py(h));
59+
}
60+
61+
HPyAPI_STORAGE int _HPy_IMPL_NAME(Number_Check)(HPyContext ctx, HPy h)
62+
{
63+
return PyNumber_Check(_h2py(h));
64+
}
65+
3666
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(Add)(HPyContext ctx, HPy h1, HPy h2)
3767
{
3868
return _py2h(PyNumber_Add(_h2py(h1), _h2py(h2)));
@@ -205,10 +235,15 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(InPlaceOr)(HPyContext ctx, HPy h1, HP
205235

206236
HPyAPI_STORAGE void _HPy_IMPL_NAME(Err_SetString)(HPyContext ctx, HPy h_type, const char *message)
207237
{
208-
return PyErr_SetString(_h2py(h_type), message);
238+
PyErr_SetString(_h2py(h_type), message);
209239
}
210240

211-
HPyAPI_STORAGE int _HPy_IMPL_NAME(Object_IsTrue)(HPyContext ctx, HPy h)
241+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Err_NoMemory)(HPyContext ctx)
242+
{
243+
return _py2h(PyErr_NoMemory());
244+
}
245+
246+
HPyAPI_STORAGE int _HPy_IMPL_NAME_NOPREFIX(IsTrue)(HPyContext ctx, HPy h)
212247
{
213248
return PyObject_IsTrue(_h2py(h));
214249
}
@@ -253,6 +288,41 @@ HPyAPI_STORAGE int _HPy_IMPL_NAME_NOPREFIX(SetItem)(HPyContext ctx, HPy obj, HPy
253288
return PyObject_SetItem(_h2py(obj), _h2py(key), _h2py(value));
254289
}
255290

291+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(Repr)(HPyContext ctx, HPy obj)
292+
{
293+
return _py2h(PyObject_Repr(_h2py(obj)));
294+
}
295+
296+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(Str)(HPyContext ctx, HPy obj)
297+
{
298+
return _py2h(PyObject_Str(_h2py(obj)));
299+
}
300+
301+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(ASCII)(HPyContext ctx, HPy obj)
302+
{
303+
return _py2h(PyObject_ASCII(_h2py(obj)));
304+
}
305+
306+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(Bytes)(HPyContext ctx, HPy obj)
307+
{
308+
return _py2h(PyObject_Bytes(_h2py(obj)));
309+
}
310+
311+
HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(RichCompare)(HPyContext ctx, HPy v, HPy w, int op)
312+
{
313+
return _py2h(PyObject_RichCompare(_h2py(v), _h2py(w), op));
314+
}
315+
316+
HPyAPI_STORAGE int _HPy_IMPL_NAME_NOPREFIX(RichCompareBool)(HPyContext ctx, HPy v, HPy w, int op)
317+
{
318+
return PyObject_RichCompareBool(_h2py(v), _h2py(w), op);
319+
}
320+
321+
HPyAPI_STORAGE HPy_hash_t _HPy_IMPL_NAME_NOPREFIX(Hash)(HPyContext ctx, HPy obj)
322+
{
323+
return PyObject_Hash(_h2py(obj));
324+
}
325+
256326
HPyAPI_STORAGE int _HPy_IMPL_NAME(Bytes_Check)(HPyContext ctx, HPy h)
257327
{
258328
return PyBytes_Check(_h2py(h));
@@ -298,6 +368,11 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Unicode_FromWideChar)(HPyContext ctx, const wc
298368
return _py2h(PyUnicode_FromWideChar(w, size));
299369
}
300370

371+
HPyAPI_STORAGE int _HPy_IMPL_NAME(List_Check)(HPyContext ctx, HPy h)
372+
{
373+
return PyList_Check(_h2py(h));
374+
}
375+
301376
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(List_New)(HPyContext ctx, HPy_ssize_t len)
302377
{
303378
return _py2h(PyList_New(len));
@@ -308,6 +383,11 @@ HPyAPI_STORAGE int _HPy_IMPL_NAME(List_Append)(HPyContext ctx, HPy h_list, HPy h
308383
return PyList_Append(_h2py(h_list), _h2py(h_item));
309384
}
310385

386+
HPyAPI_STORAGE int _HPy_IMPL_NAME(Dict_Check)(HPyContext ctx, HPy h)
387+
{
388+
return PyDict_Check(_h2py(h));
389+
}
390+
311391
HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Dict_New)(HPyContext ctx)
312392
{
313393
return _py2h(PyDict_New());

0 commit comments

Comments
 (0)
0