From cb484de796b5e6b9ecfa36111390e9b2086bdd13 Mon Sep 17 00:00:00 2001 From: Olaf Matthes Date: Fri, 1 Dec 2006 15:07:46 +0000 Subject: initial Max port for Max 4.5 on OS svn path=/trunk/externals/io/hidio/; revision=6558 --- hidio.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'hidio.h') diff --git a/hidio.h b/hidio.h index 7b709ad..3a2a670 100644 --- a/hidio.h +++ b/hidio.h @@ -8,7 +8,22 @@ #include #endif /* __linux__ */ +#ifdef PD #include +#else +#include "ext.h" +#include "ext_obex.h" +#include "commonsyms.h" +/* some Pd specific types need definition in Max */ +typedef long t_int; +typedef double t_float; +typedef double t_floatarg; +typedef void t_outlet; +typedef void t_clock; +#define MAXPDSTRING 512 +#define pd_error(x, b) error(b) +#define SETSYMBOL SETSYM +#endif /* * this is automatically generated from linux/input.h by @@ -19,7 +34,7 @@ #define HIDIO_MAJOR_VERSION 0 #define HIDIO_MINOR_VERSION 0 -/* static char *version = "$Revision: 1.1 $"; */ +/* static char *version = "$Revision: 1.2 $"; */ /*------------------------------------------------------------------------------ * GLOBAL DEFINES @@ -44,6 +59,9 @@ typedef struct _hidio { t_object x_obj; +#ifndef PD + void *x_obex; +#endif t_int x_fd; void *x_ff_device; short x_device_number; @@ -66,10 +84,10 @@ typedef struct _hidio /* count the number of instances of this object so that certain free() * functions can be called only after the final instance is detroyed. */ -t_int hidio_instance_count; +extern t_int hidio_instance_count; /* this is used to test for the first instance to execute */ -double last_execute_time[MAX_DEVICES]; +extern double last_execute_time[MAX_DEVICES]; extern unsigned short global_debug_level; @@ -99,12 +117,12 @@ typedef struct _hid_element } t_hid_element; /* mostly for status querying */ -unsigned short device_count; +extern unsigned short device_count; /* store element structs to eliminate symbol table lookups, etc. */ -t_hid_element *element[MAX_DEVICES][MAX_ELEMENTS]; +extern t_hid_element *element[MAX_DEVICES][MAX_ELEMENTS]; /* number of active elements per device */ -unsigned short element_count[MAX_DEVICES]; +extern unsigned short element_count[MAX_DEVICES]; /*------------------------------------------------------------------------------ * FUNCTION PROTOTYPES FOR DIFFERENT PLATFORMS -- cgit v1.2.1