| 243 | // tagged writing -------------------------------------- |
| 244 | |
| 245 | void BStream_writeTag(BStream *self, unsigned int t, unsigned int b, |
| 246 | unsigned int a) { |
| 247 | BStreamTag tag; |
| 248 | tag.isArray = a; |
| 249 | tag.type = t; |
| 250 | tag.byteCount = b; |
| 251 | |
| 252 | { |
| 253 | unsigned char c = BStreamTag_asUnsignedChar(&tag); |
| 254 | BStreamTag tag2 = BStreamTag_FromUnsignedChar(c); |
| 255 | |
| 256 | if (tag2.isArray != tag.isArray || tag2.type != tag.type || |
| 257 | tag2.byteCount != tag.byteCount) { |
| 258 | printf("tags don't match\n"); |
| 259 | exit(-1); |
| 260 | } |
| 261 | |
| 262 | BStream_writeUint8_(self, c); |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | void BStream_writeTaggedUint8_(BStream *self, uint8_t v) { |
| 267 | BStream_writeTag(self, BSTREAM_UNSIGNED_INT, 1, 0); |
no test coverage detected