From 7590203c486d9002522019045d34ee3dee0a66f5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 7 Aug 2019 21:15:53 -0400 Subject: add non-stub implementation of catgets localization functions these accept the netbsd/openbsd message catalog file format, consisting of a sorted list of set headers and a sorted list of message headers for each set, admitting trivial binary search for lookups. the gnu format was not chosen because it's unusably bad. it does not admit efficient (log time or better) lookups; rather, it requires linear search or hash table lookups, and the hash function is awful: it's literally set_id*msg_id. --- src/locale/catclose.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/locale/catclose.c') diff --git a/src/locale/catclose.c b/src/locale/catclose.c index 02cd3e5c..54e24dd2 100644 --- a/src/locale/catclose.c +++ b/src/locale/catclose.c @@ -1,6 +1,14 @@ +#define _BSD_SOURCE #include +#include +#include +#include + +#define V(p) be32toh(*(uint32_t *)(p)) int catclose (nl_catd catd) { + char *map = (char *)catd; + munmap(map, V(map+8)+20); return 0; } -- cgit 1.4.1