status

statusbar program for dwm
git clone anongit@rnpnr.xyz:status.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 7ea779050b0a9e71c8d95cf1c8e085c0c49c8d43
Parent: e6aa53853a59d174594f372fc7a435f8fc0dca53
Author: Randy Palamar
Date:   Thu, 19 Dec 2024 19:11:55 -0700

drop util.c

no need for a tiny useless file like this

Diffstat:
Mstatus.c | 31++++++++++++++++++++++++++++++-
Dutil.c | 31-------------------------------
2 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/status.c b/status.c @@ -1,5 +1,6 @@ /* See LICENSE for license details. */ #include <signal.h> +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -30,7 +31,35 @@ static int dflag = 0; static sigset_t blocksigmask; static struct Block *dirty; -#include "util.c" +static void +die(const char *errstr, ...) +{ + va_list ap; + + va_start(ap, errstr); + vfprintf(stderr, errstr, ap); + va_end(ap); + exit(1); +} + +static int +pscanf(const char *path, const char *fmt, ...) +{ + FILE *fp; + va_list ap; + int ret; + + if (!(fp = fopen(path, "r"))) + return -1; + + va_start(ap, fmt); + ret = vfscanf(fp, fmt, ap); + va_end(ap); + fclose(fp); + + return (ret == EOF) ? -1 : ret; +} + #include "config.h" static void diff --git a/util.c b/util.c @@ -1,31 +0,0 @@ -/* See LICENSE for license details. */ -#include <stdarg.h> - -static void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -static int -pscanf(const char *path, const char *fmt, ...) -{ - FILE *fp; - va_list ap; - int ret; - - if (!(fp = fopen(path, "r"))) - return -1; - - va_start(ap, fmt); - ret = vfscanf(fp, fmt, ap); - va_end(ap); - fclose(fp); - - return (ret == EOF) ? -1 : ret; -}