From dac018294e7351db694a6ef4bbd7fcf508b21a32 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Mon, 10 Jun 2024 12:35:05 +0200 Subject: [PATCH] Rename z_view_str_wrap to z_view_string_wrap --- examples/arduino/z_get.ino | 2 +- examples/arduino/z_queryable.ino | 2 +- examples/espidf/z_get.c | 2 +- examples/espidf/z_queryable.c | 2 +- examples/freertos_plus_tcp/z_get.c | 2 +- examples/freertos_plus_tcp/z_queryable.c | 2 +- examples/mbed/z_get.cpp | 2 +- examples/mbed/z_queryable.cpp | 2 +- examples/unix/c11/z_get.c | 2 +- examples/unix/c11/z_get_channel.c | 2 +- examples/unix/c11/z_queryable.c | 2 +- examples/unix/c11/z_queryable_channel.c | 2 +- examples/unix/c99/z_get.c | 2 +- examples/unix/c99/z_queryable.c | 2 +- examples/windows/z_get.c | 2 +- examples/windows/z_queryable.c | 2 +- examples/zephyr/z_get.c | 2 +- examples/zephyr/z_queryable.c | 2 +- include/zenoh-pico/api/primitives.h | 2 +- src/api/api.c | 2 +- tests/z_api_alignment_test.c | 2 +- tests/z_client_test.c | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/arduino/z_get.ino b/examples/arduino/z_get.ino index 2e172996f..a4a5a9f2d 100644 --- a/examples/arduino/z_get.ino +++ b/examples/arduino/z_get.ino @@ -118,7 +118,7 @@ void loop() { // Value encoding if (strcmp(VALUE, "") != 0) { z_view_string_t value_str; - z_view_str_wrap(&value_str, VALUE); + z_view_string_wrap(&value_str, VALUE); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_view_string_loan(&value_str)); opts.payload = &payload; diff --git a/examples/arduino/z_queryable.ino b/examples/arduino/z_queryable.ino index d4751dab5..da225a613 100644 --- a/examples/arduino/z_queryable.ino +++ b/examples/arduino/z_queryable.ino @@ -58,7 +58,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) { // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, VALUE); + z_view_string_wrap(&reply_str, VALUE); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_view_string_loan(&reply_str)); diff --git a/examples/espidf/z_get.c b/examples/espidf/z_get.c index eb06f20f1..7c53b86b5 100644 --- a/examples/espidf/z_get.c +++ b/examples/espidf/z_get.c @@ -165,7 +165,7 @@ void app_main() { // Value encoding if (strcmp(VALUE, "") != 0) { z_view_string_t value_str; - z_view_str_wrap(&value_str, VALUE); + z_view_string_wrap(&value_str, VALUE); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/espidf/z_queryable.c b/examples/espidf/z_queryable.c index 48b09ff8b..d10e25f57 100644 --- a/examples/espidf/z_queryable.c +++ b/examples/espidf/z_queryable.c @@ -121,7 +121,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { z_view_keyexpr_from_string_unchecked(&ke, KEYEXPR); // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, VALUE); + z_view_string_wrap(&reply_str, VALUE); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/examples/freertos_plus_tcp/z_get.c b/examples/freertos_plus_tcp/z_get.c index 1d53dab41..d91bb6065 100644 --- a/examples/freertos_plus_tcp/z_get.c +++ b/examples/freertos_plus_tcp/z_get.c @@ -89,7 +89,7 @@ void app_main(void) { // Value encoding if (strcmp(VALUE, "") != 0) { z_view_string_t value_str; - z_view_str_wrap(&value_str, VALUE); + z_view_string_wrap(&value_str, VALUE); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/freertos_plus_tcp/z_queryable.c b/examples/freertos_plus_tcp/z_queryable.c index 20d72f7eb..ca3444034 100644 --- a/examples/freertos_plus_tcp/z_queryable.c +++ b/examples/freertos_plus_tcp/z_queryable.c @@ -49,7 +49,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { z_query_reply_options_default(&options); // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, VALUE); + z_view_string_wrap(&reply_str, VALUE); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/examples/mbed/z_get.cpp b/examples/mbed/z_get.cpp index 699186612..ec2f2cef5 100644 --- a/examples/mbed/z_get.cpp +++ b/examples/mbed/z_get.cpp @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // Value encoding if (strcmp(VALUE, "") != 0) { z_view_string_t value_str; - z_view_str_wrap(&value_str, VALUE); + z_view_string_wrap(&value_str, VALUE); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_view_string_loan(&value_str)); opts.payload = &payload; diff --git a/examples/mbed/z_queryable.cpp b/examples/mbed/z_queryable.cpp index 5c09bf79f..7be7f79da 100644 --- a/examples/mbed/z_queryable.cpp +++ b/examples/mbed/z_queryable.cpp @@ -49,7 +49,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { } // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, VALUE); + z_view_string_wrap(&reply_str, VALUE); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_view_string_loan(&reply_str)); diff --git a/examples/unix/c11/z_get.c b/examples/unix/c11/z_get.c index f7677e3b3..6066ac2e7 100644 --- a/examples/unix/c11/z_get.c +++ b/examples/unix/c11/z_get.c @@ -137,7 +137,7 @@ int main(int argc, char **argv) { if (value != NULL) { z_view_string_t value_str; - z_view_str_wrap(&value_str, value); + z_view_string_wrap(&value_str, value); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/unix/c11/z_get_channel.c b/examples/unix/c11/z_get_channel.c index 4f74b1848..e2eef163c 100644 --- a/examples/unix/c11/z_get_channel.c +++ b/examples/unix/c11/z_get_channel.c @@ -93,7 +93,7 @@ int main(int argc, char **argv) { // Value encoding if (value != NULL) { z_view_string_t value_str; - z_view_str_wrap(&value_str, value); + z_view_string_wrap(&value_str, value); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/unix/c11/z_queryable.c b/examples/unix/c11/z_queryable.c index 17263e5d8..73ee65683 100644 --- a/examples/unix/c11/z_queryable.c +++ b/examples/unix/c11/z_queryable.c @@ -72,7 +72,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, value); + z_view_string_wrap(&reply_str, value); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/examples/unix/c11/z_queryable_channel.c b/examples/unix/c11/z_queryable_channel.c index 9038790b2..05091d334 100644 --- a/examples/unix/c11/z_queryable_channel.c +++ b/examples/unix/c11/z_queryable_channel.c @@ -117,7 +117,7 @@ int main(int argc, char **argv) { z_query_reply_options_default(&options); // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, value); + z_view_string_wrap(&reply_str, value); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/examples/unix/c99/z_get.c b/examples/unix/c99/z_get.c index 12c5bc3f6..e11827800 100644 --- a/examples/unix/c99/z_get.c +++ b/examples/unix/c99/z_get.c @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // Value encoding if (value != NULL) { z_view_string_t value_str; - z_view_str_wrap(&value_str, value); + z_view_string_wrap(&value_str, value); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_view_string_loan(&value_str)); opts.payload = &payload; diff --git a/examples/unix/c99/z_queryable.c b/examples/unix/c99/z_queryable.c index 08af246ab..9bdb4a910 100644 --- a/examples/unix/c99/z_queryable.c +++ b/examples/unix/c99/z_queryable.c @@ -47,7 +47,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { options.encoding = z_encoding_move(&encoding); // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, value); + z_view_string_wrap(&reply_str, value); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_view_string_loan(&reply_str)); diff --git a/examples/windows/z_get.c b/examples/windows/z_get.c index 9292ebdb1..42fdfea55 100644 --- a/examples/windows/z_get.c +++ b/examples/windows/z_get.c @@ -88,7 +88,7 @@ int main(int argc, char **argv) { // Value encoding if (value != NULL) { z_view_string_t value_str; - z_view_str_wrap(&value_str, value); + z_view_string_wrap(&value_str, value); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/windows/z_queryable.c b/examples/windows/z_queryable.c index 91c9c8117..a6130c3b7 100644 --- a/examples/windows/z_queryable.c +++ b/examples/windows/z_queryable.c @@ -47,7 +47,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { options.encoding = z_move(encoding); // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, value); + z_view_string_wrap(&reply_str, value); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/examples/zephyr/z_get.c b/examples/zephyr/z_get.c index 2635eb1ef..397b3d340 100644 --- a/examples/zephyr/z_get.c +++ b/examples/zephyr/z_get.c @@ -83,7 +83,7 @@ int main(int argc, char **argv) { // Value encoding if (strcmp(VALUE, "") != 0) { z_view_string_t value_str; - z_view_str_wrap(&value_str, VALUE); + z_view_string_wrap(&value_str, VALUE); z_owned_bytes_t payload; z_bytes_encode_from_string(&payload, z_loan(value_str)); opts.payload = &payload; diff --git a/examples/zephyr/z_queryable.c b/examples/zephyr/z_queryable.c index 61e8710f8..f210cf1b3 100644 --- a/examples/zephyr/z_queryable.c +++ b/examples/zephyr/z_queryable.c @@ -49,7 +49,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) { } // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, VALUE); + z_view_string_wrap(&reply_str, VALUE); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index eb2a62e84..0653ffab6 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -44,7 +44,7 @@ extern "C" { * Return: * ``0`` if creation successful, ``negative value`` otherwise. */ -int8_t z_view_str_wrap(z_view_string_t *str, const char *value); +int8_t z_view_string_wrap(z_view_string_t *str, const char *value); /** * Builds a :c:type:`z_keyexpr_t` from a null-terminated string. diff --git a/src/api/api.c b/src/api/api.c index 0a6224bc5..f2bed7e36 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -43,7 +43,7 @@ /********* Data Types Handlers *********/ -int8_t z_view_str_wrap(z_view_string_t *str, const char *value) { +int8_t z_view_string_wrap(z_view_string_t *str, const char *value) { str->_val = _z_string_wrap((char *)value); return _Z_RES_OK; } diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 30e9ad42e..1204092f4 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -84,7 +84,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) { // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, value); + z_view_string_wrap(&reply_str, value); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str)); diff --git a/tests/z_client_test.c b/tests/z_client_test.c index f23d1f8ea..087ff18f7 100644 --- a/tests/z_client_test.c +++ b/tests/z_client_test.c @@ -63,7 +63,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) { // Reply value encoding z_view_string_t reply_str; - z_view_str_wrap(&reply_str, res); + z_view_string_wrap(&reply_str, res); z_owned_bytes_t reply_payload; z_bytes_encode_from_string(&reply_payload, z_loan(reply_str));