aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsclient
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-25 03:05:50 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-25 03:05:50 +0200
commit7cf121b62cf78b40fefa97cc740af21fe98c65fb (patch)
treee46d58c752ffdb7c3fae5fad61bef3cadd4a431c /src/libmdsclient
parentlibmds_compose_v: make it easy to exclude headers conditionally (diff)
downloadmds-7cf121b62cf78b40fefa97cc740af21fe98c65fb.tar.gz
mds-7cf121b62cf78b40fefa97cc740af21fe98c65fb.tar.bz2
mds-7cf121b62cf78b40fefa97cc740af21fe98c65fb.tar.xz
...
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/libmdsclient')
-rw-r--r--src/libmdsclient/proto-util.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libmdsclient/proto-util.h b/src/libmdsclient/proto-util.h
index 9e10613..546b8d4 100644
--- a/src/libmdsclient/proto-util.h
+++ b/src/libmdsclient/proto-util.h
@@ -351,11 +351,14 @@ void libmds_headers_sort(char** restrict headers, size_t header_count);
* header line, that is, the header name, colon, blank space and then
* the header's value. No LF should be included. The following
* arguments should be the argument to format the header line.
- * This may be be iterated any number of this. The last argument
- * should be `NULL` to specify that there are no more headers.
- * The `Length`-header should not be included, it is added automatically.
- * A header may not have a length larger than 2¹⁵, otherwise
- * the behaviour of this function is undefined.
+ * If a format for a line begins with a question mark, the remainder
+ * of the line used, but only if the next argument is non-zero
+ * (it should be of type `int`,) that argument will not be used
+ * for the formatting. This may be be iterated any number of this.
+ * The last argument should be `NULL` to specify that there are no
+ * more headers. The `Length`-header should not be included, it is
+ * added automatically. A header may not have a length larger than
+ * 2¹⁵, otherwise the behaviour of this function is undefined.
* @return Zero on success, -1 on error, `errno` will have been set
* accordingly on error.
*
@@ -394,11 +397,14 @@ int libmds_compose(char** restrict buffer, size_t* restrict buffer_size, size_t*
* header line, that is, the header name, colon, blank space and then
* the header's value. No LF should be included. The following
* arguments should be the argument to format the header line.
- * This may be be iterated any number of this. The last argument
- * should be `NULL` to specify that there are no more headers.
- * The `Length`-header should not be included, it is added automatically.
- * A header may not have a length larger than 2¹⁵, otherwise
- * the behaviour of this function is undefined.
+ * If a format for a line begins with a question mark, the remainder
+ * of the line used, but only if the next argument is non-zero
+ * (it should be of type `int`,) that argument will not be used
+ * for the formatting. This may be be iterated any number of this.
+ * The last argument should be `NULL` to specify that there are no
+ * more headers. The `Length`-header should not be included, it is
+ * added automatically. A header may not have a length larger than
+ * 2¹⁵, otherwise the behaviour of this function is undefined.
* @return Zero on success, -1 on error, `errno` will have been set
* accordingly on error.
*