summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/reconnect/wl-socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/reconnect/wl-socket.h')
-rw-r--r--tests/auto/client/reconnect/wl-socket.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/client/reconnect/wl-socket.h b/tests/auto/client/reconnect/wl-socket.h
new file mode 100644
index 000000000..c2e68120f
--- /dev/null
+++ b/tests/auto/client/reconnect/wl-socket.h
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 David Edmundson <davidedmundson@kde.org>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * Allocate and create a socket
+ * It is bound and accepted
+ */
+struct wl_socket *wl_socket_create();
+
+/**
+ * Returns the file descriptor for the socket
+ */
+int wl_socket_get_fd(struct wl_socket *);
+
+/**
+ * Returns the name of the socket, i.e "wayland-0"
+ */
+char *wl_socket_get_display_name(struct wl_socket *);
+
+/**
+ * Cleanup resources and close the FD
+ */
+void wl_socket_destroy(struct wl_socket *socket);
+
+#ifdef __cplusplus
+}
+#endif