MCPcopy
hub / github.com/dmlc/dgl / c_str

Function c_str

python/dgl/_ffi/base.py:73–85  ·  view source on GitHub ↗

Create ctypes char * from a python string Parameters ---------- string : string type python string Returns ------- str : c_char_p A char pointer that can be passed to C API

(string)

Source from the content-addressed store, hash-verified

71
72
73def c_str(string):
74 """Create ctypes char * from a python string
75 Parameters
76 ----------
77 string : string type
78 python string
79
80 Returns
81 -------
82 str : c_char_p
83 A char pointer that can be passed to C API
84 """
85 return ctypes.c_char_p(string.encode("utf-8"))
86
87
88def c_array(ctype, values):

Callers 8

get_functionMethod · 0.85
registerFunction · 0.85
get_global_funcFunction · 0.85
registerFunction · 0.85
cfunFunction · 0.85
_make_dgl_argsFunction · 0.85
__getattr__Method · 0.85
ndarray.pyFile · 0.85

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected