58#define OSE_START_BUNDLE(B) { \
60 int32_t ose_stackops_reserved_o___ = \
61 ose_getLastBundleElemOffset(B); \
62 int32_t ose_stackops_reserved_bs___ = ose_readSize(B);
67#define OSE_END_BUNDLE(B) \
68 int32_t ose_stackops_reserved_nbs___ = ose_readSize(B); \
69 ose_writeInt32(B, ose_stackops_reserved_o___, \
70 OSE_BUNDLE_HEADER_LEN + \
71 (ose_stackops_reserved_nbs___ - \
72 ose_stackops_reserved_bs___)); \
94 const char *
const v);
101 const char *
const s,
118 const char *
const blob);
120#ifdef OSE_PROVIDE_TYPE_SYMBOL
127#ifdef OSE_PROVIDE_TYPE_DOUBLE
134#ifdef OSE_PROVIDE_TYPE_INT8
141#ifdef OSE_PROVIDE_TYPE_UINT8
148#ifdef OSE_PROVIDE_TYPE_UINT32
155#ifdef OSE_PROVIDE_TYPE_INT64
162#ifdef OSE_PROVIDE_TYPE_UINT64
169#ifdef OSE_PROVIDE_TYPE_TIMETAG
176#ifdef OSE_PROVIDE_TYPE_TRUE
183#ifdef OSE_PROVIDE_TYPE_FALSE
190#ifdef OSE_PROVIDE_TYPE_NIL
197#ifdef OSE_PROVIDE_TYPE_INFINITUM
208#define OSE_MAXLINE 4096
210void ose_pushAlignedPtr(
ose_bundle B,
const void *v);
242 const char *
const address,
281 const int32_t messageoffset);
366#ifdef OSE_PROVIDE_TYPE_SYMBOL
387#ifdef OSE_PROVIDE_TYPE_DOUBLE
399#ifdef OSE_PROVIDE_TYPE_INT8
411#ifdef OSE_PROVIDE_TYPE_UINT8
423#ifdef OSE_PROVIDE_TYPE_UINT32
435#ifdef OSE_PROVIDE_TYPE_INT16
447#ifdef OSE_PROVIDE_TYPE_UINT16
459#ifdef OSE_PROVIDE_TYPE_INT64
471#ifdef OSE_PROVIDE_TYPE_UINT64
483#ifdef OSE_PROVIDE_TYPE_TIMETAG
558#ifdef OSE_PROVIDE_TYPE_SYMBOL
572#ifdef OSE_PROVIDE_TYPE_DOUBLE
584#ifdef OSE_PROVIDE_TYPE_INT8
596#ifdef OSE_PROVIDE_TYPE_UINT8
608#ifdef OSE_PROVIDE_TYPE_UINT32
621#ifdef OSE_PROVIDE_TYPE_INT64
633#ifdef OSE_PROVIDE_TYPE_UINT64
646#ifdef OSE_PROVIDE_TYPE_TIMETAG
1491void ose_blobToElemAtOffset(
ose_bundle B, int32_t offset);
1613#ifdef OSE_PROVIDE_TYPE_SYMBOL
1616#ifdef OSE_PROVIDE_TYPE_DOUBLE
1619#ifdef OSE_PROVIDE_TYPE_INT8
1622#ifdef OSE_PROVIDE_TYPE_UINT8
1625#ifdef OSE_PROVIDE_TYPE_INT16
1628#ifdef OSE_PROVIDE_TYPE_UINT16
1631#ifdef OSE_PROVIDE_TYPE_UINT32
1634#ifdef OSE_PROVIDE_TYPE_INT64
1637#ifdef OSE_PROVIDE_TYPE_UINT64
1640#ifdef OSE_PROVIDE_TYPE_TIMETAG
1643#ifdef OSE_PROVIDE_TYPE_TRUE
1646#ifdef OSE_PROVIDE_TYPE_FALSE
1649#ifdef OSE_PROVIDE_TYPE_NIL
1652#ifdef OSE_PROVIDE_TYPE_INFINITUM
1699void ose_decatenateBlobFromEnd_impl(
ose_bundle B, int32_t n);
1701void ose_decatenateBlobFromStart_impl(
ose_bundle B, int32_t n);
1703void ose_decatenateStringFromEnd_impl(
ose_bundle B, int32_t n);
1705void ose_decatenateStringFromStart_impl(
ose_bundle B, int32_t n);
provides global definitions and types
Status codes for context bundles.
ose_errno
Definition ose_errno.h:37
void ose_mod(ose_bundle B)
Take the number in the last message modulo the number in the second to last message.
Definition ose_stackops.c:9450
void ose_drop(ose_bundle B)
Drop the last element.
Definition ose_stackops.c:1464
void ose_unpack(ose_bundle B)
Unpack the last element.
Definition ose_stackops.c:3866
void ose_swapStringToAddress(ose_bundle B)
Exchange the last string of a message with the address.
Definition ose_stackops.c:6786
void ose_lengthItem(ose_bundle B)
Get the length in bytes of the last item of the last element, excluding NULL-padding.
Definition ose_stackops.c:4323
void ose_getAddresses(ose_bundle B)
Get the address(es) of the last element of the bundle.
Definition ose_stackops.c:4556
void ose_select1(ose_bundle B)
Select messages in a bundle with patterns that match an address.
Definition ose_stackops.c:7662
void ose_pushUInt32(ose_bundle B, uint32_t v)
Append a message containing an unsigned 32-bit int.
Definition ose_stackops.c:379
void ose_toType(ose_bundle B)
Definition ose_stackops.c:5181
void ose_rollPMatch(ose_bundle B)
Move the first element whose address pattern matches the string at the end to the end — ose_rollPMatc...
Definition ose_stackops.c:2129
float ose_popFloat(ose_bundle B)
Get the last float and remove it from the bundle.
Definition ose_stackops.c:986
int32_t ose_pickPMatch_impl(ose_bundle B)
Definition ose_stackops.c:1906
void ose_blobToType(ose_bundle B)
Convert a blob to a different type.
Definition ose_stackops.c:5173
int32_t ose_rollMatch_impl(ose_bundle B)
Move the first element whose address matches the string at the end of the bundle to the end.
Definition ose_stackops.c:2075
void ose_pushUInt64(ose_bundle B, uint64_t v)
Append a message containing an unsigned 64-bit int.
Definition ose_stackops.c:399
void ose_setTypetag_impl(ose_bundle B, char typetag)
Set the typetag of the last item of the last message.
Definition ose_stackops.c:4782
void ose_blobToType_impl(ose_bundle B, char typetag)
Convert a blob to a different type.
Definition ose_stackops.c:5134
void ose_sub(ose_bundle B)
Subtract the number in the second to last message from the number in the last message.
Definition ose_stackops.c:9085
void ose_nip(ose_bundle B)
Drop the second to last element.
Definition ose_stackops.c:1564
void ose_unpackDrop(ose_bundle B)
Unpack the last element and drop it.
Definition ose_stackops.c:4131
void ose_div(ose_bundle B)
Divide the number in the second to last message by the number in the last message.
Definition ose_stackops.c:9357
struct ose_timetag ose_popTimetag(ose_bundle B)
Get the last timetag and remove it from the bundle.
Definition ose_stackops.c:1138
void ose_sizesItems(ose_bundle B)
Get the sizes of all items of the last element as a list, including NULL-padding.
Definition ose_stackops.c:4506
void ose_sizeElem(ose_bundle B)
Get the size of the last element in bytes, including NULL-padding, and excluding the size field.
Definition ose_stackops.c:4393
void ose_concatenateBlobs(ose_bundle B)
Concatenate two blobs.
Definition ose_stackops.c:6542
void ose_pushTimetag(ose_bundle B, uint32_t sec, uint32_t fsec)
Append a message containing a timetag.
Definition ose_stackops.c:422
void ose_sizeItem(ose_bundle B)
Get the size of the last item of the last element, including NULL-padding.
Definition ose_stackops.c:4425
void ose_swap(ose_bundle B)
Swap the last two elements.
Definition ose_stackops.c:2281
uint8_t ose_peekUInt8(const ose_bundle B)
Get the last uint8_t without removing it.
Definition ose_stackops.c:877
void ose_sizesElems(ose_bundle B)
Get the sizes of all elements as a list, including NULL-padding.
Definition ose_stackops.c:4472
void ose_2swap(ose_bundle B)
Swap elements the last two elements with the previous two.
Definition ose_stackops.c:1399
char * ose_peekString(ose_bundle B)
Get a pointer to the last string without removing it.
Definition ose_stackops.c:829
void ose_pow(ose_bundle B)
Raise the number in the last message to the power of the number in the second to last message.
Definition ose_stackops.c:9692
void ose_selectWithDelegation(ose_bundle B)
Route all messages in a bundle with patterns that match one or more addresses.
Definition ose_stackops.c:7921
void ose_elemIsBundle(ose_bundle B)
Determine whether the last element is a bundle.
Definition ose_stackops.c:4633
void ose_concatenateStrings(ose_bundle B)
Concatenate two strings.
Definition ose_stackops.c:6624
void ose_route1(ose_bundle B)
Route messages in a bundle with patterns that match an address.
Definition ose_stackops.c:7581
void ose_pushNil(ose_bundle B)
Append message containing NIL to B.
Definition ose_stackops.c:507
uint16_t ose_peekUInt16(const ose_bundle B)
Peek at the uint16 value of the last element.
Definition ose_stackops.c:912
void ose_push(ose_bundle B)
Push the last element of the bundle onto the element below it.
Definition ose_stackops.c:3336
void ose_over(ose_bundle B)
Copy the second from the last item over the last.
Definition ose_stackops.c:1698
void ose_plookup(ose_bundle B)
Definition ose_stackops.c:8863
void ose_max(ose_bundle B)
Definition ose_stackops.c:10237
void ose_eql(ose_bundle B)
Compare the numbers in the last two messages for equality.
Definition ose_stackops.c:9944
void ose_getTimetag(ose_bundle B)
Get the bundle's timetag.
Definition ose_stackops.c:1202
void ose_match(ose_bundle B)
Compare two strings.
Definition ose_stackops.c:7445
char * ose_peekSymbol(const ose_bundle B)
Get a pointer to the last symbol stored in the last message.
Definition ose_stackops.c:846
void ose_pushUInt8(ose_bundle B, uint8_t v)
Append a message containing an uint8_t.
Definition ose_stackops.c:369
int32_t ose_popInt32(ose_bundle B)
Get the last int and remove it from the bundle.
Definition ose_stackops.c:968
void ose_pickPMatch(ose_bundle B)
Copy the first element whose address pattern matches the string at the end to the end — ose_pickPMatc...
Definition ose_stackops.c:1926
float ose_peekFloat(ose_bundle B)
Get the value of the last float stored in the last message.
Definition ose_stackops.c:819
void ose_neq(ose_bundle B)
Compare the numbers in the last two messages for non equality.
Definition ose_stackops.c:9952
void ose_routeWithDelegation(ose_bundle B)
Route all messages in a bundle with patterns that match one or more addresses.
Definition ose_stackops.c:7760
uint8_t ose_popUInt8(ose_bundle B)
Get the last uint8_t and remove it from the bundle.
Definition ose_stackops.c:1090
void ose_pushSymbol(ose_bundle B, const char *const v)
Append a message containing a symbol.
Definition ose_stackops.c:306
void ose_elemToBlob(ose_bundle B)
Convert the last element into a blob.
Definition ose_stackops.c:7054
void ose_roll(ose_bundle B)
Move an element at an index to the end.
Definition ose_stackops.c:1951
void ose_pushInfinitum(ose_bundle B)
Append a message containing an infinitum.
Definition ose_stackops.c:517
void ose_bundleAll(ose_bundle B)
Collect all bundle elements into a single bundle.
Definition ose_stackops.c:2357
void ose_2drop(ose_bundle B)
Drop the last two elements.
Definition ose_stackops.c:1244
char ose_peekMessageArgType(const ose_bundle B)
Get the type of the last item of the last element.
Definition ose_stackops.c:745
uint64_t ose_popUInt64(ose_bundle B)
Get the last unsigned 64-bit int and remove it from the bundle.
Definition ose_stackops.c:1126
int32_t ose_popBlob(ose_bundle B, char *buf)
Get the last blob and remove it from the bundle.
Definition ose_stackops.c:1028
void ose_pick(ose_bundle B)
Copy an element at an index to the end.
Definition ose_stackops.c:1782
void ose_gte(ose_bundle B)
Definition ose_stackops.c:10589
void ose_decatenateElemFromEnd(ose_bundle B)
Split an element in two.
Definition ose_stackops.c:3714
void ose_itemToBlob(ose_bundle B)
Convert the last item of the last element into a blob.
Definition ose_stackops.c:7110
uint64_t ose_peekUInt64(const ose_bundle B)
Get the last unsigned int without removing it.
Definition ose_stackops.c:932
void ose_reverse(ose_bundle B)
Reverse the items of the last element of the bundle.
Definition ose_stackops.c:3190
void ose_abs(ose_bundle B)
Definition ose_stackops.c:10328
void ose_pushInt32(ose_bundle B, int32_t v)
Append a message containing a 32-bit signed int.
Definition ose_stackops.c:138
void ose_pushString(ose_bundle B, const char *const v)
Append a message containing a string.
Definition ose_stackops.c:192
void ose_neg(ose_bundle B)
Flip the sign of the number in the last message of the bundle.
Definition ose_stackops.c:9796
void ose_pop(ose_bundle B)
Pop the last item off the last element and push it onto the end of the bundle as a new element.
Definition ose_stackops.c:2794
int32_t ose_popString(ose_bundle B, char *buf)
Get the last string and remove it from the bundle.
Definition ose_stackops.c:1006
void ose_rrot(ose_bundle B)
Move the last element to the third from the end.
Definition ose_stackops.c:1636
void ose_nth(ose_bundle B)
Copy the nth item of an element.
Definition ose_stackops.c:8290
void ose_countElems(ose_bundle B)
Get the number of elements.
Definition ose_stackops.c:4186
void ose_popAllDrop(ose_bundle B)
Pop each item off the last element of the bundle, and drop the empty element.
Definition ose_stackops.c:3019
void ose_gt(ose_bundle B)
Definition ose_stackops.c:10498
void ose_lengthsItems(ose_bundle B)
Get the lengths in bytes of all items of the last element as a list, excluding NULL-padding.
Definition ose_stackops.c:4374
void ose_popAllDropBundle(ose_bundle B)
Pop each item off the last element of the bundle, drop the empty element, and bundle all new elements...
Definition ose_stackops.c:3162
void ose_pushFalse(ose_bundle B)
Append message containing false to B.
Definition ose_stackops.c:497
struct ose_timetag ose_peekTimetag(const ose_bundle B)
Get the last timetag without removing it.
Definition ose_stackops.c:942
void ose_makeBlob(ose_bundle B)
Create an empty blob of a given size.
Definition ose_stackops.c:8889
void ose_or(ose_bundle B)
Test whether at least one of the numbers in the last two messages is non-zero.
Definition ose_stackops.c:10743
int64_t ose_popInt64(ose_bundle B)
Get the last 64-bit int and remove it from the bundle.
Definition ose_stackops.c:1114
void ose_clear(ose_bundle B)
Clear all elements.
Definition ose_stackops.c:2633
void ose_joinStrings(ose_bundle B)
Join two strings with a separator (string) between them.
Definition ose_stackops.c:7212
void ose_decatenateElemFromStart(ose_bundle B)
Split an element in two.
Definition ose_stackops.c:3673
void ose_pushDouble(ose_bundle B, double v)
Append a message containing a double.
Definition ose_stackops.c:348
void ose_concatenateElems(ose_bundle B)
Concatenate the last two elements.
Definition ose_stackops.c:3785
void ose_bundleFromTop(ose_bundle B)
Collect elements at the end of the bundle together.
Definition ose_stackops.c:2536
void ose_typeof0(ose_bundle B)
Get the type signature of the last element of the bundle with no recursion.
Definition ose_stackops.c:4646
void ose_disarmPointers(ose_bundle B)
Convert a blob to a bundle element.
Definition ose_stackops.c:5085
void ose_pushMessage(ose_bundle B, const char *const address, int32_t addresslen, int32_t n,...)
Append a message.
Definition ose_stackops.c:602
void ose_rot(ose_bundle B)
Move the third to last element to the end.
Definition ose_stackops.c:2182
double ose_popDouble(ose_bundle B)
Get the last double and remove it from the bundle.
Definition ose_stackops.c:1066
void ose_popAtOffset(ose_bundle B, int32_t o)
Remove the element at a known offset, which must be the last one.
Definition ose_stackops.c:2651
uint32_t ose_peekUInt32(const ose_bundle B)
Get the last unsigned 32-bit int without removing it.
Definition ose_stackops.c:887
double ose_peekDouble(const ose_bundle B)
Get the last double without removing it.
Definition ose_stackops.c:856
void ose_mul(ose_bundle B)
Multiply the number in the last message by the number in the previous message.
Definition ose_stackops.c:9206
void ose_pushBlob(ose_bundle B, int32_t size, const char *const blob)
Append a message containing a blob.
Definition ose_stackops.c:243
void ose_and(ose_bundle B)
Test whether the numbers in the last two messages are both non-zero.
Definition ose_stackops.c:10710
const void * ose_peekAlignedPtr(ose_bundle B)
Get the last aligned pointer without removing it.
Definition ose_stackops.c:955
void ose_setTypetag(ose_bundle B)
Set the typetag of the last item of the last message.
Definition ose_stackops.c:4812
void ose_countItems(ose_bundle B)
Get the number of items in the last element.
Definition ose_stackops.c:4258
void ose_bundleFromBottom(ose_bundle B)
Collect elements at the start of the bundle together.
Definition ose_stackops.c:2433
void ose_toInt32(ose_bundle B)
Cast a value to a 32-bit integer.
Definition ose_stackops.c:5317
void ose_toString(ose_bundle B)
Cast a value to a string.
Definition ose_stackops.c:5717
void ose_pushTrue(ose_bundle B)
Append message containing true to B.
Definition ose_stackops.c:487
void ose_lt(ose_bundle B)
Test whether the number in the last message is less than to the number in the second to last message.
Definition ose_stackops.c:10055
void ose_pushInt64(ose_bundle B, int64_t v)
Append a message containing a signed 64-bit int.
Definition ose_stackops.c:389
void ose_pushFloat(ose_bundle B, float v)
Append a message containing a float.
Definition ose_stackops.c:146
void ose_rollBottom(ose_bundle B)
Move the first element to the end.
Definition ose_stackops.c:1987
void ose_2over(ose_bundle B)
Copy the second to last pair of elements over the last pair.
Definition ose_stackops.c:1343
char ose_peekType(const ose_bundle B)
Get the type of the last element.
Definition ose_stackops.c:767
void ose_setTimetag(ose_bundle B)
Set the bundle's timetag.
Definition ose_stackops.c:1165
int8_t ose_popInt8(ose_bundle B)
Get the last char and remove it from the bundle.
Definition ose_stackops.c:1078
void ose_pushBundle(ose_bundle B)
Create an empty bundle.
Definition ose_stackops.c:8918
void ose_typeof1(ose_bundle B)
Get the type signature of the last element of the bundle with one level of recursion.
Definition ose_stackops.c:4680
void ose_pushLines(ose_bundle B, const char *const src)
Push each line of src as a string.
Definition ose_stackops.c:526
void ose_gather(ose_bundle B)
Gather messages from a bundle that match one or more strings.
Definition ose_stackops.c:8098
uint32_t ose_popUInt32(ose_bundle B)
Get the last unsigned 32-bit int and remove it from the bundle.
Definition ose_stackops.c:1102
void ose_pmatch(ose_bundle B)
Compare two strings using pattern matching.
Definition ose_stackops.c:7519
void ose_toBlob(ose_bundle B)
Cast a value to a blob.
Definition ose_stackops.c:5725
char * ose_peekAddress(const ose_bundle B)
Get the address of the last element.
Definition ose_stackops.c:656
void ose_add(ose_bundle B)
Add the number in the last message to the number in the previous message.
Definition ose_stackops.c:8981
void ose_popAll(ose_bundle B)
Pop each item off the last element of the bundle.
Definition ose_stackops.c:2950
void ose_typeof2(ose_bundle B)
Get the type signature of the last element of the bundle with two levels of recursion.
Definition ose_stackops.c:4714
void ose_rearmPointers(ose_bundle B)
The inverse. Restores the TAG, which is not the same as restoring the meaning – an address is only va...
Definition ose_stackops.c:5090
void ose_moveStringToAddress(ose_bundle B)
Move the last string of a message to the address.
Definition ose_stackops.c:6813
void ose_not(ose_bundle B)
Definition ose_stackops.c:10412
char * ose_peekBlob(ose_bundle B)
Get a pointer to the last blob without removing it.
Definition ose_stackops.c:837
int16_t ose_peekInt16(const ose_bundle B)
Peek at the int16 value of the last element.
Definition ose_stackops.c:905
void ose_rollMatch(ose_bundle B)
Move the first element whose address equals the string at the end to the end — ose_rollMatch_impl,...
Definition ose_stackops.c:2097
int32_t ose_rollPMatch_impl(ose_bundle B)
Definition ose_stackops.c:2110
int8_t ose_peekInt8(const ose_bundle B)
Get the last signed char without removing it.
Definition ose_stackops.c:867
int64_t ose_peekInt64(const ose_bundle B)
Get the last 64-bit int without removing it.
Definition ose_stackops.c:922
int32_t ose_pickMatch_impl(ose_bundle B)
COPY the first element whose address matches the string at the end of the bundle to the end.
Definition ose_stackops.c:1876
void ose_pushInt8(ose_bundle B, int8_t v)
Append a message containing a signed char.
Definition ose_stackops.c:359
void ose_pickBottom(ose_bundle B)
Copy the first element to the end.
Definition ose_stackops.c:1806
int32_t ose_peekInt32(ose_bundle B)
Get the value of the last int stored in the last message.
Definition ose_stackops.c:811
void ose_pickMatch(ose_bundle B)
COPY the first element whose address equals the string at the end to the end — ose_pickMatch_impl,...
Definition ose_stackops.c:1893
void ose_dup(ose_bundle B)
Duplicate the last element.
Definition ose_stackops.c:1515
void ose_toFloat(ose_bundle B)
Cast a value to a 32-bit float.
Definition ose_stackops.c:5325
char ose_peekMessageArgTypeAtOffset(const ose_bundle B, const int32_t messageoffset)
Get the type of the last item of the last element, where the offset of the last element is given.
Definition ose_stackops.c:668
void ose_tuck(ose_bundle B)
Copy the last element to the third from last position.
Definition ose_stackops.c:2317
int32_t ose_popSymbol(ose_bundle B, char *buf)
Get the last symbol and remove it from the bundle.
Definition ose_stackops.c:1052
void ose_getTypetags(ose_bundle B)
Get the typetags of the last element.
Definition ose_stackops.c:6925
void ose_2dup(ose_bundle B)
Duplicate the last two elements.
Definition ose_stackops.c:1289
void ose_lte(ose_bundle B)
Test whether the number in the last message is less than or equal to the number in the second to last...
Definition ose_stackops.c:9964
void ose_min(ose_bundle B)
Definition ose_stackops.c:10146
void ose_popAllBundle(ose_bundle B)
Pop each item off the last element of the bundle, and bundle them together.
Definition ose_stackops.c:3090
#define B(...)
Instantiate a top-level OSC bundle.
Definition ose_test_ctosc.h:339
contains basic utilities for reading, writing, and querying an OSC bundle