Skip to content

Commit

Permalink
String names normalization (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc authored Jul 3, 2024
1 parent ddc565b commit 735e2e1
Show file tree
Hide file tree
Showing 44 changed files with 193 additions and 193 deletions.
2 changes: 1 addition & 1 deletion examples/z_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(int argc, char **argv) {

printf("Deleting resources matching '%s'...\n", keyexpr);
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
int res = z_delete(z_loan(s), z_loan(ke), NULL);
if (res < 0) {
printf("Delete failed...\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int argc, char **argv) {
break;
}
z_view_keyexpr_t keyexpr;
if (z_view_keyexpr_from_string(&keyexpr, expr) < 0) {
if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) {
printf("%s is not a valid key expression", expr);
exit(-1);
}
Expand Down Expand Up @@ -64,7 +64,7 @@ int main(int argc, char **argv) {

z_owned_bytes_t payload;
if (value != NULL) {
z_bytes_serialize_from_string(&payload, value);
z_bytes_serialize_from_str(&payload, value);
opts.payload = &payload;
}
z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure),
Expand Down
2 changes: 1 addition & 1 deletion examples/z_get_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t keyexpr;
if (z_view_keyexpr_from_string(&keyexpr, expr) < 0) {
if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) {
printf("%s is not a valid key expression\n", expr);
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_get_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char** argv) {
size_t value_len = value ? strlen(value) : 0;

z_view_keyexpr_t keyexpr;
if (z_view_keyexpr_from_string(&keyexpr, expr) < 0) {
if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) {
printf("%s is not a valid key expression", expr);
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t keyexpr;
if (z_view_keyexpr_from_string(&keyexpr, expr) < 0) {
if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) {
printf("%s is not a valid key expression\n", expr);
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_non_blocking_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main(int argc, char **argv) {
expr = argv[1];
}
z_view_keyexpr_t keyexpr;
if (z_view_keyexpr_from_string(&keyexpr, expr) < 0) {
if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) {
printf("%s is not a valid key expression", expr);
exit(-1);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/z_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int main(int argc, char** argv) {
z_owned_session_t session;
z_open(&session, z_move(config));
z_view_keyexpr_t ping;
z_view_keyexpr_from_string_unchecked(&ping, "test/ping");
z_view_keyexpr_from_str_unchecked(&ping, "test/ping");
z_view_keyexpr_t pong;
z_view_keyexpr_from_string_unchecked(&pong, "test/pong");
z_view_keyexpr_from_str_unchecked(&pong, "test/pong");
z_owned_publisher_t pub;
z_declare_publisher(&pub, z_loan(session), z_loan(ping), NULL);
z_owned_closure_sample_t respond;
Expand Down
4 changes: 2 additions & 2 deletions examples/z_ping_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int main(int argc, char** argv) {
z_owned_session_t session;
z_open(&session, z_move(config));
z_view_keyexpr_t ping;
z_view_keyexpr_from_string_unchecked(&ping, "test/ping");
z_view_keyexpr_from_str_unchecked(&ping, "test/ping");
z_view_keyexpr_t pong;
z_view_keyexpr_from_string_unchecked(&pong, "test/pong");
z_view_keyexpr_from_str_unchecked(&pong, "test/pong");
z_owned_publisher_t pub;
z_declare_publisher(&pub, z_loan(session), z_loan(ping), NULL);
z_owned_closure_sample_t respond;
Expand Down
4 changes: 2 additions & 2 deletions examples/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ int main(int argc, char** argv) {
z_owned_session_t session;
z_open(&session, z_move(config));
z_view_keyexpr_t ping;
z_view_keyexpr_from_string_unchecked(&ping, "test/ping");
z_view_keyexpr_from_str_unchecked(&ping, "test/ping");
z_view_keyexpr_t pong;
z_view_keyexpr_from_string_unchecked(&pong, "test/pong");
z_view_keyexpr_from_str_unchecked(&pong, "test/pong");
z_owned_publisher_t pub;
z_declare_publisher(&pub, z_loan(session), z_loan(pong), NULL);
z_owned_closure_sample_t respond;
Expand Down
4 changes: 2 additions & 2 deletions examples/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
printf("Declaring Publisher on '%s'...\n", keyexpr);
z_owned_publisher_t pub;
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) {
printf("Unable to declare Publisher for key expression!\n");
exit(-1);
Expand All @@ -77,7 +77,7 @@ int main(int argc, char **argv) {
z_publisher_put_options_default(&options);

z_owned_bytes_t payload;
z_bytes_serialize_from_string(&payload, buf);
z_bytes_serialize_from_str(&payload, buf);

z_publisher_put(z_loan(pub), z_move(payload), &options);
}
Expand Down
8 changes: 4 additions & 4 deletions examples/z_pub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ bool create_attachment_iter(z_owned_bytes_t* kv_pair, void* context) {
if (kvs->current_idx >= kvs->len) {
return false;
} else {
z_bytes_serialize_from_string(&k, kvs->data[kvs->current_idx].key);
z_bytes_serialize_from_string(&v, kvs->data[kvs->current_idx].value);
z_bytes_serialize_from_str(&k, kvs->data[kvs->current_idx].key);
z_bytes_serialize_from_str(&v, kvs->data[kvs->current_idx].value);
z_bytes_serialize_from_pair(kv_pair, z_move(k), z_move(v));
kvs->current_idx++;
return true;
Expand Down Expand Up @@ -69,7 +69,7 @@ int main(int argc, char** argv) {

printf("Declaring Publisher on '%s'...\n", keyexpr);
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
z_owned_publisher_t pub;
if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL)) {
printf("Unable to declare Publisher for key expression!\n");
Expand Down Expand Up @@ -101,7 +101,7 @@ int main(int argc, char** argv) {
sprintf(buf, "[%4d] %s", idx, value);
printf("Putting Data ('%s': '%s')...\n", keyexpr, buf);

z_bytes_serialize_from_string(&payload, buf);
z_bytes_serialize_from_str(&payload, buf);
z_publisher_put(z_loan(pub), z_move(payload), &options);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/z_pub_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
printf("Declaring publication cache on '%s'...\n", keyexpr);
ze_owned_publication_cache_t pub_cache;
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
ze_declare_publication_cache(&pub_cache, z_loan(s), z_loan(ke), &pub_cache_opts);
if (!z_check(pub_cache)) {
printf("Unable to declare publication cache for key expression!\n");
Expand All @@ -68,7 +68,7 @@ int main(int argc, char **argv) {
sprintf(buf, "[%4d] %s", idx, value);
printf("Putting Data ('%s': '%s')...\n", keyexpr, buf);
z_owned_bytes_t payload;
z_bytes_serialize_from_string(&payload, buf);
z_bytes_serialize_from_str(&payload, buf);

z_put(z_loan(s), z_loan(ke), z_move(payload), NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_pub_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
printf("Declaring Publisher on '%s'...\n", keyexpr);
z_owned_publisher_t pub;
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
if (z_declare_publisher(&pub, z_loan(s), 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/z_pub_shm_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main(int argc, char **argv) {

z_owned_publisher_t pub;
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), &options)) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
Expand Down
2 changes: 1 addition & 1 deletion examples/z_pub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char **argv) {

z_owned_publisher_t pub;
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);
if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), &options)) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
Expand Down
2 changes: 1 addition & 1 deletion examples/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char **argv) {

printf("Declaring Subscriber on '%s'...\n", expr);
z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, expr);
z_view_keyexpr_from_str(&ke, expr);
z_owned_subscriber_t sub;

if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) {
Expand Down
8 changes: 4 additions & 4 deletions examples/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ int main(int argc, char **argv) {
printf("Putting Data ('%s': '%s')...\n", keyexpr, value);

z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);

z_owned_bytes_t payload;
z_bytes_serialize_from_string(&payload, value);
z_bytes_serialize_from_str(&payload, value);

z_owned_bytes_t attachment, key, val;
z_bytes_serialize_from_string(&key, "hello");
z_bytes_serialize_from_string(&val, "there");
z_bytes_serialize_from_str(&key, "hello");
z_bytes_serialize_from_str(&val, "there");
z_bytes_serialize_from_pair(&attachment, z_move(key), z_move(val));

z_put_options_t options;
Expand Down
2 changes: 1 addition & 1 deletion examples/z_query_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);

ze_querying_subscriber_options_t sub_opts;
ze_querying_subscriber_options_default(&sub_opts);
Expand Down
6 changes: 3 additions & 3 deletions examples/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ void query_handler(const z_loaned_query_t *query, void *context) {
z_query_reply_options_default(&options);

z_owned_bytes_t reply_payload;
z_bytes_serialize_from_string(&reply_payload, value);
z_bytes_serialize_from_str(&reply_payload, value);

z_view_keyexpr_t reply_keyexpr;
z_view_keyexpr_from_string(&reply_keyexpr, (const char *)context);
z_view_keyexpr_from_str(&reply_keyexpr, (const char *)context);

z_query_reply(query, z_loan(reply_keyexpr), z_move(reply_payload), &options);
}
Expand Down Expand Up @@ -75,7 +75,7 @@ int main(int argc, char **argv) {
exit(-1);
}

if (z_view_keyexpr_from_string(&ke, keyexpr)) {
if (z_view_keyexpr_from_str(&ke, keyexpr)) {
printf("%s is not a valid key expression", keyexpr);
exit(-1);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/z_queryable_with_channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
exit(-1);
}

if (z_view_keyexpr_from_string(&ke, keyexpr) < 0) {
if (z_view_keyexpr_from_str(&ke, keyexpr) < 0) {
printf("%s is not a valid key expression", keyexpr);
exit(-1);
}
Expand Down Expand Up @@ -88,7 +88,7 @@ int main(int argc, char **argv) {
z_query_reply_options_default(&options);

z_owned_bytes_t reply_payload;
z_bytes_serialize_from_string(&reply_payload, value);
z_bytes_serialize_from_str(&reply_payload, value);
z_query_reply(query, z_loan(ke), z_move(reply_payload), &options);
z_drop(z_move(oquery));
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);

z_owned_config_t config;
z_config_default(&config);
Expand Down
2 changes: 1 addition & 1 deletion examples/z_sub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, keyexpr);
z_view_keyexpr_from_str(&ke, keyexpr);

z_owned_config_t config;
z_config_default(&config);
Expand Down
2 changes: 1 addition & 1 deletion examples/z_sub_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t ke;
if (z_view_keyexpr_from_string(&ke, keyexpr) < 0) {
if (z_view_keyexpr_from_str(&ke, keyexpr) < 0) {
printf("%s is not a valid key expression\n", keyexpr);
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_sub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char **argv) {
}

z_view_keyexpr_t ke;
z_view_keyexpr_from_string(&ke, "test/thr");
z_view_keyexpr_from_str(&ke, "test/thr");
z_owned_keyexpr_t declared_ke;
z_declare_keyexpr(&declared_ke, z_loan(s), z_loan(ke));

Expand Down
Loading

0 comments on commit 735e2e1

Please sign in to comment.