diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-15 19:08:07 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-15 19:08:07 +0200 |
commit | f035cd92a4d75858606dd6dd41105fb914adcf31 (patch) | |
tree | 076045545e65fe51a2fd4e4e04a0cde6b43f177b | |
parent | minor refactoring (diff) | |
download | cimple-f035cd92a4d75858606dd6dd41105fb914adcf31.tar.gz cimple-f035cd92a4d75858606dd6dd41105fb914adcf31.zip |
msg: strings, not words
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 2 | ||||
-rw-r--r-- | src/msg.c | 4 | ||||
-rw-r--r-- | src/msg.h | 4 | ||||
-rw-r--r-- | src/run_queue.c | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/command.c b/src/command.c index 581b319..55d60da 100644 --- a/src/command.c +++ b/src/command.c @@ -106,7 +106,7 @@ void cmd_dispatcher_destroy(struct cmd_dispatcher *dispatcher) int cmd_dispatcher_handle(const struct cmd_dispatcher *dispatcher, const struct msg *command, struct msg **result) { - const char *actual_cmd = msg_get_first_word(command); + const char *actual_cmd = msg_get_first_string(command); for (size_t i = 0; i < dispatcher->numof_cmds; ++i) { struct cmd_desc *cmd = &dispatcher->cmds[i]; @@ -24,12 +24,12 @@ size_t msg_get_length(const struct msg *msg) return msg->argc; } -const char **msg_get_words(const struct msg *msg) +const char **msg_get_strings(const struct msg *msg) { return msg->argv; } -const char *msg_get_first_word(const struct msg *msg) +const char *msg_get_first_string(const struct msg *msg) { return msg->argv[0]; } @@ -18,8 +18,8 @@ void msg_free(struct msg *); int msg_copy(struct msg **, const struct msg *); size_t msg_get_length(const struct msg *); -const char **msg_get_words(const struct msg *); -const char *msg_get_first_word(const struct msg *); +const char **msg_get_strings(const struct msg *); +const char *msg_get_first_string(const struct msg *); int msg_success(struct msg **); int msg_error(struct msg **); diff --git a/src/run_queue.c b/src/run_queue.c index 0455c92..3e83952 100644 --- a/src/run_queue.c +++ b/src/run_queue.c @@ -65,8 +65,8 @@ int run_from_msg(struct run **run, const struct msg *msg) return -1; } - const char **words = msg_get_words(msg); - return run_create(run, words[1], words[2]); + const char **argv = msg_get_strings(msg); + return run_create(run, argv[1], argv[2]); } void run_destroy(struct run *entry) |