1PMEMKV_JSON_CONFIG(3) PMEMKV Programmer's Manual PMEMKV_JSON_CONFIG(3)
2
3
4
6 pmemkv_json_config - helper configuration API for libpmemkv
7
9 #include <libpmemkv_json_config.h>
10
11 int pmemkv_config_from_json(pmemkv_config *config, const char *jsonconfig);
12 const char *pmemkv_config_from_json_errormsg(void);
13
14 For general description of pmemkv and available engines see libp‐
15 memkv(7). For description of pmemkv core API see libpmemkv(3). For
16 description of configuration API for libpmemkv see libpmemkv_config(3).
17
19 pmemkv_json_config is a helper library that provides two functions:
20
21 int pmemkv_config_from_json(pmemkv_config *config, const char *jsoncon‐
22 fig);
23 Parses JSON string and puts all items found in JSON into config.
24 Allowed types in JSON strings and their corresponding types in
25 pmemkv_config are: + number – int64 or uint64 + string – const
26 char * + object – (another JSON string) -> pointer to
27 pmemkv_config (can be obtained using pmemkv_config_get_object) +
28 True, False – int64
29
30 const char *pmemkv_config_from_json_errormsg(void);
31 Returns a human readable string describing the last error.
32
33 The pmemkv_config_from_json function depends on RapidJSON library what
34 is the direct cause of the creation of this small library.
35
36 The building of this library is enabled by default. It can be disabled
37 by setting the BUILD_JSON_CONFIG CMake variable to OFF:
38
39 cmake .. -DBUILD_JSON_CONFIG=OFF
40
41 ERRORS
42 The pmemkv_config_from_json() function returns status. Possible return
43 values are:
44
45 • PMEMKV_STATUS_OK – no error
46
47 • PMEMKV_STATUS_UNKNOWN_ERROR – unknown error
48
49 • PMEMKV_STATUS_CONFIG_PARSING_ERROR – parsing config data failed
50
52 An example using this API can be found in libpmemkv_config(3).
53
55 libpmemkv(7), libpmemkv(3), libpmemkv_config(3) and <https://pmem.io>
56
57
58
59PMEMKV - pmemkv_json_config version2012.15-.007-30 PMEMKV_JSON_CONFIG(3)