lo_osc_types.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2004 Steve Harris
00003  *
00004  *  This program is free software; you can redistribute it and/or
00005  *  modify it under the terms of the GNU Lesser General Public License
00006  *  as published by the Free Software Foundation; either version 2.1
00007  *  of the License, or (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  $Id$
00015  */
00016 
00017 #ifndef LO_OSC_TYPES_H
00018 #define LO_OSC_TYPES_H
00019 
00025 #ifdef _MSC_VER
00026 #define int32_t __int32
00027 #define int64_t __int64
00028 #define uint32_t unsigned __int32
00029 #define uint64_t unsigned __int64
00030 #define uint8_t unsigned __int8
00031 #else
00032 #include <stdint.h>
00033 #endif
00034 
00043 typedef struct {
00045     uint32_t sec;
00048     uint32_t frac;
00049 } lo_timetag;
00050 
00057 typedef enum {
00058 /* basic OSC types */
00060     LO_INT32 =     'i',
00062     LO_FLOAT =     'f',
00064     LO_STRING =    's',
00066     LO_BLOB =      'b',
00067 
00068 /* extended OSC types */
00070     LO_INT64 =     'h',
00072     LO_TIMETAG =   't',
00074     LO_DOUBLE =    'd',
00077     LO_SYMBOL =    'S',
00079     LO_CHAR =      'c',
00081     LO_MIDI =      'm',
00083     LO_TRUE =      'T',
00085     LO_FALSE =     'F',
00087     LO_NIL =       'N',
00089     LO_INFINITUM = 'I'
00090 } lo_type;
00091 
00092 
00100 typedef union {
00102     int32_t    i;
00104     int32_t    i32;
00106     int64_t    h;
00108     int64_t    i64;
00110     float      f;
00112     float      f32;
00114     double     d;
00116     double     f64;
00118     char       s;
00121     char       S;
00123     unsigned char c;
00125     uint8_t    m[4];
00127     lo_timetag t;
00128 } lo_arg;
00129 
00131 /* Note: No struct literals in MSVC */
00132 #ifdef _MSC_VER
00133 lo_timetag lo_get_tt_immediate();
00134 #define LO_TT_IMMEDIATE lo_get_tt_immediate()
00135 #else
00136 #define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})
00137 #endif
00138 
00141 #endif

Generated on Sat Oct 17 14:12:32 2009 for CSL by  doxygen 1.4.5-20051010