Skip to content

Commit

Permalink
Rename z_keyexpr_new to z_keyexpr_from_str (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc authored Jul 4, 2024
1 parent 251da76 commit c432a80
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Primitives
.. autocfunction:: primitives.h::z_undeclare_queryable
.. autocfunction:: primitives.h::z_query_reply_options_default
.. autocfunction:: primitives.h::z_query_reply
.. autocfunction:: primitives.h::z_keyexpr_new
.. autocfunction:: primitives.h::z_keyexpr_from_str
.. autocfunction:: primitives.h::z_declare_keyexpr
.. autocfunction:: primitives.h::z_undeclare_keyexpr
.. autocfunction:: primitives.h::z_subscriber_options_default
Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ int8_t z_query_reply(const z_loaned_query_t *query, const z_loaned_keyexpr_t *ke
* Return:
* ``0`` if creation successful, ``negative value`` otherwise.
*/
int8_t z_keyexpr_new(z_owned_keyexpr_t *keyexpr, const char *name);
int8_t z_keyexpr_from_str(z_owned_keyexpr_t *keyexpr, const char *name);

/**
* Declares a keyexpr, so that it is mapped on a numerical id.
Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/api/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ _Z_VIEW_TYPE(_z_string_t, string)
*
* Members are private and operations must be done using the provided functions:
*
* - :c:func:`z_keyexpr_new`
* - :c:func:`z_keyexpr_from_str`
* - :c:func:`z_keyexpr_is_initialized`
* - :c:func:`z_keyexpr_to_string`
* - :c:func:`zp_keyexpr_resolve`
Expand Down
2 changes: 1 addition & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ int8_t z_query_reply(const z_loaned_query_t *query, const z_loaned_keyexpr_t *ke
}
#endif

int8_t z_keyexpr_new(z_owned_keyexpr_t *key, const char *name) {
int8_t z_keyexpr_from_str(z_owned_keyexpr_t *key, const char *name) {
if (name != NULL) {
key->_val = _z_rid_with_suffix(Z_RESOURCE_ID_NONE, name);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/z_api_double_drop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

void test_keyexpr(void) {
z_owned_keyexpr_t keyexpr;
z_keyexpr_new(&keyexpr, URL);
z_keyexpr_from_str(&keyexpr, URL);
assert(z_check(keyexpr));
z_drop(z_move(keyexpr));
assert(!z_check(keyexpr));
Expand Down

0 comments on commit c432a80

Please sign in to comment.