Pharos
0.7.23
Modern Web Framework & Web App Hosting Service.
Toggle main menu visibility
Loading...
Searching...
No Matches
native_runtime_stack.h
Go to the documentation of this file.
1
/**
2
* @file
3
* @brief Declares runtime stack helpers for app discovery, reload detection, and request matching.
4
*/
5
6
#ifndef PHAROS_NATIVE_RUNTIME_STACK_H
7
#define PHAROS_NATIVE_RUNTIME_STACK_H
8
9
#include "
native_runtime_types.h
"
10
11
/** @name Runtime stack helpers
12
* @{
13
*/
14
/**
15
* @brief Resolves the apps directory configured for a runtime config file.
16
* @param conf_path Runtime config file path.
17
* @return Newly allocated apps directory path, or NULL when it cannot be resolved.
18
*/
19
char
*
runtime_apps_dir_native
(
const
char
*conf_path);
20
/**
21
* @brief Builds a fingerprint string describing the current runtime apps directory state.
22
* @param apps_dir Directory containing discoverable apps.
23
* @return Newly allocated fingerprint string, or NULL on failure.
24
*/
25
char
*
runtime_apps_fingerprint_native
(
const
char
*apps_dir);
26
/**
27
* @brief Emits a startup banner describing the loaded runtime stack.
28
* @param stack Loaded runtime stack.
29
* @param config Active serve configuration.
30
* @param load_ms Milliseconds spent loading the runtime stack.
31
*/
32
void
runtime_log_banner_native
(
const
RuntimeStack
*stack,
const
ServeConfig
*config,
long
load_ms);
33
/**
34
* @brief Finds the loaded app runtime that should handle a request path.
35
* @param stack Runtime stack to search.
36
* @param path Normalized request path.
37
* @return Pointer to the matching app runtime within stack, or NULL when no app matches.
38
*/
39
AppRuntime
*
runtime_match_app_native
(
RuntimeStack
*stack,
const
char
*path);
40
41
42
/** @} */
43
#endif
runtime_apps_dir_native
char * runtime_apps_dir_native(const char *conf_path)
Resolves the apps directory configured for a runtime config file.
Definition
native_runtime_stack.c:62
runtime_apps_fingerprint_native
char * runtime_apps_fingerprint_native(const char *apps_dir)
Builds a fingerprint string describing the current runtime apps directory state.
Definition
native_runtime_stack.c:78
runtime_log_banner_native
void runtime_log_banner_native(const RuntimeStack *stack, const ServeConfig *config, long load_ms)
Emits a startup banner describing the loaded runtime stack.
Definition
native_runtime_stack.c:127
runtime_match_app_native
AppRuntime * runtime_match_app_native(RuntimeStack *stack, const char *path)
Finds the loaded app runtime that should handle a request path.
Definition
native_runtime_stack.c:162
native_runtime_types.h
Defines shared native runtime data structures used across the Pharos C runtime.
AppRuntime
Loaded runtime metadata for one Pharos app artifact.
Definition
native_runtime_types.h:37
RuntimeStack
In-memory collection of loaded app runtimes served by one listener.
Definition
native_runtime_types.h:56
ServeConfig
Parsed native serve configuration used to bootstrap the runtime listener.
Definition
native_runtime_types.h:16
src
native_runtime
c
native_runtime_stack.h
Generated by
1.17.0