1#pragma once
2
3/*
4 * Accessor functions.
5 */
6
7#include <pw.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#define pw_get(result, container, ...) _pw_get((result), (container) __VA_OPT__(,) __VA_ARGS__, nullptr)
14bool _pw_get(PwValuePtr result, PwValuePtr container, ...);
15
16#define pw_set(container, ...) _pw_set((container) __VA_OPT__(,) __VA_ARGS__, nullptr)
17bool _pw_set(PwValuePtr container, ...);
18/*
19 * Get value from container object / set value.
20 *
21 * Variadic arguments are path to value and all must have char* type because
22 * there's no simple way to distinguish types of variadic args.
23 * For maps arguments are used as keys in UTF-8 encoding.
24 * For lists arguments are converted to integer index.
25 *
26 * The value to set is the last argument.
27 */
28
29#ifdef __cplusplus
30}
31#endif