45#define OSE_CONTEXT_ALIGNMENT 4
63#ifdef OSE_CONF_CONTEXT_CACHE_SIZE
64#define OSE_CONTEXT_CACHE_SIZE OSE_CONF_CONTEXT_CACHE_SIZE
66#define OSE_CONTEXT_CACHE_SIZE 36
68#define OSE_CONTEXT_CACHE_SIZE 64
70#define OSE_CONTEXT_NUM_CACHE_ITEMS 3
71#define OSE_CONTEXT_CACHE_TYPETAG_STRLEN 8
73#define OSE_CONTEXT_BUNDLE_SIZE_OFFSET -4
74#define OSE_CONTEXT_TOTAL_SIZE_OFFSET -8
75#define OSE_CONTEXT_PARENT_BUNDLE_OFFSET_OFFSET -12
76#define OSE_CONTEXT_STATUS_OFFSET -16
77#define OSE_CONTEXT_MEMUSAGE_OFFSET -20
78#define OSE_CONTEXT_CHANGED_OFFSET -24
91#define OSE_CONTEXT_FLAGS_OFFSET -28
92#define OSE_CONTEXT_CACHE_OFFSET -(36 + OSE_CONTEXT_CACHE_SIZE)
94void ose_context_set_status(
ose_bundle b, int32_t s);
107uint32_t ose_context_get_version(
ose_bundle b);
128void ose_context_cache_setGetFirstOffsetForMatchFn(
ose_bundle B,
141int32_t ose_context_getFirstOffsetForMatch(
ose_bundle B,
142 const char *
const address);
143ose_bundle ose_getTypeBundle(ose_constbundle bundle);
149#define ose_get_memusage(b) do{}while(0)
150#define ose_reset_memusage(b) do{}while(0)
178#define OSE_CONTEXT_MESSAGE_TYPETAGS ",bbiiiiiibb"
183#define OSE_CONTEXT_MESSAGE_TYPETAGS_PLEN 12
185#define OSE_CONTEXT_BUNDLE_OFFSET \
189 + OSE_SIZEWORD_LEN_ + OSE_CONTEXT_CACHE_SIZE \
202int32_t ose_readSize(ose_constbundle bundle);
210#define OSE_CONTEXT_MESSAGE_OVERHEAD \
211 (OSE_CONTEXT_BUNDLE_OFFSET \
212 + OSE_BUNDLE_HEADER_LEN_ \
221#define OSE_CONTEXT_STATUS_MESSAGE_SIZE 16
229#define OSE_CONTEXT_TYPE_MESSAGE_SIZE 1024
237#define OSE_CONTEXT_MAX_OVERHEAD \
238 ((OSE_CONTEXT_ALIGNMENT) \
239 + OSE_BUNDLE_HEADER_LEN_ \
240 + OSE_CONTEXT_MESSAGE_OVERHEAD \
241 + OSE_CONTEXT_STATUS_MESSAGE_SIZE \
242 + OSE_CONTEXT_MESSAGE_OVERHEAD \
243 + OSE_CONTEXT_MESSAGE_OVERHEAD \
244 + OSE_CONTEXT_TYPE_MESSAGE_SIZE)
260 const char *
const address);
277 const char *
const address);
278void ose_dropContextMessage(
ose_bundle bundle);
309 const char *
const address);
342 const char *
const address);
386int ose_incSize(
ose_bundle bundle, int32_t amt);
387int ose_decSize(
ose_bundle bundle, int32_t amt);
535#define ose_copyElem(src, dest) \
536 ose_copyElemAtOffset(ose_getLastBundleElemOffset(src), \
538#define ose_moveElem(src, dest) \
540 int32_t o = ose_getLastBundleElemOffset(src); \
541 ose_copyElemAtOffset(o, src, dest); \
542 ose_dropAtOffset(src, o); \
548int32_t ose_routeElemAtOffset(int32_t srcoffset,
589#define OSE_REGISTER_ADDRESS_LEN 3
629 const char *
const address,
650#if !defined(OSE_CONF_DEBUG) && !defined(OSE_INLINE_ACCESSORS_OFF)
651static inline int32_t ose_readSize_inline(ose_constbundle b)
652{
return ose_ntohl(*((
const int32_t *)(ose_getBundlePtr(b) + OSE_CONTEXT_BUNDLE_SIZE_OFFSET))); }
653#define ose_readSize(b) ose_readSize_inline(b)
provides global definitions and types
void ose_copyBundle(ose_bundle src, ose_bundle dest)
Copy the topmost bundle element to a destination at the same level.
Definition ose_context.c:972
int32_t ose_spaceAvailable(ose_bundle bundle)
Returns the number of unused bytes in the bundle.
Definition ose_context.c:648
void ose_appendBundle(ose_bundle src, ose_bundle dest)
Append the contents of the topmost element of src to dest. Equivalent to.
Definition ose_context.c:1064
int32_t ose_init(ose_bundle bundle, int32_t size, const char *const address)
Initializes a newly created bundle with a context message.
Definition ose_context.c:412
void ose_replaceBundle(ose_bundle src, ose_bundle dest)
Replace the contents of dest with those of the topmost element of src. Equivalent to.
Definition ose_context.c:1139
ose_bundle ose_exit(ose_bundle bundle)
Exit a bundle context and move one level up.
Definition ose_context.c:733
int32_t ose_addressToRegister(ose_bundle osevm, const char *const address, ose_bundle *reg, const char **rest)
Split an address into a register and the rest of the address.
Definition ose_context.c:587
ose_bundle ose_enterBundleAtOffset(ose_bundle bundle, int32_t offset)
Enter a new bundle context.
Definition ose_context.c:695
void ose_context_set_flags(ose_bundle b, int32_t flags)
Read and write the flags word of a context message.
Definition ose_context.c:141
int32_t ose_getContextMessageOffset(ose_bundle bundle, const char *const address)
Returns the offset of the context message for a given address.
Definition ose_context.c:663
int32_t ose_pushContextMessage(ose_bundle bundle, int32_t size, const char *const address)
Pushes a new context message onto the current bundle.
Definition ose_context.c:479
void ose_context_set_changed(ose_bundle b)
The context's version: moved on by every change to its bundle's size, and never set back.
Definition ose_context.c:122
ose_bundle ose_newBundleFromZeroedCBytes(int32_t nbytes, char *bytes)
The same, for bytes the caller knows are all zero – from calloc, say – which are not written over: pa...
Definition ose_context.c:1183
int ose_addToSize(ose_bundle bundle, int32_t amt)
Add an amount to the size of a bundle. This function takes care of adjusting the size of the blob of ...
Definition ose_context.c:757
void ose_copyElemAtOffset(int32_t srcoffset, ose_bundle src, ose_bundle dest)
Append the element at srcoffset in src to dest.
Definition ose_context.c:922
ose_bundle ose_enter(ose_bundle bundle, const char *const address)
Enter a new bundle context.
Definition ose_context.c:708
ose_bundle ose_newBundleFromCBytes(int32_t nbytes, char *bytes)
Initialize a new bundle from an array of bytes.
Definition ose_context.c:1171
#define B(...)
Instantiate a top-level OSC bundle.
Definition ose_test_ctosc.h:339