aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsclient/comm.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-31 21:24:11 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-31 21:24:11 +0200
commit0d546ff6ebe0363cab0d21d0c9b8d38d4ee3ac80 (patch)
tree0a874aeddfa8e513ebcd344b53d1f2b43e1057b1 /src/libmdsclient/comm.h
parenttypo (diff)
downloadmds-0d546ff6ebe0363cab0d21d0c9b8d38d4ee3ac80.tar.gz
mds-0d546ff6ebe0363cab0d21d0c9b8d38d4ee3ac80.tar.bz2
mds-0d546ff6ebe0363cab0d21d0c9b8d38d4ee3ac80.tar.xz
add libmds_connection_establish_address
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libmdsclient/comm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libmdsclient/comm.h b/src/libmdsclient/comm.h
index 94dcc7a..d26a2e2 100644
--- a/src/libmdsclient/comm.h
+++ b/src/libmdsclient/comm.h
@@ -19,6 +19,8 @@
#define MDS_LIBMDSCLIENT_COMM_H
+#include "address.h"
+
#include <stdint.h>
#include <stddef.h>
#include <pthread.h>
@@ -136,6 +138,25 @@ __attribute__((nonnull))
int libmds_connection_establish(libmds_connection_t* restrict this, const char** restrict display);
/**
+ * Connect to the display server
+ *
+ * @param this The connection descriptor, must not be `NULL`
+ * @param address The address to connect to, must not be `NULL`,
+ * and must be the result of a successful call to
+ * `libmds_parse_display_adress`
+ * @return Zero on success, -1 on error. On error, `display`
+ * will point to `NULL` if MDS_DISPLAY is not defiend,
+ * otherwise, `errno` will have been set to describe
+ * the error.
+ *
+ * @throws Any error specified for socket(2)
+ * @throws Any error specified for connect(2), except EINTR
+ */
+__attribute__((nonnull))
+int libmds_connection_establish_address(libmds_connection_t* restrict this,
+ const libmds_display_address_t* restrict address);
+
+/**
* Wrapper for `libmds_connection_send_unlocked` that locks
* the mutex of the connection
*