aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-10 11:11:27 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commit3518dba2a5fb57f601b74528ddeb67f173e4024b (patch)
tree680c384eecbef2d9894eef8bc6044c4b449177b1 /x.c
parent3e44ee5569a81ba6f06e1ecd19bf0ceb1e97f18d (diff)
downloadst-3518dba2a5fb57f601b74528ddeb67f173e4024b.tar.gz
st-3518dba2a5fb57f601b74528ddeb67f173e4024b.zip
Move usage() to be with run() in x.c
run/usage/xinit are now all internal to x.c Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to 'x.c')
-rw-r--r--x.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/x.c b/x.c
index df2a88c..f660ca3 100644
--- a/x.c
+++ b/x.c
@@ -15,6 +15,7 @@
15#include <X11/Xft/Xft.h> 15#include <X11/Xft/Xft.h>
16#include <X11/XKBlib.h> 16#include <X11/XKBlib.h>
17 17
18static char *argv0;
18#include "arg.h" 19#include "arg.h"
19 20
20#define Glyph Glyph_ 21#define Glyph Glyph_
@@ -87,6 +88,7 @@ static void xdrawglyph(Glyph, int, int);
87static void xclear(int, int, int, int); 88static void xclear(int, int, int, int);
88static void xdrawcursor(void); 89static void xdrawcursor(void);
89static int xgeommasktogravity(int); 90static int xgeommasktogravity(int);
91static void xinit(void);
90static int xloadfont(Font *, FcPattern *); 92static int xloadfont(Font *, FcPattern *);
91static void xunloadfont(Font *); 93static void xunloadfont(Font *);
92static void xsetenv(void); 94static void xsetenv(void);
@@ -110,6 +112,9 @@ static void selcopy(Time);
110static void getbuttoninfo(XEvent *); 112static void getbuttoninfo(XEvent *);
111static void mousereport(XEvent *); 113static void mousereport(XEvent *);
112 114
115static void run(void);
116static void usage(void);
117
113static void (*handler[LASTEvent])(XEvent *) = { 118static void (*handler[LASTEvent])(XEvent *) = {
114 [KeyPress] = kpress, 119 [KeyPress] = kpress,
115 [ClientMessage] = cmessage, 120 [ClientMessage] = cmessage,
@@ -1698,6 +1703,19 @@ run(void)
1698 } 1703 }
1699} 1704}
1700 1705
1706void
1707usage(void)
1708{
1709 die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
1710 " [-n name] [-o file]\n"
1711 " [-T title] [-t title] [-w windowid]"
1712 " [[-e] command [args ...]]\n"
1713 " %s [-aiv] [-c class] [-f font] [-g geometry]"
1714 " [-n name] [-o file]\n"
1715 " [-T title] [-t title] [-w windowid] -l line"
1716 " [stty_args ...]\n", argv0, argv0);
1717}
1718
1701int 1719int
1702main(int argc, char *argv[]) 1720main(int argc, char *argv[])
1703{ 1721{