Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/include/catalog.h
diff options
context:
space:
mode:
authorBernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
committer Bernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
commit1030dc837b10a03a02a85d5504cbeec168ce49e2 (patch)
tree698eefa87ac437deaf36a4141b326f8ce7986692 /src/include/catalog.h
Import XaoS r489 (trunk after version 3.5)
Diffstat (limited to 'src/include/catalog.h')
-rw-r--r--src/include/catalog.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/catalog.h b/src/include/catalog.h
new file mode 100644
index 0000000..ba33f84
--- /dev/null
+++ b/src/include/catalog.h
@@ -0,0 +1,27 @@
+/* Small library to handle catalog files
+ */
+#ifndef CATALOG_H
+#define CATALOG_H
+#define CHASHMAX 31 /*Just small hash table. Should be OK */
+#include <xio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+ struct varnames {
+ struct varnames *left, *right;
+ char *name;
+ char *value;
+ };
+ typedef struct catalog {
+ struct varnames *root[CHASHMAX];
+ } catalog_t;
+/*Find text in catalog */
+ extern char *find_text(catalog_t * catalog, CONST char *name);
+/*Load catalog from file */
+ extern catalog_t *load_catalog(xio_file f, CONST char **error);
+/*Free memory used by catalog */
+ extern void free_catalog(catalog_t *);
+#ifdef __cplusplus
+}
+#endif
+#endif /*VARIABLE_H */