Move config.h include from st.c to x.c
[st.git] / x.c
diff --git a/x.c b/x.c
index 371a467..cb8c351 100644 (file)
--- a/x.c
+++ b/x.c
@@ -20,6 +20,25 @@ static char *argv0;
 #include "st.h"
 #include "win.h"
 
+/* function definitions used in config.h */
+static void clipcopy(const Arg *);
+static void clippaste(const Arg *);
+static void selpaste(const Arg *);
+static void zoom(const Arg *);
+static void zoomabs(const Arg *);
+static void zoomreset(const Arg *);
+
+/* config.h for applying patches and the configuration. */
+#include "config.h"
+
+/* config.h array lengths */
+size_t colornamelen = LEN(colorname);
+size_t mshortcutslen = LEN(mshortcuts);
+size_t shortcutslen = LEN(shortcuts);
+size_t selmaskslen = LEN(selmasks);
+size_t keyslen = LEN(key);
+size_t mappedkeyslen = LEN(mappedkeys);
+
 /* XEMBED messages */
 #define XEMBED_FOCUS_IN  4
 #define XEMBED_FOCUS_OUT 5
@@ -179,6 +198,33 @@ static char *usedfont = NULL;
 static double usedfontsize = 0;
 static double defaultfontsize = 0;
 
+static char *opt_class = NULL;
+static char **opt_cmd  = NULL;
+static char *opt_embed = NULL;
+static char *opt_font  = NULL;
+static char *opt_io    = NULL;
+static char *opt_line  = NULL;
+static char *opt_name  = NULL;
+static char *opt_title = NULL;
+
+void
+clipcopy(const Arg *dummy)
+{
+       xclipcopy();
+}
+
+void
+clippaste(const Arg *dummy)
+{
+       xclippaste();
+}
+
+void
+selpaste(const Arg *dummy)
+{
+       xselpaste();
+}
+
 void
 zoom(const Arg *arg)
 {
@@ -1473,6 +1519,7 @@ void
 xsettitle(char *p)
 {
        XTextProperty prop;
+       DEFAULT(p, "st");
 
        Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
                        &prop);
@@ -1757,7 +1804,7 @@ run(void)
        } while (ev.type != MapNotify);
 
        cresize(w, h);
-       ttynew();
+       ttynew(opt_line, opt_io, opt_cmd);
        ttyresize(win.tw, win.th);
 
        clock_gettime(CLOCK_MONOTONIC, &last);