MCPcopy Create free account
hub / github.com/chokkan/crfsuite / SWIG_FromCharPtrAndSize

Function SWIG_FromCharPtrAndSize

swig/python/export_wrap.cpp:5242–5260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5240
5241
5242SWIGINTERNINLINE PyObject *
5243SWIG_FromCharPtrAndSize(const char* carray, size_t size)
5244{
5245 if (carray) {
5246 if (size > INT_MAX) {
5247 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
5248 return pchar_descriptor ?
5249 SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
5250 } else {
5251#if PY_VERSION_HEX >= 0x03000000
5252 return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
5253#else
5254 return PyString_FromStringAndSize(carray, static_cast< int >(size));
5255#endif
5256 }
5257 } else {
5258 return SWIG_Py_Void();
5259 }
5260}
5261
5262
5263SWIGINTERNINLINE PyObject *

Callers 1

SWIG_From_std_stringFunction · 0.85

Calls 1

SWIG_Py_VoidFunction · 0.85

Tested by

no test coverage detected