]> git.armaanb.net Git - st.git/commitdiff
Move usage() to be with run() in x.c
authorDevin J. Pohly <djpohly@gmail.com>
Tue, 10 Oct 2017 16:11:27 +0000 (11:11 -0500)
committerDevin J. Pohly <djpohly@gmail.com>
Mon, 26 Feb 2018 03:53:24 +0000 (21:53 -0600)
run/usage/xinit are now all internal to x.c

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
st.c
st.h
win.h
x.c

diff --git a/st.c b/st.c
index 668b312a09e4d07a3fe8709b2402757cc544fe11..633851015846bfea41df9e69cc0fca9fc0126c46 100644 (file)
--- a/st.c
+++ b/st.c
@@ -28,8 +28,6 @@
 #include <X11/cursorfont.h>
 #include <X11/Xft/Xft.h>
 
-char *argv0;
-
 #define Glyph Glyph_
 #define Font Font_
 
@@ -2687,16 +2685,3 @@ cresize(int width, int height)
        tresize(col, row);
        xresize(col, row);
 }
-
-void
-usage(void)
-{
-       die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
-           " [-n name] [-o file]\n"
-           "          [-T title] [-t title] [-w windowid]"
-           " [[-e] command [args ...]]\n"
-           "       %s [-aiv] [-c class] [-f font] [-g geometry]"
-           " [-n name] [-o file]\n"
-           "          [-T title] [-t title] [-w windowid] -l line"
-           " [stty_args ...]\n", argv0, argv0);
-}
diff --git a/st.h b/st.h
index 44d49381e071b13df7d50cd6a08cd774be67011e..28a751d9a20874b4c1355fc589a4bbb23a1c1beb 100644 (file)
--- a/st.h
+++ b/st.h
@@ -214,8 +214,6 @@ size_t utf8encode(Rune, char *);
 void *xmalloc(size_t);
 char *xstrdup(char *);
 
-void usage(void);
-
 /* Globals */
 extern TermWindow win;
 extern Term term;
diff --git a/win.h b/win.h
index 423c11482f868860780f1851cfb201fc202b907f..60cecb10cbbf5440bf5c46d3af8b3425b22241cd 100644 (file)
--- a/win.h
+++ b/win.h
@@ -9,13 +9,11 @@ typedef XftGlyphFontSpec GlyphFontSpec;
 
 void draw(void);
 void drawregion(int, int, int, int);
-void run(void);
 
 void xbell(int);
 void xclipcopy(void);
 void xclippaste(void);
 void xhints(void);
-void xinit(void);
 void xloadcols(void);
 int xsetcolorname(int, const char *);
 void xloadfonts(char *, double);
diff --git a/x.c b/x.c
index df2a88c6e53c9a624e920513cb30343614c1529d..f660ca3ee4225d0f01ecc19f81d2e6e5a06e5f8b 100644 (file)
--- a/x.c
+++ b/x.c
@@ -15,6 +15,7 @@
 #include <X11/Xft/Xft.h>
 #include <X11/XKBlib.h>
 
+static char *argv0;
 #include "arg.h"
 
 #define Glyph Glyph_
@@ -87,6 +88,7 @@ static void xdrawglyph(Glyph, int, int);
 static void xclear(int, int, int, int);
 static void xdrawcursor(void);
 static int xgeommasktogravity(int);
+static void xinit(void);
 static int xloadfont(Font *, FcPattern *);
 static void xunloadfont(Font *);
 static void xsetenv(void);
@@ -110,6 +112,9 @@ static void selcopy(Time);
 static void getbuttoninfo(XEvent *);
 static void mousereport(XEvent *);
 
+static void run(void);
+static void usage(void);
+
 static void (*handler[LASTEvent])(XEvent *) = {
        [KeyPress] = kpress,
        [ClientMessage] = cmessage,
@@ -1698,6 +1703,19 @@ run(void)
        }
 }
 
+void
+usage(void)
+{
+       die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
+           " [-n name] [-o file]\n"
+           "          [-T title] [-t title] [-w windowid]"
+           " [[-e] command [args ...]]\n"
+           "       %s [-aiv] [-c class] [-f font] [-g geometry]"
+           " [-n name] [-o file]\n"
+           "          [-T title] [-t title] [-w windowid] -l line"
+           " [stty_args ...]\n", argv0, argv0);
+}
+
 int
 main(int argc, char *argv[])
 {