|
SofaBuffers C/C++ 0.12.0
API Documentation
|
SofaBuffers C - Type definitions and constants. More...
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Macros | |
| #define | SOFAB_EXTERN extern |
| #define | SOFAB_API_VERSION 1 |
| SofaBuffers C API version. | |
| #define | SOFAB_UNSIGNED_MAX (UINT64_MAX) |
| #define | SOFAB_SIGNED_MAX (INT64_MAX) |
| #define | SOFAB_SIGNED_MIN (INT64_MIN) |
| #define | SOFAB_ID_MAX (INT32_MAX) |
| Largest encodable field id (the (id<<3)|type header must fit in sofab_unsigned_t). | |
| #define | SOFAB_MAX_DEPTH (UINT8_MAX) |
| Maximum sequence nesting depth. | |
| #define | SOFAB_MIN_OUTPUT_BUFFER 1 |
| Smallest output buffer this port accepts for streaming (CORELIB_PLAN §5.1). | |
| #define | SOFAB_STRICT_UTF8 0 |
| Wire-construct switches — what a reduced build does on the wire. | |
| #define | SOFAB_SKIP_COUNTER 0 |
| Count fields skipped because their wire type contradicted the read bound for them (MESSAGE_SPEC §7.3). | |
| #define | SOFAB_OBJECT_DESCR_SMALL 1 |
| Narrow unsigned/signed scalar varint values from 64-bit to 32-bit. | |
| #define | SOFAB_OBJECT_DESCR_MEDIUM 2 |
| #define | SOFAB_OBJECT_DESCR_BIG 3 |
| #define | SOFAB_OBJECT_DESCR_PROFILE SOFAB_OBJECT_DESCR_MEDIUM |
| Selected object descriptor profile (default: MEDIUM). | |
| #define | SOFAB_OBJECT_DESCR_ID_MAX (UINT16_MAX) |
| #define | SOFAB_OBJECT_DESCR_OFFSET_MAX (UINT16_MAX) |
| #define | SOFAB_OBJECT_DESCR_SIZE_MAX (UINT16_MAX) |
Format-wide ceilings (CORELIB_PLAN §6.2) | |
A declared length or element count above its ceiling is §6.2 puts both ceilings at 2,147,483,647 and grants constrained profiles the allowance to lower them to 65,535. **This port takes that allowance exactly where the target forces it, and derives the value from The profile choice §6.2 requires be documented: 2,147,483,647 on every target whose Both are overridable (
| |
| #define | SOFAB_FIXLEN_MAX (INT32_MAX) |
| Maximum fixed-length field size in bytes. | |
| #define | SOFAB_ARRAY_MAX (INT32_MAX) |
| Maximum number of elements in an array. | |
Typedefs | |
| typedef uint32_t | sofab_id_t |
| Field identifier type. | |
| typedef uint64_t | sofab_unsigned_t |
| Scalar varint value types. | |
| typedef int64_t | sofab_signed_t |
| Signed value type. | |
| typedef uint16_t | sofab_object_descr_id_t |
| typedef uint16_t | sofab_object_descr_offset_t |
| typedef uint16_t | sofab_object_descr_size_t |
| typedef char | sofab_check_size_double[(sizeof(double)==8) ? 1 :-1] |
| typedef char | sofab_check_size_float[(sizeof(float)==4) ? 1 :-1] |
| typedef char | sofab_check_size_char_t[(sizeof(char)==1) ? 1 :-1] |
| typedef char | sofab_check_size_uint8_t[(sizeof(uint8_t)==1) ? 1 :-1] |
| typedef char | sofab_check_size_int8_t[(sizeof(int8_t)==1) ? 1 :-1] |
| typedef char | sofab_check_size_uint16_t[(sizeof(uint16_t)==2) ? 1 :-1] |
| typedef char | sofab_check_size_int16_t[(sizeof(int16_t)==2) ? 1 :-1] |
| typedef char | sofab_check_size_uint32_t[(sizeof(uint32_t)==4) ? 1 :-1] |
| typedef char | sofab_check_size_int32_t[(sizeof(int32_t)==4) ? 1 :-1] |
| typedef char | sofab_check_size_uint64_t[(sizeof(uint64_t)==8) ? 1 :-1] |
| typedef char | sofab_check_size_int64_t[(sizeof(int64_t)==8) ? 1 :-1] |
Enumerations | |
| enum | sofab_ret_t { SOFAB_RET_OK , SOFAB_RET_INCOMPLETE , SOFAB_RET_E_ARGUMENT , SOFAB_RET_E_BUFFER_FULL , SOFAB_RET_E_INVALID_MSG , SOFAB_RET_E_LIMIT_EXCEEDED } |
| Return status codes. More... | |
| enum | sofab_type_t { SOFAB_TYPE_VARINT_UNSIGNED = 0x00 , SOFAB_TYPE_VARINT_SIGNED = 0x01 , SOFAB_TYPE_FIXLEN = 0x02 , SOFAB_TYPE_VARINTARRAY_UNSIGNED = 0x03 , SOFAB_TYPE_VARINTARRAY_SIGNED = 0x04 , SOFAB_TYPE_FIXLENARRAY = 0x05 , SOFAB_TYPE_SEQUENCE_START = 0x06 , SOFAB_TYPE_SEQUENCE_END = 0x07 } |
| SofaBuffers 3bit field data types. More... | |
| enum | sofab_fixlentype_t { SOFAB_FIXLENTYPE_FP32 = 0x00 , SOFAB_FIXLENTYPE_FP64 = 0x01 , SOFAB_FIXLENTYPE_STRING = 0x02 , SOFAB_FIXLENTYPE_BLOB = 0x03 } |
| SofaBuffers 3bit fixed-length data types. More... | |
SofaBuffers C - Type definitions and constants.
SPDX-License-Identifier: MIT
Definition in file sofab.h.