|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Loads app-local runtime configuration and resolves app-relative override paths from local config and manifest data. More...
#include "native_app_config.h"#include "native_json_config.h"#include "native_support.h"#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | pharos_app_config_strdup strdup |
Functions | |
| char * | resolve_conf_relative_path_native (const char *conf_path, const char *raw_value) |
| Resolves a config value relative to the directory that owns a config file. | |
| char * | app_local_conf_path_native (const char *app_root) |
| Builds the path to an app-local runtime configuration file. | |
| static char * | resolve_conf_value_key_native (const char *conf_path, const char *key, const char *value) |
| static char * | duplicate_config_field_native (const AppLocalConfigNative *config, size_t offset) |
| char * | app_local_conf_value_native (const char *app_root, const char *key) |
| Looks up one key from the app-local runtime configuration. | |
| int | load_app_local_config_native (const char *app_root, AppLocalConfigNative *config) |
| Loads app-local configuration and manifest-derived path hints into a config record. | |
| void | free_app_local_config_native (AppLocalConfigNative *config) |
| Releases heap-owned fields in an app-local configuration record. | |
| char * | normalize_base_path_native (const char *raw_value) |
| Normalizes a configured app base path into Pharos runtime form. | |
Loads app-local runtime configuration and resolves app-relative override paths from local config and manifest data.
Definition in file native_app_config.c.
| #define pharos_app_config_strdup strdup |
Definition at line 17 of file native_app_config.c.
Referenced by duplicate_config_field_native(), normalize_base_path_native(), resolve_conf_relative_path_native(), and resolve_conf_value_key_native().
| char * app_local_conf_path_native | ( | const char * | app_root | ) |
Builds the path to an app-local runtime configuration file.
| app_root | Root directory of the Pharos app. |
Definition at line 44 of file native_app_config.c.
References path_exists(), and path_join().
Referenced by dynamic_merged_config_value_runtime(), load_app_local_config_native(), native_dynamic_config_merged_value_dup(), and resolved_runtime_conf_path_from_config_native().
| char * app_local_conf_value_native | ( | const char * | app_root, |
| const char * | key ) |
Looks up one key from the app-local runtime configuration.
| app_root | Root directory of the Pharos app. |
| key | Configuration key to read. |
Definition at line 85 of file native_app_config.c.
References duplicate_config_field_native(), free_app_local_config_native(), load_app_local_config_native(), and streq().
|
static |
Definition at line 73 of file native_app_config.c.
References pharos_app_config_strdup.
Referenced by app_local_conf_value_native().
| void free_app_local_config_native | ( | AppLocalConfigNative * | config | ) |
Releases heap-owned fields in an app-local configuration record.
| config | Configuration record to clear. |
Definition at line 180 of file native_app_config.c.
References AppLocalConfigNative::base_path, AppLocalConfigNative::build_dir, AppLocalConfigNative::conf_path, AppLocalConfigNative::debug, AppLocalConfigNative::error_report_path, AppLocalConfigNative::log_path, AppLocalConfigNative::manifest_base_path, AppLocalConfigNative::manifest_build_artifact_dir, AppLocalConfigNative::manifest_state_path, AppLocalConfigNative::socket_path, AppLocalConfigNative::state_dir, and AppLocalConfigNative::state_path.
Referenced by app_base_path_local_native(), app_build_dir_local_native(), app_debug_local_native(), app_error_report_path_local_native(), app_local_conf_value_native(), app_log_path_local_native(), app_state_path_local_native(), effective_app_artifact_dir_native(), and load_app_runtime_for_single_app().
| int load_app_local_config_native | ( | const char * | app_root, |
| AppLocalConfigNative * | config ) |
Loads app-local configuration and manifest-derived path hints into a config record.
| app_root | Root directory of the Pharos app. |
| config | Destination record to populate. |
Definition at line 120 of file native_app_config.c.
References app_local_conf_path_native(), AppLocalConfigNative::base_path, AppLocalConfigNative::build_dir, conf_lookup_value_in_text(), AppLocalConfigNative::conf_path, AppLocalConfigNative::debug, AppLocalConfigNative::error_report_path, json_find_string_in_section(), AppLocalConfigNative::log_path, AppLocalConfigNative::manifest_base_path, AppLocalConfigNative::manifest_build_artifact_dir, AppLocalConfigNative::manifest_state_path, path_exists(), path_join(), read_file_text(), resolve_conf_value_key_native(), AppLocalConfigNative::socket_path, AppLocalConfigNative::state_dir, and AppLocalConfigNative::state_path.
Referenced by app_base_path_local_native(), app_build_dir_local_native(), app_debug_local_native(), app_error_report_path_local_native(), app_local_conf_value_native(), app_log_path_local_native(), app_state_path_local_native(), effective_app_artifact_dir_native(), and load_app_runtime_for_single_app().
| char * normalize_base_path_native | ( | const char * | raw_value | ) |
Normalizes a configured app base path into Pharos runtime form.
| raw_value | Raw base path text from config or manifest data. |
Definition at line 199 of file native_app_config.c.
References len, pharos_app_config_strdup, and streq().
Referenced by app_base_path_local_native(), and effective_app_base_path_native().
| char * resolve_conf_relative_path_native | ( | const char * | conf_path, |
| const char * | raw_value ) |
Resolves a config value relative to the directory that owns a config file.
| conf_path | Path to the config file that supplied the value. |
| raw_value | Raw config value to resolve. |
Definition at line 20 of file native_app_config.c.
References path_dirname(), path_join(), and pharos_app_config_strdup.
Referenced by native_dynamic_config_resolve_value_dup(), resolve_conf_value_key_native(), resolve_dynamic_config_value_runtime(), and runtime_apps_dir_native().
|
static |
Definition at line 63 of file native_app_config.c.
References pharos_app_config_strdup, resolve_conf_relative_path_native(), and streq().
Referenced by load_app_local_config_native().