-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.hpp
64 lines (54 loc) · 2.71 KB
/
storage.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
+----------------------------------------------------------------------+
| UC |
+----------------------------------------------------------------------+
| Copyright (c) 2017 David Strauss |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: David Strauss <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef UC_DATABASE_H
#define UC_DATABASE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef void* uc_storage_t;
uc_storage_t uc_storage_init(size_t size, char** errptr);
int uc_storage_store(uc_storage_t st_opaque,
const char* address,
size_t address_len,
const char* data,
size_t data_size,
time_t expiration,
int exclusive,
char** errptr);
int uc_storage_store_long(uc_storage_t st_opaque,
const char* address,
size_t address_len,
const long data,
time_t expiration,
int exclusive,
char** errptr);
int uc_storage_increment(
uc_storage_t st_opaque, const char* address, size_t address_len, long step, zval** dst, char** errptr);
int uc_storage_cas(
uc_storage_t st_opaque, const char* address, size_t address_len, long next, long expected, char** errptr);
void uc_storage_clear(uc_storage_t st_opaque, char** errptr);
int uc_storage_get(uc_storage_t st_opaque, const char* address, size_t address_len, zval** dst, char** errptr);
void uc_string_free(char* strptr);
size_t uc_storage_size(uc_storage_t st_opaque, char** errptr);
int uc_storage_exists(uc_storage_t st_opaque, const char* address, size_t address_len, char** errptr);
void uc_storage_dump(uc_storage_t st_opaque, char** errptr);
int uc_storage_delete(uc_storage_t st_opaque, const char* address, size_t address_len, char** errptr);
#ifdef __cplusplus
}
#endif
#endif