wdvi

network DVI viewer
Log | Files | Refs

commit 043cd9dd4dcc2208c2d618c7cb2d7ecbc29bd4b7
parent 4cf0cdf3801f8372015bedca45154473ecbd72d3
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Tue,  7 Sep 2021 18:52:27 +0000

move more function declarations into util.h

Diffstat:
Mdvi-draw.c | 1+
Mdvi-init.c | 1+
Mfilefind.c | 2+-
Mfont-open.c | 2+-
Mft.c | 1+
Mpk.c | 1+
Mpopups.c | 2+-
Mspecial.c | 1+
Mutil.h | 28++++++++++++++++++++++++++--
Mvf.c | 1+
Mxdvi.c | 1+
Mxdvi.h | 27---------------------------
12 files changed, 36 insertions(+), 32 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -35,6 +35,7 @@ NOTE: #include <X11/XKBlib.h> #define XBell(dpy, percent) XkbBell(dpy, mane.win, percent, (Atom) None) +#include "util.h" /* xfopen(), snum() */ #include "xdvi.h" #include "dvi.h" diff --git a/dvi-init.c b/dvi-init.c @@ -29,6 +29,7 @@ NOTE: #include "xdvi.h" #include "dvi.h" +#include "util.h" /* xmalloc() */ # include <ft2build.h> # include FT_SIZES_H diff --git a/filefind.c b/filefind.c @@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "filf-app.h" /* application-related declarations & defs */ #include "filefind.h" -#include "util.h" +#include "util.h" /* xfopen(), expandline(), ff_getpw() */ /* default list of texmf trees */ diff --git a/font-open.c b/font-open.c @@ -29,7 +29,7 @@ NOTE: #include "filf-app.h" /* application-related defs, etc. */ #include "filefind.h" -#include "util.h" /* prep_fd */ +#include "util.h" /* prep_fd(), xfopen(), xpipe(), xputenv(), ... */ #include <errno.h> #include <signal.h> diff --git a/ft.c b/ft.c @@ -27,6 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "xdvi.h" +#include "util.h" /* oops() */ #include <ctype.h> /* isspace(), isdigit() */ #include <math.h> diff --git a/pk.c b/pk.c @@ -31,6 +31,7 @@ NOTE: */ #include "xdvi.h" +#include "util.h" /* xmalloc() */ #define PK_ID 89 #define PK_CMD_START 240 diff --git a/popups.c b/popups.c @@ -28,7 +28,7 @@ IN THE SOFTWARE. */ #include "xdvi.h" -#include "util.h" /* prep_fd() */ +#include "util.h" /* prep_fd(), xfopen(), xputenv() */ #include <ctype.h> #include <errno.h> #include <signal.h> diff --git a/special.c b/special.c @@ -54,6 +54,7 @@ NOTE: */ #include "xdvi.h" +#include "util.h" /* xmalloc(), memicmp() */ #include <math.h> #include <ctype.h> diff --git a/util.h b/util.h @@ -1,4 +1,28 @@ #include <dirent.h> +#include <stdio.h> -extern void prep_fd(int, Boolean); -extern DIR *xopendir(const char *); +void expandline(size_t); +const struct passwd *ff_getpw(const char **, const char *); +int memicmp(const char *, const char *, size_t); +void oops(const char *, ...) __attribute__((__noreturn__)); +void prep_fd(int, Boolean); + +FILE *xfopen(const char *, const char *); +int xopen(const char *, int); +DIR *xopendir(const char *); +int xpipe(int *); +void xputenv(const char *, const char *); + +void *xmalloc(unsigned); +void *xrealloc(void *, unsigned); +char *xstrdup(const char *); +char *xmemdup(const char *, size_t); + +unsigned long num(FILE *, int); +long snum(FILE *, int); +#define one(fp) ((unsigned char) getc(fp)) +#define sone(fp) ((long) one(fp)) +#define two(fp) num (fp, 2) +#define stwo(fp) snum(fp, 2) +#define four(fp) num (fp, 4) +#define sfour(fp) snum(fp, 4) diff --git a/vf.c b/vf.c @@ -30,6 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xdvi.h" #include "dvi.h" +#include "util.h" /* xmalloc() */ #define LONG_CHAR 242 diff --git a/xdvi.c b/xdvi.c @@ -77,6 +77,7 @@ NOTE: #include <X11/Xaw/AsciiText.h> #include <X11/Xaw/Command.h> +#include "util.h" /* xmalloc(), memicmp() */ #include "version.h" #include "xdvi.h" #include "xdvi.icon" diff --git a/xdvi.h b/xdvi.h @@ -641,8 +641,6 @@ char *ffline = NULL; /* an array used by filefind to store */ /* Also used elsewhere. */ size_t ffline_len = 0; /* current length of ffline[] */ - - /* * AVL tree structures. */ @@ -791,25 +789,7 @@ extern void set_fg_color(const struct rgb *); extern void applicationDoSpecial(char *); extern void scan_special(char *); extern void geom_do_special(struct geom_info *, char *, double); -extern void oops(const char *, ...) NORETURN; -#ifndef KPATHSEA -extern void *xmalloc(unsigned); -extern void *xrealloc(void *, unsigned); -extern char *xstrdup(const char *); -extern char *xmemdup(const char *, size_t); -#endif -extern void expandline(size_t); extern void alloc_bitmap(struct bitmap *); -#ifndef KPATHSEA -extern void xputenv(const char *, const char *); -#endif -extern int memicmp(const char *, const char *, size_t); -extern FILE *xfopen(const char *, const char *); -extern int xopen(const char *, int); -extern int xpipe(int *); -extern const struct passwd *ff_getpw(const char **, const char *); -extern unsigned long num(FILE *, int); -extern long snum(FILE *, int); extern struct avl *avladd(const char *, size_t, struct avl **, size_t); extern void read_PK_index(struct font *, Boolean); extern void read_GF_index(struct font *, Boolean); @@ -818,11 +798,4 @@ extern Boolean load_ft_font(struct font *); _XFUNCPROTOEND -#define one(fp) ((unsigned char) getc(fp)) -#define sone(fp) ((long) one(fp)) -#define two(fp) num (fp, 2) -#define stwo(fp) snum(fp, 2) -#define four(fp) num (fp, 4) -#define sfour(fp) snum(fp, 4) - #endif /* XDVI_H */