New doc system done for core
[io.git] / libs / basekit / source / BStreamTag.h
blobdd8b07ac4b7c8b277634744ce818a2b7c48c4693
1 /*
2 copyright
3 Steve Dekorte, 2004
4 license
5 BSD revised
6 */
8 #ifndef BSTREAMTAG_DEFINED
9 #define BSTREAMTAG_DEFINED 1
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 #define BSTREAM_UNSIGNED_INT 0
16 #define BSTREAM_SIGNED_INT 1
17 #define BSTREAM_FLOAT 2
18 #define BSTREAM_POINTER 3
20 typedef struct
22 unsigned int isArray : 1;
23 unsigned int type : 2; // 0 = unsigned int, 1 = signed int, 2 = float, 3 = pointer
24 unsigned int byteCount : 5; // number of bytes in data value(s)
25 } BStreamTag;
27 // values in network byte order / big endian
29 BStreamTag BStreamTag_FromUnsignedChar(unsigned char c);
30 unsigned char BStreamTag_asUnsignedChar(BStreamTag *self);
31 BStreamTag BStreamTag_TagArray_type_byteCount_(unsigned int a, unsigned int t, unsigned int b);
32 int BStreamTag_isEqual_(BStreamTag *self, BStreamTag *other);
33 void BStreamTag_print(BStreamTag *self);
35 char *BStreamTag_typeName(BStreamTag *self);
37 #ifdef __cplusplus
39 #endif
40 #endif