def convert_argument(self, space, w_obj, address, call_local): r = rffi.cast(rffi.VOIDPP, call_local) r[0] = rffi.cast(rffi.VOIDP, self._unwrap_object(space, w_obj)) x = rffi.cast(rffi.VOIDPP, address) x[0] = rffi.cast(rffi.VOIDP, call_local) address = rffi.cast(capi.C_OBJECT, address) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'o'
def convert_argument(self, space, w_obj, address, call_local): if hasattr(space, "fake"): raise NotImplementedError space.getbuiltinmodule("cpyext") from pypy.module.cpyext.pyobject import make_ref ref = make_ref(space, w_obj) x = rffi.cast(rffi.VOIDPP, address) x[0] = rffi.cast(rffi.VOIDP, ref) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'a'
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.VOIDPP, address) ba = rffi.cast(rffi.CCHARP, address) r = rffi.cast(rffi.VOIDPP, call_local) try: r[0] = get_rawbuffer(space, w_obj) except TypeError: r[0] = rffi.cast(rffi.VOIDP, get_rawobject(space, w_obj)) x[0] = rffi.cast(rffi.VOIDP, call_local) ba[capi.c_function_arg_typeoffset(space)] = self.typecode
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.VOIDPP, address) ba = rffi.cast(rffi.CCHARP, address) r = rffi.cast(rffi.VOIDPP, call_local) try: r[0] = get_rawbuffer(space, w_obj) except TypeError: r[0] = rffi.cast(rffi.VOIDP, get_rawobject(space, w_obj)) x[0] = rffi.cast(rffi.VOIDP, call_local) ba[capi.c_function_arg_typeoffset(space)] = 'a'
def convert_argument(self, space, w_obj, address, call_local): w_tc = space.findattr(w_obj, space.wrap('typecode')) if w_tc is not None and space.str_w(w_tc) != self.typecode: msg = "expected %s pointer type, but received %s" % (self.typecode, space.str_w(w_tc)) raise OperationError(space.w_TypeError, space.wrap(msg)) x = rffi.cast(rffi.VOIDPP, address) try: x[0] = rffi.cast(rffi.VOIDP, get_rawbuffer(space, w_obj)) except TypeError: raise OperationError(space.w_TypeError, space.wrap("raw buffer interface not supported")) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'o'
def convert_argument(self, space, w_obj, address, call_local): w_tc = space.findattr(w_obj, space.newtext('typecode')) if w_tc is not None and space.text_w(w_tc) != self.typecode: raise oefmt(space.w_TypeError, "expected %s pointer type, but received %s", self.typecode, space.text_w(w_tc)) x = rffi.cast(rffi.VOIDPP, address) try: x[0] = rffi.cast(rffi.VOIDP, get_rawbuffer(space, w_obj)) except TypeError: raise oefmt(space.w_TypeError, "raw buffer interface not supported") ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'o'
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.LONGP, address) arg = space.text_w(w_obj) x[0] = rffi.cast(rffi.LONG, rffi.str2charp(arg)) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'o'
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.CCHARP, address) x[0] = self._unwrap_object(space, w_obj) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'b'
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(self.c_ptrtype, address) x[0] = self._unwrap_object(space, w_obj) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = self.typecode
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.LONGP, address) arg = space.str_w(w_obj) x[0] = rffi.cast(rffi.LONG, rffi.str2charp(arg)) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset(space)] = 'o'
def convert_argument(self, space, w_obj, address, call_local): x = rffi.cast(rffi.VOIDPP, address) x[0] = rffi.cast(rffi.VOIDP, get_rawobject(space, w_obj)) ba = rffi.cast(rffi.CCHARP, address) ba[capi.c_function_arg_typeoffset()] = 'r'