aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcoopgamma.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-15 17:11:22 +0200
committerMattias Andrée <maandree@kth.se>2016-07-15 17:11:46 +0200
commitf0fb9bc5f222a157723e57bc4ae4940cc5c7e803 (patch)
treef6c925dcdcf003d284766ac0206d55e800a6e63d /src/libcoopgamma.h
parentm + Implement check_error, next_payload, and next_header (diff)
downloadlibcoopgamma-f0fb9bc5f222a157723e57bc4ae4940cc5c7e803.tar.gz
libcoopgamma-f0fb9bc5f222a157723e57bc4ae4940cc5c7e803.tar.bz2
libcoopgamma-f0fb9bc5f222a157723e57bc4ae4940cc5c7e803.tar.xz
Add libcoopgamma_set_nonblocking and prototype for libcoopgamma_synchronise
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/libcoopgamma.h')
-rw-r--r--src/libcoopgamma.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/libcoopgamma.h b/src/libcoopgamma.h
index 3f9c935..cef8fc1 100644
--- a/src/libcoopgamma.h
+++ b/src/libcoopgamma.h
@@ -1208,6 +1208,16 @@ char* libcoopgamma_get_socket_file(const char* restrict, const char* restrict);
int libcoopgamma_connect(const char* restrict, const char* restrict, libcoopgamma_context_t* restrict);
/**
+ * By default communication is blocking, this function
+ * can be used to switch between blocking and nonblocking
+ *
+ * @param ctx The state of the library, must be connected
+ * @param nonblocking Nonblocking mode?
+ * @return Zero on success, -1 on error
+ */
+int libcoopgamma_set_nonblocking(libcoopgamma_context_t* restrict, int);
+
+/**
* Send all pending outbound data
*
* If this function or another function that sends a request
@@ -1216,12 +1226,32 @@ int libcoopgamma_connect(const char* restrict, const char* restrict, libcoopgamm
* be in a properly configured state if a function fails
* with EINTR.
*
- * @param ctx The state of the library, must be initialised
+ * @param ctx The state of the library, must be connected
* @return Zero on success, -1 on error
*/
int libcoopgamma_flush(libcoopgamma_context_t* restrict);
/**
+ * Wait for the next message to be received
+ *
+ * @param ctx The state of the library, must be connected
+ * @param pending Information for each pending request
+ * @param n The number of elements in `pending`
+ * @param selected The index of the element in `pending` which corresponds
+ * to the first inbound message, note that this only means
+ * that the message is not for any of the other request,
+ * if the message is corrupt any of the listed requests can
+ * be selected even if it is not for any of the requests.
+ * 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
+ */
+int libcoopgamma_synchronise(libcoopgamma_context_t* restrict, libcoopgamma_async_context_t* restrict,
+ size_t, size_t* restrict);
+
+
+/**
* List all available CRTC:s, send request part
*
* Cannot be used before connecting to the server