annotate win32-mingw/include/lo/lo_macros.h @ 94:d278df1123f9

Add liblo
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:25:02 +0000
parents
children
rev   line source
cannam@94 1 /*
cannam@94 2 * Copyright (C) 2004 Steve Harris
cannam@94 3 *
cannam@94 4 * This program is free software; you can redistribute it and/or
cannam@94 5 * modify it under the terms of the GNU Lesser General Public License
cannam@94 6 * as published by the Free Software Foundation; either version 2.1
cannam@94 7 * of the License, or (at your option) any later version.
cannam@94 8 *
cannam@94 9 * This program is distributed in the hope that it will be useful,
cannam@94 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@94 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@94 12 * GNU Lesser General Public License for more details.
cannam@94 13 *
cannam@94 14 * $Id$
cannam@94 15 */
cannam@94 16
cannam@94 17 #ifndef LO_MACROS_H
cannam@94 18 #define LO_MACROS_H
cannam@94 19
cannam@94 20 /* macros that have to be defined after function signatures */
cannam@94 21
cannam@94 22 #ifdef __cplusplus
cannam@94 23 extern "C" {
cannam@94 24 #endif
cannam@94 25
cannam@94 26 /* \brief Maximum length of UDP messages in bytes
cannam@94 27 */
cannam@94 28 #define LO_MAX_MSG_SIZE 32768
cannam@94 29
cannam@94 30 /* \brief A set of macros to represent different communications transports
cannam@94 31 */
cannam@94 32 #define LO_DEFAULT 0x0
cannam@94 33 #define LO_UDP 0x1
cannam@94 34 #define LO_UNIX 0x2
cannam@94 35 #define LO_TCP 0x4
cannam@94 36
cannam@94 37 /* an internal value, ignored in transmission but check against LO_MARKER in the
cannam@94 38 * argument list. Used to do primitive bounds checking */
cannam@94 39 #define LO_MARKER_A 0xdeadbeef
cannam@94 40 #define LO_MARKER_B 0xf00baa23
cannam@94 41 #define LO_ARGS_END LO_MARKER_A, LO_MARKER_B
cannam@94 42
cannam@94 43 #define lo_message_add_varargs(msg, types, list) \
cannam@94 44 lo_message_add_varargs_internal(msg, types, list, __FILE__, __LINE__)
cannam@94 45
cannam@94 46 #ifdef __GNUC__
cannam@94 47
cannam@94 48 #define lo_message_add(msg, types...) \
cannam@94 49 lo_message_add_internal(msg, __FILE__, __LINE__, types, \
cannam@94 50 LO_MARKER_A, LO_MARKER_B)
cannam@94 51
cannam@94 52 #define lo_send(targ, path, types...) \
cannam@94 53 lo_send_internal(targ, __FILE__, __LINE__, path, types, \
cannam@94 54 LO_MARKER_A, LO_MARKER_B)
cannam@94 55
cannam@94 56 #define lo_send_timestamped(targ, ts, path, types...) \
cannam@94 57 lo_send_timestamped_internal(targ, __FILE__, __LINE__, ts, path, \
cannam@94 58 types, LO_MARKER_A, LO_MARKER_B)
cannam@94 59
cannam@94 60 #define lo_send_from(targ, from, ts, path, types...) \
cannam@94 61 lo_send_from_internal(targ, from, __FILE__, __LINE__, ts, path, \
cannam@94 62 types, LO_MARKER_A, LO_MARKER_B)
cannam@94 63
cannam@94 64 #else
cannam@94 65
cannam@94 66 /* In non-GCC compilers, there is no support for variable-argument
cannam@94 67 * macros, so provide "internal" vararg functions directly instead. */
cannam@94 68
cannam@94 69 int lo_message_add(lo_message msg, const char *types, ...);
cannam@94 70 int lo_send(lo_address targ, const char *path, const char *types, ...);
cannam@94 71 int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, const char *types, ...);
cannam@94 72 int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, const char *path, const char *types, ...);
cannam@94 73
cannam@94 74 #endif
cannam@94 75
cannam@94 76 #ifdef __cplusplus
cannam@94 77 }
cannam@94 78 #endif
cannam@94 79
cannam@94 80 #endif