예제 #1
0
 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'
예제 #2
0
파일: converter.py 프로젝트: Darriall/pypy
 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'
예제 #3
0
 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'
예제 #4
0
 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
예제 #5
0
파일: converter.py 프로젝트: Darriall/pypy
 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'
예제 #6
0
파일: converter.py 프로젝트: Darriall/pypy
 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'
예제 #7
0
파일: converter.py 프로젝트: Darriall/pypy
 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'
예제 #8
0
 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'
예제 #9
0
 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'
예제 #10
0
 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'
예제 #11
0
파일: converter.py 프로젝트: Darriall/pypy
 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
예제 #12
0
파일: converter.py 프로젝트: Darriall/pypy
 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'
예제 #13
0
 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'