-
Notifications
You must be signed in to change notification settings - Fork 4
/
osc_bundle_u.h
113 lines (98 loc) · 5 KB
/
osc_bundle_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
/*
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_bundle_u.h
\author John MacCallum
\brief Utilities for manipulating userialized OSC bundles
*/
#ifndef __OSC_BUNDLE_U_H__
#define __OSC_BUNDLE_U_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _osc_bundle_u t_osc_bundle_u, t_osc_bndl_u;
#ifdef SWIG
#define OSC_DEPRECATED(decl, msg) decl;
#else
#define OSC_DEPRECATED(decl, msg) decl __attribute__((deprecated(msg)));
#endif
#include <stdint.h>
#include "osc_bundle_s.h"
#include "osc_message_u.h"
#include "osc_error.h"
#include "osc_array.h"
typedef t_osc_array t_osc_bundle_array_u, t_osc_bndl_ar_u;
t_osc_bndl_u *osc_bundle_u_alloc(void);
size_t osc_bundle_u_getStructSize(void);
void osc_bundle_u_free(t_osc_bndl_u *bndl);
void osc_bundle_u_clear(t_osc_bndl_u *bndl);
t_osc_err osc_bundle_u_copy(t_osc_bndl_u **dest, t_osc_bndl_u *src);
int osc_bundle_u_getMsgCount(t_osc_bndl_u *bndl);
t_osc_msg_u *osc_bundle_u_getFirstMsg(t_osc_bndl_u *bndl);
t_osc_err osc_bundle_u_getMessagesWithCallback(t_osc_bndl_u *bndl, void (*f)(t_osc_msg_u*, void *), void *context);
t_osc_err osc_bundle_u_addressExists(t_osc_bndl_u *bndl, char *address, int fullmatch, int *res);
t_osc_err osc_bundle_u_addressIsBound(t_osc_bndl_u *bndl, char *address, int fullmatch, int *res);
t_osc_msg_u *osc_bundle_u_getFirstFullMatch(t_osc_bndl_u *bndl, char *address);
t_osc_err osc_bundle_u_replaceMessage(t_osc_bndl_u *bndl, t_osc_msg_u *msg);
t_osc_msg_ar_u *osc_bundle_u_lookupAddress(t_osc_bndl_u *bndl, const char *address, int fullmatch);
t_osc_err osc_bundle_u_addMsg(t_osc_bndl_u *bndl, t_osc_msg_u *msg);
t_osc_err osc_bundle_u_addMsgWithoutDups(t_osc_bndl_u *bndl, t_osc_msg_u *msg);
t_osc_err osc_bundle_u_addMsgCopy(t_osc_bndl_u *bndl, t_osc_msg_u *msg);
t_osc_err osc_bundle_u_addMsgWithoutDupsCopy(t_osc_bndl_u *bndl, t_osc_msg_u *msg);
t_osc_err osc_bundle_u_addMsgArrayCopy(t_osc_bndl_u *bndl, t_osc_array *ar);
t_osc_err osc_bundle_u_addMsgList(t_osc_bndl_u *bndl, t_osc_msg_u *msgs);
t_osc_err osc_bundle_u_removeMsg(t_osc_bndl_u *bndl, t_osc_msg_u *m);
void osc_bundle_u_removeMessage(t_osc_bndl_u * bndl, const char *address);
t_osc_err osc_bundle_u_explode(t_osc_bndl_u **dest,
t_osc_bndl_u *src,
int maxlevel,
char *sep);
t_osc_err osc_bundle_u_flatten(t_osc_bndl_u **dest,
t_osc_bndl_u *src,
int maxlevel,
char *sep,
int remove_enclosing_address_if_empty);
t_osc_err osc_bundle_u_union(t_osc_bndl_u *bndl1, t_osc_bndl_u *bndl2, t_osc_bndl_u **bndl_out);
t_osc_err osc_bundle_u_intersection(t_osc_bndl_u *bndl1, t_osc_bndl_u *bndl2, t_osc_bndl_u **bndl_out);
t_osc_bndl_s *osc_bundle_u_serialize(t_osc_bndl_u *bndl);
long osc_bundle_u_getSerializedSize(t_osc_bndl_u *b);
size_t osc_bundle_u_nserialize(char *buf, size_t n, t_osc_bndl_u *b);
long osc_bundle_u_getFormattedSize(t_osc_bndl_u *bndl);
char *osc_bundle_u_format(t_osc_bndl_u *bndl);
long osc_bundle_u_nformat(char *buf, long n, t_osc_bndl_u *bndl, int nindent);
long osc_bundle_u_nformatNestedBndl(char *buf, long n, t_osc_bndl_u *bndl, int nindent);
t_osc_bundle_array_u *osc_bundle_array_u_alloc(long len);
void osc_bundle_array_u_free(t_osc_bundle_array_u *ar);
void osc_bundle_array_u_clear(t_osc_bundle_array_u *ar);
t_osc_bndl_u *osc_bundle_array_u_get(t_osc_bundle_array_u *ar, long idx);
long osc_bundle_array_u_getLen(t_osc_bundle_array_u *ar);
t_osc_bundle_array_u *osc_bundle_array_u_copy(t_osc_bundle_array_u *ar);
t_osc_err osc_bundle_array_u_resize(t_osc_bundle_array_u *ar, long newlen);
/*
#define osc_bundle_array_u_free(ar) osc_array_free((ar))
#define osc_bundle_array_u_clear(ar) osc_array_clear((ar))
#define osc_bundle_array_u_get(ar, idx) osc_array_get((ar), (idx))
#define osc_bundle_array_u_getLen(ar) osc_array_getLen((ar))
#define osc_bundle_array_u_copy(ar) osc_array_copy((ar))
#define osc_bundle_array_u_resize(ar, newlen) osc_array_resize((ar), (newlen))
*/
#ifdef __cplusplus
}
#endif
#endif // __OSC_BUNDLE_U_H__