aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcoopgamma.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-15 17:54:17 +0200
committerMattias Andrée <maandree@kth.se>2016-07-15 17:54:17 +0200
commit6c6a8d38751318d1eea8be8e69a0a8f23e596f4d (patch)
treeb8e2e62f404071b9cd4dd0d505d04a835a9e88f4 /src/libcoopgamma.h
parentm doc (diff)
downloadlibcoopgamma-6c6a8d38751318d1eea8be8e69a0a8f23e596f4d.tar.gz
libcoopgamma-6c6a8d38751318d1eea8be8e69a0a8f23e596f4d.tar.bz2
libcoopgamma-6c6a8d38751318d1eea8be8e69a0a8f23e596f4d.tar.xz
Implement libcoopgamma_synchronise
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/libcoopgamma.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/libcoopgamma.h b/src/libcoopgamma.h
index 4ed1fad..4b93710 100644
--- a/src/libcoopgamma.h
+++ b/src/libcoopgamma.h
@@ -672,6 +672,31 @@ typedef struct libcoopgamma_context
*/
size_t length;
+ /**
+ * The beginning of the current line that
+ * is being read by `libcoopgamma_synchronise`
+ */
+ size_t curline;
+
+ /**
+ * The ID of outbound message to which the inbound
+ * message being read by `libcoopgamma_synchronise`
+ * is a response
+ */
+ uint32_t in_response_to;
+
+ /**
+ * Whether `libcoopgamma_synchronise` have
+ * read the empty end-of-headers line
+ */
+ int have_all_headers;
+
+ /**
+ * Whether `libcoopgamma_synchronise` is reading
+ * a corrupt but recoverable message
+ */
+ int bad_message;
+
} libcoopgamma_context_t;
@@ -1252,7 +1277,9 @@ int libcoopgamma_flush(libcoopgamma_context_t* restrict);
* Functions that parse the message will detect such corruption.
* @return Zero on success, -1 on error, -2 if the message is ignored
* which happens if corresponding `libcoopgamma_async_context_t`
- * is not listed
+ * is not listed. If `-1` is returned, `errno` will be set,
+ * if it is set to `ENOTRECOVERABLE` you have receive a corrupt
+ * message and the context has been tainted beyond recover.
*/
int libcoopgamma_synchronise(libcoopgamma_context_t* restrict, libcoopgamma_async_context_t* restrict,
size_t, size_t* restrict);