aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/main.c b/src/main.c
index 68ba075..33673dd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,8 @@
#include "dbx.h"
-static const char *progname = "dbx";
+const char *progname = "dbx";
+
static void usage(FILE *output) {
fprintf(
output,
@@ -37,30 +38,6 @@ static void usage(FILE *output) {
progname);
}
-void dbx_printerr(const char *format, ...) {
- va_list ap;
- va_start(ap, format);
- fprintf(stderr, "%s: ", progname);
- vfprintf(stderr, format, ap);
- fprintf(stderr, "\n");
- va_end(ap);
-}
-
-void dbx_perror(const char *s, int e) {
- dbx_printerr("%s: %s", s, strerror(e));
-}
-
-int dbx_fpath(char path[PATH_MAX], const char *format, ...) {
- va_list ap;
- va_start(ap, format);
- int n = vsnprintf(path, PATH_MAX, format, ap);
- va_end(ap);
- if (n < 0 || n >= PATH_MAX) {
- n = -1;
- }
- return n;
-}
-
#define USAGE_ERROR(...) (dbx_printerr(__VA_ARGS__), EX_USAGE)
static bool parse_port(const char *str, uint16_t *port) {