ipc: rename COMMAND to RUN_COMMAND for consistency (#2956)
All other message types are verbs, only our first-ever message COMMAND wasn’t. While we’re here, also change the message type dictionary into a table with clickable links to the corresponding reply type. Authors of downstream IPC libraries are encouraged to keep the old name around so as to not break existing code, but mark it as deprecated.
This commit is contained in:
committed by
GitHub
parent
d726d09d49
commit
607e97e651
@ -418,7 +418,7 @@ int main(int argc, char *argv[]) {
|
||||
if (connect(sockfd, (const struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0)
|
||||
err(EXIT_FAILURE, "Could not connect to i3");
|
||||
|
||||
if (ipc_send_message(sockfd, strlen(payload), I3_IPC_MESSAGE_TYPE_COMMAND,
|
||||
if (ipc_send_message(sockfd, strlen(payload), I3_IPC_MESSAGE_TYPE_RUN_COMMAND,
|
||||
(uint8_t *)payload) == -1)
|
||||
err(EXIT_FAILURE, "IPC: write()");
|
||||
FREE(payload);
|
||||
@ -432,8 +432,8 @@ int main(int argc, char *argv[]) {
|
||||
err(EXIT_FAILURE, "IPC: read()");
|
||||
return 1;
|
||||
}
|
||||
if (reply_type != I3_IPC_MESSAGE_TYPE_COMMAND)
|
||||
errx(EXIT_FAILURE, "IPC: received reply of type %d but expected %d (COMMAND)", reply_type, I3_IPC_MESSAGE_TYPE_COMMAND);
|
||||
if (reply_type != I3_IPC_REPLY_TYPE_COMMAND)
|
||||
errx(EXIT_FAILURE, "IPC: received reply of type %d but expected %d (COMMAND)", reply_type, I3_IPC_REPLY_TYPE_COMMAND);
|
||||
printf("%.*s\n", reply_length, reply);
|
||||
FREE(reply);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user