tMove usage() to be with run() in x.c - st - [fork] customized build of st, the simple terminal
(HTM) git clone git://src.adamsgaard.dk/st
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 3518dba2a5fb57f601b74528ddeb67f173e4024b
(DIR) parent 3e44ee5569a81ba6f06e1ecd19bf0ceb1e97f18d
(HTM) Author: Devin J. Pohly <djpohly@gmail.com>
Date: Tue, 10 Oct 2017 11:11:27 -0500
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:
M st.c | 15 ---------------
M st.h | 2 --
M win.h | 2 --
M x.c | 18 ++++++++++++++++++
4 files changed, 18 insertions(+), 19 deletions(-)
---
(DIR) diff --git a/st.c b/st.c
t@@ -28,8 +28,6 @@
#include <X11/cursorfont.h>
#include <X11/Xft/Xft.h>
-char *argv0;
-
#define Glyph Glyph_
#define Font Font_
t@@ -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);
-}
(DIR) diff --git a/st.h b/st.h
t@@ -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;
(DIR) diff --git a/win.h b/win.h
t@@ -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);
(DIR) diff --git a/x.c b/x.c
t@@ -15,6 +15,7 @@
#include <X11/Xft/Xft.h>
#include <X11/XKBlib.h>
+static char *argv0;
#include "arg.h"
#define Glyph Glyph_
t@@ -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);
t@@ -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,
t@@ -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[])
{