aboutsummaryrefslogtreecommitdiff
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
parent3e44ee5569a81ba6f06e1ecd19bf0ceb1e97f18d (diff)
downloadst-patched-3518dba2a5fb57f601b74528ddeb67f173e4024b.tar.bz2
st-patched-3518dba2a5fb57f601b74528ddeb67f173e4024b.tar.xz
st-patched-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>
-rw-r--r--st.c15
-rw-r--r--st.h2
-rw-r--r--win.h2
-rw-r--r--x.c18
4 files changed, 18 insertions, 19 deletions
diff --git a/st.c b/st.c
index 668b312..6338510 100644
--- a/st.c
+++ b/st.c
@@ -28,8 +28,6 @@
28#include <X11/cursorfont.h> 28#include <X11/cursorfont.h>
29#include <X11/Xft/Xft.h> 29#include <X11/Xft/Xft.h>
30 30
31char *argv0;
32
33#define Glyph Glyph_ 31#define Glyph Glyph_
34#define Font Font_ 32#define Font Font_
35 33
@@ -2687,16 +2685,3 @@ cresize(int width, int height)
2687 tresize(col, row); 2685 tresize(col, row);
2688 xresize(col, row); 2686 xresize(col, row);
2689} 2687}
2690
2691void
2692usage(void)
2693{
2694 die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
2695 " [-n name] [-o file]\n"
2696 " [-T title] [-t title] [-w windowid]"
2697 " [[-e] command [args ...]]\n"
2698 " %s [-aiv] [-c class] [-f font] [-g geometry]"
2699 " [-n name] [-o file]\n"
2700 " [-T title] [-t title] [-w windowid] -l line"
2701 " [stty_args ...]\n", argv0, argv0);
2702}
diff --git a/st.h b/st.h
index 44d4938..28a751d 100644
--- a/st.h
+++ b/st.h
@@ -214,8 +214,6 @@ size_t utf8encode(Rune, char *);
214void *xmalloc(size_t); 214void *xmalloc(size_t);
215char *xstrdup(char *); 215char *xstrdup(char *);
216 216
217void usage(void);
218
219/* Globals */ 217/* Globals */
220extern TermWindow win; 218extern TermWindow win;
221extern Term term; 219extern Term term;
diff --git a/win.h b/win.h
index 423c114..60cecb1 100644
--- a/win.h
+++ b/win.h
@@ -9,13 +9,11 @@ typedef XftGlyphFontSpec GlyphFontSpec;
9 9
10void draw(void); 10void draw(void);
11void drawregion(int, int, int, int); 11void drawregion(int, int, int, int);
12void run(void);
13 12
14void xbell(int); 13void xbell(int);
15void xclipcopy(void); 14void xclipcopy(void);
16void xclippaste(void); 15void xclippaste(void);
17void xhints(void); 16void xhints(void);
18void xinit(void);
19void xloadcols(void); 17void xloadcols(void);
20int xsetcolorname(int, const char *); 18int xsetcolorname(int, const char *);
21void xloadfonts(char *, double); 19void xloadfonts(char *, double);
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{