summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-01-10 19:16:46 -0300
committerEuAndreh <eu@euandre.org>2025-01-10 19:16:46 -0300
commit453690061035661435407594f2c3d8304671bf7b (patch)
tree0c63a279ac7d642fca75467df8e794a115d6f1a4
parentsrc/random.h: Add initial implementation of random_{new,free,generate}() (diff)
downloadpindaiba-453690061035661435407594f2c3d8304671bf7b.tar.gz
pindaiba-453690061035661435407594f2c3d8304671bf7b.tar.xz
Replace src/config.h with <s.h>; incorporate changes from other projects
-rw-r--r--.gitignore2
-rw-r--r--Makefile27
-rw-r--r--deps.mk2
-rw-r--r--src/config.h.in6
-rw-r--r--src/hash.c2
-rw-r--r--src/meta.h.in3
-rw-r--r--src/pindaiba.en.msg (renamed from src/pindaibabs.en.msg)0
l---------src/pindaiba.h (renamed from src/pindaibabs.h)0
-rw-r--r--src/testing.c14
9 files changed, 24 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index 783c195..d46649e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
/*.a
/*.bin
-/src/config.h
+/src/meta.h
/src/*.o
/src/*.cat
/tests/*.o
diff --git a/Makefile b/Makefile
index 60fee9d..f89520b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
.POSIX:
DATE = 1970-01-01
VERSION = 0.1.0
-NAME = pindaibabs
-NAME_UC = PindaĆ­ba bootstrap
+NAME = pindaiba
+NAME_UC = $(NAME)
LANGUAGES = en
## Installation prefix. Defaults to "/usr".
PREFIX = /usr
@@ -16,7 +16,7 @@ MANDIR = $(SHAREDIR)/man
EXEC = ./
## Where to store the installation. Empty by default.
DESTDIR =
-LDLIBS = -lpthread -lendiannessbs -lsiphashbs
+LDLIBS = -lendianness -lsiphash
@@ -51,6 +51,12 @@ tests.o = $(tests.c:.c=.o)
tests.a = $(tests.c:.c=.a)
tests.bin = $(tests.c:.c=.bin)
+objects = \
+ $(sources.o) \
+ $(tests.o) \
+ src/main.o \
+ tests/slurp.o \
+
archives = \
lib$(NAME).a \
$(tests.a) \
@@ -59,22 +65,19 @@ archives = \
sources = \
$(sources.c) \
$(sources.h) \
- src/config.h.in \
- src/config.h \
+ src/meta.h.in \
+ src/meta.h \
src/main.c \
src/$(NAME).h \
$(catalogs.msg) \
derived-assets = \
+ $(objects) \
$(archives) \
- src/config.h \
+ src/meta.h \
$(catalogs.cat) \
- $(sources.o) \
- $(tests.o) \
$(tests.bin) \
- tests/slurp.o \
- src/main.o \
$(NAME).bin \
side-assets = \
@@ -91,10 +94,8 @@ all: $(derived-assets)
lib$(NAME).a: $(sources.o)
$(NAME).a: $(sources.o) src/main.o
-src/config.h: Makefile deps.mk
-$(sources.o) $(tests.o) src/main.o: Makefile deps.mk src/config.h
+src/meta.h $(objects): Makefile deps.mk
src/main.o: src/$(NAME).h
-tests/slurp.o: src/config.h
$(archives):
diff --git a/deps.mk b/deps.mk
index 159626b..92b6011 100644
--- a/deps.mk
+++ b/deps.mk
@@ -1,4 +1,4 @@
-catalogs.en.msg = src/pindaibabs.en.msg
+catalogs.en.msg = src/pindaiba.en.msg
catalogs.msg = $(catalogs.en.msg)
diff --git a/src/config.h.in b/src/config.h.in
deleted file mode 100644
index ab2256e..0000000
--- a/src/config.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#define _XOPEN_SOURCE 700
-#define _POSIX_C_SOURCE 200809L
-#define VERSION "@VERSION@"
-#define DATE "@DATE@"
-#define NAME "@NAME@"
-#define LOCALEDIR "@LOCALEDIR@"
diff --git a/src/hash.c b/src/hash.c
index 67b3656..03fc8df 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <string.h>
-#include <siphashbs.h>
+#include <siphash.h>
#include "hash.h"
#include "logerr.h"
diff --git a/src/meta.h.in b/src/meta.h.in
new file mode 100644
index 0000000..9bd8c08
--- /dev/null
+++ b/src/meta.h.in
@@ -0,0 +1,3 @@
+#define VERSION "@VERSION@"
+#define DATE "@DATE@"
+#define NAME "@NAME@"
diff --git a/src/pindaibabs.en.msg b/src/pindaiba.en.msg
index 72c5daa..72c5daa 100644
--- a/src/pindaibabs.en.msg
+++ b/src/pindaiba.en.msg
diff --git a/src/pindaibabs.h b/src/pindaiba.h
index a564cc1..a564cc1 120000
--- a/src/pindaibabs.h
+++ b/src/pindaiba.h
diff --git a/src/testing.c b/src/testing.c
index 917ad45..f3239e0 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -11,8 +11,8 @@
#define COLOUR_GREEN "\033[0;32m"
#define COLOUR_YELLOW "\033[0;33m"
-static const char *const
-ENVVAR_NAME = "NO_COLOUR";
+static const char
+ENVVAR_NAME[] = "NO_COLOUR";
static bool
@@ -24,8 +24,6 @@ show_colour(void) {
void
test_start(const char *const name) {
(void)fprintf(stderr, "%s:\n", name);
-
- return;
}
void
@@ -33,7 +31,7 @@ testing(const char *const message) {
if (show_colour()) {
(void)fprintf(
stderr,
- COLOUR_YELLOW "testing" COLOUR_RESET ": %s...",
+ COLOUR_YELLOW "testing" COLOUR_RESET ": %s... ",
message
);
} else {
@@ -43,17 +41,13 @@ testing(const char *const message) {
message
);
}
-
- return;
}
void
test_ok(void) {
if (show_colour()) {
- (void)fprintf(stderr, " " COLOUR_GREEN "OK" COLOUR_RESET ".\n");
+ (void)fprintf(stderr, COLOUR_GREEN "OK" COLOUR_RESET ".\n");
} else {
(void)fprintf(stderr, " OK.\n");
}
-
- return;
}