|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Declares helpers for locating app roots and deriving runtime paths. More...
Go to the source code of this file.
Functions | |
App runtime path helpers | |
| char * | match_app_root_in_directory (const char *base_dir, const char *target_id) |
| Searches one directory for an app root matching a target identifier. | |
| char * | find_app_root_for_target (const char *target_id, const char *app_dir_hint, const char *repo_root, const char *binary_dir) |
| Locates an app root for a target using explicit app-dir hints and canonical apps directories. | |
| char * | app_build_dir_local_native (const char *app_root) |
| Builds the default local build directory path for an app. | |
| char * | effective_app_build_dir_native (const char *app_root, const char *build_dir_override) |
| Resolves the effective build directory for an app. | |
| char * | app_artifact_dir_from_build_dir_native (const char *build_dir, const char *app_id) |
| Resolves the artifact directory for one app from a build root or deployed app parent. | |
| char * | effective_app_artifact_dir_native (const char *app_root, const char *build_dir, const char *app_id) |
| Resolves the effective artifact directory for an app from framework build root plus app-owned contract hints. | |
| char * | app_state_path_local_native (const char *app_root, const char *build_dir, const char *app_id) |
| Builds the default local state file path for an app. | |
| char * | effective_app_state_path_native (const char *app_root, const char *build_dir, const char *app_id, const char *state_path_override, const char *state_dir_override) |
| Resolves the effective state file path for an app. | |
| char * | app_base_path_local_native (const char *app_root) |
| Builds the default local URL base path for an app. | |
| char * | effective_app_base_path_native (const char *app_root, const char *base_path_override) |
| Resolves the effective URL base path for an app. | |
| char * | app_log_path_local_native (const char *app_root, const char *app_id) |
| Builds the default local log file path for an app. | |
| char * | effective_app_log_path_native (const char *app_root, const char *app_id, const char *log_path_override) |
| Resolves the effective log file path for an app. | |
| char * | app_log_format_local_native (const char *app_root) |
| Builds the default local log format setting for an app. | |
| char * | effective_app_log_format_native (const char *app_root) |
| Resolves the effective log format for an app. | |
| char * | app_error_report_path_local_native (const char *app_root) |
| Builds the default local error report path for an app. | |
| char * | effective_app_error_report_path_native (const char *app_root, const char *app_id) |
| Resolves the effective error report path for an app. | |
| char * | app_debug_local_native (const char *app_root) |
| Builds the default local debug setting for an app. | |
| char * | effective_app_debug_native (const char *app_root, const char *debug_override) |
| Resolves the effective debug setting for an app. | |
Declares helpers for locating app roots and deriving runtime paths.
Definition in file native_app_runtime_paths.h.
| char * app_artifact_dir_from_build_dir_native | ( | const char * | build_dir, |
| const char * | app_id ) |
Resolves the artifact directory for one app from a build root or deployed app parent.
| build_dir | Build root or deployed app parent directory. |
| app_id | App identifier. |
Definition at line 178 of file native_app_runtime_paths.c.
References len, path_join(), and streq().
Referenced by effective_app_artifact_dir_native().
| char * app_base_path_local_native | ( | const char * | app_root | ) |
Builds the default local URL base path for an app.
| app_root | Root directory of the app. |
Definition at line 300 of file native_app_runtime_paths.c.
References AppLocalConfigNative::base_path, free_app_local_config_native(), load_app_local_config_native(), AppLocalConfigNative::manifest_base_path, normalize_base_path_native(), and pharos_app_runtime_paths_strdup.
Referenced by effective_app_base_path_native().
| char * app_build_dir_local_native | ( | const char * | app_root | ) |
Builds the default local build directory path for an app.
| app_root | Root directory of the app. |
Definition at line 139 of file native_app_runtime_paths.c.
References AppLocalConfigNative::build_dir, free_app_local_config_native(), load_app_local_config_native(), AppLocalConfigNative::manifest_build_artifact_dir, path_dirname(), path_join(), pharos_app_runtime_paths_strdup, and streq().
Referenced by effective_app_build_dir_native(), and runtime_build_dir_override_native().
| char * app_debug_local_native | ( | const char * | app_root | ) |
Builds the default local debug setting for an app.
| app_root | Root directory of the app. |
Definition at line 398 of file native_app_runtime_paths.c.
References AppLocalConfigNative::debug, free_app_local_config_native(), load_app_local_config_native(), and pharos_app_runtime_paths_strdup.
Referenced by effective_app_debug_native().
| char * app_error_report_path_local_native | ( | const char * | app_root | ) |
Builds the default local error report path for an app.
| app_root | Root directory of the app. |
Definition at line 366 of file native_app_runtime_paths.c.
References AppLocalConfigNative::error_report_path, free_app_local_config_native(), load_app_local_config_native(), and pharos_app_runtime_paths_strdup.
Referenced by effective_app_error_report_path_native().
| char * app_log_format_local_native | ( | const char * | app_root | ) |
Builds the default local log format setting for an app.
| app_root | Root directory of the app. |
Definition at line 357 of file native_app_runtime_paths.c.
References pharos_app_runtime_paths_strdup.
Referenced by effective_app_log_format_native().
| char * app_log_path_local_native | ( | const char * | app_root, |
| const char * | app_id ) |
Builds the default local log file path for an app.
| app_root | Root directory of the app. |
| app_id | App identifier. |
Definition at line 327 of file native_app_runtime_paths.c.
References free_app_local_config_native(), load_app_local_config_native(), AppLocalConfigNative::log_path, and pharos_app_runtime_paths_strdup.
Referenced by effective_app_log_path_native().
| char * app_state_path_local_native | ( | const char * | app_root, |
| const char * | build_dir, | ||
| const char * | app_id ) |
Builds the default local state file path for an app.
| app_root | Root directory of the app. |
| build_dir | Effective build directory for the app. |
| app_id | App identifier. |
Definition at line 233 of file native_app_runtime_paths.c.
References effective_app_artifact_dir_native(), free_app_local_config_native(), load_app_local_config_native(), AppLocalConfigNative::manifest_state_path, path_join(), pharos_app_runtime_paths_strdup, AppLocalConfigNative::state_dir, AppLocalConfigNative::state_path, and streq().
Referenced by effective_app_state_path_native().
| char * effective_app_artifact_dir_native | ( | const char * | app_root, |
| const char * | build_dir, | ||
| const char * | app_id ) |
Resolves the effective artifact directory for an app from framework build root plus app-owned contract hints.
| app_root | Root directory of the app. |
| build_dir | Effective build directory selected by Pharos. |
| app_id | App identifier. |
Definition at line 202 of file native_app_runtime_paths.c.
References app_artifact_dir_from_build_dir_native(), free_app_local_config_native(), load_app_local_config_native(), AppLocalConfigNative::manifest_build_artifact_dir, path_join(), pharos_app_runtime_paths_strdup, and streq().
Referenced by add_runtime_app_native(), app_state_path_local_native(), and build_app_from_root_native().
| char * effective_app_base_path_native | ( | const char * | app_root, |
| const char * | base_path_override ) |
Resolves the effective URL base path for an app.
| app_root | Root directory of the app. |
| base_path_override | Optional explicit base path override. |
Definition at line 320 of file native_app_runtime_paths.c.
References app_base_path_local_native(), and normalize_base_path_native().
Referenced by build_app_from_root_native(), finalize_base_path_native(), and maybe_seed_app_state_native().
| char * effective_app_build_dir_native | ( | const char * | app_root, |
| const char * | build_dir_override ) |
Resolves the effective build directory for an app.
| app_root | Root directory of the app. |
| build_dir_override | Optional explicit build directory override. |
Definition at line 171 of file native_app_runtime_paths.c.
References app_build_dir_local_native(), and pharos_app_runtime_paths_strdup.
Referenced by build_app_from_root_native(), load_app_runtime_for_single_app(), prepare_app_artifact_native(), and prepare_finalized_app_from_config().
| char * effective_app_debug_native | ( | const char * | app_root, |
| const char * | debug_override ) |
Resolves the effective debug setting for an app.
| app_root | Root directory of the app. |
| debug_override | Optional explicit debug override. |
Definition at line 414 of file native_app_runtime_paths.c.
References app_debug_local_native(), and pharos_app_runtime_paths_strdup.
Referenced by build_app_from_root_native(), and finalize_debug_native().
| char * effective_app_error_report_path_native | ( | const char * | app_root, |
| const char * | app_id ) |
Resolves the effective error report path for an app.
| app_root | Root directory of the app. |
| app_id | App identifier. |
Definition at line 382 of file native_app_runtime_paths.c.
References app_error_report_path_local_native().
Referenced by build_app_from_root_native(), and finalize_error_report_path_native().
| char * effective_app_log_format_native | ( | const char * | app_root | ) |
Resolves the effective log format for an app.
| app_root | Root directory of the app. |
Definition at line 362 of file native_app_runtime_paths.c.
References app_log_format_local_native().
Referenced by build_app_from_root_native(), and finalize_log_format_native().
| char * effective_app_log_path_native | ( | const char * | app_root, |
| const char * | app_id, | ||
| const char * | log_path_override ) |
Resolves the effective log file path for an app.
| app_root | Root directory of the app. |
| app_id | App identifier. |
| log_path_override | Optional explicit log path override. |
Definition at line 350 of file native_app_runtime_paths.c.
References app_log_path_local_native(), and pharos_app_runtime_paths_strdup.
Referenced by build_app_from_root_native(), and finalize_log_path_native().
| char * effective_app_state_path_native | ( | const char * | app_root, |
| const char * | build_dir, | ||
| const char * | app_id, | ||
| const char * | state_path_override, | ||
| const char * | state_dir_override ) |
Resolves the effective state file path for an app.
| app_root | Root directory of the app. |
| build_dir | Effective build directory for the app. |
| app_id | App identifier. |
| state_path_override | Optional explicit state file override. |
| state_dir_override | Optional explicit state directory override. |
Definition at line 281 of file native_app_runtime_paths.c.
References app_state_path_local_native(), path_join(), and pharos_app_runtime_paths_strdup.
Referenced by build_app_from_root_native(), finalize_state_path_native(), and maybe_seed_app_state_native().
| char * find_app_root_for_target | ( | const char * | target_id, |
| const char * | app_dir_hint, | ||
| const char * | repo_root, | ||
| const char * | binary_dir ) |
Locates an app root for a target using explicit app-dir hints and canonical apps directories.
| target_id | App identifier to locate. |
| app_dir_hint | Optional app directory or apps directory hint. |
| repo_root | Repository root whose apps directory may be consulted. |
| binary_dir | Executable directory for nearby apps-directory fallback discovery. |
Definition at line 100 of file native_app_runtime_paths.c.
References match_app_root_in_directory(), path_dirname(), and path_join().
Referenced by handle_native_runtime_app_command(), load_app_runtime_for_single_app(), and prepare_finalized_app_from_config().
| char * match_app_root_in_directory | ( | const char * | base_dir, |
| const char * | target_id ) |
Searches one directory for an app root matching a target identifier.
| base_dir | Directory whose child entries should be inspected. |
| target_id | App identifier to match. |
Definition at line 23 of file native_app_runtime_paths.c.
References json_find_string(), path_canonicalize(), path_exists(), path_is_directory(), path_join(), pharos_app_runtime_paths_strdup, read_file_text(), and streq().
Referenced by find_app_root_for_target().