Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename (de/en)code to (de)serialize #424

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,32 +292,32 @@ Primitives
.. autocfunction:: primitives.h::z_value_payload
.. autocfunction:: primitives.h::z_slice_data
.. autocfunction:: primitives.h::z_slice_len
.. autocfunction:: primitives.h::z_bytes_decode_into_int8
.. autocfunction:: primitives.h::z_bytes_decode_into_int16
.. autocfunction:: primitives.h::z_bytes_decode_into_int32
.. autocfunction:: primitives.h::z_bytes_decode_into_int64
.. autocfunction:: primitives.h::z_bytes_decode_into_uint8
.. autocfunction:: primitives.h::z_bytes_decode_into_uint16
.. autocfunction:: primitives.h::z_bytes_decode_into_uint32
.. autocfunction:: primitives.h::z_bytes_decode_into_uint64
.. autocfunction:: primitives.h::z_bytes_decode_into_float
.. autocfunction:: primitives.h::z_bytes_decode_into_double
.. autocfunction:: primitives.h::z_bytes_decode_into_slice
.. autocfunction:: primitives.h::z_bytes_decode_into_string
.. autocfunction:: primitives.h::z_bytes_encode_from_int8
.. autocfunction:: primitives.h::z_bytes_encode_from_int16
.. autocfunction:: primitives.h::z_bytes_encode_from_int32
.. autocfunction:: primitives.h::z_bytes_encode_from_int64
.. autocfunction:: primitives.h::z_bytes_encode_from_uint8
.. autocfunction:: primitives.h::z_bytes_encode_from_uint16
.. autocfunction:: primitives.h::z_bytes_encode_from_uint32
.. autocfunction:: primitives.h::z_bytes_encode_from_uint64
.. autocfunction:: primitives.h::z_bytes_encode_from_float
.. autocfunction:: primitives.h::z_bytes_encode_from_double
.. autocfunction:: primitives.h::z_bytes_encode_from_slice
.. autocfunction:: primitives.h::z_bytes_encode_from_slice_copy
.. autocfunction:: primitives.h::z_bytes_encode_from_string
.. autocfunction:: primitives.h::z_bytes_encode_from_string_copy
.. autocfunction:: primitives.h::z_bytes_deserialize_into_int8
.. autocfunction:: primitives.h::z_bytes_deserialize_into_int16
.. autocfunction:: primitives.h::z_bytes_deserialize_into_int32
.. autocfunction:: primitives.h::z_bytes_deserialize_into_int64
.. autocfunction:: primitives.h::z_bytes_deserialize_into_uint8
.. autocfunction:: primitives.h::z_bytes_deserialize_into_uint16
.. autocfunction:: primitives.h::z_bytes_deserialize_into_uint32
.. autocfunction:: primitives.h::z_bytes_deserialize_into_uint64
.. autocfunction:: primitives.h::z_bytes_deserialize_into_float
.. autocfunction:: primitives.h::z_bytes_deserialize_into_double
.. autocfunction:: primitives.h::z_bytes_deserialize_into_slice
.. autocfunction:: primitives.h::z_bytes_deserialize_into_string
.. autocfunction:: primitives.h::z_bytes_serialize_from_int8
.. autocfunction:: primitives.h::z_bytes_serialize_from_int16
.. autocfunction:: primitives.h::z_bytes_serialize_from_int32
.. autocfunction:: primitives.h::z_bytes_serialize_from_int64
.. autocfunction:: primitives.h::z_bytes_serialize_from_uint8
.. autocfunction:: primitives.h::z_bytes_serialize_from_uint16
.. autocfunction:: primitives.h::z_bytes_serialize_from_uint32
.. autocfunction:: primitives.h::z_bytes_serialize_from_uint64
.. autocfunction:: primitives.h::z_bytes_serialize_from_float
.. autocfunction:: primitives.h::z_bytes_serialize_from_double
.. autocfunction:: primitives.h::z_bytes_serialize_from_slice
.. autocfunction:: primitives.h::z_bytes_serialize_from_slice_copy
.. autocfunction:: primitives.h::z_bytes_serialize_from_string
.. autocfunction:: primitives.h::z_bytes_serialize_from_string_copy
.. autocfunction:: primitives.h::z_timestamp_check
.. autocfunction:: primitives.h::z_query_target_default
.. autocfunction:: primitives.h::z_query_consolidation_auto
Expand Down
4 changes: 2 additions & 2 deletions examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void reply_handler(const z_loaned_reply_t *oreply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

Serial.print(" >> [Get listener] Received (");
Serial.print(z_string_data(z_string_loan(&keystr)));
Expand Down Expand Up @@ -118,7 +118,7 @@ void loop() {
// Value encoding
z_owned_bytes_t payload;
if (strcmp(VALUE, "") != 0) {
z_bytes_encode_from_string(&payload, VALUE);
z_bytes_serialize_from_string(&payload, VALUE);
opts.payload = &payload;
}
z_owned_closure_reply_t callback;
Expand Down
4 changes: 2 additions & 2 deletions examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) {

// Process value
z_owned_string_t payload_string;
z_bytes_decode_into_string(z_value_payload(z_query_value(query)), &payload_string);
z_bytes_deserialize_into_string(z_value_payload(z_query_value(query)), &payload_string);
if (z_string_len(z_string_loan(&payload_string)) > 1) {
Serial.print(" with value '");
Serial.print(z_string_data(z_string_loan(&payload_string)));
Expand All @@ -57,7 +57,7 @@ void query_handler(const z_loaned_query_t *query, void *arg) {

// Reply value encoding
z_owned_bytes_t reply_payload;
z_bytes_encode_from_string(&reply_payload, VALUE);
z_bytes_serialize_from_string(&reply_payload, VALUE);

z_query_reply(query, z_view_keyexpr_loan(&ke), z_bytes_move(&reply_payload), NULL);

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 @@ -38,7 +38,7 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(sample), &value);
z_bytes_deserialize_into_string(z_sample_payload(sample), &value);

Serial.print(" >> [Subscription listener] Received (");
Serial.print(z_string_data(z_string_loan(&keystr)));
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void reply_handler(const z_loaned_reply_t *oreply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(" >> Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(replystr)));
z_drop(z_move(keystr));
Expand Down Expand Up @@ -165,7 +165,7 @@ void app_main() {
// Value encoding
z_owned_bytes_t payload;
if (strcmp(VALUE, "") != 0) {
z_bytes_encode_from_string(&payload, VALUE);
z_bytes_serialize_from_string(&payload, VALUE);
opts.payload = &payload;
}
z_owned_closure_reply_t callback;
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
z_loan(params)->val);
// Process value
z_owned_string_t payload_string;
z_bytes_decode_into_string(z_value_payload(z_query_value(query)), &payload_string);
z_bytes_deserialize_into_string(z_value_payload(z_query_value(query)), &payload_string);
if (z_string_len(z_loan(payload_string)) > 1) {
printf(" with value '%s'\n", z_string_data(z_loan(payload_string)));
}
Expand All @@ -122,7 +122,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {

// Reply value encoding
z_owned_bytes_t reply_payload;
z_bytes_encode_from_string(&reply_payload, VALUE);
z_bytes_serialize_from_string(&reply_payload, VALUE);

z_query_reply(query, z_loan(ke), z_move(reply_payload), NULL);
z_drop(z_move(keystr));
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 @@ -104,7 +104,7 @@ void data_handler(const z_loaned_sample_t* sample, void* arg) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(sample), &value);
z_bytes_deserialize_into_string(z_sample_payload(sample), &value);
printf(" >> [Subscriber handler] Received ('%s': '%s')\n", z_string_data(z_string_loan(&keystr)),
z_string_data(z_string_loan(&value)));
z_string_drop(z_string_move(&keystr));
Expand Down
4 changes: 2 additions & 2 deletions examples/freertos_plus_tcp/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void reply_handler(const z_loaned_reply_t *reply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(">> Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(replystr)));
z_drop(z_move(keystr));
Expand Down Expand Up @@ -89,7 +89,7 @@ void app_main(void) {
// Value encoding
z_owned_bytes_t payload;
if (strcmp(VALUE, "") != 0) {
z_bytes_encode_from_string(&payload, VALUE);
z_bytes_serialize_from_string(&payload, VALUE);
opts.payload = &payload;
}
z_owned_closure_reply_t callback;
Expand Down
4 changes: 2 additions & 2 deletions examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
z_loan(params)->val);
// Process value
z_owned_string_t payload_string;
z_bytes_decode_into_string(z_value_payload(z_query_value(query)), &payload_string);
z_bytes_deserialize_into_string(z_value_payload(z_query_value(query)), &payload_string);
if (z_string_len(z_loan(payload_string)) > 1) {
printf(" with value '%s'\n", z_string_data(z_loan(payload_string)));
}
Expand All @@ -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_owned_bytes_t reply_payload;
z_bytes_encode_from_string(&reply_payload, VALUE);
z_bytes_serialize_from_string(&reply_payload, VALUE);

z_query_reply(query, z_query_keyexpr(query), z_move(reply_payload), &options);
z_drop(z_move(keystr));
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 @@ -33,7 +33,7 @@ void data_handler(const z_loaned_sample_t *sample, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(sample), &value);
z_bytes_deserialize_into_string(z_sample_payload(sample), &value);
printf(">> [Subscriber] Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(value)));
z_drop(z_move(keystr));
z_drop(z_move(value));
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 @@ -36,7 +36,7 @@ void data_handler(const z_loaned_sample_t *sample, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(sample), &value);
z_bytes_deserialize_into_string(z_sample_payload(sample), &value);
printf(">> [Subscriber] Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(value)));
z_drop(z_move(keystr));
z_drop(z_move(value));
Expand Down
4 changes: 2 additions & 2 deletions examples/mbed/z_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void reply_handler(const z_loaned_reply_t *oreply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(" >> Received ('%s': '%s')\n", z_string_data(z_string_loan(&keystr)),
z_string_data(z_string_loan(&replystr)));
Expand Down Expand Up @@ -86,7 +86,7 @@ int main(int argc, char **argv) {
// Value encoding
z_owned_bytes_t payload;
if (strcmp(VALUE, "") != 0) {
z_bytes_encode_from_string(&payload, VALUE);
z_bytes_serialize_from_string(&payload, VALUE);
opts.payload = &payload;
}
z_owned_closure_reply_t callback;
Expand Down
4 changes: 2 additions & 2 deletions examples/mbed/z_queryable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ void query_handler(const z_loaned_query_t *query, void *ctx) {
(int)z_view_string_loan(&pred)->len, z_view_string_loan(&pred)->val);
// Process value
z_owned_string_t payload_string;
z_bytes_decode_into_string(z_value_payload(z_query_value(query)), &payload_string);
z_bytes_deserialize_into_string(z_value_payload(z_query_value(query)), &payload_string);
if (z_string_len(z_string_loan(&payload_string)) > 1) {
printf(" with value '%s'\n", z_string_data(z_string_loan(&payload_string)));
}
z_string_drop(z_string_move(&payload_string));

// Reply value encoding
z_owned_bytes_t reply_payload;
z_bytes_encode_from_string(&reply_payload, VALUE);
z_bytes_serialize_from_string(&reply_payload, VALUE);

z_query_reply(query, z_query_keyexpr(query), z_bytes_move(&reply_payload), NULL);
z_string_drop(z_string_move(&keystr));
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 @@ -34,7 +34,7 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(sample), &value);
z_bytes_deserialize_into_string(z_sample_payload(sample), &value);
printf(" >> [Subscriber handler] Received ('%s': '%s')\n", z_string_data(z_string_loan(&keystr)),
z_string_data(z_string_loan(&value)));
z_string_drop(z_string_move(&keystr));
Expand Down
4 changes: 2 additions & 2 deletions examples/unix/c11/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void reply_handler(const z_loaned_reply_t *reply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(">> Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(replystr)));
z_drop(z_move(keystr));
Expand Down Expand Up @@ -123,7 +123,7 @@ int main(int argc, char **argv) {
// Value encoding
z_owned_bytes_t payload;
if (value != NULL) {
z_bytes_encode_from_string(&payload, value);
z_bytes_serialize_from_string(&payload, value);
opts.payload = &payload;
}

Expand Down
19 changes: 10 additions & 9 deletions examples/unix/c11/z_get_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ _Bool create_attachment_iter(z_owned_bytes_t *kv_pair, void *context, size_t *cu
if (kvs->current_idx >= kvs->len) {
return false;
} else {
z_bytes_encode_from_string(&k, kvs->data[kvs->current_idx].key);
z_bytes_encode_from_string(&v, kvs->data[kvs->current_idx].value);
zp_bytes_encode_from_pair(kv_pair, z_move(k), z_move(v), curr_idx);
z_bytes_serialize_from_string(&k, kvs->data[kvs->current_idx].key);
z_bytes_serialize_from_string(&v, kvs->data[kvs->current_idx].value);
zp_bytes_serialize_from_pair(kv_pair, z_move(k), z_move(v), curr_idx);
kvs->current_idx++;
return true;
}
Expand All @@ -74,9 +74,10 @@ _Bool create_attachment_iter(z_owned_bytes_t *kv_pair, void *context, size_t *cu
void parse_attachment(kv_pairs_rx_t *kvp, const z_loaned_bytes_t *attachment) {
size_t curr_idx = 0;
z_owned_bytes_t first, second;
while ((kvp->current_idx < kvp->len) && (zp_bytes_decode_into_pair(attachment, &first, &second, &curr_idx) == 0)) {
z_bytes_decode_into_string(z_loan(first), &kvp->data[kvp->current_idx].key);
z_bytes_decode_into_string(z_loan(second), &kvp->data[kvp->current_idx].value);
while ((kvp->current_idx < kvp->len) &&
(zp_bytes_deserialize_into_pair(attachment, &first, &second, &curr_idx) == 0)) {
z_bytes_deserialize_into_string(z_loan(first), &kvp->data[kvp->current_idx].key);
z_bytes_deserialize_into_string(z_loan(second), &kvp->data[kvp->current_idx].value);
z_bytes_drop(&first);
z_bytes_drop(&second);
kvp->current_idx++;
Expand Down Expand Up @@ -113,7 +114,7 @@ void reply_handler(const z_loaned_reply_t *reply, void *ctx) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(">> Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(replystr)));

Expand Down Expand Up @@ -210,7 +211,7 @@ int main(int argc, char **argv) {
// Value encoding
z_owned_bytes_t payload;
if (value != NULL) {
z_bytes_encode_from_string(&payload, value);
z_bytes_serialize_from_string(&payload, value);
opts.payload = &payload;
}

Expand All @@ -219,7 +220,7 @@ int main(int argc, char **argv) {
kvs[0] = (kv_pair_t){.key = "test_key", .value = "test_value"};
kv_pairs_tx_t ctx = (kv_pairs_tx_t){.data = kvs, .current_idx = 0, .len = 1};
z_owned_bytes_t attachment;
zp_bytes_encode_from_iter(&attachment, create_attachment_iter, (void *)&ctx, kv_pairs_size(&ctx));
zp_bytes_serialize_from_iter(&attachment, create_attachment_iter, (void *)&ctx, kv_pairs_size(&ctx));
opts.attachment = z_move(attachment);

z_owned_closure_reply_t callback;
Expand Down
4 changes: 2 additions & 2 deletions examples/unix/c11/z_get_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int main(int argc, char **argv) {
// Value encoding
z_owned_bytes_t payload;
if (value != NULL) {
z_bytes_encode_from_string(&payload, value);
z_bytes_serialize_from_string(&payload, value);
opts.payload = &payload;
}
z_owned_reply_ring_channel_t channel;
Expand All @@ -111,7 +111,7 @@ int main(int argc, char **argv) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(sample), &keystr);
z_owned_string_t replystr;
z_bytes_decode_into_string(z_sample_payload(sample), &replystr);
z_bytes_deserialize_into_string(z_sample_payload(sample), &replystr);

printf(">> Received ('%s': '%s')\n", z_string_data(z_loan(keystr)), z_string_data(z_loan(replystr)));
z_drop(z_move(keystr));
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
void callback(const z_loaned_sample_t* sample, void* context) {
const z_loaned_publisher_t* pub = z_loan(*(z_owned_publisher_t*)context);
z_owned_slice_t value;
z_bytes_decode_into_slice(z_sample_payload(sample), &value);
z_bytes_deserialize_into_slice(z_sample_payload(sample), &value);
z_publisher_put(pub, z_slice_data(z_loan(value)), z_slice_len(z_loan(value)), NULL);
z_drop(z_move(value));
}
Expand Down
8 changes: 4 additions & 4 deletions examples/unix/c11/z_pub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ _Bool create_attachment_iter(z_owned_bytes_t *kv_pair, void *context, size_t *cu
if (kvs->current_idx >= kvs->len) {
return false;
} else {
z_bytes_encode_from_string(&k, kvs->data[kvs->current_idx].key);
z_bytes_encode_from_string(&v, kvs->data[kvs->current_idx].value);
zp_bytes_encode_from_pair(kv_pair, z_move(k), z_move(v), curr_idx);
z_bytes_serialize_from_string(&k, kvs->data[kvs->current_idx].key);
z_bytes_serialize_from_string(&v, kvs->data[kvs->current_idx].value);
zp_bytes_serialize_from_pair(kv_pair, z_move(k), z_move(v), curr_idx);
kvs->current_idx++;
return true;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ int main(int argc, char **argv) {
sprintf(buf_ind, "%d", idx);
kvs[1] = (kv_pair_t){.key = "index", .value = buf_ind};
kv_pairs_t ctx = (kv_pairs_t){.data = kvs, .current_idx = 0, .len = 2};
zp_bytes_encode_from_iter(&attachment, create_attachment_iter, (void *)&ctx, kv_pairs_size(&ctx));
zp_bytes_serialize_from_iter(&attachment, create_attachment_iter, (void *)&ctx, kv_pairs_size(&ctx));
options.attachment = z_move(attachment);

sprintf(buf, "[%4d] %s", idx, value);
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 @@ -91,7 +91,7 @@ int main(int argc, char **argv) {
z_owned_string_t keystr;
z_keyexpr_to_string(z_sample_keyexpr(z_loan(sample)), &keystr);
z_owned_string_t value;
z_bytes_decode_into_string(z_sample_payload(z_loan(sample)), &value);
z_bytes_deserialize_into_string(z_sample_payload(z_loan(sample)), &value);
printf(">> [Subscriber] Pulled ('%s': '%s')\n", z_string_data(z_loan(keystr)),
z_string_data(z_loan(value)));
z_drop(z_move(keystr));
Expand Down
Loading
Loading