This repository was archived by the owner on Aug 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +21
-77
lines changed Expand file tree Collapse file tree 14 files changed +21
-77
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,21 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
16
+ import (
17
+ "unsafe"
18
+ )
19
+
17
20
//python boolean constants
18
21
var (
19
22
Py_False = togo (C .Py_False )
20
23
Py_True = togo (C .Py_True )
21
24
)
22
25
23
26
//Bool : https://docs.python.org/3/c-api/bool.html#c.PyBool_Type
24
- var Bool = togo (C . _go_PyBool_Type )
27
+ var Bool = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyBool_Type )) )
25
28
26
29
//PyBool_Check : https://docs.python.org/3/c-api/bool.html#c.PyBool_Check
27
30
func PyBool_Check (o * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
import "unsafe"
17
16
18
17
//ByteArray : https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_Type
19
- var ByteArray = togo (C . _go_PyByteArray_Type )
18
+ var ByteArray = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyByteArray_Type )) )
20
19
21
20
//PyByteArray_Check : https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_Check
22
21
func PyByteArray_Check (o * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
import "unsafe"
17
16
18
17
//Bytes : https://docs.python.org/3/c-api/bytes.html#c.PyBytes_Type
19
- var Bytes = togo (C . _go_PyBytes_Type )
18
+ var Bytes = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyBytes_Type )) )
20
19
21
20
//PyBytes_Check : https://docs.python.org/3/c-api/bytes.html#c.PyBytes_Check
22
21
func PyBytes_Check (o * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
15
+ import "unsafe"
16
16
17
17
//Complex : https://docs.python.org/3/c-api/complex.html#c.PyComplex_Type
18
- var Complex = togo (C . _go_PyComplex_Type )
18
+ var Complex = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyComplex_Type )) )
19
19
20
20
//PyComplex_Check : https://docs.python.org/3/c-api/complex.html#c.PyComplex_Check
21
21
func PyComplex_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
import (
17
16
"unsafe"
18
17
)
19
18
20
19
//Dict : https://docs.python.org/3/c-api/dict.html#c.PyDict_Type
21
- var Dict = togo (C . _go_PyDict_Type )
20
+ var Dict = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyDict_Type )) )
22
21
23
22
//PyDict_Check : https://docs.python.org/3/c-api/dict.html#c.PyDict_Check
24
23
func PyDict_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
15
+ import "unsafe"
16
16
17
17
//Float : https://docs.python.org/3/c-api/float.html#c.PyFloat_Type
18
- var Float = togo (C . _go_PyFloat_Type )
18
+ var Float = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyFloat_Type )) )
19
19
20
20
//PyFloat_Check : https://docs.python.org/3/c-api/float.html#c.PyFloat_Check
21
21
func PyFloat_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
import (
17
16
"unsafe"
18
17
)
19
18
20
19
//Long : https://docs.python.org/3/c-api/long.html#c.PyLong_Type
21
- var Long = togo (C . _go_PyLong_Type )
20
+ var Long = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyLong_Type )) )
22
21
23
22
//PyLong_Check : https://docs.python.org/3/c-api/long.html#c.PyLong_Check
24
23
func PyLong_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
15
+ import "unsafe"
16
16
17
17
//List : https://docs.python.org/3/c-api/list.html#c.PyList_Type
18
- var List = togo (C . _go_PyList_Type )
18
+ var List = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyList_Type )) )
19
19
20
20
//PyList_Check : https://docs.python.org/3/c-api/list.html#c.PyList_Check
21
21
func PyList_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
16
15
import "unsafe"
17
16
18
17
//Module : https://docs.python.org/3/c-api/module.html#c.PyModule_Type
19
- var Module = togo (C . _go_PyModule_Type )
18
+ var Module = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyModule_Type )) )
20
19
21
20
//PyModule_Check : https://docs.python.org/3/c-api/module.html#c.PyModule_Check
22
21
func PyModule_Check (p * PyObject ) bool {
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ package python3
10
10
/*
11
11
#include "Python.h"
12
12
#include "macro.h"
13
- #include "type.h"
14
13
*/
15
14
import "C"
15
+ import "unsafe"
16
16
17
17
//Tuple : https://docs.python.org/3/c-api/tuple.html#c.PyTuple_Type
18
- var Tuple = togo (C . _go_PyTuple_Type )
18
+ var Tuple = togo (( * C . PyObject )( unsafe . Pointer ( & C . PyTuple_Type )) )
19
19
20
20
//PyTuple_Check : https://docs.python.org/3/c-api/tuple.html#c.PyTuple_Check
21
21
func PyTuple_Check (p * PyObject ) bool {
You can’t perform that action at this time.
0 commit comments