MCPcopy Create free account
hub / github.com/goplus/py / AddIntConstant

Method AddIntConstant

module.go:110–120  ·  view source on GitHub ↗
(name string, value int)

Source from the content-addressed store, hash-verified

108}
109
110func (mod *Module) AddIntConstant(name string, value int) error {
111 cname := C.CString(name)
112 defer C.free(unsafe.Pointer(cname))
113
114 ret := C.PyModule_AddIntConstant(mod.c(), cname, C.long(value))
115 if ret < 0 {
116 return exception()
117 }
118
119 return nil
120}
121
122func (mod *Module) AddStringConstant(name, value string) error {
123 cname := C.CString(name)

Callers

nothing calls this directly

Calls 2

exceptionFunction · 0.85
cMethod · 0.80

Tested by

no test coverage detected