Skip to content

Commit

Permalink
API alignment (#731)
Browse files Browse the repository at this point in the history
* Rename z_publisher_declare to z_declare_publisher and make session first

* Rename z_subscriber_declare to z_declare_subscriber and make session first

* Rename z_queryable_declare to z_declare_queryable and make session first

* Move a session as the first parameter for z_declare_keyexpr/z_undeclare_keyexpr

* Return undeclare for publisher/subscriber/queriable
  • Loading branch information
sashacmc authored Oct 10, 2024
1 parent e43f9ff commit 9bf1203
Show file tree
Hide file tree
Showing 67 changed files with 165 additions and 111 deletions.
13 changes: 8 additions & 5 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,8 @@ Functions
.. autocfunction:: primitives.h::z_put
.. autocfunction:: primitives.h::z_delete
.. autocfunction:: primitives.h::z_publisher_declare
.. autocfunction:: primitives.h::z_declare_publisher
.. autocfunction:: primitives.h::z_undeclare_publisher
.. autocfunction:: primitives.h::z_publisher_put
.. autocfunction:: primitives.h::z_publisher_delete
.. autocfunction:: primitives.h::z_publisher_keyexpr
Expand Down Expand Up @@ -982,8 +983,9 @@ Option Types
Functions
---------
.. autocfunction:: primitives.h::z_subscriber_declare
.. autocfunction:: primitives.h::z_subscriber_declare_background
.. autocfunction:: primitives.h::z_declare_subscriber
.. autocfunction:: primitives.h::z_undeclare_subscriber
.. autocfunction:: primitives.h::z_declare_background_subscriber
.. autocfunction:: primitives.h::z_subscriber_options_default
.. autocfunction:: primitives.h::z_subscriber_keyexpr
Expand Down Expand Up @@ -1027,8 +1029,9 @@ Option Types
Functions
---------
.. autocfunction:: primitives.h::z_queryable_declare
.. autocfunction:: primitives.h::z_queryable_declare_background
.. autocfunction:: primitives.h::z_declare_queryable
.. autocfunction:: primitives.h::z_undeclare_queryable
.. autocfunction:: primitives.h::z_declare_background_queryable
.. autocfunction:: primitives.h::z_queryable_options_default
.. autocfunction:: primitives.h::z_query_reply_options_default
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_pub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void setup() {
Serial.println("...");
z_view_keyexpr_t ke;
z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR);
if (z_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) {
if (z_declare_publisher(z_session_loan(&s), &pub, z_view_keyexpr_loan(&ke), NULL) < 0) {
Serial.println("Unable to declare publisher for key expression!");
while (1) {
;
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_pull.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure),
if (z_declare_subscriber(z_session_loan(&s), &sub, z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure),
NULL) < 0) {
Serial.println("Unable to declare subscriber.");
return;
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback),
if (z_declare_queryable(z_session_loan(&s), &qable, z_view_keyexpr_loan(&ke), z_closure_query_move(&callback),
NULL) < 0) {
Serial.println("Unable to declare queryable.");
while (1) {
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback),
if (z_declare_subscriber(z_session_loan(&s), &sub, z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback),
NULL) < 0) {
Serial.println("Unable to declare subscriber.");
while (1) {
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to declare subscriber.\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare queryable.\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/freertos_plus_tcp/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void app_main(void) {
z_owned_keyexpr_t ke;
z_view_keyexpr_t vke;
z_view_keyexpr_from_str_unchecked(&vke, KEYEXPR);
if (z_declare_keyexpr(&ke, z_loan(s), z_loan(vke)) < 0) {
if (z_declare_keyexpr(z_loan(s), &ke, z_loan(vke)) < 0) {
printf("Unable to declare key expression!\n");
z_drop(z_move(s));
return;
Expand All @@ -78,7 +78,7 @@ void app_main(void) {
}

// Clean up
z_undeclare_keyexpr(z_move(ke), z_loan(s));
z_undeclare_keyexpr(z_loan(s), z_move(ke));
z_drop(z_move(s));
}
#else
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to create queryable.\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/mbed/z_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_session_loan(&s), z_view_keyexpr_loan(&ke), NULL) < 0) {
if (z_declare_publisher(z_session_loan(&s), &pub, z_view_keyexpr_loan(&ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/mbed/z_pull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure),
if (z_declare_subscriber(z_session_loan(&s), &sub, z_view_keyexpr_loan(&ke), z_closure_sample_move(&closure),
NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion examples/mbed/z_queryable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_query_move(&callback),
if (z_declare_queryable(z_session_loan(&s), &qable, z_view_keyexpr_loan(&ke), z_closure_query_move(&callback),
NULL) < 0) {
printf("Unable to declare queryable.\n");
exit(-1);
Expand Down
2 changes: 1 addition & 1 deletion examples/mbed/z_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_session_loan(&s), z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback),
if (z_declare_subscriber(z_session_loan(&s), &sub, z_view_keyexpr_loan(&ke), z_closure_sample_move(&callback),
NULL) < 0) {
printf("Unable to declare subscriber.\n");
exit(-1);
Expand Down
4 changes: 2 additions & 2 deletions examples/unix/c11/z_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ int main(int argc, char** argv) {
z_view_keyexpr_from_str_unchecked(&pong, "test/pong");

z_owned_publisher_t pub;
if (z_publisher_declare(&pub, z_loan(session), z_loan(ping), NULL) < 0) {
if (z_declare_publisher(z_loan(session), &pub, z_loan(ping), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return -1;
}

z_owned_closure_sample_t respond;
z_closure(&respond, callback, drop, NULL);
z_owned_subscriber_t sub;
if (z_subscriber_declare(&sub, z_loan(session), z_loan(pong), z_move(respond), NULL) < 0) {
if (z_declare_subscriber(z_loan(session), &sub, z_loan(pong), z_move(respond), NULL) < 0) {
printf("Unable to declare subscriber for key expression.\n");
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/unix/c11/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(session), z_loan(pong), NULL) < 0) {
if (z_declare_publisher(z_loan(session), &pub, z_loan(pong), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return -1;
}
Expand All @@ -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_subscriber_declare_background(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) {
if (z_declare_background_subscriber(z_loan(session), z_loan(ping), z_move(respond), NULL) < 0) {
printf("Unable to declare subscriber for key expression.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_publisher_declare(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/unix/c11/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main(int argc, char **argv) {
z_view_keyexpr_t vke;
z_view_keyexpr_from_str(&vke, keyexpr);
z_owned_keyexpr_t ke;
if (z_declare_keyexpr(&ke, z_loan(s), z_loan(vke)) < 0) {
if (z_declare_keyexpr(z_loan(s), &ke, z_loan(vke)) < 0) {
z_drop(z_move(s));
return -1;
}
Expand All @@ -103,7 +103,7 @@ int main(int argc, char **argv) {
printf("Oh no! Put has failed...\n");
}
// Clean up
z_undeclare_keyexpr(z_move(ke), z_loan(s));
z_undeclare_keyexpr(z_loan(s), z_move(ke));
z_drop(z_move(s));
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to create queryable.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_queryable_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to create queryable.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_queryable_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_queryable_declare(&qable, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to create queryable.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_sub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_sub_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_sub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_subscriber_declare_background(z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
if (z_declare_background_subscriber(z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to create subscriber.\n");
exit(-1);
}
Expand Down
Loading

0 comments on commit 9bf1203

Please sign in to comment.