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

Deep-copies AppRuntime structures so loaded runtime state can be duplicated safely. More...

#include "native_app_runtime_clone.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define native_clone_strdup   strdup

Functions

static void clear_cloned_app_runtime (AppRuntime *app)
static char * clone_optional_string (const char *value)
int clone_app_runtime_native (const AppRuntime *source, AppRuntime *target)
 Deep-copies one loaded app runtime into another record.

Detailed Description

Deep-copies AppRuntime structures so loaded runtime state can be duplicated safely.

Definition in file native_app_runtime_clone.c.

Macro Definition Documentation

◆ native_clone_strdup

#define native_clone_strdup   strdup

Definition at line 14 of file native_app_runtime_clone.c.

Referenced by clone_optional_string().

Function Documentation

◆ clear_cloned_app_runtime()

◆ clone_app_runtime_native()

int clone_app_runtime_native ( const AppRuntime * source,
AppRuntime * target )

Deep-copies one loaded app runtime into another record.

Parameters
sourceSource runtime metadata to duplicate.
targetDestination runtime record to populate.
Returns
0 on success, or a non-zero status code on allocation failure.

Definition at line 44 of file native_app_runtime_clone.c.

References AppRuntime::app_id, AppRuntime::app_root, AppRuntime::artifact_dir, AppRuntime::base_path, AppRuntime::build_dir, clear_cloned_app_runtime(), clone_optional_string(), AppRuntime::compiled_entrypoint, AppRuntime::debug, AppRuntime::error_report_path, AppRuntime::host_profile, AppRuntime::log_format, AppRuntime::log_path, AppRuntime::runtime_conf_path, and AppRuntime::state_path.

Referenced by build_worker_context_native().

◆ clone_optional_string()

char * clone_optional_string ( const char * value)
static

Definition at line 37 of file native_app_runtime_clone.c.

References native_clone_strdup.

Referenced by clone_app_runtime_native().