commit c0fe580be69d5d66585576cea46654f7b50a5518
parent f754bfab842bee11a3a6b254bb0ea4f96ed4bed9
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Tue, 19 Apr 2022 13:01:16 -0500
assign initial options values at compile time
Diffstat:
4 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/common.c b/common.c
@@ -3,11 +3,7 @@
#include <wayland-client.h>
#include "protocol/wlr-data-control-unstable-v1-client-protocol.h"
-
-extern struct {
- const char *type;
- const char *seat;
-} options;
+#include "common.h"
bool seat_found = false;
diff --git a/util.c b/util.c
@@ -54,7 +54,9 @@ struct {
const char *type;
const char *seat;
bool foreground;
-} options;
+} options = {
+ .type = "text/plain"
+};
void
parseopts(const char *opts, int argc, char *const argv[])
diff --git a/waycopy.c b/waycopy.c
@@ -46,9 +46,6 @@ main(int argc, char *argv[])
{
close(STDOUT_FILENO);
argv0 = argv[0];
-
- options.type = "text/plain";
- options.seat = NULL;
parseopts("fs:t:", argc, argv);
char path[PATH_MAX] = {0};
diff --git a/waypaste.c b/waypaste.c
@@ -56,9 +56,6 @@ int
main(int argc, char *argv[])
{
argv0 = argv[0];
-
- options.type = "text/plain";
- options.seat = NULL;
parseopts("s:t:", argc, argv);
display = wl_display_connect(NULL);