From e465a280b562cf0ed4ab136e240437f6574189f8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 30 Dec 2010 05:04:04 +0100 Subject: old Virtual OSC Controller project exported from SVN working copy unfortunately the repository is long gone, so is its history working and tested for: * POSIX/gcc (Linux, Windows Cygwin, OS/2 EMX) * Open Watcom C (native OS/2 and Windows) --- src/osc.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/osc.h (limited to 'src/osc.h') diff --git a/src/osc.h b/src/osc.h new file mode 100644 index 0000000..f8aa6d9 --- /dev/null +++ b/src/osc.h @@ -0,0 +1,61 @@ + +#ifndef __OSC_H +#define __OSC_H + +#include +#ifdef __WATCOMC__ +#include +#endif +#include + +#include +#include + + /* mainly for Open Watcom C */ + +#ifndef HAVE_IN_ADDR_T +#define HAVE_IN_ADDR_T +typedef Uint32 in_addr_t; +#endif + +#if !(defined(SHUT_RD) || defined(SHUT_WR) || defined(SHUT_RDWR)) +enum { + SHUT_RD = 0, /* No more receptions. */ +#define SHUT_RD SHUT_RD + SHUT_WR, /* No more transmissions. */ +#define SHUT_WR SHUT_WR + SHUT_RDWR /* No more receptions or transmissions. */ +#define SHUT_RDWR SHUT_RDWR +}; +#endif + +int Osc_Connect(const char *hostname, int port); +static inline void Osc_Disconnect(int fd); + +SDL_Thread *Osc_InitThread(int *fd); +int Osc_TerminateThread(void); + +int Osc_EnqueueFloatMessage(const char *address, float value); + +static inline void +Osc_Disconnect(int fd) +{ + shutdown(fd, SHUT_WR); + close(fd); +} + +enum Osc_DataType { + OSC_INT = 0, + OSC_FLOAT, + OSC_DOUBLE, + OSC_STRING, + OSC_BOOL +}; +#define OSC_DATATYPE \ + "int\0" \ + "float\0" \ + "double\0" \ + "string\0" \ + "bool\0" + +#endif -- cgit v1.2.3