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

Declares argv construction helpers for spawned app requests. More...

#include "native_runtime_types.h"
#include <stddef.h>

Go to the source code of this file.

Macros

#define PHAROS_APP_REQUEST_ARGV_CAPACITY   32

Functions

int build_native_app_request_argv (const AppRuntime *app, const char *request_method, const char *request_target, const char *request_cookie, const char *request_headers, const char *request_content_type, const char *request_body, int request_is_multipart, const char *temp_body_path, char *argv_list[], size_t argv_capacity, size_t *argc_out)
 Builds the argv vector used to execute one compiled app request.

Detailed Description

Declares argv construction helpers for spawned app requests.

Definition in file native_spawn_argv.h.

Macro Definition Documentation

◆ PHAROS_APP_REQUEST_ARGV_CAPACITY

#define PHAROS_APP_REQUEST_ARGV_CAPACITY   32

Definition at line 13 of file native_spawn_argv.h.

Referenced by spawn_app_request().

Function Documentation

◆ build_native_app_request_argv()

int build_native_app_request_argv ( const AppRuntime * app,
const char * request_method,
const char * request_target,
const char * request_cookie,
const char * request_headers,
const char * request_content_type,
const char * request_body,
int request_is_multipart,
const char * temp_body_path,
char * argv_list[],
size_t argv_capacity,
size_t * argc_out )

Builds the argv vector used to execute one compiled app request.

Parameters
appFinalized app runtime that will handle the request.
request_methodHTTP request method.
request_targetHTTP request target.
request_cookieCookie header value.
request_headersNormalized request headers.
request_content_typeRequest content type.
request_bodyRequest body text when passed inline.
request_is_multipartNon-zero when the request uses multipart form data.
temp_body_pathOptional temporary body file path for multipart requests.
argv_listDestination argv array to populate.
argv_capacityCapacity of argv_list in entries.
argc_outDestination for the populated argv length.
Returns
0 on success, or a non-zero status code when the argv cannot be constructed.

Definition at line 22 of file native_spawn_argv.c.

References AppRuntime::base_path, AppRuntime::build_dir, AppRuntime::compiled_entrypoint, AppRuntime::debug, AppRuntime::log_path, push_argv_value(), and AppRuntime::state_path.

Referenced by spawn_app_request().