summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-09-28 10:27:39 +0530
committersinanmohd <sinan@firemail.cc>2023-09-28 16:17:21 +0530
commitd605727d4bb3b7ae19dc0227d55030a7ebc73148 (patch)
treeb183df7104eedaf8628985933d52df16d23df278 /server.c
parent3647b6c1140cb9e0cebeab19e53c0294f966b19b (diff)
server: initHEADmaster
Diffstat (limited to 'server.c')
-rw-r--r--server.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/server.c b/server.c
new file mode 100644
index 0000000..79b5f75
--- /dev/null
+++ b/server.c
@@ -0,0 +1,43 @@
+#include <wayland-server.h>
+#include "util.h"
+
+
+static void
+wl_output_handle_bind(struct wl_client *client, void *data,
+ uint32_t version, uint32_t id)
+{
+ // TODO
+}
+
+int main(void)
+{
+ struct wl_display *display = wl_display_create();
+ if (!display) {
+ plog(PLOG_ERR, "Unable to create wayland display");
+ return 1;
+ }
+
+ const char *socket = wl_display_add_socket_auto(display);
+ if (!socket) {
+ plog(PLOG_ERR, "unbale to add socket to wayland display");
+ return 1;
+ }
+
+ const struct wl_interface interface = {
+ .name = "sneed",
+ .version = 60,
+ .method_count = 0,
+ .methods = NULL,
+ .event_count =0,
+ .events = NULL,
+ };
+
+ wl_global_create(display, &interface, 51, NULL, wl_output_handle_bind);
+ wl_global_create(display, &interface, 50, NULL, wl_output_handle_bind);
+
+ plog(PLOG_INFO, "Running wayland display on %s", socket);
+ wl_display_run(display);
+
+ wl_display_destroy(display);
+ return 0;
+}