libIM on OSX; small ffi wrapper