summaryrefslogtreecommitdiff
path: root/pom.h
diff options
context:
space:
mode:
Diffstat (limited to 'pom.h')
-rw-r--r--pom.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/pom.h b/pom.h
index 1139ee8..5635316 100644
--- a/pom.h
+++ b/pom.h
@@ -230,10 +230,14 @@ bool
pom_conf_location(const pom_conf *conf, const char *key, const char **file, uint64_t *line);
/// Get value of `key` in configuration, or `NULL` if key is not present.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get(const pom_conf *conf, const char *key);
/// Get value of `key` in configuration, or use `dflt` if not present.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_or_default(const pom_conf *conf, const char *key, const char *dflt);
@@ -246,6 +250,8 @@ pom_conf_get_or_default(const pom_conf *conf, const char *key, const char *dflt)
/// (decimal or `0x`/`0X`-prefixed hexadecimal, absolute value less than 2<sup>53</sup>),
/// returns the value of `key`.
/// `*value` is set to 0 in these cases.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_int(const pom_conf *conf, const char *key, int64_t *value);
@@ -257,6 +263,8 @@ pom_conf_get_int(const pom_conf *conf, const char *key, int64_t *value);
/// (decimal or `0x`/`0X`-prefixed hexadecimal, absolute value less than 2<sup>53</sup>),
/// returns the value of `key`.
/// `*value` is still set to `dflt` in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_int_or_default(const pom_conf *conf, const char *key, int64_t *value, int64_t dflt);
@@ -268,6 +276,8 @@ pom_conf_get_int_or_default(const pom_conf *conf, const char *key, int64_t *valu
/// (decimal or `0x`/`0X`-prefixed hexadecimal, less than 2<sup>53</sup>),
/// returns the value of `key`.
/// `*value` is set to 0 in these case cases.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_uint(const pom_conf *conf, const char *key, uint64_t *value);
@@ -279,6 +289,8 @@ pom_conf_get_uint(const pom_conf *conf, const char *key, uint64_t *value);
/// (decimal or `0x`/`0X`-prefixed hexadecimal, less than 2<sup>53</sup>),
/// returns the value of `key`.
/// `*value` is set to 0 in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_uint_or_default(const pom_conf *conf, const char *key, uint64_t *value, uint64_t dflt);
@@ -289,6 +301,8 @@ pom_conf_get_uint_or_default(const pom_conf *conf, const char *key, uint64_t *va
/// If `key` is not set, returns `""`. If `key` is set but not a valid floating-point number,
/// returns the value of `key`.
/// `*value` is set to 0.0 in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_float(const pom_conf *conf, const char *key, double *value);
@@ -299,6 +313,8 @@ pom_conf_get_float(const pom_conf *conf, const char *key, double *value);
/// If `key` is set but not a valid floating-point number,
/// returns the value of `key`.
/// `*value` is still set to `dflt` in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_float_or_default(const pom_conf *conf, const char *key, double *value, double dflt);
@@ -310,6 +326,8 @@ pom_conf_get_float_or_default(const pom_conf *conf, const char *key, double *val
/// (`off`/`false`/`no`/`on`/`true`/`yes`),
/// returns the value of `key`.
/// `*value` is set to `false` in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_bool(const pom_conf *conf, const char *key, bool *value);
@@ -321,6 +339,8 @@ pom_conf_get_bool(const pom_conf *conf, const char *key, bool *value);
/// (`off`/`false`/`no`/`on`/`true`/`yes`),
/// returns the value of `key`.
/// `*value` is still set to `dflt` in this case.
+///
+/// The returned pointer is valid until \ref pom_conf_free is called.
const char *
pom_conf_get_bool_or_default(const pom_conf *conf, const char *key, bool *value, bool dflt);