aboutsummaryrefslogtreecommitdiff
path: root/crypto.h
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-18 23:37:45 -0400
committerFranklin Wei <me@fwei.tk>2018-07-18 23:37:45 -0400
commit75e5bf09506412ac679d60dc051f97d99d24702d (patch)
tree67de107d7a39ffee14aaec877eb245eca44e3c07 /crypto.h
parentdc5df5430888f2ff4054d87086f0f8d3689af644 (diff)
downloadcsaa-75e5bf09506412ac679d60dc051f97d99d24702d.zip
csaa-75e5bf09506412ac679d60dc051f97d99d24702d.tar.gz
csaa-75e5bf09506412ac679d60dc051f97d99d24702d.tar.bz2
csaa-75e5bf09506412ac679d60dc051f97d99d24702d.tar.xz
Add a compile-time option to do database prepopulation and exit
Enabling the PREPOPULATE macro in service_provider.c will cause it to initialize a database with 2^logleaves - RUNS_TEST files, and exit. This allows fast testing on the resulting database at near full load.
Diffstat (limited to 'crypto.h')
-rw-r--r--crypto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto.h b/crypto.h
index ae5c958..19fc15f 100644
--- a/crypto.h
+++ b/crypto.h
@@ -108,6 +108,9 @@ void commit_transaction(void *db);
void *deserialize_file(int cl, size_t *len);
void serialize_file(int cl, const void *buf, size_t len);
+void *load_file(const char *path, size_t *len);
+void write_file(const char *path, const void *contents, size_t len);
+
void warn(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
/* self-test */