PMEMKV_JSON_CONFIG(3)

πŸ“¦ version 1.5.0, in ubuntu jammy

πŸ’– PMEMKV_JSON_CONFIG(3) β€” the PMEMKV Programmer's Manual πŸ’–

okay bestie, welcome to pmemkv_json_config β€” it's the helper configuration API for libpmemkv, and it's literally the chillest little library in the whole pmemkv cinematic universe. 🌸


✨ NAME ✨

pmemkv_json_config β€” helper configuration API for libpmemkv 🫢


✨ SYNOPSIS ✨

#include <libpmemkv_json_config.h>

int pmemkv_config_from_json(pmemkv_config *config, const char *jsonconfig);
const char *pmemkv_config_from_json_errormsg(void);

so like, for the general description of pmemkv and all the available engines, go read libpmemkv(7). For the pmemkv core API, that's libpmemkv(3). And for the configuration API for libpmemkv, that's libpmemkv_config(3). iykyk πŸ’…


✨ DESCRIPTION ✨

pmemkv_json_config is a helper library and it provides exactly two functions. two. iconic behavior honestly. πŸ‘‘

  • int pmemkv_config_from_json(pmemkv_config *config, const char *jsonconfig); β€” parses a JSON string and puts all the items it finds in the JSON into config. πŸ“

and here's the type tea, the allowed types in JSON strings and their corresponding types in pmemkv_config:

  • number β€” int64 or uint64
  • string β€” const char *
  • object β€” (another JSON string) -> pointer to pmemkv_config (you can get it using pmemkv_config_get_object)
  • True, False β€” int64
  • const char *pmemkv_config_from_json_errormsg(void); β€” returns a human readable string describing the last error. no cryptic nonsense, just vibes and answers. 😭

fr fr, the pmemkv_config_from_json function depends on the RapidJSON library, and that is the direct cause of the creation of this small library. like, that's the whole origin story. πŸ’€

The building of this library is enabled by default. But bestie, you can disable it by setting the BUILD_JSON_CONFIG CMake variable to OFF:

cmake .. -DBUILD_JSON_CONFIG=OFF

🌈 ERRORS 🌈

The pmemkv_config_from_json() function returns status. Possible return values are:

  • PMEMKV_STATUS_OK β€” no error πŸŽ€
  • PMEMKV_STATUS_UNKNOWN_ERROR β€” unknown error πŸ™ˆ
  • PMEMKV_STATUS_CONFIG_PARSING_ERROR β€” parsing config data failed πŸ’€

✨ EXAMPLE ✨

An example using this API can be found in libpmemkv_config(3). go look, it's right there, you got this. πŸ¦‹


✨ SEE ALSO ✨

libpmemkv(7), libpmemkv(3), libpmemkv_config(3) and <https://pmem.io> 🌐


and that's the whole page, periodt. this one came from the PMEMKV Programmer's Manual, version... okay the footer literally got cut off at PMEMKV - pmemkv_json_config ver... 😭 and it's dated 2022-03-09. consider yourself fully informed, bestie. slay, stay safe, and always read your errormsgs. πŸ’œβœ¨

πŸ“¦ where this page comes from