-
Notifications
You must be signed in to change notification settings - Fork 4
/
osc_message_u.h
169 lines (147 loc) · 9.04 KB
/
osc_message_u.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
Written by John MacCallum, The Center for New Music and Audio Technologies,
University of California, Berkeley. Copyright (c) 2009-ll, The Regents of
the University of California (Regents).
Permission to use, copy, modify, distribute, and distribute modified versions
of this software and its documentation without fee and without a signed
licensing agreement, is hereby granted, provided that the above copyright
notice, this paragraph and the following two paragraphs appear in all copies,
modifications, and distributions.
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
/** \file osc_message.h
\author John MacCallum
\brief Utilities for manipulating OSC messages
*/
#ifndef __OSC_MESSAGE_U_H__
#define __OSC_MESSAGE_U_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _osc_message_u t_osc_message_u, t_osc_msg_u;
#include "osc_array.h"
typedef t_osc_array t_osc_message_array_u, t_osc_msg_ar_u;
#include <stdint.h>
#include "osc_atom_u.h"
#include "osc_atom_array_u.h"
#include "osc_timetag.h"
#include "osc_bundle_u.h"
#include "osc_bundle_s.h"
t_osc_msg_u *osc_message_u_alloc(void);
size_t osc_message_u_getStructSize(void);
void osc_message_u_free(t_osc_msg_u *m);
void osc_message_u_initMsg(t_osc_msg_u *m);
void osc_message_u_clearArgs(t_osc_msg_u *m);
void osc_message_u_copy(t_osc_msg_u **dest, t_osc_msg_u *src);
t_osc_err osc_message_u_deepCopy(t_osc_msg_u **dest, t_osc_msg_u *src);
uint32_t osc_message_u_getSize(t_osc_msg_u *m);
void osc_message_u_append(t_osc_msg_u *m1, t_osc_msg_u *m2);
t_osc_msg_u *osc_message_u_next(t_osc_msg_u *m);
char *osc_message_u_getAddress(t_osc_msg_u *m);
t_osc_err osc_message_u_setAddress(t_osc_msg_u *m, const char *address);
t_osc_err osc_message_u_setAddressPtr(t_osc_msg_u *m, char *newAddress, char **oldAddress);
int osc_message_u_getArgCount(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_getArg(t_osc_msg_u *m, int n);
t_osc_err osc_message_u_appendAtom(t_osc_msg_u *m, t_osc_atom_u *a);
t_osc_err osc_message_u_prependAtom(t_osc_msg_u *m, t_osc_atom_u *a);
t_osc_err osc_message_u_insertAtom(t_osc_msg_u *m, t_osc_atom_u *a, int pos);
void osc_message_u_removeAtom(t_osc_msg_u *m, t_osc_atom_u *a);
t_osc_atom_u *osc_message_u_appendInt8(t_osc_msg_u *m, int8_t v);
t_osc_atom_u *osc_message_u_appendInt16(t_osc_msg_u *m, int16_t v);
t_osc_atom_u *osc_message_u_appendInt32(t_osc_msg_u *m, int32_t v);
t_osc_atom_u *osc_message_u_appendInt64(t_osc_msg_u *m, int64_t v);
t_osc_atom_u *osc_message_u_appendUInt8(t_osc_msg_u *m, uint8_t v);
t_osc_atom_u *osc_message_u_appendUInt16(t_osc_msg_u *m, uint16_t v);
t_osc_atom_u *osc_message_u_appendUInt32(t_osc_msg_u *m, uint32_t v);
t_osc_atom_u *osc_message_u_appendUInt64(t_osc_msg_u *m, uint64_t v);
t_osc_atom_u *osc_message_u_appendFloat(t_osc_msg_u *m, float v);
t_osc_atom_u *osc_message_u_appendDouble(t_osc_msg_u *m, double v);
t_osc_atom_u *osc_message_u_appendStringPtr(t_osc_msg_u *m, char *v);
t_osc_atom_u *osc_message_u_appendString(t_osc_msg_u *m, const char *v);
t_osc_atom_u *osc_message_u_appendBool(t_osc_msg_u *m, int v);
t_osc_atom_u *osc_message_u_appendTrue(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_appendFalse(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_appendNil(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_appendBndl(t_osc_msg_u *m, long len, char *bndl);
t_osc_atom_u *osc_message_u_appendBndl_s(t_osc_msg_u *m, long len, char *bndl);
t_osc_atom_u *osc_message_u_appendBndl_u(t_osc_msg_u *m, t_osc_bndl_u *b);
t_osc_atom_u *osc_message_u_appendTimetag(t_osc_msg_u *m, t_osc_timetag t);
t_osc_atom_u *osc_message_u_appendBlob(t_osc_msg_u *m, char *b);
t_osc_atom_u *osc_message_u_prependInt8(t_osc_msg_u *m, int8_t v);
t_osc_atom_u *osc_message_u_prependInt16(t_osc_msg_u *m, int16_t v);
t_osc_atom_u *osc_message_u_prependInt32(t_osc_msg_u *m, int32_t v);
t_osc_atom_u *osc_message_u_prependInt64(t_osc_msg_u *m, int64_t v);
t_osc_atom_u *osc_message_u_prependUInt8(t_osc_msg_u *m, uint8_t v);
t_osc_atom_u *osc_message_u_prependUInt16(t_osc_msg_u *m, uint16_t v);
t_osc_atom_u *osc_message_u_prependUInt32(t_osc_msg_u *m, uint32_t v);
t_osc_atom_u *osc_message_u_prependUInt64(t_osc_msg_u *m, uint64_t v);
t_osc_atom_u *osc_message_u_prependFloat(t_osc_msg_u *m, float v);
t_osc_atom_u *osc_message_u_prependDouble(t_osc_msg_u *m, double v);
t_osc_atom_u *osc_message_u_prependStringPtr(t_osc_msg_u *m, char *v);
t_osc_atom_u *osc_message_u_prependString(t_osc_msg_u *m, char *v);
t_osc_atom_u *osc_message_u_prependBool(t_osc_msg_u *m, int v);
t_osc_atom_u *osc_message_u_prependTrue(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_prependFalse(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_prependNil(t_osc_msg_u *m);
t_osc_atom_u *osc_message_u_prependBndl(t_osc_msg_u *m, long len, char *bndl);
t_osc_atom_u *osc_message_u_prependBndl_s(t_osc_msg_u *m, long len, char *bndl);
t_osc_atom_u *osc_message_u_prependBndl_u(t_osc_msg_u *m, t_osc_bndl_u *b);
t_osc_atom_u *osc_message_u_prependTimetag(t_osc_msg_u *m, t_osc_timetag t);
t_osc_atom_u *osc_message_u_prependBlob(t_osc_msg_u *m, char *b);
t_osc_atom_u *osc_message_u_insertInt8(t_osc_msg_u *m, int8_t v, int pos);
t_osc_atom_u *osc_message_u_insertInt16(t_osc_msg_u *m, int16_t v, int pos);
t_osc_atom_u *osc_message_u_insertInt32(t_osc_msg_u *m, int32_t v, int pos);
t_osc_atom_u *osc_message_u_insertInt64(t_osc_msg_u *m, int64_t v, int pos);
t_osc_atom_u *osc_message_u_insertUInt8(t_osc_msg_u *m, uint8_t v, int pos);
t_osc_atom_u *osc_message_u_insertUInt16(t_osc_msg_u *m, uint16_t v, int pos);
t_osc_atom_u *osc_message_u_insertUInt32(t_osc_msg_u *m, uint32_t v, int pos);
t_osc_atom_u *osc_message_u_insertUInt64(t_osc_msg_u *m, uint64_t v, int pos);
t_osc_atom_u *osc_message_u_insertFloat(t_osc_msg_u *m, float v, int pos);
t_osc_atom_u *osc_message_u_insertDouble(t_osc_msg_u *m, double v, int pos);
t_osc_atom_u *osc_message_u_insertStringPtr(t_osc_msg_u *m, char *v, int pos);
t_osc_atom_u *osc_message_u_insertString(t_osc_msg_u *m, char *v, int pos);
t_osc_atom_u *osc_message_u_insertBool(t_osc_msg_u *m, int v, int pos);
t_osc_atom_u *osc_message_u_insertTrue(t_osc_msg_u *m, int pos);
t_osc_atom_u *osc_message_u_insertFalse(t_osc_msg_u *m, int pos);
t_osc_atom_u *osc_message_u_insertNil(t_osc_msg_u *m, int pos);
t_osc_atom_u *osc_message_u_insertBndl(t_osc_msg_u *m, long len, char *bndl, int pos);
t_osc_atom_u *osc_message_u_insertBndl_s(t_osc_msg_u *m, long len, char *bndl, int pos);
t_osc_atom_u *osc_message_u_insertBndl_u(t_osc_msg_u *m, t_osc_bndl_u *b, int pos);
t_osc_atom_u *osc_message_u_insertTimetag(t_osc_msg_u *m, t_osc_timetag t, int pos);
t_osc_atom_u *osc_message_u_insertBlob(t_osc_msg_u *m, char *b, int pos);
t_osc_err osc_message_u_explode(t_osc_bndl_u *dest, t_osc_msg_u *msg, int maxlevel, char *sep);
long osc_message_u_getSerializedSize(t_osc_msg_u *m);
t_osc_msg_s *osc_message_u_serialize(t_osc_msg_u *m);
size_t osc_message_u_nserialize(char *buf, size_t n, t_osc_msg_u *m);
long osc_message_u_getFormattedSize(t_osc_msg_u *m);
char *osc_message_u_format(t_osc_msg_u *m);
long osc_message_u_nformat(char *buf, long n, t_osc_msg_u *m, int nindent);
t_osc_message_array_u *osc_message_array_u_alloc(long len);
void osc_message_array_u_free(t_osc_msg_ar_u *ar);//#define osc_message_array_u_free(ar) osc_array_free((ar))
void osc_message_array_u_clear(t_osc_msg_ar_u *ar);//#define osc_message_array_u_clear(ar) osc_array_clear((ar))
t_osc_msg_u *osc_message_array_u_get(t_osc_msg_ar_u *ar, long idx);//#define osc_message_array_u_get(ar, idx) osc_array_get((ar), (idx))
long osc_message_array_u_getLen(t_osc_msg_ar_u *ar);//#define osc_message_array_u_getLen(ar) osc_array_getLen((ar))
t_osc_msg_ar_u *osc_message_array_u_copy(t_osc_msg_ar_u *ar);//#define osc_message_array_u_copy(ar) osc_array_copy((ar))
t_osc_err osc_message_array_u_resize(t_osc_msg_ar_u *ar, long newlen);//#define osc_message_array_u_resize(ar, newlen) osc_array_resize((ar), (newlen))
t_osc_array *osc_message_u_getArgArrayCopy(t_osc_msg_u *msg);
t_osc_err osc_message_u_setArgArrayCopy(t_osc_msg_u *msg, t_osc_array *ar);
t_osc_msg_u *osc_message_u_allocWithAddress(char *address);
t_osc_msg_u *osc_message_u_allocWithFloat(char *address, float f);
t_osc_msg_u *osc_message_u_allocWithString(char *address, char *s);
t_osc_msg_u *osc_message_u_allocWithTimetag(char *address, t_osc_timetag t);
t_osc_msg_u *osc_message_u_allocWithArray(char *address, t_osc_array *ar);
t_osc_msg_u *osc_message_u_allocWithBlob(char *address, char *blob);
t_osc_msg_u *osc_message_u_allocWithDouble(char *address, double f);
t_osc_msg_u *osc_message_u_allocWithInt(char *address, int i);
#ifdef __cplusplus
}
#endif
#endif // __OSC_MESSAGE_U_H__