aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-15 19:08:07 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-15 19:08:07 +0200
commitf035cd92a4d75858606dd6dd41105fb914adcf31 (patch)
tree076045545e65fe51a2fd4e4e04a0cde6b43f177b /src
parentminor refactoring (diff)
downloadcimple-f035cd92a4d75858606dd6dd41105fb914adcf31.tar.gz
cimple-f035cd92a4d75858606dd6dd41105fb914adcf31.zip
msg: strings, not words
Diffstat (limited to 'src')
-rw-r--r--src/command.c2
-rw-r--r--src/msg.c4
-rw-r--r--src/msg.h4
-rw-r--r--src/run_queue.c4
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];
diff --git a/src/msg.c b/src/msg.c
index b95e27e..918ae43 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -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];
}
diff --git a/src/msg.h b/src/msg.h
index 19a204d..64da9b8 100644
--- a/src/msg.h
+++ b/src/msg.h
@@ -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)