summaryrefslogtreecommitdiff
path: root/utils/messages.h
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-08-16 18:39:10 +0000
committerJames Bursa <james@netsurf-browser.org>2003-08-16 18:39:10 +0000
commit15d57a66349d999edf83bfb892b8405779fc2821 (patch)
tree095d449e25b4176bed77b710f26e9a37340e7cda /utils/messages.h
parent0732b6c0403869d4e8f3a7b8b5e12ebca514444c (diff)
downloadnetsurf-15d57a66349d999edf83bfb892b8405779fc2821.tar.gz
netsurf-15d57a66349d999edf83bfb892b8405779fc2821.tar.bz2
[project @ 2003-08-16 18:39:10 by bursa]
New portable messages module. svn path=/import/netsurf/; revision=244
Diffstat (limited to 'utils/messages.h')
-rw-r--r--utils/messages.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/utils/messages.h b/utils/messages.h
new file mode 100644
index 000000000..fd8457da8
--- /dev/null
+++ b/utils/messages.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of NetSurf, http://netsurf.sourceforge.net/
+ * Licensed under the GNU General Public License,
+ * http://www.opensource.org/licenses/gpl-license
+ * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
+ */
+
+/**
+ * The messages module loads a file of keys and associated strings, and
+ * provides fast lookup by key. The messages file consists of key:value lines,
+ * comment lines starting with #, and other lines are ignored. Use
+ * messages_load() to read the file into memory. To lookup a key, use
+ * messages_get("key") or messages_get("key:fallback") . A pointer to the
+ * value is returned, and this is shared by all callers. If the key does not
+ * exist, the parameter will be returned in the first case and a pointer to
+ * the fallback string in the parameter in the second. Thus the parameter must
+ * be a constant string.
+ */
+
+#ifndef _NETSURF_UTILS_MESSAGES_H_
+#define _NETSURF_UTILS_MESSAGES_H_
+
+void messages_load(const char *path);
+const char *messages_get(const char *key);
+void messages_dump(void);
+
+#endif