MCPcopy Create free account
hub / github.com/cvxpy/cvxpy / SWIG_Python_FixMethods

Function SWIG_Python_FixMethods

cvxpy/cvxcore/python/cvxcore_wrap.cxx:21965–22004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21963 * -----------------------------------------------------------------------------*/
21964
21965 SWIGINTERN void
21966 SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) {
21967 size_t i;
21968 for (i = 0; methods[i].ml_name; ++i) {
21969 const char *c = methods[i].ml_doc;
21970 if (!c) continue;
21971 c = strstr(c, "swig_ptr: ");
21972 if (c) {
21973 int j;
21974 const swig_const_info *ci = 0;
21975 const char *name = c + 10;
21976 for (j = 0; const_table[j].type; ++j) {
21977 if (strncmp(const_table[j].name, name,
21978 strlen(const_table[j].name)) == 0) {
21979 ci = &(const_table[j]);
21980 break;
21981 }
21982 }
21983 if (ci) {
21984 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
21985 if (ptr) {
21986 size_t shift = (ci->ptype) - types;
21987 swig_type_info *ty = types_initial[shift];
21988 size_t ldoc = (c - methods[i].ml_doc);
21989 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
21990 char *ndoc = (char*)malloc(ldoc + lptr + 10);
21991 if (ndoc) {
21992 char *buff = ndoc;
21993 memcpy(buff, methods[i].ml_doc, ldoc);
21994 buff += ldoc;
21995 memcpy(buff, "swig_ptr: ", 10);
21996 buff += 10;
21997 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
21998 methods[i].ml_doc = ndoc;
21999 }
22000 }
22001 }
22002 }
22003 }
22004 }
22005
22006#ifdef __cplusplus
22007}

Callers 1

cvxcore_wrap.cxxFile · 0.85

Calls 1

SWIG_PackVoidPtrFunction · 0.85

Tested by

no test coverage detected