summaryrefslogtreecommitdiff
path: root/src/libstddjb/cdbmake_start.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/cdbmake_start.c')
-rw-r--r--src/libstddjb/cdbmake_start.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstddjb/cdbmake_start.c b/src/libstddjb/cdbmake_start.c
new file mode 100644
index 0000000..94f1635
--- /dev/null
+++ b/src/libstddjb/cdbmake_start.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <unistd.h>
+
+#include <skalibs/buffer.h>
+#include <skalibs/genalloc.h>
+#include <skalibs/cdbmake.h>
+
+int cdbmake_start (cdbmaker *c, int fd)
+{
+ c->hplist = genalloc_zero ;
+ c->pos = 2048 ;
+ buffer_init(&c->b, &buffer_write, fd, c->buf, BUFFER_OUTSIZE) ;
+ return lseek(fd, c->pos, SEEK_SET) >= 0 ;
+}