aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-colour.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-colour.c')
-rw-r--r--src/mds-colour.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mds-colour.c b/src/mds-colour.c
index 51e7a49..52a1184 100644
--- a/src/mds-colour.c
+++ b/src/mds-colour.c
@@ -1,6 +1,6 @@
/**
* mds — A micro-display server
- * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (maandree@kth.se)
+ * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (m@maandree.se)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -391,7 +391,7 @@ handle_message(void)
size_t i;
#define __get_header(storage, header)\
- (startswith(received.headers[i], header))\
+ (strstarts(received.headers[i], header))\
storage = received.headers[i] + strlen(header)
for (i = 0; i < received.header_count; i++) {
@@ -418,11 +418,11 @@ handle_message(void)
return 0; /* How did that get here, no matter, just ignore it? */
#define t(expr) do { fail_if (expr); return 0; } while (0)
- if (strequals(recv_command, "list-colours"))
+ if (streq(recv_command, "list-colours"))
t (handle_list_colours(recv_client_id, recv_message_id, recv_include_values));
- if (strequals(recv_command, "get-colour"))
+ if (streq(recv_command, "get-colour"))
t (handle_get_colour(recv_client_id, recv_message_id, recv_name));
- if (strequals(recv_command, "set-colour"))
+ if (streq(recv_command, "set-colour"))
t (handle_set_colour(recv_name, recv_remove, recv_bytes, recv_red, recv_green, recv_blue));
#undef t
@@ -529,12 +529,12 @@ handle_list_colours(const char *recv_client_id, const char *recv_message_id, con
size_t length;
char *temp;
- if (strequals(recv_client_id, "0:0"))
+ if (streq(recv_client_id, "0:0"))
return eprint("got a query from an anonymous client, ignoring."), 0;
if (!recv_include_values) include_values = 0;
- else if (strequals(recv_include_values, "yes")) include_values = 1;
- else if (strequals(recv_include_values, "no")) include_values = 0;
+ else if (streq(recv_include_values, "yes")) include_values = 1;
+ else if (streq(recv_include_values, "no")) include_values = 0;
else {
fail_if (send_error(recv_client_id, recv_message_id, "list-colours", 0, EPROTO, NULL));
return 0;
@@ -598,7 +598,7 @@ handle_get_colour(const char *recv_client_id, const char *recv_message_id, const
size_t length;
char *temp;
- if (strequals(recv_client_id, "0:0"))
+ if (streq(recv_client_id, "0:0"))
return eprint("got a query from an anonymous client, ignoring."), 0;
if (!recv_name) {
@@ -671,8 +671,8 @@ handle_set_colour(const char *recv_name, const char *recv_remove, const char *re
int bytes;
if (!recv_remove) remove_colour = 0;
- else if (strequals(recv_remove, "yes")) remove_colour = 1;
- else if (strequals(recv_remove, "no")) remove_colour = 0;
+ else if (streq(recv_remove, "yes")) remove_colour = 1;
+ else if (streq(recv_remove, "no")) remove_colour = 0;
else
return eprint("got an invalid value on the Remove-header, ignoring."), 0;