Table of Contents
- AVRO: binary format encoding/decoding with JSON conversion
- Structures
- Types
- Functions
- Defines
- Types Documentation
- Functions Documentation
- function avro_schema_to_json
- function avro_schema_parse_nstr
- function avro_schema_parse
- function avro_schema_from_cjson
- function avro_schema_free
- function avro_nstr_json_to_avro
- function avro_nstr_avro_to_json
- function avro_json_to_file
- function avro_file_to_json
- function avro_encode_long
- function avro_encode_datum
- function avro_encode_container
- function avro_decode_long
- function avro_decode_datum
- function avro_decode_container
- Macros Documentation
AVRO: binary format encoding/decoding with JSON conversion
Structures
| Name | |
|---|---|
| struct | AVRO_SCHEMA Avro schema definition. |
| struct | AVRO_READER Avro read cursor for decoding. |
| struct | AVRO_FIELD Avro schema field (for records). |
Types
| Name | |
|---|---|
| enum | AVRO_TYPE { AVRO_UNION, AVRO_STRING, AVRO_RECORD, AVRO_NULL = 0, AVRO_MAP, AVRO_LONG, AVRO_INT, AVRO_FLOAT, AVRO_FIXED, AVRO_ENUM, AVRO_DOUBLE, AVRO_BYTES, AVRO_BOOLEAN, AVRO_ARRAY} Avro schema type enumeration. |
Functions
| Name | |
|---|---|
| char * | avro_schema_to_json(const AVRO_SCHEMA * schema) Convert an Avro schema back to JSON string (caller must free). |
| AVRO_SCHEMA * | avro_schema_parse_nstr(const N_STR * schema_nstr) Parse schema from N_STR. |
| AVRO_SCHEMA * | avro_schema_parse(const char * json_str) Parse an Avro schema from a JSON string. |
| AVRO_SCHEMA * | avro_schema_from_cjson(const cJSON * json) Parse an Avro schema from a cJSON object. |
| void | avro_schema_free(AVRO_SCHEMA ** schema) Free an Avro schema. |
| N_STR * | avro_nstr_json_to_avro(const N_STR * schema_nstr, const N_STR * json_nstr) Convert JSON N_STR to Avro N_STR using schema N_STR (all in-memory). |
| N_STR * | avro_nstr_avro_to_json(const N_STR * schema_nstr, const N_STR * avro_nstr) Convert Avro N_STR to JSON N_STR using schema N_STR (all in-memory). |
| int | avro_json_to_file(const char * avro_filename, const char * schema_filename, const char * json_filename) Write an Avro object container file from a JSON file and schema file. |
| int | avro_file_to_json(const char * avro_filename, const char * schema_filename, const char * json_filename) Read an Avro object container file and produce a JSON file using a schema file. |
| int | avro_encode_long(N_STR ** dest, int64_t value) Encode a 64-bit signed integer as zig-zag varint into N_STR. |
| int | avro_encode_datum(N_STR ** dest, const AVRO_SCHEMA * schema, const cJSON * json) Encode a cJSON value as Avro binary according to schema. |
| N_STR * | avro_encode_container(const AVRO_SCHEMA * schema, const cJSON * records) Encode a cJSON array of records into Avro container format N_STR. |
| int | avro_decode_long(AVRO_READER * reader, int64_t * value) Decode a zig-zag varint from reader into a 64-bit signed integer. |
| cJSON * | avro_decode_datum(AVRO_READER * reader, const AVRO_SCHEMA * schema) Decode an Avro binary datum into cJSON according to schema. |
| cJSON * | avro_decode_container(const AVRO_SCHEMA * schema, const N_STR * avro_data) Decode an Avro container format N_STR into a cJSON array of records. |
Defines
| Name | |
|---|---|
| AVRO_SYNC_LEN Avro sync marker length. |
|
| AVRO_MAGIC_LEN Avro magic length. |
|
| AVRO_MAGIC Avro object container file magic bytes. |
Types Documentation
enum AVRO_TYPE
| Enumerator | Value | Description |
|---|---|---|
| AVRO_UNION | ||
| AVRO_STRING | ||
| AVRO_RECORD | ||
| AVRO_NULL | 0 | |
| AVRO_MAP | ||
| AVRO_LONG | ||
| AVRO_INT | ||
| AVRO_FLOAT | ||
| AVRO_FIXED | ||
| AVRO_ENUM | ||
| AVRO_DOUBLE | ||
| AVRO_BYTES | ||
| AVRO_BOOLEAN | ||
| AVRO_ARRAY |
Avro schema type enumeration.
Functions Documentation
function avro_schema_to_json
char * avro_schema_to_json(
const AVRO_SCHEMA * schema
)
Convert an Avro schema back to JSON string (caller must free).
function avro_schema_parse_nstr
AVRO_SCHEMA * avro_schema_parse_nstr(
const N_STR * schema_nstr
)
Parse schema from N_STR.
function avro_schema_parse
AVRO_SCHEMA * avro_schema_parse(
const char * json_str
)
Parse an Avro schema from a JSON string.
function avro_schema_from_cjson
AVRO_SCHEMA * avro_schema_from_cjson(
const cJSON * json
)
Parse an Avro schema from a cJSON object.
function avro_schema_free
void avro_schema_free(
AVRO_SCHEMA ** schema
)
Free an Avro schema.
function avro_nstr_json_to_avro
N_STR * avro_nstr_json_to_avro(
const N_STR * schema_nstr,
const N_STR * json_nstr
)
Convert JSON N_STR to Avro N_STR using schema N_STR (all in-memory).
function avro_nstr_avro_to_json
N_STR * avro_nstr_avro_to_json(
const N_STR * schema_nstr,
const N_STR * avro_nstr
)
Convert Avro N_STR to JSON N_STR using schema N_STR (all in-memory).
function avro_json_to_file
int avro_json_to_file(
const char * avro_filename,
const char * schema_filename,
const char * json_filename
)
Write an Avro object container file from a JSON file and schema file.
function avro_file_to_json
int avro_file_to_json(
const char * avro_filename,
const char * schema_filename,
const char * json_filename
)
Read an Avro object container file and produce a JSON file using a schema file.
function avro_encode_long
int avro_encode_long(
N_STR ** dest,
int64_t value
)
Encode a 64-bit signed integer as zig-zag varint into N_STR.
function avro_encode_datum
int avro_encode_datum(
N_STR ** dest,
const AVRO_SCHEMA * schema,
const cJSON * json
)
Encode a cJSON value as Avro binary according to schema.
function avro_encode_container
N_STR * avro_encode_container(
const AVRO_SCHEMA * schema,
const cJSON * records
)
Encode a cJSON array of records into Avro container format N_STR.
function avro_decode_long
int avro_decode_long(
AVRO_READER * reader,
int64_t * value
)
Decode a zig-zag varint from reader into a 64-bit signed integer.
function avro_decode_datum
cJSON * avro_decode_datum(
AVRO_READER * reader,
const AVRO_SCHEMA * schema
)
Decode an Avro binary datum into cJSON according to schema.
function avro_decode_container
cJSON * avro_decode_container(
const AVRO_SCHEMA * schema,
const N_STR * avro_data
)
Decode an Avro container format N_STR into a cJSON array of records.
Macros Documentation
define AVRO_SYNC_LEN
#define AVRO_SYNC_LEN 16
Avro sync marker length.
define AVRO_MAGIC_LEN
#define AVRO_MAGIC_LEN 4
Avro magic length.
define AVRO_MAGIC
#define AVRO_MAGIC "Obj\x01"
Avro object container file magic bytes.
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB