Skip to content

Commit

Permalink
rename loaned_take -> take_loaned
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Oct 30, 2024
1 parent 0b2dac9 commit e954df6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 59 deletions.
26 changes: 13 additions & 13 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: z_loaned_slice_t * z_view_slice_loan_mut(z_view_slice_t * slice)
.. c:function:: const z_loaned_slice_t * z_slice_loan(const z_owned_slice_t * slice)
.. c:function:: z_loaned_slice_t * z_slice_loan_mut(z_owned_slice_t * slice)
.. c:function:: z_result_t z_slice_loaned_take(z_owned_slice_t *dst, z_loaned_slice_t *src)
.. c:function:: z_result_t z_slice_take_loaned(z_owned_slice_t *dst, z_loaned_slice_t *src)
String
------
Expand Down Expand Up @@ -108,7 +108,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: z_loaned_string_t * z_view_string_loan_mut(z_view_string_t * string)
.. c:function:: const z_loaned_string_t * z_string_loan(const z_owned_string_t * string)
.. c:function:: z_loaned_string_t * z_string_loan_mut(z_owned_string_t * string)
.. c:function:: z_result_t z_string_loaned_take(z_owned_string_t *dst, z_loaned_string_t *src)
.. c:function:: z_result_t z_string_take_loaned(z_owned_string_t *dst, z_loaned_string_t *src)
String Array
------------
Expand Down Expand Up @@ -142,7 +142,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_string_array_clone(z_owned_string_array_t * dst, const z_loaned_string_array_t * string_array)
.. c:function:: const z_loaned_string_array_t * z_string_array_loan(const z_owned_string_array_t * string_array)
.. c:function:: z_loaned_string_array_t * z_string_array_loan_mut(z_owned_string_array_t * string_array)
.. c:function:: z_result_t z_string_array_loaned_take(z_owned_string_array_t *dst, z_loaned_string_array_t *src)
.. c:function:: z_result_t z_string_array_take_loaned(z_owned_string_array_t *dst, z_loaned_string_array_t *src)
Common
Expand Down Expand Up @@ -206,7 +206,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: z_loaned_keyexpr_t * z_view_keyexpr_loan_mut(z_view_keyexpr_t * keyexpr)
.. c:function:: const z_loaned_keyexpr_t * z_keyexpr_loan(const z_owned_keyexpr_t * keyexpr)
.. c:function:: z_loaned_keyexpr_t * z_keyexpr_loan_mut(z_owned_keyexpr_t * keyexpr)
.. c:function:: z_result_t z_keyexpr_loaned_take(z_owned_keyexpr_t *dst, z_loaned_keyexpr_t *src)
.. c:function:: z_result_t z_keyexpr_take_loaned(z_owned_keyexpr_t *dst, z_loaned_keyexpr_t *src)
Payload
-------
Expand Down Expand Up @@ -263,13 +263,13 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_bytes_clone(z_owned_bytes_t * dst, const z_loaned_bytes_t * bytes)
.. c:function:: const z_loaned_bytes_t * z_bytes_loan(const z_owned_bytes_t * bytes)
.. c:function:: z_loaned_bytes_t * z_bytes_loan_mut(z_owned_bytes_t * bytes)
.. c:function:: z_result_t z_bytes_loaned_take(z_owned_bytes_t *dst, z_loaned_bytes_t *src)
.. c:function:: z_result_t z_bytes_take_loaned(z_owned_bytes_t *dst, z_loaned_bytes_t *src)
.. c:function:: void z_bytes_writer_drop(z_moved_bytes_writer_t * bytes_writer)
.. c:function:: void z_bytes_writer_clone(z_owned_bytes_writer_t * dst, const z_loaned_bytes_writer_t * bytes_writer)
.. c:function:: const z_loaned_bytes_writer_t * z_bytes_writer_loan(const z_owned_bytes_writer_t * bytes_writer)
.. c:function:: z_loaned_bytes_writer_t * z_bytes_writer_loan_mut(z_owned_bytes_writer_t * bytes_writer)
.. c:function:: z_result_t z_bytes_writer_loaned_take(z_owned_bytes_writer_t *dst, z_loaned_bytes_writer_t *src)
.. c:function:: z_result_t z_bytes_writer_take_loaned(z_owned_bytes_writer_t *dst, z_loaned_bytes_writer_t *src)
Encoding
--------
Expand Down Expand Up @@ -304,7 +304,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_encoding_clone(z_owned_encoding_t * dst, const z_loaned_encoding_t * encoding)
.. c:function:: const z_loaned_encoding_t * z_encoding_loan(const z_owned_encoding_t * encoding)
.. c:function:: z_loaned_encoding_t * z_encoding_loan_mut(z_owned_encoding_t * encoding)
.. c:function:: z_result_t z_encoding_loaned_take(z_owned_encoding_t *dst, z_loaned_encoding_t *src)
.. c:function:: z_result_t z_encoding_take_loaned(z_owned_encoding_t *dst, z_loaned_encoding_t *src)
Predefined Encodings
Expand Down Expand Up @@ -391,7 +391,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_reply_err_clone(z_owned_reply_err_t * dst, const z_loaned_reply_err_t * reply_err)
.. c:function:: const z_loaned_reply_err_t * z_reply_err_loan(const z_owned_reply_err_t * reply_err)
.. c:function:: z_loaned_reply_err_t * z_reply_err_loan_mut(z_owned_reply_err_t * reply_err)
.. c:function:: z_result_t z_reply_err_loaned_take(z_owned_reply_err_t *dst, z_loaned_reply_err_t *src)
.. c:function:: z_result_t z_reply_err_take_loaned(z_owned_reply_err_t *dst, z_loaned_reply_err_t *src)
Sample
------
Expand Down Expand Up @@ -431,7 +431,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_sample_clone(z_owned_sample_t * dst, const z_loaned_sample_t * sample)
.. c:function:: const z_loaned_sample_t * z_sample_loan(const z_owned_sample_t * sample)
.. c:function:: z_loaned_sample_t * z_sample_loan_mut(z_owned_sample_t * sample)
.. c:function:: z_result_t z_sample_loaned_take(z_owned_sample_t *dst, z_loaned_sample_t *src)
.. c:function:: z_result_t z_sample_take_loaned(z_owned_sample_t *dst, z_loaned_sample_t *src)
Timestamp
Expand Down Expand Up @@ -1112,7 +1112,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_query_clone(z_owned_query_t * dst, const z_loaned_query_t * query)
.. c:function:: const z_loaned_query_t * z_query_loan(const z_owned_query_t * query)
.. c:function:: z_loaned_query_t * z_query_loan_mut(z_owned_query_t * query)
.. c:function:: z_result_t z_query_loaned_take(z_owned_query_t *dst, z_loaned_query_t *src)
.. c:function:: z_result_t z_query_take_loaned(z_owned_query_t *dst, z_loaned_query_t *src)
Query
=====
Expand Down Expand Up @@ -1160,7 +1160,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_reply_clone(z_owned_reply_t * dst, const z_loaned_reply_t * reply)
.. c:function:: const z_loaned_reply_t * z_reply_loan(const z_owned_reply_t * reply)
.. c:function:: z_loaned_reply_t * z_reply_loan_mut(z_owned_reply_t * reply)
.. c:function:: z_result_t z_reply_loaned_take(z_owned_reply_t *dst, z_loaned_reply_t *src)
.. c:function:: z_result_t z_reply_take_loaned(z_owned_reply_t *dst, z_loaned_reply_t *src)
Scouting
Expand Down Expand Up @@ -1200,7 +1200,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void z_hello_clone(z_owned_hello_t * dst, const z_loaned_hello_t * hello)
.. c:function:: const z_loaned_hello_t * z_hello_loan(const z_owned_hello_t * hello)
.. c:function:: z_loaned_hello_t * z_hello_loan(z_owned_hello_t * hello)
.. c:function:: z_result_t z_hello_loaned_take(z_owned_hello_t *dst, z_loaned_hello_t *src)
.. c:function:: z_result_t z_hello_take_loaned(z_owned_hello_t *dst, z_loaned_hello_t *src)
Serialization
Expand Down Expand Up @@ -1293,7 +1293,7 @@ See details at :ref:`owned_types_concept`
.. c:function:: void ze_serializer_clone(ze_owned_serializer_t * dst, const ze_loaned_serializer_t * serializer)
.. c:function:: const ze_loaned_serializer_t * ze_serializer_loan(const ze_owned_serializer_t * serializer)
.. c:function:: ze_loaned_serializer_t * ze_serializer_loan_mut(ze_owned_serializer_t * serializer)
.. c:function:: z_result_t ze_serializer_loaned_take(ze_owned_serializer_t *dst, ze_loaned_serializer_t *src)
.. c:function:: z_result_t ze_serializer_take_loaned(ze_owned_serializer_t *dst, ze_loaned_serializer_t *src)
Others
======
Expand Down
88 changes: 44 additions & 44 deletions include/zenoh-pico/api/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,21 +333,21 @@
* Returns:
* `0` in case of success, negative error code otherwise.
*/
#define z_loaned_take(dst, src) _Generic((dst), \
z_owned_keyexpr_t* : z_keyexpr_loaned_take, \
z_owned_query_t* : z_query_loaned_take, \
z_owned_sample_t* : z_sample_loaned_take, \
z_owned_bytes_t* : z_bytes_loaned_take, \
z_owned_encoding_t* : z_encoding_loaned_take, \
z_owned_reply_err_t* : z_reply_err_loaned_take, \
z_owned_reply_t* : z_reply_loaned_take, \
z_owned_hello_t* : z_hello_loaned_take, \
z_owned_string_t* : z_string_loaned_take, \
z_owned_slice_t* : z_slice_loaned_take, \
z_owned_string_array_t* : z_string_array_loaned_take, \
z_owned_config_t* : z_config_loaned_take \
z_owned_bytes_writer_t* : z_bytes_writer_loaned_take, \
ze_owned_serializer_t* : ze_serializer_loaned_take, \
#define z_take_loaned(dst, src) _Generic((dst), \
z_owned_keyexpr_t* : z_keyexpr_take_loaned, \
z_owned_query_t* : z_query_take_loaned, \
z_owned_sample_t* : z_sample_take_loaned, \
z_owned_bytes_t* : z_bytes_take_loaned, \
z_owned_encoding_t* : z_encoding_take_loaned, \
z_owned_reply_err_t* : z_reply_err_take_loaned, \
z_owned_reply_t* : z_reply_take_loaned, \
z_owned_hello_t* : z_hello_take_loaned, \
z_owned_string_t* : z_string_take_loaned, \
z_owned_slice_t* : z_slice_take_loaned, \
z_owned_string_array_t* : z_string_array_take_loaned, \
z_owned_config_t* : z_config_take_loaned \
z_owned_bytes_writer_t* : z_bytes_writer_take_loaned, \
ze_owned_serializer_t* : ze_serializer_take_loaned, \
)(dst, src)

/**
Expand Down Expand Up @@ -757,48 +757,48 @@ inline z_result_t z_clone(z_owned_string_array_t* dst, const z_loaned_string_arr
}
inline z_result_t z_clone(z_owned_hello_t* dst, const z_loaned_hello_t* this_) { return z_hello_clone(dst, this_); }

// z_loaned_take definition
inline z_result_t z_loaned_take(z_owned_bytes_t* dst, z_loaned_bytes_t* this_) {
return z_bytes_loaned_take(dst, this_);
// z_take_loaned definition
inline z_result_t z_take_loaned(z_owned_bytes_t* dst, z_loaned_bytes_t* this_) {
return z_bytes_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_config_t* dst, z_loaned_config_t* this_) {
return z_config_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_config_t* dst, z_loaned_config_t* this_) {
return z_config_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_encoding_t* dst, z_loaned_encoding_t* this_) {
return z_encoding_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_encoding_t* dst, z_loaned_encoding_t* this_) {
return z_encoding_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_keyexpr_t* dst, z_loaned_keyexpr_t* this_) {
return z_keyexpr_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_keyexpr_t* dst, z_loaned_keyexpr_t* this_) {
return z_keyexpr_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_query_t* dst, z_loaned_query_t* this_) {
return z_query_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_query_t* dst, z_loaned_query_t* this_) {
return z_query_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_reply_t* dst, z_loaned_reply_t* this_) {
return z_reply_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_reply_t* dst, z_loaned_reply_t* this_) {
return z_reply_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_reply_err_t* dst, z_loaned_reply_err_t* this_) {
return z_reply_err_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_reply_err_t* dst, z_loaned_reply_err_t* this_) {
return z_reply_err_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_sample_t* dst, z_loaned_sample_t* this_) {
return z_sample_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_sample_t* dst, z_loaned_sample_t* this_) {
return z_sample_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_slice_t* dst, z_loaned_slice_t* this_) {
return z_slice_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_slice_t* dst, z_loaned_slice_t* this_) {
return z_slice_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_string_t* dst, z_loaned_string_t* this_) {
return z_string_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_string_t* dst, z_loaned_string_t* this_) {
return z_string_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_string_array_t* dst, z_loaned_string_array_t* this_) {
return z_string_array_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_string_array_t* dst, z_loaned_string_array_t* this_) {
return z_string_array_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_hello_t* dst, z_loaned_hello_t* this_) {
return z_hello_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_hello_t* dst, z_loaned_hello_t* this_) {
return z_hello_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(z_owned_bytes_writer_t* dst, z_loaned_bytes_writer_t* this_) {
return z_bytes_writer_loaned_take(dst, this_);
inline z_result_t z_take_loaned(z_owned_bytes_writer_t* dst, z_loaned_bytes_writer_t* this_) {
return z_bytes_writer_take_loaned(dst, this_);
}
inline z_result_t z_loaned_take(ze_owned_serializer_t* dst, ze_loaned_serializer_t* this_) {
return ze_serializer_loaned_take(dst, this_);
inline z_result_t z_take_loaned(ze_owned_serializer_t* dst, ze_loaned_serializer_t* this_) {
return ze_serializer_take_loaned(dst, this_);
}

template <class T>
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 @@ -1804,7 +1804,7 @@ void z_query_reply_options_default(z_query_reply_options_t *options);
z_result_t z_query_reply(const z_loaned_query_t *query, const z_loaned_keyexpr_t *keyexpr, z_moved_bytes_t *payload,
const z_query_reply_options_t *options);

z_result_t z_query_loaned_take(z_owned_query_t *dst, z_loaned_query_t *src);
z_result_t z_query_take_loaned(z_owned_query_t *dst, z_loaned_query_t *src);

/**
* Builds a :c:type:`z_query_reply_del_options_t` with default values.
Expand Down
2 changes: 1 addition & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ bool z_reply_replier_id(const z_loaned_reply_t *reply, z_id_t *out_id) {
#if Z_FEATURE_QUERYABLE == 1
_Z_OWNED_FUNCTIONS_RC_IMPL(query)

z_result_t z_query_loaned_take(z_owned_query_t *dst, z_loaned_query_t *src) {
z_result_t z_query_take_loaned(z_owned_query_t *dst, z_loaned_query_t *src) {
dst->_rc = *src;
_z_query_t q = _z_query_null();
*src = _z_query_rc_new_from_val(&q);
Expand Down

0 comments on commit e954df6

Please sign in to comment.