From 0d546ff6ebe0363cab0d21d0c9b8d38d4ee3ac80 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 31 Aug 2015 21:24:11 +0200 Subject: add libmds_connection_establish_address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsclient/comm.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/libmdsclient/comm.h') 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 #include #include @@ -135,6 +137,25 @@ void libmds_connection_free(libmds_connection_t* restrict this); __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 -- cgit v1.2.3-70-g09d2