comparison osx/include/lo/lo_macros.h @ 27:fffb975dc0b1

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