libpd/libpd — pull request #54 by danomatika (2013-12-19 19:02:12+00:00)
Title: set hook functions

This branch replaces setting the underlying C hook function pointers through assignment with explicit set functions. Basically, the functions from util/z_hook_util.h brought into z_libpd.h with the underlying function pointers moved into a separate header that is only used internally. This is safer and fixes #44.

Other, related changes:

The atom convenience macros (libpd_is_float, libpd_is_symbol, libpd_get_float, libpd_get_symbol) have been updated to full fledge functions. This was required by the C# wrapper, so I decided to bring it into z_libpd.h. _Note_: I changed the atom var type to a pointer, again this was required by the C# wrapper and passing by reference makes more sense to me here.

The libpd_next_atom function has been added, again from z_hook_utils.h. This is a wrapper around a pointer increment on a given atom array and is required by the C# wrapper (I guess C# can't work with C arrays directly? anyway ...).

libpd_init now has the check from libpd_safe_init in z_hook_utils. _Note_: It returns a 0 on success and a -1 on failure to match C conventions. This is different from the bool return from libpd_safe_init. I updated the C# wrapper to use libpd_init and, from what I can tell, it wasn't using the return from libpd_safe_init, so it should work fine.