@@ -75,3 +75,39 @@ func Py_SetPath(path string) {
7575func Py_SetPythonHome (home string ) {
7676 py_SetPythonHome .Call (StringToUTF16Ptr (home ))
7777}
78+
79+ func Py_fopen_obj (path uintptr ,mode string )uintptr {
80+ r ,_ ,_ := _py_fopen_obj .Call (path ,GoStrToCStr (mode ))
81+ return r
82+ }
83+
84+ func PyUnicode_FromString (u string )uintptr {
85+ r ,_ ,_ := pyUnicode_FromString .Call (GoStrToCStr (u ))
86+ return r
87+ }
88+ func PyUnicode_GetLength (obj uintptr )uintptr {
89+ r ,_ ,_ := pyUnicode_GetLength .Call (obj )
90+ return r
91+ }
92+ func PyLong_FromLong (l int64 )uintptr {
93+ r ,_ ,_ := pyLong_FromLong .Call (uintptr (l ))
94+ return r
95+ }
96+
97+
98+ func Py_IncRef (obj uintptr ){
99+ py_IncRef .Call (obj )
100+ }
101+ func Py_DecRef (obj uintptr ){
102+ py_DecRef .Call (obj )
103+ }
104+
105+
106+ func PyImport_AppendInittab (name string ,initfunc uintptr )int {
107+ r ,_ ,_ := pyImport_AppendInittab .Call (GoStrToCStr (name ),initfunc )
108+ return int (r )
109+ }
110+ func PyModule_Create2 (PyModuleDef uintptr ,apiver int )uintptr {
111+ r ,_ ,_ := pyModule_Create2 .Call (PyModuleDef , uintptr (apiver ))
112+ return r
113+ }
0 commit comments