summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--po/POTFILES.in1
-rw-r--r--po/da.po12
-rw-r--r--src/bin/main.c17
-rw-r--r--src/core/init.c8
-rw-r--r--src/core/nls.h5
-rw-r--r--src/include/aplwc.h1
7 files changed, 37 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 339d312..a2bec32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+aplwc-*.tar.gz
aclocal.m4
ar-lib
autom4te.cache
@@ -34,4 +35,4 @@ test-driver
**/*.o
**/*.lo
**/*.la
-**/*~ \ No newline at end of file
+**/*~
diff --git a/po/POTFILES.in b/po/POTFILES.in
index dde66ff..9f52e63 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1 +1,2 @@
src/core/init.c
+src/bin/main.c
diff --git a/po/da.po b/po/da.po
index 3d0f0c0..91a2b47 100644
--- a/po/da.po
+++ b/po/da.po
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: aplwc 0.0.1\n"
"Report-Msgid-Bugs-To: petermikkelsen10@gmail.com\n"
-"POT-Creation-Date: 2025-11-13 20:02+0100\n"
-"PO-Revision-Date: 2025-11-13 19:38+0100\n"
+"POT-Creation-Date: 2025-11-13 21:01+0100\n"
+"PO-Revision-Date: 2025-11-13 21:01+0100\n"
"Last-Translator: Peter Mikkelsen <petermikkelsen10@gmail.com>\n"
"Language-Team: Danish\n"
"Language: da\n"
@@ -19,10 +19,14 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 47.1\n"
-#: src/core/init.c:69
+#: src/core/init.c:73
msgid "initialized"
msgstr "initialiseret"
-#: src/core/init.c:76
+#: src/core/init.c:80
msgid "exiting"
msgstr "afslutter"
+
+#: src/bin/main.c:21
+msgid "No command line arguments expected"
+msgstr "Ingen kommandolinjeargumenter forventet"
diff --git a/src/bin/main.c b/src/bin/main.c
index 19281ea..5d5ea97 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1,12 +1,27 @@
+#include <config.h>
+#include <stdio.h>
#include <aplwc.h>
+#if ENABLE_NLS
+#include <libintl.h>
+#define _(S) dgettext(PACKAGE, S)
+#else
+#define _(S) S
+#endif
+
int
main(int argc, char *argv[])
{
APLWCFunctions fns;
+ APLWC *aplwc;
+
+ aplwc_boot();
+
+ if(argc != 1)
+ puts(_("No command line arguments expected"));
aplwc_init_fns(&fns);
- APLWC *aplwc = aplwc_init(&fns, NULL);
+ aplwc = aplwc_init(&fns, NULL);
aplwc_exit(aplwc);
return 0;
}
diff --git a/src/core/init.c b/src/core/init.c
index 04a7135..3fd07a1 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -34,6 +34,12 @@ default_fatal(void *aux, char *msg)
}
void
+aplwc_boot(void)
+{
+ init_nls();
+}
+
+void
aplwc_init_fns(APLWCFunctions *fns)
{
fns->alloc = default_alloc;
@@ -45,8 +51,6 @@ aplwc_init_fns(APLWCFunctions *fns)
APLWC *
aplwc_init(APLWCFunctions *fns, void *aux)
{
- init_nls();
-
size_t size = sizeof(APLWC) + (APLWC_ALIGNMENT - 1) + WS_START_SIZE + (WS_ALIGNMENT - 1);
intptr_t base = (intptr_t)fns->alloc(aux, size);
intptr_t aligned;
diff --git a/src/core/nls.h b/src/core/nls.h
index dfa640d..3709d6d 100644
--- a/src/core/nls.h
+++ b/src/core/nls.h
@@ -1,11 +1,12 @@
#ifndef NLS_H
#define NLS_H
+#include <config.h>
+
#if ENABLE_NLS
-#include <config.h>
#include <libintl.h>
-#define _(S) gettext(S)
+#define _(S) dgettext(PACKAGE, S)
#define init_nls() \
do{ \
bindtextdomain(PACKAGE, LOCALEDIR); \
diff --git a/src/include/aplwc.h b/src/include/aplwc.h
index 6724127..61ccc36 100644
--- a/src/include/aplwc.h
+++ b/src/include/aplwc.h
@@ -14,6 +14,7 @@ struct APLWCFunctions
void (*fatal)(void *, char *);
};
+void aplwc_boot(void);
void aplwc_init_fns(APLWCFunctions *);
APLWC *aplwc_init(APLWCFunctions *, void *aux);
void aplwc_exit(APLWC *);