libose
Loading...
Searching...
No Matches
ose_stackops.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019-23 John MacCallum Permission is hereby
3 granted, free of charge, to any person obtaining a copy of this
4 software and associated documentation files (the "Software"), to
5 deal in the Software without restriction, including without
6 limitation the rights to use, copy, modify, merge, publish,
7 distribute, sublicense, and/or sell copies of the Software, and
8 to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be
12 included in all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 OTHER DEALINGS IN THE SOFTWARE.
22*/
23
44#ifndef OSE_STACKOPS_H
45#define OSE_STACKOPS_H
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51#include "ose.h"
52#include "ose_util.h"
53#include "ose_errno.h"
54
58#define OSE_START_BUNDLE(B) { \
59 ose_pushBundle(B); \
60 int32_t ose_stackops_reserved_o___ = \
61 ose_getLastBundleElemOffset(B); \
62 int32_t ose_stackops_reserved_bs___ = ose_readSize(B);
63
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___)); \
73}
74
83void ose_pushInt32(ose_bundle B, int32_t v);
84
88void ose_pushFloat(ose_bundle B, float v);
89
94 const char * const v);
95
96void ose_pushStringBelowAtOffset(ose_bundle B,
97 const int32_t offset,
98 const char * const s,
99 const int32_t slen);
100void ose_pushStringBelow(ose_bundle B,
101 const char * const s,
102 const int32_t slen);
103
117 int32_t size,
118 const char * const blob);
119
120#ifdef OSE_PROVIDE_TYPE_SYMBOL
124void ose_pushSymbol(ose_bundle B, const char * const v);
125#endif
126
127#ifdef OSE_PROVIDE_TYPE_DOUBLE
131void ose_pushDouble(ose_bundle B, double v);
132#endif
133
134#ifdef OSE_PROVIDE_TYPE_INT8
138void ose_pushInt8(ose_bundle B, int8_t v);
139#endif
140
141#ifdef OSE_PROVIDE_TYPE_UINT8
145void ose_pushUInt8(ose_bundle B, uint8_t v);
146#endif
147
148#ifdef OSE_PROVIDE_TYPE_UINT32
152void ose_pushUInt32(ose_bundle B, uint32_t v);
153#endif
154
155#ifdef OSE_PROVIDE_TYPE_INT64
159void ose_pushInt64(ose_bundle B, int64_t v);
160#endif
161
162#ifdef OSE_PROVIDE_TYPE_UINT64
166void ose_pushUInt64(ose_bundle B, uint64_t v);
167#endif
168
169#ifdef OSE_PROVIDE_TYPE_TIMETAG
173void ose_pushTimetag(ose_bundle B, uint32_t sec, uint32_t fsec);
174#endif
175
176#ifdef OSE_PROVIDE_TYPE_TRUE
181#endif
182
183#ifdef OSE_PROVIDE_TYPE_FALSE
188#endif
189
190#ifdef OSE_PROVIDE_TYPE_NIL
195#endif
196
197#ifdef OSE_PROVIDE_TYPE_INFINITUM
202#endif
203
208#define OSE_MAXLINE 4096
209
210void ose_pushAlignedPtr(ose_bundle B, const void *v);
211
227void ose_pushLines(ose_bundle B, const char * const src);
228
240#ifndef SWIGCSHARP
242 const char * const address,
243 int32_t addresslen,
244 int32_t n,
245 ...);
246#endif
247
// C to OSC
249
265char *ose_peekAddress(const ose_bundle B);
266
281 const int32_t messageoffset);
282
296
309char ose_peekType(const ose_bundle B);
310
319int32_t ose_peekInt32(ose_constbundle B);
320
329float ose_peekFloat(ose_constbundle B);
330
347char *ose_peekString(ose_constbundle B);
348
364char *ose_peekBlob(ose_constbundle B);
365
366#ifdef OSE_PROVIDE_TYPE_SYMBOL
384char *ose_peekSymbol(const ose_bundle B);
385#endif
386
387#ifdef OSE_PROVIDE_TYPE_DOUBLE
396double ose_peekDouble(const ose_bundle B);
397#endif
398
399#ifdef OSE_PROVIDE_TYPE_INT8
408int8_t ose_peekInt8(const ose_bundle B);
409#endif
410
411#ifdef OSE_PROVIDE_TYPE_UINT8
420uint8_t ose_peekUInt8(const ose_bundle B);
421#endif
422
423#ifdef OSE_PROVIDE_TYPE_UINT32
432uint32_t ose_peekUInt32(const ose_bundle B);
433#endif
434
435#ifdef OSE_PROVIDE_TYPE_INT16
444int16_t ose_peekInt16(const ose_bundle B);
445#endif
446
447#ifdef OSE_PROVIDE_TYPE_UINT16
456uint16_t ose_peekUInt16(const ose_bundle B);
457#endif
458
459#ifdef OSE_PROVIDE_TYPE_INT64
468int64_t ose_peekInt64(const ose_bundle B);
469#endif
470
471#ifdef OSE_PROVIDE_TYPE_UINT64
480uint64_t ose_peekUInt64(const ose_bundle B);
481#endif
482
483#ifdef OSE_PROVIDE_TYPE_TIMETAG
493#endif
494
506const void *ose_peekAlignedPtr(ose_bundle B);
507
516int32_t ose_popInt32(ose_bundle B);
517
527
543int32_t ose_popString(ose_bundle B, char *buf);
544
556int32_t ose_popBlob(ose_bundle B, char *buf);
557
558#ifdef OSE_PROVIDE_TYPE_SYMBOL
569int32_t ose_popSymbol(ose_bundle B, char *buf);
570#endif
571
572#ifdef OSE_PROVIDE_TYPE_DOUBLE
582#endif
583
584#ifdef OSE_PROVIDE_TYPE_INT8
593int8_t ose_popInt8(ose_bundle B);
594#endif
595
596#ifdef OSE_PROVIDE_TYPE_UINT8
605uint8_t ose_popUInt8(ose_bundle B);
606#endif
607
608#ifdef OSE_PROVIDE_TYPE_UINT32
618uint32_t ose_popUInt32(ose_bundle B);
619#endif
620
621#ifdef OSE_PROVIDE_TYPE_INT64
630int64_t ose_popInt64(ose_bundle B);
631#endif
632
633#ifdef OSE_PROVIDE_TYPE_UINT64
643uint64_t ose_popUInt64(ose_bundle B);
644#endif
645
646#ifdef OSE_PROVIDE_TYPE_TIMETAG
656#endif
657
// OSC to C
659
670void ose_drop(ose_bundle B);
671
678
684void ose_dup(ose_bundle B);
685
691void ose_2dup(ose_bundle B);
692
693void ose_nip_impl(ose_bundle B,
694 int32_t onm1,
695 int32_t snm1,
696 int32_t on,
697 int32_t sn);
698
704void ose_nip(ose_bundle B);
705
711void ose_rot(ose_bundle B);
712
718void ose_rrot(ose_bundle B);
719
725void ose_over(ose_bundle B);
726
734
758void ose_pick(ose_bundle B);
759
784void ose_roll(ose_bundle B);
785
795
809
875
936
942void ose_swap(ose_bundle B);
943
950
956void ose_tuck(ose_bundle B);
957
// Stack Operations
959
969
991
1013
1017void ose_clear(ose_bundle B);
1018
1033void ose_popAtOffset(ose_bundle B, int32_t o);
1034
1049void ose_pop(ose_bundle B);
1050
1068void ose_popAll(ose_bundle B);
1069
1088
1107
1127
1134
1153void ose_push(ose_bundle B);
1154
1172
1190
1201
1214void ose_unpack(ose_bundle B);
1215
1230
// Grouping / Ungrouping
1232
1247
1259
1274
1289
1303
1318
1334
1349
1362
1376
1385
1390
1401
1410
1419
1428
// Queries
1430
1436void ose_setTypetagAtOffset_impl(ose_bundle B,
1437 char typetag,
1438 int32_t offset);
1439
1465void ose_setTypetag_impl(ose_bundle B, char typetag);
1466
1490
1491void ose_blobToElemAtOffset(ose_bundle B, int32_t offset);
1492
1521
1530
1531void ose_blobToElem(ose_bundle B);
1532
1545void ose_blobToType_impl(ose_bundle B, char typetag);
1546
1560
1561void ose_toType(ose_bundle B);
1562
1577
1592
1601
1609void ose_toBlob(ose_bundle B);
1610
1611
1612void ose_appendByte(ose_bundle B);
1613#ifdef OSE_PROVIDE_TYPE_SYMBOL
1614void ose_toSymbol(ose_bundle B);
1615#endif
1616#ifdef OSE_PROVIDE_TYPE_DOUBLE
1617void ose_toDouble(ose_bundle B);
1618#endif
1619#ifdef OSE_PROVIDE_TYPE_INT8
1620void ose_toInt8(ose_bundle B);
1621#endif
1622#ifdef OSE_PROVIDE_TYPE_UINT8
1623void ose_toUInt8(ose_bundle B);
1624#endif
1625#ifdef OSE_PROVIDE_TYPE_INT16
1626void ose_toInt16(ose_bundle B);
1627#endif
1628#ifdef OSE_PROVIDE_TYPE_UINT16
1629void ose_toUInt16(ose_bundle B);
1630#endif
1631#ifdef OSE_PROVIDE_TYPE_UINT32
1632void ose_toUInt32(ose_bundle B);
1633#endif
1634#ifdef OSE_PROVIDE_TYPE_INT64
1635void ose_toInt64(ose_bundle B);
1636#endif
1637#ifdef OSE_PROVIDE_TYPE_UINT64
1638void ose_toUInt64(ose_bundle B);
1639#endif
1640#ifdef OSE_PROVIDE_TYPE_TIMETAG
1641void ose_toTimetag(ose_bundle B);
1642#endif
1643#ifdef OSE_PROVIDE_TYPE_TRUE
1644void ose_toTrue(ose_bundle B);
1645#endif
1646#ifdef OSE_PROVIDE_TYPE_FALSE
1647void ose_toFalse(ose_bundle B);
1648#endif
1649#ifdef OSE_PROVIDE_TYPE_NIL
1650void ose_toNil(ose_bundle B);
1651#endif
1652#ifdef OSE_PROVIDE_TYPE_INFINITUM
1653void ose_toInfinitum(ose_bundle B);
1654#endif
1655
1667
1680
1689
1698
1699void ose_decatenateBlobFromEnd_impl(ose_bundle B, int32_t n);
1700void ose_decatenateBlobFromEnd(ose_bundle B);
1701void ose_decatenateBlobFromStart_impl(ose_bundle B, int32_t n);
1702void ose_decatenateBlobFromStart(ose_bundle B);
1703void ose_decatenateStringFromEnd_impl(ose_bundle B, int32_t n);
1704void ose_decatenateStringFromEnd(ose_bundle B);
1705void ose_decatenateStringFromStart_impl(ose_bundle B, int32_t n);
1706void ose_decatenateStringFromStart(ose_bundle B);
1707
1714
1723
1745void ose_splitStringFromEnd(ose_bundle B);
1746void ose_splitStringFromStart(ose_bundle B);
1747void ose_swap4Bytes(ose_bundle B);
1748void ose_swap8Bytes(ose_bundle B);
1749void ose_swapNBytes(ose_bundle B);
1750void ose_trimStringEnd(ose_bundle B);
1751void ose_trimStringStart(ose_bundle B);
1752
// Operations on Bundle Elements and Items
1754
1774void ose_match(ose_bundle B);
1775
1802void ose_pmatch(ose_bundle B);
1803void ose_replace(ose_bundle B);
1804void ose_assign(ose_bundle B);
1805void ose_lookup(ose_bundle B);
1807
1829void ose_route1(ose_bundle B);
1830
1858
1880
1907
1929void ose_gather(ose_bundle B);
1930
1948void ose_nth(ose_bundle B);
1949
// Matching, Selecting, Routing, and Assignment
1951
1970
1975
// Element and Item Creation
1977
1994void ose_add(ose_bundle B);
1995
2007void ose_sub(ose_bundle B);
2008
2020void ose_mul(ose_bundle B);
2021
2033void ose_div(ose_bundle B);
2034
2046void ose_mod(ose_bundle B);
2047
2059void ose_pow(ose_bundle B);
2060
2069void ose_neg(ose_bundle B);
2070
2082void ose_eql(ose_bundle B);
2083
2096void ose_neq(ose_bundle B);
2097
2109void ose_lte(ose_bundle B);
2110void ose_gt(ose_bundle B);
2111void ose_gte(ose_bundle B);
2112void ose_min(ose_bundle B);
2113void ose_max(ose_bundle B);
2114void ose_abs(ose_bundle B);
2115void ose_not(ose_bundle B);
2116
2128void ose_lt(ose_bundle B);
2129
2141void ose_and(ose_bundle B);
2142
2154void ose_or(ose_bundle B);
2155
// Arithmetic
2157
2158enum ose_errno ose_getLastBundleElem(ose_bundle B,
2159 int32_t *n,
2160 int32_t *offsetn,
2161 int32_t *sizen);
2162
2163enum ose_errno ose_getLastTwoBundleElems(ose_bundle B,
2164 int32_t *n,
2165 int32_t *offsetnm1,
2166 int32_t *sizenm1,
2167 int32_t *offsetn,
2168 int32_t *sizen);
2169
2170enum ose_errno ose_getLastThreeBundleElems(ose_bundle B,
2171 int32_t *n,
2172 int32_t *offsetnm2,
2173 int32_t *sizenm2,
2174 int32_t *offsetnm1,
2175 int32_t *sizenm1,
2176 int32_t *offsetn,
2177 int32_t *sizen);
2178
2179enum ose_errno ose_getLastFourBundleElems(ose_bundle B,
2180 int32_t *n,
2181 int32_t *offsetnm3,
2182 int32_t *sizenm3,
2183 int32_t *offsetnm2,
2184 int32_t *sizenm2,
2185 int32_t *offsetnm1,
2186 int32_t *sizenm1,
2187 int32_t *offsetn,
2188 int32_t *sizen);
2189
2190#ifdef __cplusplus
2191}
2192#endif
2193
2194#endif
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
Definition ose.h:374
Convenience struct for OSC/NTP timetags.
Definition ose.h:420