Code

analyzer: Analyze expressions as well; validate typed expressions.
[sysdb.git] / src / include / client / sock.h
index e33f4d769b01d2451ba6c019a7b0a885f4bfb3b5..aeed8a253b58f310c4e3e55df13e38f4bfa0232b 100644 (file)
@@ -31,6 +31,8 @@
 #include "core/object.h"
 #include "core/data.h"
 
+#include "frontend/proto.h"
+
 #include "utils/strbuf.h"
 
 #include <sys/socket.h>
@@ -65,14 +67,29 @@ sdb_client_destroy(sdb_client_t *client);
 
 /*
  * sdb_client_connect:
- * Connect to the client's address.
+ * Connect to the client's address using the specified username.
  *
  * Returns:
  *  - 0 on success
  *  - a negative value else
  */
 int
-sdb_client_connect(sdb_client_t *client);
+sdb_client_connect(sdb_client_t *client, const char *username);
+
+/*
+ * sdb_client_sockfd:
+ * Return the client socket's file descriptor.
+ */
+int
+sdb_client_sockfd(sdb_client_t *client);
+
+/*
+ * sdb_client_shutdown:
+ * Shut down the client's send and/or receive operations.
+ * See shutdown(3) for details.
+ */
+int
+sdb_client_shutdown(sdb_client_t *client, int how);
 
 /*
  * sdb_client_close:
@@ -87,7 +104,7 @@ sdb_client_close(sdb_client_t *client);
  * connection.
  *
  * Returns:
- *  - 0 on success
+ *  - the number of bytes send
  *  - a negative value else.
  */
 ssize_t
@@ -112,6 +129,14 @@ ssize_t
 sdb_client_recv(sdb_client_t *client,
                uint32_t *code, sdb_strbuf_t *buf);
 
+/*
+ * sdb_client_eof:
+ * Returns true if end of file on the client connection was reached, that is,
+ * if the remote side closed the connection.
+ */
+_Bool
+sdb_client_eof(sdb_client_t *client);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif