Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_app_runtime_paths.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief Declares helpers for locating app roots and deriving runtime paths.
4 */
5
6#ifndef PHAROS_NATIVE_APP_RUNTIME_PATHS_H
7#define PHAROS_NATIVE_APP_RUNTIME_PATHS_H
8
9/** @name App runtime path helpers
10 * @{
11 */
12/**
13 * @brief Searches one directory for an app root matching a target identifier.
14 * @param base_dir Directory whose child entries should be inspected.
15 * @param target_id App identifier to match.
16 * @return Newly allocated app root path, or NULL when no match is found.
17 */
18char *match_app_root_in_directory(const char *base_dir, const char *target_id);
19/**
20 * @brief Locates an app root for a target using explicit app-dir hints and canonical apps directories.
21 * @param target_id App identifier to locate.
22 * @param app_dir_hint Optional app directory or apps directory hint.
23 * @param repo_root Repository root whose apps directory may be consulted.
24 * @param binary_dir Executable directory for nearby apps-directory fallback discovery.
25 * @return Newly allocated app root path, or NULL when the app cannot be found.
26 */
27char *find_app_root_for_target(const char *target_id, const char *app_dir_hint, const char *repo_root, const char *binary_dir);
28/**
29 * @brief Builds the default local build directory path for an app.
30 * @param app_root Root directory of the app.
31 * @return Newly allocated build directory path, or NULL on failure.
32 */
33char *app_build_dir_local_native(const char *app_root);
34/**
35 * @brief Resolves the effective build directory for an app.
36 * @param app_root Root directory of the app.
37 * @param build_dir_override Optional explicit build directory override.
38 * @return Newly allocated effective build directory path, or NULL on failure.
39 */
40char *effective_app_build_dir_native(const char *app_root, const char *build_dir_override);
41/**
42 * @brief Resolves the artifact directory for one app from a build root or deployed app parent.
43 * @param build_dir Build root or deployed app parent directory.
44 * @param app_id App identifier.
45 * @return Newly allocated artifact directory path, or NULL on failure.
46 */
47char *app_artifact_dir_from_build_dir_native(const char *build_dir, const char *app_id);
48/**
49 * @brief Resolves the effective artifact directory for an app from framework build root plus app-owned contract hints.
50 * @param app_root Root directory of the app.
51 * @param build_dir Effective build directory selected by Pharos.
52 * @param app_id App identifier.
53 * @return Newly allocated artifact directory path, or NULL on failure.
54 */
55char *effective_app_artifact_dir_native(const char *app_root, const char *build_dir, const char *app_id);
56/**
57 * @brief Builds the default local state file path for an app.
58 * @param app_root Root directory of the app.
59 * @param build_dir Effective build directory for the app.
60 * @param app_id App identifier.
61 * @return Newly allocated state file path, or NULL on failure.
62 */
63char *app_state_path_local_native(const char *app_root, const char *build_dir, const char *app_id);
64/**
65 * @brief Resolves the effective state file path for an app.
66 * @param app_root Root directory of the app.
67 * @param build_dir Effective build directory for the app.
68 * @param app_id App identifier.
69 * @param state_path_override Optional explicit state file override.
70 * @param state_dir_override Optional explicit state directory override.
71 * @return Newly allocated effective state file path, or NULL on failure.
72 */
73char *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);
74/**
75 * @brief Builds the default local URL base path for an app.
76 * @param app_root Root directory of the app.
77 * @return Newly allocated base path string, or NULL on failure.
78 */
79char *app_base_path_local_native(const char *app_root);
80/**
81 * @brief Resolves the effective URL base path for an app.
82 * @param app_root Root directory of the app.
83 * @param base_path_override Optional explicit base path override.
84 * @return Newly allocated effective base path, or NULL on failure.
85 */
86char *effective_app_base_path_native(const char *app_root, const char *base_path_override);
87/**
88 * @brief Builds the default local log file path for an app.
89 * @param app_root Root directory of the app.
90 * @param app_id App identifier.
91 * @return Newly allocated log path, or NULL on failure.
92 */
93char *app_log_path_local_native(const char *app_root, const char *app_id);
94/**
95 * @brief Resolves the effective log file path for an app.
96 * @param app_root Root directory of the app.
97 * @param app_id App identifier.
98 * @param log_path_override Optional explicit log path override.
99 * @return Newly allocated effective log path, or NULL on failure.
100 */
101char *effective_app_log_path_native(const char *app_root, const char *app_id, const char *log_path_override);
102/**
103 * @brief Builds the default local log format setting for an app.
104 * @param app_root Root directory of the app.
105 * @return Newly allocated log format string, or NULL on failure.
106 */
107char *app_log_format_local_native(const char *app_root);
108/**
109 * @brief Resolves the effective log format for an app.
110 * @param app_root Root directory of the app.
111 * @return Newly allocated effective log format string, or NULL on failure.
112 */
113char *effective_app_log_format_native(const char *app_root);
114/**
115 * @brief Builds the default local error report path for an app.
116 * @param app_root Root directory of the app.
117 * @return Newly allocated error report path, or NULL on failure.
118 */
119char *app_error_report_path_local_native(const char *app_root);
120/**
121 * @brief Resolves the effective error report path for an app.
122 * @param app_root Root directory of the app.
123 * @param app_id App identifier.
124 * @return Newly allocated effective error report path, or NULL on failure.
125 */
126char *effective_app_error_report_path_native(const char *app_root, const char *app_id);
127/**
128 * @brief Builds the default local debug setting for an app.
129 * @param app_root Root directory of the app.
130 * @return Newly allocated debug setting string, or NULL on failure.
131 */
132char *app_debug_local_native(const char *app_root);
133/**
134 * @brief Resolves the effective debug setting for an app.
135 * @param app_root Root directory of the app.
136 * @param debug_override Optional explicit debug override.
137 * @return Newly allocated effective debug setting string, or NULL on failure.
138 */
139char *effective_app_debug_native(const char *app_root, const char *debug_override);
140
141
142/** @} */
143#endif
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 * 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 * effective_app_log_format_native(const char *app_root)
Resolves the effective log format 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_debug_native(const char *app_root, const char *debug_override)
Resolves the effective debug setting for an app.
char * app_debug_local_native(const char *app_root)
Builds the default local debug setting for an app.
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_error_report_path_local_native(const char *app_root)
Builds the default local error report path for an app.
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_error_report_path_native(const char *app_root, const char *app_id)
Resolves the effective error report 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 * 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 contrac...
char * app_log_format_local_native(const char *app_root)
Builds the default local log format setting 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_base_path_local_native(const char *app_root)
Builds the default local URL base path for an app.
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 * app_log_path_local_native(const char *app_root, const char *app_id)
Builds the default local log file path for an app.