Pharos
0.7.23
Modern Web Framework & Web App Hosting Service.
Toggle main menu visibility
Loading...
Searching...
No Matches
native_dynamic_config.h
Go to the documentation of this file.
1
#ifndef PHAROS_NATIVE_DYNAMIC_CONFIG_H
2
#define PHAROS_NATIVE_DYNAMIC_CONFIG_H
3
4
/**
5
* @file
6
* @brief Declares Pharos-owned dynamic runtime config resolution helpers.
7
*/
8
9
/**
10
* @brief Returns whether a dynamic config key resolves relative to its config file.
11
*
12
* @param key Config key name.
13
* @return Non-zero when the key is path-bearing, otherwise 0.
14
*/
15
int
native_dynamic_config_key_is_path
(
const
char
*key);
16
17
/**
18
* @brief Resolves one raw dynamic config value against its owning config file.
19
*
20
* @param conf_path Path to the config file that supplied the value.
21
* @param key Config key name.
22
* @param raw_value Raw config value.
23
* @return Newly allocated resolved value, or NULL when no value is available.
24
*/
25
char
*
native_dynamic_config_resolve_value_dup
(
26
const
char
*conf_path,
27
const
char
*key,
28
const
char
*raw_value
29
);
30
31
/**
32
* @brief Loads one raw dynamic config value from a config file when it exists.
33
*
34
* @param conf_path Config file path.
35
* @param key Config key name.
36
* @return Newly allocated raw value, or NULL when the key or file is missing.
37
*/
38
char
*
native_dynamic_config_lookup_raw_dup
(
const
char
*conf_path,
const
char
*key);
39
40
/**
41
* @brief Loads one merged dynamic config value with runtime-conf precedence over app-local config.
42
*
43
* @param app_root App root directory.
44
* @param runtime_conf_path Runtime config path from the environment.
45
* @param key Config key name.
46
* @return Newly allocated resolved value, or NULL when the key is absent.
47
*/
48
char
*
native_dynamic_config_merged_value_dup
(
49
const
char
*app_root,
50
const
char
*runtime_conf_path,
51
const
char
*key
52
);
53
54
#endif
native_dynamic_config_lookup_raw_dup
char * native_dynamic_config_lookup_raw_dup(const char *conf_path, const char *key)
Loads one raw dynamic config value from a config file when it exists.
Definition
native_dynamic_config.c:33
native_dynamic_config_merged_value_dup
char * native_dynamic_config_merged_value_dup(const char *app_root, const char *runtime_conf_path, const char *key)
Loads one merged dynamic config value with runtime-conf precedence over app-local config.
Definition
native_dynamic_config.c:40
native_dynamic_config_key_is_path
int native_dynamic_config_key_is_path(const char *key)
Returns whether a dynamic config key resolves relative to its config file.
Definition
native_dynamic_config.c:10
native_dynamic_config_resolve_value_dup
char * native_dynamic_config_resolve_value_dup(const char *conf_path, const char *key, const char *raw_value)
Resolves one raw dynamic config value against its owning config file.
Definition
native_dynamic_config.c:19
src
native_runtime
c
native_dynamic_config.h
Generated by
1.17.0