Documentation
¶
Index ¶
- Constants
- Variables
- func Load_library(exe string) error
- func PyBytesToString(b WCharPtr) string
- type GilType
- type PyConfig_3_12
- type PyGILState
- type PyInterpreterConfig
- type PyInterpreterStatePtr
- type PyObjectPtr
- type PyPreConfig
- type PyStatus
- type PyThreadStatePtr
- type PyTypeObjectPtr
- type PyWideStringList
- type PythonLibraryPtr
- type StartToken
- type Type
- type WCharPtr
Constants ¶
View Source
const ( TypeMask = (0x3f << 24) ImmutableFlag = (1 << 8) AllowsSubclassingFlag = (1 << 10) NoneMask = (ImmutableFlag | AllowsSubclassingFlag) )
Variables ¶
View Source
var ( Py_DecodeLocale func(string, uint64) WCharPtr Py_EncodeLocale func(WCharPtr, uint64) string PyPreConfig_InitIsolatedConfig func(*PyPreConfig) PyConfig_InitPythonConfig func(*PyConfig_3_12) PyConfig_InitIsolatedPythonConfig func(*PyConfig_3_12) PyConfig_Clear func(*PyConfig_3_12) Py_FinalizeEx func() int32 Py_EndInterpreter func(PyThreadStatePtr) // Check if we have the GIL. 1 if true, 0 if false. PyGILState_Check func() int32 // Take a reference to the GIL. Caution: this is recursive. PyGILState_Ensure func() PyGILState // Release a reference to the GIL. PyGILState_Release func(PyGILState) PyEval_AcquireThread func(PyThreadStatePtr) PyEval_ReleaseThread func(PyThreadStatePtr) PyEval_SaveThread func() PyThreadStatePtr PyEval_RestoreThread func(PyThreadStatePtr) PyThreadState_Get func() PyThreadStatePtr PyThreadState_New func(PyInterpreterStatePtr) PyThreadStatePtr PyThreadState_Swap func(PyThreadStatePtr) PyThreadStatePtr PyThreadState_Clear func(PyThreadStatePtr) PyThreadState_Delete func(PyThreadStatePtr) PyThreadState_DeleteCurrent func() PyThreadState_GetInterpreter func(PyThreadStatePtr) PyInterpreterStatePtr PyInterpreterState_Get func() PyInterpreterStatePtr PyInterpreterState_GetID func(PyInterpreterStatePtr) int64 PyInterpreterState_Clear func(PyInterpreterStatePtr) PyInterpreterState_Delete func(PyInterpreterStatePtr) PyRun_SimpleString func(string) int32 PyRun_String func(s string, token StartToken, globals, locals PyObjectPtr) PyObjectPtr PyModule_New func(string) PyObjectPtr PyModule_AddObjectRef func(module PyObjectPtr, name string, item PyObjectPtr) int32 PyBool_FromLong func(int) PyObjectPtr PyLong_FromLong func(int) PyObjectPtr PyLong_FromUnsignedLong func(uint) PyObjectPtr PyLong_FromLongLong func(int64) PyObjectPtr PyLong_FromUnsignedLongLong func(uint64) PyObjectPtr PyTuple_New func(int64) PyObjectPtr PyTuple_SetItem func(tuple PyObjectPtr, pos int64, item PyObjectPtr) int32 PyList_New func(PyObjectPtr) int32 PyList_Size func(PyObjectPtr) int PyList_GetItem func(PyObjectPtr, int) PyObjectPtr PyList_SetItem func(list PyObjectPtr, index int, item PyObjectPtr) int32 PyList_Append func(list, item PyObjectPtr) int32 PyList_Insert func(list PyObjectPtr, index int, item PyObjectPtr) int32 PyDict_New func() PyObjectPtr PyDictProxy_New func(mapping PyObjectPtr) PyObjectPtr PyDict_Clear func(PyObjectPtr) PyDict_SetItem func(dict, key, val PyObjectPtr) int32 PyDict_SetItemString func(dict PyObjectPtr, key string, val PyObjectPtr) int PyDict_GetItem func(dict, key, val PyObjectPtr) PyObjectPtr PyDict_GetItemString func(dict PyObjectPtr, key string) PyObjectPtr PyBytes_FromString func(string) PyObjectPtr PyBytes_FromStringAndSize func(*byte, int) PyObjectPtr PyByteArray_FromStringAndSize func(*byte, int) PyObjectPtr Py_DecRef func(PyObjectPtr) Py_IncRef func(PyObjectPtr) PyErr_Clear func() PyErr_Print func() PyObject_Type func(PyObjectPtr) PyTypeObjectPtr PyType_GetFlags func(PyTypeObjectPtr) uint64 )
View Source
var ( Py_PreInitialize func(*PyPreConfig) PyStatus PyConfig_SetBytesString func(*PyConfig_3_12, *WCharPtr, string) PyStatus Py_InitializeFromConfig func(*PyConfig_3_12) PyStatus Py_NewInterpreterFromConfig func(state *PyThreadStatePtr, c *PyInterpreterConfig) PyStatus )
View Source
var TypeStatus = ffi.Type{Type: ffi.Struct, Elements: &[]*ffi.Type{&ffi.TypeSint32, &ffi.TypePointer, &ffi.TypePointer, &ffi.TypeSint32, nil}[0]}
Functions ¶
func Load_library ¶
func PyBytesToString ¶
Types ¶
type PyConfig_3_12 ¶
type PyConfig_3_12 struct {
ConfigInit int32
Isolated int32
UseEnvironment int32
DevMode int32
InstallSignalHandlers int32
UseHashSeed int32
HashSeed uint
FaultHandler int32
TraceMalloc int32
PerfProfiling int32
ImportTime int32
CodeDebugRanges int32
ShowRefCount int32
DumpRefs int32
DumpRefsFile WCharPtr
MallocStats int32
FilesystemEncoding WCharPtr
FilesystemErrors WCharPtr
PycachePrefix WCharPtr
ParseArgv int32
OrigArgv PyWideStringList
Argv PyWideStringList
XOptions PyWideStringList
WarnOptions PyWideStringList
SiteImport int32
BytesWarning int32
WarnDefaultEncoding int32
Inspect int32
Interactive int32
OptimizationLevel int32
ParserDebug int32
WriteBytecode int32
Verbose int32
Quiet int32
UserSiteDirectory int32
ConfigureCStdio int32
BufferedStdio int32
StdioEncodings WCharPtr
StdioErrors WCharPtr
// LegacyWindowsStdio int32 // if windows
CheckHashPycsMode WCharPtr
UseFrozenModules int32
SafePath int32
IntMaxStrDigits int32
/* Path configuration inputs */
PathConfigWarnings int32
ProgramName WCharPtr
PythonPathEnv WCharPtr
Home WCharPtr
PlatLibDir WCharPtr
/* Path configuration outputs */
ModuleSearchPathsSet int32
ModuleSearchPaths PyWideStringList
StdlibDir *byte
Executable *byte
BaseExecutable *byte
Prefix *byte
BasePrefix *byte
ExecPrefix *byte
BaseExecPrefix *byte
/* Parameter only used by Py_Main */
SkipSourceFirstLine int32
RunCommand *byte
RunModule *byte
RunFilename *byte
/* Set by Py_Main */
SysPath0 *byte
/* Private Fields */
InstallImportLib int32
InitMain int32
IsPythonBuild int32
}
type PyGILState ¶
type PyGILState int32
type PyInterpreterConfig ¶
type PyInterpreterStatePtr ¶
type PyInterpreterStatePtr uintptr
type PyPreConfig ¶
type PyTypeObjectPtr ¶ added in v0.3.0
type PyTypeObjectPtr uintptr
const NullPyTypeObjectPtr PyTypeObjectPtr = 0
type PyWideStringList ¶
type PythonLibraryPtr ¶
type PythonLibraryPtr = uintptr
type StartToken ¶
type StartToken = int32
const ( PySingleInput StartToken = 256 // Used for single statements PyFileInput StartToken = 257 // Used for modules (i.e. many statements) PyEvalInput StartToken = 258 // Used for expressions(?) PyFuncTypeInput StartToken = 345 // ??? no idea )
type Type ¶ added in v0.3.0
type Type uint64
PyObject types basd on inspecting the tpflags of a PyTypeObject
func Py_BaseType ¶ added in v0.3.0
func Py_BaseType(obj PyObjectPtr) Type
Click to show internal directories.
Click to hide internal directories.