Ctypes update: pretty objects

Since my last couple of posts, things have been done:

  • Complete revamping of call logic
  • Finished objects for basic C Types (int, double etc.)
  • A fairly sound cast() function for Ctypes
  • Array objects
  • Despite this, I don't think I'm going to get everything implemented for the GSoC deadline :-/ Still a long list of features I want to add. Particularly notable by their absence are Pointers, Structures, Unions, paramflags and support for special Win32 objects (COM stuff, HRESULT and friends).

    Crap... when you list it like that, sounds pretty dire…

    Following convention across language boundaries

    I've been meaning to write this post for a while. I'd like your opinion on it.

    Thoughts on a Ctypes::Type object API

    For the past few days I've been considering and experimenting with the design of simple Ctypes::Type objects. These are objects which, funnily enough, represent C data types for manipulation in Perl.

    Looking at the Python ctypes module, there were various things I didn't like. Python's simple types [0] can be summarized thusly:

    >>> i = c_int(42)
    >>> print i
    c_long(42)
    >>> print i.value
    42
    >>> i.value = -99
    >>> print i.value
    -99
    >>>
    

    Having to specify …

    Callbacks done, weird 64bit libffi issue?

    The week has been frustrating, funny, yet ultimately fruitful.

    I had callbacks to Perl almost working at the start of the week, but couldn't seem to get variables updated 'in place'. The example function I was using to test callbacks, the C standard qsort, takes as its arguments a pointer to an array, the number of items in the array, the size in bytes of one item, and a reference to a function which will be passed two items from the array at a time and decide how to sort them. It returns void, and the …

    GSoC Update: New objects, Perl callbacks

    July already - where has the time gone? Oh wait, Twitter can tell me.

    In the wake of my last blog post, rurban told me Magic was more of a 'last resort', and that everything necessary for making type objects could be done with perl's pack and unpack functions, which precipitated a day or two experimenting and trying to get …