aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-24 20:13:05 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-24 20:13:07 +0200
commitbdbf0844d8027289a48f12f6fd068413b7cc4884 (patch)
tree9aa61cd02796bd3e8bc01850d5f803a9d7bea2d0 /src/libmdsserver/util.h
parentmds-kkbd: decipher mapping_query and fix a minor bug in it (diff)
downloadmds-bdbf0844d8027289a48f12f6fd068413b7cc4884.tar.gz
mds-bdbf0844d8027289a48f12f6fd068413b7cc4884.tar.bz2
mds-bdbf0844d8027289a48f12f6fd068413b7cc4884.tar.xz
introduce the `Origin command`-header
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/libmdsserver/util.h')
-rw-r--r--src/libmdsserver/util.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h
index 9ac0357..e6fa5ee 100644
--- a/src/libmdsserver/util.h
+++ b/src/libmdsserver/util.h
@@ -385,6 +385,8 @@ int verify_utf8(const char* string, int allow_modified_nul) __attribute__((pure)
*
* @param recv_client_id The client ID attached on the message that was received, must not be `NULL`
* @param recv_message_id The message ID attached on the message that was received, must not be `NULL`
+ * @param recv_command The value of the `Command`-header on the message that was received,
+ * must not be `NULL`
* @param custom Non-zero if the error is a custom error
* @param errnum The error number, `errno` should be used if the error
* is not a custom error, zero should be used on success,
@@ -404,15 +406,18 @@ int verify_utf8(const char* string, int allow_modified_nul) __attribute__((pure)
* @return The length of the message, zero on error
*/
size_t construct_error_message(const char* restrict recv_client_id, const char* restrict recv_message_id,
- int custom, int errnum, const char* restrict message,
- char** restrict send_buffer, size_t* restrict send_buffer_size,
- uint32_t message_id) __attribute__((nonnull(1, 2, 6, 7)));
+ const char* restrict recv_command, int custom, int errnum,
+ const char* restrict message, char** restrict send_buffer,
+ size_t* restrict send_buffer_size,
+ uint32_t message_id) __attribute__((nonnull(1, 2, 3, 7, 8)));
/**
* Send an error message
*
* @param recv_client_id The client ID attached on the message that was received, must not be `NULL`
* @param recv_message_id The message ID attached on the message that was received, must not be `NULL`
+ * @param recv_command The value of the `Command`-header on the message that was received,
+ * must not be `NULL`
* @param custom Non-zero if the error is a custom error
* @param errnum The error number, `errno` should be used if the error
* is not a custom error, zero should be used on success,
@@ -433,9 +438,9 @@ size_t construct_error_message(const char* restrict recv_client_id, const char*
* @return Zero on success, -1 on error
*/
int send_error(const char* restrict recv_client_id, const char* restrict recv_message_id,
- int custom, int errnum, const char* restrict message, char** restrict send_buffer,
- size_t* restrict send_buffer_size, uint32_t message_id,
- int socket_fd) __attribute__((nonnull(1, 2, 6, 7)));
+ const char* restrict recv_command, int custom, int errnum, const char* restrict message,
+ char** restrict send_buffer, size_t* restrict send_buffer_size, uint32_t message_id,
+ int socket_fd) __attribute__((nonnull(1, 2, 3, 7, 8)));
#endif