You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gen.py
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -32,13 +32,14 @@ def ctp(data: str) -> str:
32
32
WCHAR=ctc("wchar")
33
33
DOUBLE_QUOTE: str='"'
34
34
TRIPLE_QUOTE: str='"""'
35
+
SSIZE=ctc("ssize_t")
35
36
36
37
C_TYPES= {
37
38
"void": "None",
38
39
"PyObject*": ct("py_object"),
39
40
"int": ctc("int"),
40
41
"void*": VOID_P,
41
-
"Py_ssize_t": ctc("ssize_t"),
42
+
"Py_ssize_t": SSIZE,
42
43
"char": ctc("char"),
43
44
"char*": CHAR_P,
44
45
"const char*": CHAR_P,
@@ -57,13 +58,19 @@ def ctp(data: str) -> str:
57
58
"w_char*": WCHAR_P,
58
59
"va_list": VOID_P,
59
60
"wchar_t": WCHAR,
60
-
"const wchar_t": WCHAR,
61
61
"PyTypeObject": "PyTypeObject",
62
62
"Py_UCS4": "Py_UCS4",
63
63
"PyThreadState": "PyThreadState",
64
64
"PyVarObject": "PyVarObject",
65
65
"PyFrameObject": "PyFrameObject",
66
66
"PyInterpreterState": "PyInterpreterState",
67
+
"PyType_Spec": "PyType_Spec",
68
+
"Py_tss_t": "Py_tss_t",
69
+
"Py_hash_t": SSIZE,
70
+
"Py_buffer": "Py_buffer",
71
+
"PyOS_sighandler_t": VOID_P,
72
+
"PyGILState_STATE": VOID_P,
73
+
"PyModuleDef": "PyModuleDef",
67
74
}
68
75
69
76
CT_TYPES= {
@@ -306,7 +313,7 @@ def main():
306
313
return
307
314
break
308
315
309
-
out: str="""raise Exception('autogenerating some things is too complicated or not possible! please manually go through and update the rest. you may delete this error when finished\n')"""
316
+
out: str="""raise Exception('autogenerating some things is too complicated or not possible! please manually go through and update the rest. you may delete this error when finished')\n"""
0 commit comments