diff --git a/examples/unix/c11/z_bytes.c b/examples/unix/c11/z_bytes.c index dee10e86f..05f570e63 100644 --- a/examples/unix/c11/z_bytes.c +++ b/examples/unix/c11/z_bytes.c @@ -64,7 +64,7 @@ int main(void) { assert(input_u32 == output_u32); z_drop(z_move(payload)); // Corresponding encoding to be used in operations options like `z_put()`, `z_get()`, etc. - // encoding = ENCODING_ZENOH_UINT32; + // encoding = ZP_ENCODING_ZENOH_UINT32; // String, also work with and z_owned_string_t const char *input_str = "test"; @@ -75,7 +75,7 @@ int main(void) { z_drop(z_move(payload)); z_drop(z_move(output_string)); // Corresponding encoding to be used in operations options like `z_put()`, `z_get()`, etc. - // encoding = ENCODING_ZENOH_STRING; + // encoding = ZP_ENCODING_ZENOH_STRING; // Bytes, also work with z_owned_slice_t const uint8_t input_bytes[] = {1, 2, 3, 4}; @@ -86,7 +86,7 @@ int main(void) { z_drop(z_move(payload)); z_drop(z_move(output_bytes)); // Corresponding encoding to be used in operations options like `z_put()`, `z_get()`, etc. - // encoding = ENCODING_ZENOH_BYTES; // That's the default value + // encoding = ZP_ENCODING_ZENOH_BYTES; // That's the default value // Writer reader uint8_t input_writer[] = {0, 1, 2, 3, 4}; diff --git a/include/zenoh-pico/api/encoding.h b/include/zenoh-pico/api/encoding.h index fdfb0b1b8..1270191b3 100644 --- a/include/zenoh-pico/api/encoding.h +++ b/include/zenoh-pico/api/encoding.h @@ -47,358 +47,424 @@ extern "C" { // Constant alias for string: `"zenoh/bytes"`. // // Usually used for types: `uint8_t[]`. -extern const z_owned_encoding_t ENCODING_ZENOH_BYTES; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_BYTES; +const z_loaned_encoding_t *z_encoding_zenoh_bytes(void); // A VLE-encoded signed little-endian 8bit integer. Binary representation uses two's complement. //// - Primitives types supported in all Zenoh bindings // Constant alias for string: `"zenoh/int8"`. // // Usually used for types: `int8_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_INT8; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_INT8; +const z_loaned_encoding_t *z_encoding_zenoh_int8(void); // A VLE-encoded signed little-endian 16bit integer. Binary representation uses two's complement. // // Constant alias for string: `"zenoh/int16"`. // // Usually used for types: `int16_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_INT16; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_INT16; +const z_loaned_encoding_t *z_encoding_zenoh_int16(void); // A VLE-encoded signed little-endian 32bit integer. Binary representation uses two's complement. // // Constant alias for string: `"zenoh/int32"`. // // Usually used for types: `int32_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_INT32; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_INT32; +const z_loaned_encoding_t *z_encoding_zenoh_int32(void); // A VLE-encoded signed little-endian 64bit integer. Binary representation uses two's complement. // // Constant alias for string: `"zenoh/int64"`. // // Usually used for types: `int64_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_INT64; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_INT64; +const z_loaned_encoding_t *z_encoding_zenoh_int64(void); // A VLE-encoded signed little-endian 128bit integer. Binary representation uses two's complement. // // Constant alias for string: `"zenoh/int128"`. -extern const z_owned_encoding_t ENCODING_ZENOH_INT128; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_INT128; +const z_loaned_encoding_t *z_encoding_zenoh_int128(void); // A VLE-encoded unsigned little-endian 8bit integer. // // Constant alias for string: `"zenoh/uint8"`. // // Usually used for types: `uint8_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_UINT8; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_UINT8; +const z_loaned_encoding_t *z_encoding_zenoh_uint8(void); // A VLE-encoded unsigned little-endian 16bit integer. // // Constant alias for string: `"zenoh/uint16"`. // // Usually used for types: `uint16_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_UINT16; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_UINT16; +const z_loaned_encoding_t *z_encoding_zenoh_uint16(void); // A VLE-encoded unsigned little-endian 32bit integer. // // Constant alias for string: `"zenoh/uint32"`. // // Usually used for types: `uint32_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_UINT32; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_UINT32; +const z_loaned_encoding_t *z_encoding_zenoh_uint32(void); // A VLE-encoded unsigned little-endian 64bit integer. // // Constant alias for string: `"zenoh/uint64"`. // // Usually used for types: `uint64_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_UINT64; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_UINT64; +const z_loaned_encoding_t *z_encoding_zenoh_uint64(void); // A VLE-encoded unsigned little-endian 128bit integer. // // Constant alias for string: `"zenoh/uint128"`. -extern const z_owned_encoding_t ENCODING_ZENOH_UINT128; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_UINT128; +const z_loaned_encoding_t *z_encoding_zenoh_uint128(void); // A VLE-encoded 32bit float. Binary representation uses *IEEE 754-2008* *binary32* . // // Constant alias for string: `"zenoh/float32"`. // // Usually used for types: `float`. -extern const z_owned_encoding_t ENCODING_ZENOH_FLOAT32; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_FLOAT32; +const z_loaned_encoding_t *z_encoding_zenoh_float32(void); // A VLE-encoded 64bit float. Binary representation uses *IEEE 754-2008* *binary64*. // // Constant alias for string: `"zenoh/float64"`. // // Usually used for types: `double`. -extern const z_owned_encoding_t ENCODING_ZENOH_FLOAT64; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_FLOAT64; +const z_loaned_encoding_t *z_encoding_zenoh_float64(void); // A boolean. `0` is `false`, `1` is `true`. Other values are invalid. // // Constant alias for string: `"zenoh/bool"`. // // Usually used for types: `bool`. -extern const z_owned_encoding_t ENCODING_ZENOH_BOOL; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_BOOL; +const z_loaned_encoding_t *z_encoding_zenoh_bool(void); // A UTF-8 string. // // Constant alias for string: `"zenoh/string"`. // // Usually used for types: `char[]`. -extern const z_owned_encoding_t ENCODING_ZENOH_STRING; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_STRING; +const z_loaned_encoding_t *z_encoding_zenoh_string(void); // A zenoh error. // // Constant alias for string: `"zenoh/error"`. // // Usually used for types: `z_reply_err_t`. -extern const z_owned_encoding_t ENCODING_ZENOH_ERROR; +extern const z_owned_encoding_t ZP_ENCODING_ZENOH_ERROR; +const z_loaned_encoding_t *z_encoding_zenoh_error(void); // - Below are Advanced types, may be supported in some of the Zenoh bindings. // An application-specific stream of bytes. // // Constant alias for string: `"application/octet-stream"`. extern const z_owned_encoding_t ENCODING_APPLICATION_OCTET_STREAM; +const z_loaned_encoding_t *z_encoding_application_octet_stream(void); // A textual file. // // Constant alias for string: `"text/plain"`. extern const z_owned_encoding_t ENCODING_TEXT_PLAIN; +const z_loaned_encoding_t *z_encoding_text_plain(void); // JSON data intended to be consumed by an application. // // Constant alias for string: `"application/json"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JSON; +const z_loaned_encoding_t *z_encoding_application_json(void); // JSON data intended to be human readable. // // Constant alias for string: `"text/json"`. extern const z_owned_encoding_t ENCODING_TEXT_JSON; +const z_loaned_encoding_t *z_encoding_text_json(void); // A Common Data Representation (CDR)-encoded data. // // Constant alias for string: `"application/cdr"`. extern const z_owned_encoding_t ENCODING_APPLICATION_CDR; +const z_loaned_encoding_t *z_encoding_application_cdr(void); // A Concise Binary Object Representation (CBOR)-encoded data. // // Constant alias for string: `"application/cbor"`. extern const z_owned_encoding_t ENCODING_APPLICATION_CBOR; +const z_loaned_encoding_t *z_encoding_application_cbor(void); // YAML data intended to be consumed by an application. // // Constant alias for string: `"application/yaml"`. extern const z_owned_encoding_t ENCODING_APPLICATION_YAML; +const z_loaned_encoding_t *z_encoding_application_yaml(void); // YAML data intended to be human readable. // // Constant alias for string: `"text/yaml"`. extern const z_owned_encoding_t ENCODING_TEXT_YAML; +const z_loaned_encoding_t *z_encoding_text_yaml(void); // JSON5 encoded data that are human readable. // // Constant alias for string: `"text/json5"`. extern const z_owned_encoding_t ENCODING_TEXT_JSON5; +const z_loaned_encoding_t *z_encoding_text_json5(void); // A Python object serialized using [pickle](https://docs.python.org/3/library/pickle.html). // // Constant alias for string: `"application/python-serialized-object"`. extern const z_owned_encoding_t ENCODING_APPLICATION_PYTHON_SERIALIZED_OBJECT; +const z_loaned_encoding_t *z_encoding_application_python_serialized_object(void); // An application-specific protobuf-encoded data. // // Constant alias for string: `"application/protobuf"`. extern const z_owned_encoding_t ENCODING_APPLICATION_PROTOBUF; +const z_loaned_encoding_t *z_encoding_application_protobuf(void); // A Java serialized object. // // Constant alias for string: `"application/java-serialized-object"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JAVA_SERIALIZED_OBJECT; +const z_loaned_encoding_t *z_encoding_application_java_serialized_object(void); // An [openmetrics](https://github.com/OpenObservability/OpenMetrics) data, common used by // [Prometheus](https://prometheus.io/). // // Constant alias for string: `"application/openmetrics-text"`. extern const z_owned_encoding_t ENCODING_APPLICATION_OPENMETRICS_TEXT; +const z_loaned_encoding_t *z_encoding_application_openmetrics_text(void); // A Portable Network Graphics (PNG) image. // // Constant alias for string: `"image/png"`. extern const z_owned_encoding_t ENCODING_IMAGE_PNG; +const z_loaned_encoding_t *z_encoding_image_png(void); // A Joint Photographic Experts Group (JPEG) image. // // Constant alias for string: `"image/jpeg"`. extern const z_owned_encoding_t ENCODING_IMAGE_JPEG; +const z_loaned_encoding_t *z_encoding_image_jpeg(void); // A Graphics Interchange Format (GIF) image. // // Constant alias for string: `"image/gif"`. extern const z_owned_encoding_t ENCODING_IMAGE_GIF; +const z_loaned_encoding_t *z_encoding_image_gif(void); // A BitMap (BMP) image. // // Constant alias for string: `"image/bmp"`. extern const z_owned_encoding_t ENCODING_IMAGE_BMP; +const z_loaned_encoding_t *z_encoding_image_bmp(void); // A Web Portable (WebP) image. // // Constant alias for string: `"image/webp"`. extern const z_owned_encoding_t ENCODING_IMAGE_WEBP; +const z_loaned_encoding_t *z_encoding_image_webp(void); // An XML file intended to be consumed by an application.. // // Constant alias for string: `"application/xml"`. extern const z_owned_encoding_t ENCODING_APPLICATION_XML; +const z_loaned_encoding_t *z_encoding_application_xml(void); // An encoded a list of tuples, each consisting of a name and a value. // // Constant alias for string: `"application/x-www-form-urlencoded"`. extern const z_owned_encoding_t ENCODING_APPLICATION_X_WWW_FORM_URLENCODED; +const z_loaned_encoding_t *z_encoding_application_x_www_form_urlencoded(void); // An HTML file. // // Constant alias for string: `"text/html"`. extern const z_owned_encoding_t ENCODING_TEXT_HTML; +const z_loaned_encoding_t *z_encoding_text_html(void); // An XML file that is human readable. // // Constant alias for string: `"text/xml"`. extern const z_owned_encoding_t ENCODING_TEXT_XML; +const z_loaned_encoding_t *z_encoding_text_xml(void); // A CSS file. // // Constant alias for string: `"text/css"`. extern const z_owned_encoding_t ENCODING_TEXT_CSS; +const z_loaned_encoding_t *z_encoding_text_css(void); // A JavaScript file. // // Constant alias for string: `"text/javascript"`. extern const z_owned_encoding_t ENCODING_TEXT_JAVASCRIPT; +const z_loaned_encoding_t *z_encoding_text_javascript(void); // A MarkDown file. // // Constant alias for string: `"text/markdown"`. extern const z_owned_encoding_t ENCODING_TEXT_MARKDOWN; +const z_loaned_encoding_t *z_encoding_text_markdown(void); // A CSV file. // // Constant alias for string: `"text/csv"`. extern const z_owned_encoding_t ENCODING_TEXT_CSV; +const z_loaned_encoding_t *z_encoding_text_csv(void); // An application-specific SQL query. // // Constant alias for string: `"application/sql"`. extern const z_owned_encoding_t ENCODING_APPLICATION_SQL; +const z_loaned_encoding_t *z_encoding_application_sql(void); // Constrained Application Protocol (CoAP) data intended for CoAP-to-HTTP and HTTP-to-CoAP proxies. // // Constant alias for string: `"application/coap-payload"`. extern const z_owned_encoding_t ENCODING_APPLICATION_COAP_PAYLOAD; +const z_loaned_encoding_t *z_encoding_application_coap_payload(void); // Defines a JSON document structure for expressing a sequence of operations to apply to a JSON document. // // Constant alias for string: `"application/json-patch+json"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JSON_PATCH_JSON; +const z_loaned_encoding_t *z_encoding_application_json_patch_json(void); // A JSON text sequence consists of any number of JSON texts, all encoded in UTF-8. // // Constant alias for string: `"application/json-seq"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JSON_SEQ; +const z_loaned_encoding_t *z_encoding_application_json_seq(void); // A JSONPath defines a string syntax for selecting and extracting JSON values from within a given JSON value. // // Constant alias for string: `"application/jsonpath"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JSONPATH; +const z_loaned_encoding_t *z_encoding_application_jsonpath(void); // A JSON Web Token (JWT). // // Constant alias for string: `"application/jwt"`. extern const z_owned_encoding_t ENCODING_APPLICATION_JWT; +const z_loaned_encoding_t *z_encoding_application_jwt(void); // An application-specific MPEG-4 encoded data, either audio or video. // // Constant alias for string: `"application/mp4"`. extern const z_owned_encoding_t ENCODING_APPLICATION_MP4; +const z_loaned_encoding_t *z_encoding_application_mp4(void); // A SOAP 1.2 message serialized as XML 1.0. // // Constant alias for string: `"application/soap+xml"`. extern const z_owned_encoding_t ENCODING_APPLICATION_SOAP_XML; +const z_loaned_encoding_t *z_encoding_application_soap_xml(void); // A YANG-encoded data commonly used by the Network Configuration Protocol (NETCONF). // // Constant alias for string: `"application/yang"`. extern const z_owned_encoding_t ENCODING_APPLICATION_YANG; +const z_loaned_encoding_t *z_encoding_application_yang(void); // A MPEG-4 Advanced Audio Coding (AAC) media. // // Constant alias for string: `"audio/aac"`. extern const z_owned_encoding_t ENCODING_AUDIO_AAC; +const z_loaned_encoding_t *z_encoding_audio_aac(void); // A Free Lossless Audio Codec (FLAC) media. // // Constant alias for string: `"audio/flac"`. extern const z_owned_encoding_t ENCODING_AUDIO_FLAC; +const z_loaned_encoding_t *z_encoding_audio_flac(void); // An audio codec defined in MPEG-1, MPEG-2, MPEG-4, or registered at the MP4 registration authority. // // Constant alias for string: `"audio/mp4"`. extern const z_owned_encoding_t ENCODING_AUDIO_MP4; +const z_loaned_encoding_t *z_encoding_audio_mp4(void); // An Ogg-encapsulated audio stream. // // Constant alias for string: `"audio/ogg"`. extern const z_owned_encoding_t ENCODING_AUDIO_OGG; +const z_loaned_encoding_t *z_encoding_audio_ogg(void); // A Vorbis-encoded audio stream. // // Constant alias for string: `"audio/vorbis"`. extern const z_owned_encoding_t ENCODING_AUDIO_VORBIS; +const z_loaned_encoding_t *z_encoding_audio_vorbis(void); // A h261-encoded video stream. // // Constant alias for string: `"video/h261"`. extern const z_owned_encoding_t ENCODING_VIDEO_H261; +const z_loaned_encoding_t *z_encoding_video_h261(void); // A h263-encoded video stream. // // Constant alias for string: `"video/h263"`. extern const z_owned_encoding_t ENCODING_VIDEO_H263; +const z_loaned_encoding_t *z_encoding_video_h263(void); // A h264-encoded video stream. // // Constant alias for string: `"video/h264"`. extern const z_owned_encoding_t ENCODING_VIDEO_H264; +const z_loaned_encoding_t *z_encoding_video_h264(void); // A h265-encoded video stream. // // Constant alias for string: `"video/h265"`. extern const z_owned_encoding_t ENCODING_VIDEO_H265; +const z_loaned_encoding_t *z_encoding_video_h265(void); // A h266-encoded video stream. // // Constant alias for string: `"video/h266"`. extern const z_owned_encoding_t ENCODING_VIDEO_H266; +const z_loaned_encoding_t *z_encoding_video_h266(void); // A video codec defined in MPEG-1, MPEG-2, MPEG-4, or registered at the MP4 registration authority. // // Constant alias for string: `"video/mp4"`. extern const z_owned_encoding_t ENCODING_VIDEO_MP4; +const z_loaned_encoding_t *z_encoding_video_mp4(void); // An Ogg-encapsulated video stream. // // Constant alias for string: `"video/ogg"`. extern const z_owned_encoding_t ENCODING_VIDEO_OGG; +const z_loaned_encoding_t *z_encoding_video_ogg(void); // An uncompressed, studio-quality video stream. // // Constant alias for string: `"video/raw"`. extern const z_owned_encoding_t ENCODING_VIDEO_RAW; +const z_loaned_encoding_t *z_encoding_video_raw(void); // A VP8-encoded video stream. // // Constant alias for string: `"video/vp8"`. extern const z_owned_encoding_t ENCODING_VIDEO_VP8; +const z_loaned_encoding_t *z_encoding_video_vp8(void); // A VP9-encoded video stream. // // Constant alias for string: `"video/vp9"`. extern const z_owned_encoding_t ENCODING_VIDEO_VP9; +const z_loaned_encoding_t *z_encoding_video_vp9(void); #endif #ifdef __cplusplus diff --git a/src/api/encoding.c b/src/api/encoding.c index 15e3a6c22..cf21bf035 100644 --- a/src/api/encoding.c +++ b/src/api/encoding.c @@ -23,79 +23,80 @@ #if Z_FEATURE_ENCODING_VALUES == 1 #define ENCODING_SCHEMA_SEPARATOR ';' -#define ENCODING_CONSTANT_MACRO(_name, _id) \ - const z_owned_encoding_t _name = { \ +#define ENCODING_CONSTANT_MACRO(_cname, _fname, _id) \ + const z_owned_encoding_t ZP_ENCODING_##_cname = { \ ._val = { \ .id = _id, \ .schema = {._slice = {.start = NULL, .len = 0, ._delete_context = {.deleter = NULL, .context = NULL}}}, \ - }} + }}; \ + const z_loaned_encoding_t *z_encoding_##_fname(void) { return &ZP_ENCODING_##_cname._val; } -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_BYTES, 0); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_INT8, 1); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_INT16, 2); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_INT32, 3); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_INT64, 4); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_INT128, 5); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_UINT8, 6); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_UINT16, 7); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_UINT32, 8); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_UINT64, 9); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_UINT128, 10); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_FLOAT32, 11); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_FLOAT64, 12); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_BOOL, 13); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_STRING, 14); -ENCODING_CONSTANT_MACRO(ENCODING_ZENOH_ERROR, 15); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_OCTET_STREAM, 16); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_PLAIN, 17); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JSON, 18); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_JSON, 19); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_CDR, 20); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_CBOR, 21); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_YAML, 22); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_YAML, 23); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_JSON5, 24); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_PYTHON_SERIALIZED_OBJECT, 25); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_PROTOBUF, 26); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JAVA_SERIALIZED_OBJECT, 27); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_OPENMETRICS_TEXT, 28); -ENCODING_CONSTANT_MACRO(ENCODING_IMAGE_PNG, 29); -ENCODING_CONSTANT_MACRO(ENCODING_IMAGE_JPEG, 30); -ENCODING_CONSTANT_MACRO(ENCODING_IMAGE_GIF, 31); -ENCODING_CONSTANT_MACRO(ENCODING_IMAGE_BMP, 32); -ENCODING_CONSTANT_MACRO(ENCODING_IMAGE_WEBP, 33); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_XML, 34); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_X_WWW_FORM_URLENCODED, 35); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_HTML, 36); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_XML, 37); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_CSS, 38); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_JAVASCRIPT, 39); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_MARKDOWN, 40); -ENCODING_CONSTANT_MACRO(ENCODING_TEXT_CSV, 41); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_SQL, 42); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_COAP_PAYLOAD, 43); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JSON_PATCH_JSON, 44); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JSON_SEQ, 45); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JSONPATH, 46); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_JWT, 47); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_MP4, 48); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_SOAP_XML, 49); -ENCODING_CONSTANT_MACRO(ENCODING_APPLICATION_YANG, 50); -ENCODING_CONSTANT_MACRO(ENCODING_AUDIO_AAC, 51); -ENCODING_CONSTANT_MACRO(ENCODING_AUDIO_FLAC, 52); -ENCODING_CONSTANT_MACRO(ENCODING_AUDIO_MP4, 53); -ENCODING_CONSTANT_MACRO(ENCODING_AUDIO_OGG, 54); -ENCODING_CONSTANT_MACRO(ENCODING_AUDIO_VORBIS, 55); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_H261, 56); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_H263, 57); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_H264, 58); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_H265, 59); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_H266, 60); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_MP4, 61); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_OGG, 62); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_RAW, 63); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_VP8, 64); -ENCODING_CONSTANT_MACRO(ENCODING_VIDEO_VP9, 65); +ENCODING_CONSTANT_MACRO(ZENOH_BYTES, zenoh_bytes, 0) +ENCODING_CONSTANT_MACRO(ZENOH_INT8, zenoh_int8, 1) +ENCODING_CONSTANT_MACRO(ZENOH_INT16, zenoh_int16, 2) +ENCODING_CONSTANT_MACRO(ZENOH_INT32, zenoh_int32, 3) +ENCODING_CONSTANT_MACRO(ZENOH_INT64, zenoh_int64, 4) +ENCODING_CONSTANT_MACRO(ZENOH_INT128, zenoh_int128, 5) +ENCODING_CONSTANT_MACRO(ZENOH_UINT8, zenoh_uint8, 6) +ENCODING_CONSTANT_MACRO(ZENOH_UINT16, zenoh_uint16, 7) +ENCODING_CONSTANT_MACRO(ZENOH_UINT32, zenoh_uint32, 8) +ENCODING_CONSTANT_MACRO(ZENOH_UINT64, zenoh_uint64, 9) +ENCODING_CONSTANT_MACRO(ZENOH_UINT128, zenoh_uint128, 10) +ENCODING_CONSTANT_MACRO(ZENOH_FLOAT32, zenoh_float32, 11) +ENCODING_CONSTANT_MACRO(ZENOH_FLOAT64, zenoh_float64, 12) +ENCODING_CONSTANT_MACRO(ZENOH_BOOL, zenoh_bool, 13) +ENCODING_CONSTANT_MACRO(ZENOH_STRING, zenoh_string, 14) +ENCODING_CONSTANT_MACRO(ZENOH_ERROR, zenoh_error, 15) +ENCODING_CONSTANT_MACRO(APPLICATION_OCTET_STREAM, application_octet_stream, 16) +ENCODING_CONSTANT_MACRO(TEXT_PLAIN, text_plain, 17) +ENCODING_CONSTANT_MACRO(APPLICATION_JSON, application_json, 18) +ENCODING_CONSTANT_MACRO(TEXT_JSON, text_json, 19) +ENCODING_CONSTANT_MACRO(APPLICATION_CDR, application_cdr, 20) +ENCODING_CONSTANT_MACRO(APPLICATION_CBOR, application_cbor, 21) +ENCODING_CONSTANT_MACRO(APPLICATION_YAML, application_yaml, 22) +ENCODING_CONSTANT_MACRO(TEXT_YAML, text_yaml, 23) +ENCODING_CONSTANT_MACRO(TEXT_JSON5, text_json5, 24) +ENCODING_CONSTANT_MACRO(APPLICATION_PYTHON_SERIALIZED_OBJECT, application_python_serialized_object, 25) +ENCODING_CONSTANT_MACRO(APPLICATION_PROTOBUF, application_protobuf, 26) +ENCODING_CONSTANT_MACRO(APPLICATION_JAVA_SERIALIZED_OBJECT, application_java_serialized_object, 27) +ENCODING_CONSTANT_MACRO(APPLICATION_OPENMETRICS_TEXT, application_openmetrics_text, 28) +ENCODING_CONSTANT_MACRO(IMAGE_PNG, image_png, 29) +ENCODING_CONSTANT_MACRO(IMAGE_JPEG, image_jpeg, 30) +ENCODING_CONSTANT_MACRO(IMAGE_GIF, image_gif, 31) +ENCODING_CONSTANT_MACRO(IMAGE_BMP, image_bmp, 32) +ENCODING_CONSTANT_MACRO(IMAGE_WEBP, image_webp, 33) +ENCODING_CONSTANT_MACRO(APPLICATION_XML, application_xml, 34) +ENCODING_CONSTANT_MACRO(APPLICATION_X_WWW_FORM_URLENCODED, application_x_www_form_urlencoded, 35) +ENCODING_CONSTANT_MACRO(TEXT_HTML, text_html, 36) +ENCODING_CONSTANT_MACRO(TEXT_XML, text_xml, 37) +ENCODING_CONSTANT_MACRO(TEXT_CSS, text_css, 38) +ENCODING_CONSTANT_MACRO(TEXT_JAVASCRIPT, text_javascript, 39) +ENCODING_CONSTANT_MACRO(TEXT_MARKDOWN, text_markdown, 40) +ENCODING_CONSTANT_MACRO(TEXT_CSV, text_csv, 41) +ENCODING_CONSTANT_MACRO(APPLICATION_SQL, application_sql, 42) +ENCODING_CONSTANT_MACRO(APPLICATION_COAP_PAYLOAD, application_coap_payload, 43) +ENCODING_CONSTANT_MACRO(APPLICATION_JSON_PATCH_JSON, application_json_patch_json, 44) +ENCODING_CONSTANT_MACRO(APPLICATION_JSON_SEQ, application_json_seq, 45) +ENCODING_CONSTANT_MACRO(APPLICATION_JSONPATH, application_jsonpath, 46) +ENCODING_CONSTANT_MACRO(APPLICATION_JWT, application_jwt, 47) +ENCODING_CONSTANT_MACRO(APPLICATION_MP4, application_mp4, 48) +ENCODING_CONSTANT_MACRO(APPLICATION_SOAP_XML, application_soap_xml, 49) +ENCODING_CONSTANT_MACRO(APPLICATION_YANG, application_yang, 50) +ENCODING_CONSTANT_MACRO(AUDIO_AAC, audio_aac, 51) +ENCODING_CONSTANT_MACRO(AUDIO_FLAC, audio_flac, 52) +ENCODING_CONSTANT_MACRO(AUDIO_MP4, audio_mp4, 53) +ENCODING_CONSTANT_MACRO(AUDIO_OGG, audio_ogg, 54) +ENCODING_CONSTANT_MACRO(AUDIO_VORBIS, audio_vorbis, 55) +ENCODING_CONSTANT_MACRO(VIDEO_H261, video_h261, 56) +ENCODING_CONSTANT_MACRO(VIDEO_H263, video_h263, 57) +ENCODING_CONSTANT_MACRO(VIDEO_H264, video_h264, 58) +ENCODING_CONSTANT_MACRO(VIDEO_H265, video_h265, 59) +ENCODING_CONSTANT_MACRO(VIDEO_H266, video_h266, 60) +ENCODING_CONSTANT_MACRO(VIDEO_MP4, video_mp4, 61) +ENCODING_CONSTANT_MACRO(VIDEO_OGG, video_ogg, 62) +ENCODING_CONSTANT_MACRO(VIDEO_RAW, video_raw, 63) +ENCODING_CONSTANT_MACRO(VIDEO_VP8, video_vp8, 64) +ENCODING_CONSTANT_MACRO(VIDEO_VP9, video_vp9, 65) const char *ENCODING_VALUES_ID_TO_STR[] = { "zenoh/bytes",