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

Method AddStringConstant

module.go:122–135  ·  view source on GitHub ↗
(name, value string)

Source from the content-addressed store, hash-verified

120}
121
122func (mod *Module) AddStringConstant(name, value string) error {
123 cname := C.CString(name)
124 defer C.free(unsafe.Pointer(cname))
125
126 cvalue := C.CString(value)
127 defer C.free(unsafe.Pointer(cvalue))
128
129 ret := C.PyModule_AddStringConstant(mod.c(), cname, cvalue)
130 if ret < 0 {
131 return exception()
132 }
133
134 return nil
135}

Callers

nothing calls this directly

Calls 2

exceptionFunction · 0.85
cMethod · 0.80

Tested by

no test coverage detected