sharedfuncs.cpp
/* boxes the object, stealing the reference */
boxes the object, stealing the reference
boxes the object stealing the reference
mxArray *box (PyObject *pyobj) {
  mxArray *boxed = NULL;
  if (!pyobj) {
    PYMEX_DEBUG("Boxing null object.");
  }
  boxed = box_by_type(pyobj);
  if (!boxed) return NULL;
  if (pyobj) mexLock();
  mxArray *ptr_field = mxGetProperty(boxed, 0, "pointer");
  void **ptr = (void **) mxGetData(ptr_field);
  *ptr = (void*) pyobj;
  mxSetProperty(boxed, 0, "pointer", ptr_field);
  return boxed;
}
mxArray * box ( PyObject * pyobj ) { mxArray * boxed = NULL ; if ( ! pyobj ) { PYMEX_DEBUG ( " " ) ; } boxed = box_by_type ( pyobj ) ; if ( ! boxed ) return NULL ; if ( pyobj ) mexLock ( ) ; mxArray * ptr_field = mxGetProperty ( boxed , 0 , " " ) ; void * * ptr = ( void * * ) mxGetData ( ptr_field ) ; * ptr = ( void * ) pyobj ; mxSetProperty ( boxed , 0 , " " , ptr_field ) ; return boxed ; }
boxes the object, stealing the reference
boxes the object stealing the reference