]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/stringpool.h
stringpool: Make them initializable right from the file
[people/ms/libloc.git] / src / stringpool.h
index a07cd5ccdabc31a09e679e1bac7871ef8b397ce4..29a0eb38d66389c52c32f32aed1d8848e8b16892 100644 (file)
 #define LIBLOC_STRINGPOOL_H
 
 #include <stddef.h>
+#include <stdio.h>
 
 #include <loc/libloc.h>
 
 struct loc_stringpool;
-int loc_stringpool_new(struct loc_ctx* ctx, struct loc_stringpool** pool, size_t max_length);
+int loc_stringpool_new(struct loc_ctx* ctx, struct loc_stringpool** pool);
+int loc_stringpool_open(struct loc_ctx* ctx, struct loc_stringpool** pool,
+       FILE* f, size_t length, off_t offset);
+
 struct loc_stringpool* loc_stringpool_ref(struct loc_stringpool* pool);
 struct loc_stringpool* loc_stringpool_unref(struct loc_stringpool* pool);
 
 const char* loc_stringpool_get(struct loc_stringpool* pool, off_t offset);
+size_t loc_stringpool_get_size(struct loc_stringpool* pool);
+
 off_t loc_stringpool_add(struct loc_stringpool* pool, const char* string);
 void loc_stringpool_dump(struct loc_stringpool* pool);
 
+size_t loc_stringpool_write(struct loc_stringpool* pool, FILE* f);
+
 #endif