summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-07-23 00:02:27 +0200
committerLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-07-23 00:02:27 +0200
commit93394b388f7cbec6640e361aa95c3b30ba2a90fc (patch)
tree40a30f58d39f01f3eaf9df9446b14edd9b09b534 /src/util
parentbd22d0e47d0fb203286b088f048cf1aff1fa93a1 (diff)
global progname variable
Diffstat (limited to 'src/util')
-rw-r--r--src/util/error.c3
-rw-r--r--src/util/error.h2
-rw-r--r--src/util/option.c2
-rw-r--r--src/util/versie.c3
-rw-r--r--src/util/versie.h2
5 files changed, 7 insertions, 5 deletions
diff --git a/src/util/error.c b/src/util/error.c
index e7f1f02..6c02810 100644
--- a/src/util/error.c
+++ b/src/util/error.c
@@ -2,8 +2,9 @@
#include <stdlib.h>
#include "error.h"
+#include "global.h"
-void print_error_nomem(const char *progname) {
+void print_error_nomem() {
fprintf(stderr, "%s: Kon geen geheugen reserveren!\n", progname);
exit(1);
}
diff --git a/src/util/error.h b/src/util/error.h
index 99a9c77..27f9ea8 100644
--- a/src/util/error.h
+++ b/src/util/error.h
@@ -2,4 +2,4 @@
__attribute__((noreturn))
-void print_error_nomem(const char *progname);
+void print_error_nomem();
diff --git a/src/util/option.c b/src/util/option.c
index ef7a398..5efcbd7 100644
--- a/src/util/option.c
+++ b/src/util/option.c
@@ -65,7 +65,7 @@ char** option_parse(int argc, char **argv, const struct option_spec *speclist) {
exit(0);
case OPTSPECKIND_VERSION:
- drukkedoos_print_versie(stdout, argv[0]);
+ drukkedoos_print_versie(stdout);
exit(0);
case OPTSPECKIND_END: abort(); // unreachable
diff --git a/src/util/versie.c b/src/util/versie.c
index 880823a..cdb7341 100644
--- a/src/util/versie.c
+++ b/src/util/versie.c
@@ -1,6 +1,7 @@
#include "versie.h"
+#include "global.h"
-void drukkedoos_print_versie(FILE *f, const char *progname) {
+void drukkedoos_print_versie(FILE *f) {
fprintf(f,
"%s, deel van drukkedoos versie %s\n",
progname, DRUKKEDOOS_VERSIE);
diff --git a/src/util/versie.h b/src/util/versie.h
index 0f1dafb..f24b359 100644
--- a/src/util/versie.h
+++ b/src/util/versie.h
@@ -3,4 +3,4 @@
#include <stdio.h>
-void drukkedoos_print_versie(FILE *f, const char *progname);
+void drukkedoos_print_versie(FILE *f);