• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #pragma once
2 #ifndef IWRDB_H
3 #define IWRDB_H
4 
5 #include "basedefs.h"
6 #include <stdio.h>
7 
8 IW_EXTERN_C_START
9 
10 typedef uint8_t iwrdb_oflags_t;
11 #define IWRDB_NOLOCKS ((iwrdb_oflags_t) 0x01U)
12 
13 typedef struct _IWRDB *IWRDB;
14 
15 IW_EXPORT iwrc iwrdb_open(const char *path, iwrdb_oflags_t oflags, size_t bufsz, IWRDB *db);
16 
17 IW_EXPORT iwrc iwrdb_sync(IWRDB db);
18 
19 IW_EXPORT iwrc iwrdb_append(IWRDB db, const void *data, int len, uint64_t *oref);
20 
21 IW_EXPORT iwrc iwrdb_patch(IWRDB db, uint64_t ref, off_t skip, const void *data, int len);
22 
23 IW_EXPORT iwrc iwrdb_close(IWRDB *db);
24 
25 IW_EXPORT iwrc iwrdb_read(IWRDB db, uint64_t ref, off_t skip, void *buf, int len, size_t *sp);
26 
27 IW_EXTERN_C_END
28 #endif
29 
30