summaryrefslogtreecommitdiff
path: root/src/journal/catalog.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-28 20:17:24 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-28 23:45:59 -0400
commit844ec79b3c2f246114ea316ebe1f36044bdb688e (patch)
tree6e937c3738ee75fdd2c22e5f9bec72d789d6e13b /src/journal/catalog.h
parent18cd5fe99f70a55a2d6f2303d6ee0624942695b1 (diff)
catalog: open up catalog internals
In order to write tests for the catalog functions, they are made non-static and start taking a 'database' parameter, which is the name of a file with the preprocessed catalog entries. This makes it possible to make test-catalog part of the normal test suite, since it now only operates on files in /tmp. Some more tests are added.
Diffstat (limited to 'src/journal/catalog.h')
-rw-r--r--src/journal/catalog.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/journal/catalog.h b/src/journal/catalog.h
index 8ea2c41c2d..89f8f93d03 100644
--- a/src/journal/catalog.h
+++ b/src/journal/catalog.h
@@ -24,8 +24,14 @@
#include <stdbool.h>
#include "sd-id128.h"
-
-int catalog_update(void);
-int catalog_get(sd_id128_t id, char **data);
-int catalog_list(FILE *f, bool oneline);
-int catalog_list_items(FILE *f, bool oneline, char **items);
+#include "hashmap.h"
+#include "strbuf.h"
+
+int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path);
+unsigned catalog_hash_func(const void *p);
+int catalog_compare_func(const void *a, const void *b);
+int catalog_update(const char* database, const char* root, const char* const* dirs);
+int catalog_get(const char* database, sd_id128_t id, char **data);
+int catalog_list(FILE *f, const char* database, bool oneline);
+int catalog_list_items(FILE *f, const char* database, bool oneline, char **items);
+extern const char * const catalog_file_dirs[];