From 83497424c47a1c20b11f9d3aadfc8b5b2c2a01a6 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Tue, 1 Oct 2024 15:46:14 +0200 Subject: [PATCH] Add z_encoding_loan_default --- include/zenoh-pico/api/encoding.h | 5 +++++ src/api/encoding.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/zenoh-pico/api/encoding.h b/include/zenoh-pico/api/encoding.h index 0e46f4f46..e7df22dfe 100644 --- a/include/zenoh-pico/api/encoding.h +++ b/include/zenoh-pico/api/encoding.h @@ -534,6 +534,11 @@ extern const z_owned_encoding_t ENCODING_VIDEO_VP8; const z_loaned_encoding_t *z_encoding_video_vp9(void); extern const z_owned_encoding_t ENCODING_VIDEO_VP9; +/** + * Returns a loaned default `z_loaned_encoding_t`. + */ +const z_loaned_encoding_t *z_encoding_loan_default(void); + #endif #ifdef __cplusplus diff --git a/src/api/encoding.c b/src/api/encoding.c index cf21bf035..6ee239e7c 100644 --- a/src/api/encoding.c +++ b/src/api/encoding.c @@ -282,3 +282,5 @@ z_result_t z_encoding_to_string(const z_loaned_encoding_t *encoding, z_owned_str _z_encoding_convert_into_string(encoding, s); return _Z_RES_OK; } + +const z_loaned_encoding_t *z_encoding_loan_default(void) { return z_encoding_zenoh_bytes(); }