diff --git a/docs/api.rst b/docs/api.rst index 48f16db4c..230f31f39 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -872,7 +872,7 @@ Functions .. autocfunction:: primitives.h::z_put .. autocfunction:: primitives.h::z_delete -.. autocfunction:: primitives.h::z_declare_publisher +.. autocfunction:: primitives.h::z_publisher_declare .. autocfunction:: primitives.h::z_publisher_put .. autocfunction:: primitives.h::z_publisher_delete .. autocfunction:: primitives.h::z_publisher_keyexpr @@ -914,8 +914,8 @@ Option Types Functions --------- -.. autocfunction:: primitives.h::z_declare_subscriber -.. autocfunction:: primitives.h::z_declare_background_subscriber +.. autocfunction:: primitives.h::z_subscriber_declare +.. autocfunction:: primitives.h::z_subscriber_declare_background .. autocfunction:: primitives.h::z_subscriber_options_default .. autocfunction:: primitives.h::z_subscriber_keyexpr @@ -959,8 +959,8 @@ Option Types Functions --------- -.. autocfunction:: primitives.h::z_declare_queryable -.. autocfunction:: primitives.h::z_declare_background_queryable +.. autocfunction:: primitives.h::z_queryable_declare +.. autocfunction:: primitives.h::z_queryable_declare_background .. autocfunction:: primitives.h::z_queryable_options_default .. autocfunction:: primitives.h::z_query_reply_options_default diff --git a/examples/arduino/z_pub.ino b/examples/arduino/z_pub.ino index d738a6c3e..009b64370 100644 --- a/examples/arduino/z_pub.ino +++ b/examples/arduino/z_pub.ino @@ -84,7 +84,7 @@ void setup() { Serial.println("..."); z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_publisher(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { Serial.println("Unable to declare publisher for key expression!"); while (1) { ; diff --git a/examples/arduino/z_pull.ino b/examples/arduino/z_pull.ino index 9ee704372..8cb13a715 100644 --- a/examples/arduino/z_pull.ino +++ b/examples/arduino/z_pull.ino @@ -84,7 +84,7 @@ void setup() { z_ring_channel_sample_new(&closure, &handler, SIZE); z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), NULL) < 0) { Serial.println("Unable to declare subscriber."); return; diff --git a/examples/arduino/z_queryable.ino b/examples/arduino/z_queryable.ino index bc844df48..0b2a89078 100644 --- a/examples/arduino/z_queryable.ino +++ b/examples/arduino/z_queryable.ino @@ -112,7 +112,7 @@ void setup() { z_closure_query(&callback, query_handler, NULL, NULL); z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_queryable(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), + if (z_queryable_declare(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), NULL) < 0) { Serial.println("Unable to declare queryable."); while (1) { diff --git a/examples/arduino/z_sub.ino b/examples/arduino/z_sub.ino index fcc1b7491..e3ec32ada 100644 --- a/examples/arduino/z_sub.ino +++ b/examples/arduino/z_sub.ino @@ -99,7 +99,7 @@ void setup() { z_closure_sample(&callback, data_handler, NULL, NULL); z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), NULL) < 0) { Serial.println("Unable to declare subscriber."); while (1) { diff --git a/examples/espidf/z_pub.c b/examples/espidf/z_pub.c index 6219809e6..335f88418 100644 --- a/examples/espidf/z_pub.c +++ b/examples/espidf/z_pub.c @@ -143,7 +143,7 @@ void app_main() { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); exit(-1); } diff --git a/examples/espidf/z_pull.c b/examples/espidf/z_pull.c index 3035dd866..27bb1acf7 100644 --- a/examples/espidf/z_pull.c +++ b/examples/espidf/z_pull.c @@ -151,7 +151,7 @@ void app_main() { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); } diff --git a/examples/espidf/z_queryable.c b/examples/espidf/z_queryable.c index 2314bba2f..0d8ef30fb 100644 --- a/examples/espidf/z_queryable.c +++ b/examples/espidf/z_queryable.c @@ -173,7 +173,7 @@ void app_main() { z_owned_queryable_t qable; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare queryable.\n"); exit(-1); } diff --git a/examples/espidf/z_sub.c b/examples/espidf/z_sub.c index 2878fb93d..6a9d831e8 100644 --- a/examples/espidf/z_sub.c +++ b/examples/espidf/z_sub.c @@ -155,7 +155,7 @@ void app_main() { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); } diff --git a/examples/freertos_plus_tcp/z_pub.c b/examples/freertos_plus_tcp/z_pub.c index 61c39b400..e5cb3f3a4 100644 --- a/examples/freertos_plus_tcp/z_pub.c +++ b/examples/freertos_plus_tcp/z_pub.c @@ -86,7 +86,7 @@ void app_main(void) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return; } diff --git a/examples/freertos_plus_tcp/z_pub_st.c b/examples/freertos_plus_tcp/z_pub_st.c index 250f7f2d5..1aa73034d 100644 --- a/examples/freertos_plus_tcp/z_pub_st.c +++ b/examples/freertos_plus_tcp/z_pub_st.c @@ -51,7 +51,7 @@ void app_main(void) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return; } diff --git a/examples/freertos_plus_tcp/z_pull.c b/examples/freertos_plus_tcp/z_pull.c index 8a3e2b236..c417e45a6 100644 --- a/examples/freertos_plus_tcp/z_pull.c +++ b/examples/freertos_plus_tcp/z_pull.c @@ -60,7 +60,7 @@ void app_main(void) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return; } diff --git a/examples/freertos_plus_tcp/z_queryable.c b/examples/freertos_plus_tcp/z_queryable.c index 850965332..17776cd1c 100644 --- a/examples/freertos_plus_tcp/z_queryable.c +++ b/examples/freertos_plus_tcp/z_queryable.c @@ -87,7 +87,7 @@ void app_main(void) { z_owned_closure_query_t callback; z_closure(&callback, query_handler); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create queryable.\n"); return; } diff --git a/examples/freertos_plus_tcp/z_sub.c b/examples/freertos_plus_tcp/z_sub.c index afd358aae..26222feda 100644 --- a/examples/freertos_plus_tcp/z_sub.c +++ b/examples/freertos_plus_tcp/z_sub.c @@ -67,7 +67,7 @@ void app_main(void) { z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return; } diff --git a/examples/freertos_plus_tcp/z_sub_st.c b/examples/freertos_plus_tcp/z_sub_st.c index 7b855d913..6539e8c81 100644 --- a/examples/freertos_plus_tcp/z_sub_st.c +++ b/examples/freertos_plus_tcp/z_sub_st.c @@ -64,7 +64,7 @@ void app_main(void) { z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return; } diff --git a/examples/mbed/z_pub.cpp b/examples/mbed/z_pub.cpp index 206502fae..b6622f542 100644 --- a/examples/mbed/z_pub.cpp +++ b/examples/mbed/z_pub.cpp @@ -63,7 +63,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_publisher(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); exit(-1); } diff --git a/examples/mbed/z_pull.cpp b/examples/mbed/z_pull.cpp index 6e8d56f42..fbf9914d2 100644 --- a/examples/mbed/z_pull.cpp +++ b/examples/mbed/z_pull.cpp @@ -71,7 +71,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; diff --git a/examples/mbed/z_queryable.cpp b/examples/mbed/z_queryable.cpp index 866c75b2e..09471f18f 100644 --- a/examples/mbed/z_queryable.cpp +++ b/examples/mbed/z_queryable.cpp @@ -91,7 +91,7 @@ int main(int argc, char **argv) { z_owned_queryable_t qable; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_queryable(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), + if (z_queryable_declare(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), NULL) < 0) { printf("Unable to declare queryable.\n"); exit(-1); diff --git a/examples/mbed/z_sub.cpp b/examples/mbed/z_sub.cpp index fcaed73d9..fccb89594 100644 --- a/examples/mbed/z_sub.cpp +++ b/examples/mbed/z_sub.cpp @@ -75,7 +75,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); diff --git a/examples/unix/c11/z_ping.c b/examples/unix/c11/z_ping.c index 96aaaa1bd..fd05a6f6a 100644 --- a/examples/unix/c11/z_ping.c +++ b/examples/unix/c11/z_ping.c @@ -83,7 +83,7 @@ int main(int argc, char** argv) { z_view_keyexpr_from_str_unchecked(&pong, "test/pong"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(session), z_loan(ping), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(session), z_loan(ping), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -91,7 +91,7 @@ int main(int argc, char** argv) { z_owned_closure_sample_t respond; z_closure(&respond, callback, drop, NULL); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_loan(session), z_loan(pong), z_move(respond), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(session), z_loan(pong), z_move(respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; } diff --git a/examples/unix/c11/z_pong.c b/examples/unix/c11/z_pong.c index 901ed4ba5..5dc3a292b 100644 --- a/examples/unix/c11/z_pong.c +++ b/examples/unix/c11/z_pong.c @@ -51,7 +51,7 @@ int main(int argc, char** argv) { z_view_keyexpr_t pong; z_view_keyexpr_from_str_unchecked(&pong, "test/pong"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(session), z_loan(pong), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(session), z_loan(pong), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -60,7 +60,7 @@ int main(int argc, char** argv) { z_view_keyexpr_from_str_unchecked(&ping, "test/ping"); z_owned_closure_sample_t respond; z_closure(&respond, callback, drop, (void*)(&pub)); - if (z_declare_background_subscriber(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) { + if (z_subscriber_declare_background(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; } diff --git a/examples/unix/c11/z_pub.c b/examples/unix/c11/z_pub.c index 94d2e452e..a4151f6f4 100644 --- a/examples/unix/c11/z_pub.c +++ b/examples/unix/c11/z_pub.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/unix/c11/z_pub_attachment.c b/examples/unix/c11/z_pub_attachment.c index bc4291415..66056bd06 100644 --- a/examples/unix/c11/z_pub_attachment.c +++ b/examples/unix/c11/z_pub_attachment.c @@ -105,7 +105,7 @@ int main(int argc, char **argv) { z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/unix/c11/z_pub_st.c b/examples/unix/c11/z_pub_st.c index 74d1bc0c5..379ddcebf 100644 --- a/examples/unix/c11/z_pub_st.c +++ b/examples/unix/c11/z_pub_st.c @@ -84,7 +84,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/unix/c11/z_pub_thr.c b/examples/unix/c11/z_pub_thr.c index 5a41736e3..6dc4dba68 100644 --- a/examples/unix/c11/z_pub_thr.c +++ b/examples/unix/c11/z_pub_thr.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); exit(-1); } diff --git a/examples/unix/c11/z_pull.c b/examples/unix/c11/z_pull.c index 6fa0b5776..094fb5710 100644 --- a/examples/unix/c11/z_pull.c +++ b/examples/unix/c11/z_pull.c @@ -79,7 +79,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/unix/c11/z_queryable.c b/examples/unix/c11/z_queryable.c index fb0690691..16c6f5fc0 100644 --- a/examples/unix/c11/z_queryable.c +++ b/examples/unix/c11/z_queryable.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) { z_owned_closure_query_t callback; z_closure(&callback, query_handler); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create queryable.\n"); return -1; } diff --git a/examples/unix/c11/z_queryable_attachment.c b/examples/unix/c11/z_queryable_attachment.c index 1859fc4d5..e18e7047f 100644 --- a/examples/unix/c11/z_queryable_attachment.c +++ b/examples/unix/c11/z_queryable_attachment.c @@ -188,7 +188,7 @@ int main(int argc, char **argv) { z_owned_closure_query_t callback; z_closure(&callback, query_handler); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create queryable.\n"); return -1; } diff --git a/examples/unix/c11/z_queryable_channel.c b/examples/unix/c11/z_queryable_channel.c index 1e8739644..1b9a0f520 100644 --- a/examples/unix/c11/z_queryable_channel.c +++ b/examples/unix/c11/z_queryable_channel.c @@ -92,7 +92,7 @@ int main(int argc, char **argv) { z_owned_ring_handler_query_t handler; z_ring_channel_query_new(&closure, &handler, 10); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to create queryable.\n"); return -1; } diff --git a/examples/unix/c11/z_sub.c b/examples/unix/c11/z_sub.c index d409b7c24..2d2caa945 100644 --- a/examples/unix/c11/z_sub.c +++ b/examples/unix/c11/z_sub.c @@ -103,7 +103,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/unix/c11/z_sub_attachment.c b/examples/unix/c11/z_sub_attachment.c index da3b64dbe..7460969be 100644 --- a/examples/unix/c11/z_sub_attachment.c +++ b/examples/unix/c11/z_sub_attachment.c @@ -154,7 +154,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/unix/c11/z_sub_channel.c b/examples/unix/c11/z_sub_channel.c index 07a38f725..66fa24de8 100644 --- a/examples/unix/c11/z_sub_channel.c +++ b/examples/unix/c11/z_sub_channel.c @@ -72,7 +72,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/unix/c11/z_sub_st.c b/examples/unix/c11/z_sub_st.c index 299f65364..fe3471ec9 100644 --- a/examples/unix/c11/z_sub_st.c +++ b/examples/unix/c11/z_sub_st.c @@ -95,7 +95,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/unix/c11/z_sub_thr.c b/examples/unix/c11/z_sub_thr.c index 1a0d0075f..b276b7f0d 100644 --- a/examples/unix/c11/z_sub_thr.c +++ b/examples/unix/c11/z_sub_thr.c @@ -97,7 +97,7 @@ int main(int argc, char **argv) { z_closure(&callback, on_sample, drop_stats, (void *)context); z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_background_subscriber(z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare_background(z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create subscriber.\n"); exit(-1); } diff --git a/examples/unix/c99/z_ping.c b/examples/unix/c99/z_ping.c index f0eef8dae..bc9d4f212 100644 --- a/examples/unix/c99/z_ping.c +++ b/examples/unix/c99/z_ping.c @@ -82,7 +82,7 @@ int main(int argc, char** argv) { z_view_keyexpr_t ping; z_view_keyexpr_from_str_unchecked(&ping, "test/ping"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_session_loan(&session), z_view_keyexpr_loan(&ping), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&session), z_view_keyexpr_loan(&ping), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -92,7 +92,7 @@ int main(int argc, char** argv) { z_owned_closure_sample_t respond; z_closure_sample(&respond, callback, drop, NULL); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_session_loan(&session), z_view_keyexpr_loan(&pong), + if (z_subscriber_declare(&sub, z_session_loan(&session), z_view_keyexpr_loan(&pong), z_closure_sample_move(&respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; diff --git a/examples/unix/c99/z_pong.c b/examples/unix/c99/z_pong.c index 30e91799a..057dc2351 100644 --- a/examples/unix/c99/z_pong.c +++ b/examples/unix/c99/z_pong.c @@ -54,7 +54,7 @@ int main(int argc, char** argv) { z_view_keyexpr_t pong; z_view_keyexpr_from_str_unchecked(&pong, "test/pong"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_session_loan(&session), z_view_keyexpr_loan(&pong), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&session), z_view_keyexpr_loan(&pong), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -64,7 +64,7 @@ int main(int argc, char** argv) { z_owned_closure_sample_t respond; z_closure_sample(&respond, callback, drop, (void*)(&pub)); - if (z_declare_background_subscriber(z_session_loan(&session), z_view_keyexpr_loan(&ping), + if (z_subscriber_declare_background(z_session_loan(&session), z_view_keyexpr_loan(&ping), z_closure_sample_move(&respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; diff --git a/examples/unix/c99/z_pub.c b/examples/unix/c99/z_pub.c index 535aea5c5..0e865dca0 100644 --- a/examples/unix/c99/z_pub.c +++ b/examples/unix/c99/z_pub.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/unix/c99/z_pub_st.c b/examples/unix/c99/z_pub_st.c index 8a08eef99..9fa82efdf 100644 --- a/examples/unix/c99/z_pub_st.c +++ b/examples/unix/c99/z_pub_st.c @@ -83,7 +83,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/unix/c99/z_pull.c b/examples/unix/c99/z_pull.c index b1fb4c8c7..0ffb83f05 100644 --- a/examples/unix/c99/z_pull.c +++ b/examples/unix/c99/z_pull.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; diff --git a/examples/unix/c99/z_queryable.c b/examples/unix/c99/z_queryable.c index 79fe4d586..ff775b999 100644 --- a/examples/unix/c99/z_queryable.c +++ b/examples/unix/c99/z_queryable.c @@ -117,7 +117,7 @@ int main(int argc, char **argv) { printf("Creating Queryable on '%s'...\n", keyexpr); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), + if (z_queryable_declare(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback), NULL) < 0) { printf("Unable to create queryable.\n"); return -1; diff --git a/examples/unix/c99/z_sub.c b/examples/unix/c99/z_sub.c index 58f12dca8..412f7695d 100644 --- a/examples/unix/c99/z_sub.c +++ b/examples/unix/c99/z_sub.c @@ -96,7 +96,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; diff --git a/examples/unix/c99/z_sub_st.c b/examples/unix/c99/z_sub_st.c index 9fb898802..c74d253d5 100644 --- a/examples/unix/c99/z_sub_st.c +++ b/examples/unix/c99/z_sub_st.c @@ -97,7 +97,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), + if (z_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; diff --git a/examples/windows/z_ping.c b/examples/windows/z_ping.c index eb102ac5b..49d00a8d4 100644 --- a/examples/windows/z_ping.c +++ b/examples/windows/z_ping.c @@ -80,7 +80,7 @@ int main(int argc, char** argv) { z_view_keyexpr_t ping; z_view_keyexpr_from_str_unchecked(&ping, "test/ping"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(session), z_loan(ping), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(session), z_loan(ping), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -90,7 +90,7 @@ int main(int argc, char** argv) { z_owned_closure_sample_t respond; z_closure(&respond, callback, drop, NULL); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_loan(session), z_loan(pong), z_move(respond), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(session), z_loan(pong), z_move(respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; } diff --git a/examples/windows/z_pong.c b/examples/windows/z_pong.c index fae246b2f..ab9893671 100644 --- a/examples/windows/z_pong.c +++ b/examples/windows/z_pong.c @@ -51,7 +51,7 @@ int main(int argc, char** argv) { z_view_keyexpr_t pong; z_view_keyexpr_from_str_unchecked(&pong, "test/pong"); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(session), z_loan(pong), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(session), z_loan(pong), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } @@ -61,7 +61,7 @@ int main(int argc, char** argv) { z_owned_closure_sample_t respond; z_closure(&respond, callback, drop, (void*)(&pub)); - if (z_declare_background_subscriber(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) { + if (z_subscriber_declare_background(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) { printf("Unable to declare subscriber for key expression.\n"); return -1; } diff --git a/examples/windows/z_pub.c b/examples/windows/z_pub.c index c94bd9d8f..50394adfa 100644 --- a/examples/windows/z_pub.c +++ b/examples/windows/z_pub.c @@ -52,7 +52,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/windows/z_pub_st.c b/examples/windows/z_pub_st.c index 67aae3862..31db7a4f7 100644 --- a/examples/windows/z_pub_st.c +++ b/examples/windows/z_pub_st.c @@ -47,7 +47,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); return -1; } diff --git a/examples/windows/z_pull.c b/examples/windows/z_pull.c index 96c705a34..f90ec7ea6 100644 --- a/examples/windows/z_pull.c +++ b/examples/windows/z_pull.c @@ -53,7 +53,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/windows/z_queryable.c b/examples/windows/z_queryable.c index 1555a144f..86f2a3b84 100644 --- a/examples/windows/z_queryable.c +++ b/examples/windows/z_queryable.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) { z_owned_closure_query_t callback; z_closure(&callback, query_handler); z_owned_queryable_t qable; - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create queryable.\n"); return -1; } diff --git a/examples/windows/z_sub.c b/examples/windows/z_sub.c index c168786fb..b81757442 100644 --- a/examples/windows/z_sub.c +++ b/examples/windows/z_sub.c @@ -64,7 +64,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/windows/z_sub_st.c b/examples/windows/z_sub_st.c index 6c3421c48..d48369b7a 100644 --- a/examples/windows/z_sub_st.c +++ b/examples/windows/z_sub_st.c @@ -61,7 +61,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; } diff --git a/examples/zephyr/z_pub.c b/examples/zephyr/z_pub.c index 1b3212a24..3b8db0ca9 100644 --- a/examples/zephyr/z_pub.c +++ b/examples/zephyr/z_pub.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) { z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); z_owned_publisher_t pub; - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); exit(-1); } diff --git a/examples/zephyr/z_pull.c b/examples/zephyr/z_pull.c index ec0f5f17f..00cf42248 100644 --- a/examples/zephyr/z_pull.c +++ b/examples/zephyr/z_pull.c @@ -66,7 +66,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, KEYEXPR); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); } diff --git a/examples/zephyr/z_queryable.c b/examples/zephyr/z_queryable.c index 920ae294f..e1a3226af 100644 --- a/examples/zephyr/z_queryable.c +++ b/examples/zephyr/z_queryable.c @@ -86,7 +86,7 @@ int main(int argc, char **argv) { z_owned_queryable_t qable; z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); - if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare queryable.\n"); exit(-1); } diff --git a/examples/zephyr/z_sub.c b/examples/zephyr/z_sub.c index fab5d2e24..02ab37bf0 100644 --- a/examples/zephyr/z_sub.c +++ b/examples/zephyr/z_sub.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) { z_view_keyexpr_t ke; z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR); z_owned_subscriber_t sub; - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); } diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index 5f457dde2..83cf9323a 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -1594,7 +1594,7 @@ void z_publisher_options_default(z_publisher_options_t *options); * Return: * ``0`` if declare is successful, ``negative value`` otherwise. */ -z_result_t z_declare_publisher(z_owned_publisher_t *pub, const z_loaned_session_t *zs, +z_result_t z_publisher_declare(z_owned_publisher_t *pub, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, const z_publisher_options_t *options); /** @@ -1747,7 +1747,7 @@ void z_queryable_options_default(z_queryable_options_t *options); * Return: * ``0`` if declare operation is successful, ``negative value`` otherwise. */ -z_result_t z_declare_queryable(z_owned_queryable_t *queryable, const z_loaned_session_t *zs, +z_result_t z_queryable_declare(z_owned_queryable_t *queryable, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_query_t *callback, const z_queryable_options_t *options); @@ -1764,7 +1764,7 @@ z_result_t z_declare_queryable(z_owned_queryable_t *queryable, const z_loaned_se * Return: * ``0`` if declare operation is successful, ``negative value`` otherwise. */ -z_result_t z_declare_background_queryable(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, +z_result_t z_queryable_declare_background(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_query_t *callback, const z_queryable_options_t *options); /** @@ -2008,7 +2008,7 @@ void z_subscriber_options_default(z_subscriber_options_t *options); * Return: * ``0`` if declare is successful, ``negative value`` otherwise. */ -z_result_t z_declare_subscriber(z_owned_subscriber_t *sub, const z_loaned_session_t *zs, +z_result_t z_subscriber_declare(z_owned_subscriber_t *sub, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_sample_t *callback, const z_subscriber_options_t *options); @@ -2025,7 +2025,7 @@ z_result_t z_declare_subscriber(z_owned_subscriber_t *sub, const z_loaned_sessio * Return: * ``0`` if declare is successful, ``negative value`` otherwise. */ -z_result_t z_declare_background_subscriber(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, +z_result_t z_subscriber_declare_background(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_sample_t *callback, const z_subscriber_options_t *options); /** diff --git a/include/zenoh-pico/api/types.h b/include/zenoh-pico/api/types.h index 7bf8f3eb3..8518b6658 100644 --- a/include/zenoh-pico/api/types.h +++ b/include/zenoh-pico/api/types.h @@ -138,7 +138,7 @@ _Z_OWNED_TYPE_VALUE(_z_encoding_t, encoding) _Z_OWNED_TYPE_VALUE(_z_value_t, reply_err) /** - * Represents the configuration used to configure a subscriber upon declaration :c:func:`z_declare_subscriber`. + * Represents the configuration used to configure a subscriber upon declaration :c:func:`z_subscriber_declare`. */ typedef struct { uint8_t __dummy; // Just to avoid empty structures that might cause undefined behavior @@ -169,7 +169,7 @@ typedef struct { } z_query_consolidation_t; /** - * Represents the configuration used to configure a publisher upon declaration with :c:func:`z_declare_publisher`. + * Represents the configuration used to configure a publisher upon declaration with :c:func:`z_publisher_declare`. * * Members: * z_owned_encoding_t *encoding: Default encoding for messages put by this publisher. @@ -190,7 +190,7 @@ typedef struct { } z_publisher_options_t; /** - * Represents the configuration used to configure a queryable upon declaration :c:func:`z_declare_queryable`. + * Represents the configuration used to configure a queryable upon declaration :c:func:`z_queryable_declare`. * * Members: * bool complete: The completeness of the queryable. @@ -386,7 +386,7 @@ typedef struct { } zp_send_join_options_t; /** - * Represents the configuration used to configure a publisher upon declaration with :c:func:`z_declare_publisher`. + * Represents the configuration used to configure a publisher upon declaration with :c:func:`z_publisher_declare`. * * Members: * uint64_t timeout_ms: The maximum duration in ms the scouting can take. diff --git a/src/api/api.c b/src/api/api.c index f7aaa3b92..7f72e7a70 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -871,7 +871,7 @@ void z_publisher_options_default(z_publisher_options_t *options) { #endif } -z_result_t z_declare_publisher(z_owned_publisher_t *pub, const z_loaned_session_t *zs, +z_result_t z_publisher_declare(z_owned_publisher_t *pub, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, const z_publisher_options_t *options) { _z_keyexpr_t keyexpr_aliased = _z_keyexpr_alias_from_user_defined(*keyexpr, true); _z_keyexpr_t key = keyexpr_aliased; @@ -1103,15 +1103,15 @@ _Z_OWNED_FUNCTIONS_VALUE_NO_COPY_IMPL(_z_queryable_t, queryable, _z_queryable_ch void z_queryable_options_default(z_queryable_options_t *options) { options->complete = _Z_QUERYABLE_COMPLETE_DEFAULT; } -z_result_t z_declare_background_queryable(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, +z_result_t z_queryable_declare_background(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_query_t *callback, const z_queryable_options_t *options) { z_owned_queryable_t qle; - _Z_RETURN_IF_ERR(z_declare_queryable(&qle, zs, keyexpr, callback, options)); + _Z_RETURN_IF_ERR(z_queryable_declare(&qle, zs, keyexpr, callback, options)); _z_queryable_clear(&qle._val); return _Z_RES_OK; } -z_result_t z_declare_queryable(z_owned_queryable_t *queryable, const z_loaned_session_t *zs, +z_result_t z_queryable_declare(z_owned_queryable_t *queryable, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_query_t *callback, const z_queryable_options_t *options) { void *ctx = callback->_this._val.context; @@ -1316,15 +1316,15 @@ _Z_OWNED_FUNCTIONS_VALUE_NO_COPY_IMPL(_z_subscriber_t, subscriber, _z_subscriber void z_subscriber_options_default(z_subscriber_options_t *options) { options->__dummy = 0; } -z_result_t z_declare_background_subscriber(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, +z_result_t z_subscriber_declare_background(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_sample_t *callback, const z_subscriber_options_t *options) { z_owned_subscriber_t sub; - _Z_RETURN_IF_ERR(z_declare_subscriber(&sub, zs, keyexpr, callback, options)); + _Z_RETURN_IF_ERR(z_subscriber_declare(&sub, zs, keyexpr, callback, options)); _z_subscriber_clear(&sub._val); return _Z_RES_OK; } -z_result_t z_declare_subscriber(z_owned_subscriber_t *sub, const z_loaned_session_t *zs, +z_result_t z_subscriber_declare(z_owned_subscriber_t *sub, const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr, z_moved_closure_sample_t *callback, const z_subscriber_options_t *options) { _ZP_UNUSED(options); diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 55c4d2d0c..57df994dd 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -268,7 +268,7 @@ int main(int argc, char **argv) { z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr_str); z_owned_subscriber_t _ret_sub; - _ret_res = z_declare_subscriber(&_ret_sub, z_loan(s2), z_loan(ke), z_move(_ret_closure_sample), &_ret_sub_opt); + _ret_res = z_subscriber_declare(&_ret_sub, z_loan(s2), z_loan(ke), z_move(_ret_closure_sample), &_ret_sub_opt); assert(_ret_res == _Z_RES_OK); printf("Ok\n"); @@ -328,7 +328,7 @@ int main(int argc, char **argv) { _ret_pub_opt.encoding = z_move(encoding); _ret_pub_opt.congestion_control = Z_CONGESTION_CONTROL_BLOCK; z_owned_publisher_t _ret_pub; - _ret_res = z_declare_publisher(&_ret_pub, z_loan(s1), z_loan(s1_key), &_ret_pub_opt); + _ret_res = z_publisher_declare(&_ret_pub, z_loan(s1), z_loan(s1_key), &_ret_pub_opt); assert(_ret_res == _Z_RES_OK); assert(!z_internal_check(encoding)); printf("Ok\n"); @@ -378,7 +378,7 @@ int main(int argc, char **argv) { z_queryable_options_t _ret_qle_opt; z_queryable_options_default(&_ret_qle_opt); z_owned_queryable_t qle; - assert(z_declare_queryable(&qle, z_loan(s1), z_loan(s1_key), z_move(_ret_closure_query), &_ret_qle_opt) == + assert(z_queryable_declare(&qle, z_loan(s1), z_loan(s1_key), z_move(_ret_closure_query), &_ret_qle_opt) == _Z_RES_OK); printf("Ok\n"); diff --git a/tests/z_client_test.c b/tests/z_client_test.c index 97f96d7dd..6fe241cbd 100644 --- a/tests/z_client_test.c +++ b/tests/z_client_test.c @@ -196,7 +196,7 @@ int main(int argc, char **argv) { z_owned_closure_sample_t callback; z_closure(&callback, data_handler, NULL, &idx[i]); z_owned_subscriber_t *sub = (z_owned_subscriber_t *)z_malloc(sizeof(z_owned_subscriber_t)); - z_result_t res = z_declare_subscriber(sub, z_loan(s2), z_loan(rids2[i]), z_move(callback), NULL); + z_result_t res = z_subscriber_declare(sub, z_loan(s2), z_loan(rids2[i]), z_move(callback), NULL); assert(res == _Z_RES_OK); printf("Declared subscription on session 2: %ju %u %s\n", (uintmax_t)z_subscriber_loan(sub)->_entity_id, z_loan(rids2[i])->_id, ""); @@ -212,7 +212,7 @@ int main(int argc, char **argv) { z_owned_queryable_t *qle = (z_owned_queryable_t *)z_malloc(sizeof(z_owned_queryable_t)); z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, s1_res); - assert(z_declare_queryable(qle, z_loan(s2), z_loan(ke), z_move(callback), NULL) == _Z_RES_OK); + assert(z_queryable_declare(qle, z_loan(s2), z_loan(ke), z_move(callback), NULL) == _Z_RES_OK); printf("Declared queryable on session 2: %ju %zu %s\n", (uintmax_t)qle->_val._entity_id, (z_zint_t)0, s1_res); qles2 = _z_list_push(qles2, qle); } @@ -222,7 +222,7 @@ int main(int argc, char **argv) { // Declare publisher on first session for (unsigned int i = 0; i < SET; i++) { z_owned_publisher_t *pub = (z_owned_publisher_t *)z_malloc(sizeof(z_owned_publisher_t)); - if (z_declare_publisher(pub, z_loan(s1), z_loan(rids1[i]), NULL) < 0) { + if (z_publisher_declare(pub, z_loan(s1), z_loan(rids1[i]), NULL) < 0) { printf("Declared publisher on session 1: %zu\n", z_loan(*pub)->_id); } pubs1 = _z_list_push(pubs1, pub); diff --git a/tests/z_peer_multicast_test.c b/tests/z_peer_multicast_test.c index cadad990b..aa16e27c4 100644 --- a/tests/z_peer_multicast_test.c +++ b/tests/z_peer_multicast_test.c @@ -117,7 +117,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t *sub = (z_owned_subscriber_t *)z_malloc(sizeof(z_owned_subscriber_t)); z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, s1_res); - z_result_t res = z_declare_subscriber(sub, z_loan(s2), z_loan(ke), z_move(callback), NULL); + z_result_t res = z_subscriber_declare(sub, z_loan(s2), z_loan(ke), z_move(callback), NULL); assert(res == _Z_RES_OK); printf("Declared subscription on session 2: %ju %zu %s\n", (uintmax_t)z_subscriber_loan(sub)->_entity_id, (z_zint_t)0, s1_res); diff --git a/tests/z_perf_rx.c b/tests/z_perf_rx.c index 55fc0c2da..161661e50 100644 --- a/tests/z_perf_rx.c +++ b/tests/z_perf_rx.c @@ -107,7 +107,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to create subscriber.\n"); exit(-1); } diff --git a/tests/z_perf_tx.c b/tests/z_perf_tx.c index 2e0d15cc9..449406391 100644 --- a/tests/z_perf_tx.c +++ b/tests/z_perf_tx.c @@ -83,7 +83,7 @@ int main(int argc, char **argv) { z_owned_publisher_t pub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { + if (z_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare publisher for key expression!\n"); exit(-1); } diff --git a/tests/z_test_fragment_rx.c b/tests/z_test_fragment_rx.c index f31a2ba84..94bd57085 100644 --- a/tests/z_test_fragment_rx.c +++ b/tests/z_test_fragment_rx.c @@ -84,7 +84,7 @@ int main(int argc, char **argv) { z_owned_subscriber_t sub; z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); - if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { + if (z_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); return -1; }