summaryrefslogtreecommitdiff
path: root/src/msgs.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/msgs.c (renamed from src/catalog.c)35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/catalog.c b/src/msgs.c
index 9550631..eaa6276 100644
--- a/src/catalog.c
+++ b/src/msgs.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <s.h>
#include <assert.h>
#include <errno.h>
@@ -8,12 +8,14 @@
#include <string.h>
#include "logerr.h"
+#include "meta.h"
-#include "catalog.h"
+#include "msgs.h"
-static const char *const
-CATALOG_NAME = NAME;
+
+static const char
+CATALOG_NAME[] = NAME;
static nl_catd
catalog_descriptor = NULL;
@@ -21,16 +23,17 @@ catalog_descriptor = NULL;
static size_t
msgs_length = 0U;
-static const char *const
-NLSPATH = LOCALEDIR "/%l_%t/LC_MESSAGES/%N.cat" ":"
+static const char
+NLSPATH[] = LOCALEDIR "/%l_%t/LC_MESSAGES/%N.cat" ":"
LOCALEDIR "/%l/LC_MESSAGES/%N.cat";
-static const char *const
-NLSPATH_KEY = "NLSPATH";
+static const char
+NLSPATH_KEY[] = "NLSPATH";
+
int
-i18n_init_msgs(const char *const MSGS[]) {
+msgs_init(const char *const MSGS[]) {
int rc = -1;
static const int should_overwrite = 0;
@@ -57,7 +60,7 @@ out:
}
int
-i18n_destroy(void) {
+msgs_end(void) {
int rc = -1;
if (catalog_descriptor != NULL) {
@@ -76,7 +79,7 @@ out:
}
const char *
-s(const char* const MSGS[], const int msg_id) {
+msgs_string(const char* const MSGS[], const int msg_id) {
assert(msg_id >= 0);
if (msgs_length != 0U) {
assert((size_t)msg_id < msgs_length);
@@ -96,7 +99,7 @@ s(const char* const MSGS[], const int msg_id) {
}
int
-s_print_msgs(
+msgs_print_ids(
const char *const MSGS[],
FILE *restrict stream,
const int msg_begin,
@@ -105,7 +108,7 @@ s_print_msgs(
int rc = -1;
for (int i = msg_begin; i <= msg_end; i++) {
- if (fprintf(stream, "%s", s(MSGS, i)) < 0) {
+ if (fprintf(stream, "%s", msgs_string(MSGS, i)) < 0) {
logerr("fprintf(): %s", strerror(errno));
goto out;
}
@@ -117,12 +120,12 @@ out:
}
int
-s_print_msg(const char *const MSGS[], FILE *const fd, const int msg_id) {
- return s_print_msgs(MSGS, fd, msg_id, msg_id);
+msgs_print_id(const char *const MSGS[], FILE *const stream, const int msg_id) {
+ return msgs_print_ids(MSGS, stream, msg_id, msg_id);
}
int
-dump_translatable_strings(const char *const MSGS[]) {
+msgs_dump_translatable_strings(const char *const MSGS[]) {
int rc = -1;
for (size_t i = 0U; MSGS[i] != NULL; i++) {