Index: apps/plugins/pdbox/PDa/src/m_fixed.c =================================================================== --- apps/plugins/pdbox/PDa/src/m_fixed.c (revision 21272) +++ apps/plugins/pdbox/PDa/src/m_fixed.c (working copy) @@ -1,9 +1,17 @@ +#ifdef ROCKBOX +#include "plugin.h" +#include "pdbox.h" +#define strcmp rb->strcmp +#define strncmp rb->strncmp +#define snprintf rb->snprintf +#else /* ROCKBOX */ #include #include #include #include #include +#endif /* ROCKBOX */ #include "m_pd.h" #include "m_imp.h" @@ -21,8 +29,19 @@ -static void ipod_connect() +static void ipod_connect(void) { +#ifdef ROCKBOX + if (x_fd >= 0) + { + error("ipod_connect: already connected"); + return; + } + else + { + x_fd++; + } +#else /* ROCKBOX */ struct sockaddr_in server; struct hostent *hp; int sockfd; @@ -65,6 +84,7 @@ } post("connected %s %d",hostname,portno); x_fd = sockfd; +#endif /* ROCKBOX */ } @@ -72,8 +92,13 @@ static void ipod_bang(t_ipod *x) { static char sendme[200]; +#ifdef ROCKBOX + snprintf(sendme, sizeof(sendme)-1, "%s bang;\n", x->x_what->s_name); + SEND_FROM_CORE(sendme); +#else /* ROCKBOX */ sprintf(sendme,"%s bang;\n",x->x_what->s_name); send(x_fd,sendme,strlen(sendme),0); +#endif /*ROCKBOX */ // if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); } @@ -81,9 +106,13 @@ static void ipod_float(t_ipod *x, t_float f) { static char sendme[200]; - +#ifdef ROCKBOX + snprintf(sendme, sizeof(sendme)-1, "%s %f;\n", x->x_what->s_name, f); + SEND_FROM_CORE(sendme); +#else /* ROCKBOX */ sprintf(sendme,"%s %f;\n",x->x_what->s_name,f); send(x_fd,sendme,strlen(sendme),0); +#endif /* ROCKBOX */ // post("forwarding float %s",x->x_what->s_name); // if (x->x_sym->s_thing) pd_float(x->x_sym->s_thing, f);