Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_runtime_stack.h File Reference

Declares runtime stack helpers for app discovery, reload detection, and request matching. More...

Go to the source code of this file.

Functions

Runtime stack helpers
char * runtime_apps_dir_native (const char *conf_path)
 Resolves the apps directory configured for a runtime config file.
char * runtime_apps_fingerprint_native (const char *apps_dir)
 Builds a fingerprint string describing the current runtime apps directory state.
void runtime_log_banner_native (const RuntimeStack *stack, const ServeConfig *config, long load_ms)
 Emits a startup banner describing the loaded runtime stack.
AppRuntimeruntime_match_app_native (RuntimeStack *stack, const char *path)
 Finds the loaded app runtime that should handle a request path.

Detailed Description

Declares runtime stack helpers for app discovery, reload detection, and request matching.

Definition in file native_runtime_stack.h.

Function Documentation

◆ runtime_apps_dir_native()

char * runtime_apps_dir_native ( const char * conf_path)

Resolves the apps directory configured for a runtime config file.

Parameters
conf_pathRuntime config file path.
Returns
Newly allocated apps directory path, or NULL when it cannot be resolved.

Definition at line 62 of file native_runtime_stack.c.

References conf_lookup_value(), current_working_directory(), and resolve_conf_relative_path_native().

Referenced by handle_native_runtime_command(), and serve_runtime_stack_native().

◆ runtime_apps_fingerprint_native()

char * runtime_apps_fingerprint_native ( const char * apps_dir)

Builds a fingerprint string describing the current runtime apps directory state.

Parameters
apps_dirDirectory containing discoverable apps.
Returns
Newly allocated fingerprint string, or NULL on failure.

Definition at line 78 of file native_runtime_stack.c.

References dup_range(), len, and shell_quote_runtime_stack_native().

Referenced by serve_runtime_stack_native().

◆ 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.

Parameters
stackLoaded runtime stack.
configActive serve configuration.
load_msMilliseconds spent loading the runtime stack.

Definition at line 127 of file native_runtime_stack.c.

References RuntimeStack::apps, buffer_append(), buffer_free(), buffer_init(), RuntimeStack::count, Buffer::data, ServeConfig::host, Buffer::len, PHAROS_RUNTIME_STACK_VERSION, runtime_loaded_app_context_native(), and ServeConfig::socket_path.

Referenced by serve_runtime_stack_native().

◆ 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.

Parameters
stackRuntime stack to search.
pathNormalized request path.
Returns
Pointer to the matching app runtime within stack, or NULL when no app matches.

Definition at line 162 of file native_runtime_stack.c.

References RuntimeStack::apps, AppRuntime::base_path, RuntimeStack::count, and starts_with().

Referenced by serve_runtime_stack_native().