parent
8c7eedeae7
commit
7d65f97b9f
|
@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
|
||||||
package python3
|
package python3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
#cgo pkg-config: python-3.9-embed
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
|
||||||
package python3
|
package python3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
#cgo pkg-config: python-3.9-embed
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
*/
|
*/
|
||||||
|
|
1
bytes.go
1
bytes.go
|
@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
|
||||||
package python3
|
package python3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
#cgo pkg-config: python-3.9-embed
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
*/
|
*/
|
||||||
|
|
6
dict.go
6
dict.go
|
@ -137,6 +137,6 @@ func PyDict_Next(p *PyObject, ppos *int, pkey, pvalue **PyObject) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
//PyDict_ClearFreeList : https://docs.python.org/3/c-api/dict.html#c.PyDict_ClearFreeList
|
//PyDict_ClearFreeList : https://docs.python.org/3/c-api/dict.html#c.PyDict_ClearFreeList
|
||||||
func PyDict_ClearFreeList() int {
|
//func PyDict_ClearFreeList() int {
|
||||||
return int(C.PyDict_ClearFreeList())
|
// return int(C.PyDict_ClearFreeList())
|
||||||
}
|
//}
|
||||||
|
|
6
float.go
6
float.go
|
@ -58,6 +58,6 @@ func PyFloat_GetMin() float64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
//PyFloat_ClearFreeList : https://docs.python.org/3/c-api/float.html#c.PyFloat_ClearFreeList
|
//PyFloat_ClearFreeList : https://docs.python.org/3/c-api/float.html#c.PyFloat_ClearFreeList
|
||||||
func PyFloat_ClearFreeList() int {
|
//func PyFloat_ClearFreeList() int {
|
||||||
return int(C.PyFloat_ClearFreeList())
|
// return int(C.PyFloat_ClearFreeList())
|
||||||
}
|
//}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
module git.stein-ivar.net/steino/cpy3
|
||||||
|
|
||||||
|
go 1.20
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/go-python/cpy3 v0.2.0
|
||||||
|
github.com/stretchr/testify v1.2.2
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
|
)
|
|
@ -0,0 +1,8 @@
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/go-python/cpy3 v0.2.0 h1:IQ8v6KOTGSvejROZ8BPCfVW4rSMOKfpVwDi6sKYuu1w=
|
||||||
|
github.com/go-python/cpy3 v0.2.0/go.mod h1:W7F8SGWQv11501PYSj9d+NSv8U0/vWYa+FcMxBu4eqo=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||||
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
2
list.go
2
list.go
|
@ -83,6 +83,8 @@ func PyList_AsTuple(list *PyObject) *PyObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
//PyList_ClearFreeList : https://docs.python.org/3/c-api/list.html#c.PyList_ClearFreeList
|
//PyList_ClearFreeList : https://docs.python.org/3/c-api/list.html#c.PyList_ClearFreeList
|
||||||
|
/*
|
||||||
func PyList_ClearFreeList() int {
|
func PyList_ClearFreeList() int {
|
||||||
return int(C.PyList_ClearFreeList())
|
return int(C.PyList_ClearFreeList())
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
1
sys.go
1
sys.go
|
@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
|
||||||
package python3
|
package python3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
#cgo pkg-config: python-3.9-embed
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
|
@ -19,9 +19,11 @@ type PyThreadState C.PyThreadState
|
||||||
type PyGILState C.PyGILState_STATE
|
type PyGILState C.PyGILState_STATE
|
||||||
|
|
||||||
//PyEval_InitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
|
//PyEval_InitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
|
||||||
|
/*
|
||||||
func PyEval_InitThreads() {
|
func PyEval_InitThreads() {
|
||||||
C.PyEval_InitThreads()
|
C.PyEval_InitThreads()
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// PyEval_ThreadsInitialized : https://docs.python.org/3/c-api/init.html#c.PyEval_ThreadsInitialized
|
// PyEval_ThreadsInitialized : https://docs.python.org/3/c-api/init.html#c.PyEval_ThreadsInitialized
|
||||||
func PyEval_ThreadsInitialized() bool {
|
func PyEval_ThreadsInitialized() bool {
|
||||||
|
@ -49,9 +51,11 @@ func PyThreadState_Swap(tstate *PyThreadState) *PyThreadState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PyEval_ReInitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_ReInitThreads
|
// PyEval_ReInitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_ReInitThreads
|
||||||
|
/*
|
||||||
func PyEval_ReInitThreads() {
|
func PyEval_ReInitThreads() {
|
||||||
C.PyEval_ReInitThreads()
|
C.PyEval_ReInitThreads()
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// PyGILState_Ensure : https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure
|
// PyGILState_Ensure : https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure
|
||||||
func PyGILState_Ensure() PyGILState {
|
func PyGILState_Ensure() PyGILState {
|
||||||
|
|
Loading…
Reference in New Issue