diff options
Diffstat (limited to 'hidio.c')
-rw-r--r-- | hidio.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -2,6 +2,7 @@ /* */ /* interface to native HID (Human Interface Devices) API */ /* Written by Hans-Christoph Steiner <hans@at.or.at> */ +/* Max/MSP port by Olaf Matthes <olaf.matthes@gmx.de> */
/* */ /* Copyright (c) 2004-2006 Hans-Christoph Steiner */ /* */ @@ -22,12 +23,16 @@ /* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ - +
+#ifdef _WINDOWS
+/* any Windows specific includes go in here */
+#else #include <unistd.h> -#include <stdarg.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> +#include <ctype.h>
+#endif +#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
#include "hidio.h" @@ -83,14 +88,15 @@ static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv); void debug_print(t_int message_debug_level, const char *fmt, ...) { if(message_debug_level <= global_debug_level) - { + {
char buf[MAXPDSTRING]; va_list ap; //t_int arg[8]; va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); post(buf); - va_end(ap); + va_end(ap);
+ } } @@ -384,8 +390,8 @@ t_int hidio_close(t_hidio *x) */ static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv) { + short device_number;
debug_print(LOG_DEBUG,"hid_%s",s->s_name); - short device_number; pthread_mutex_lock(&x->x_mutex); device_number = get_device_number_from_arguments(argc, argv); @@ -830,7 +836,7 @@ int main() hidio_class = c; finder_addclass("Devices", "hidio"); - post("hidio: © 2006 by Olaf Matthes"); + post("hidio: © 2006 by Hans-Christoph Steiner & Olaf Matthes"); /* pre-generate often used symbols */ ps_open = gensym("open"); |