Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_process_capture.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief Declares child-process capture helpers.
4 */
5
6#ifndef PHAROS_NATIVE_PROCESS_CAPTURE_H
7#define PHAROS_NATIVE_PROCESS_CAPTURE_H
8
9#include <stddef.h>
10
11/** @name Process capture helpers
12 * @{
13 */
14/**
15 * @brief Executes a process and captures its combined output.
16 * @param argv Null-terminated argv array for the child process.
17 * @param output Destination for the allocated output buffer.
18 * @param output_len Optional destination for the output length.
19 * @return Process exit status, or a non-zero launcher status on failure.
20 */
21int capture_execv_output_native(char *const argv[], char **output, size_t *output_len);
22/**
23 * @brief Executes a process with injected environment values and captures its output.
24 * @param argv Null-terminated argv array for the child process.
25 * @param env_keys Environment variable names to set.
26 * @param env_values Environment variable values paired with env_keys.
27 * @param env_count Number of environment pairs to apply.
28 * @param output Destination for the allocated output buffer.
29 * @param output_len Optional destination for the output length.
30 * @return Process exit status, or a non-zero launcher status on failure.
31 */
32int capture_execv_output_env_native(char *const argv[], const char *env_keys[], const char *env_values[], size_t env_count, char **output, size_t *output_len);
33/**
34 * @brief Executes a process with injected environment values and captures stdout and stderr separately.
35 * @param argv Null-terminated argv array for the child process.
36 * @param env_keys Environment variable names to set.
37 * @param env_values Environment variable values paired with env_keys.
38 * @param env_count Number of environment pairs to apply.
39 * @param stdout_output Destination for the allocated stdout buffer.
40 * @param stdout_len Optional destination for the stdout length.
41 * @param stderr_output Destination for the allocated stderr buffer.
42 * @param stderr_len Optional destination for the stderr length.
43 * @return Process exit status, or a non-zero launcher status on failure.
44 */
45int capture_execv_output_split_env_native(char *const argv[], const char *env_keys[], const char *env_values[], size_t env_count, char **stdout_output, size_t *stdout_len, char **stderr_output, size_t *stderr_len);
46/**
47 * @brief Executes a process and captures its combined output text.
48 * @param argv Null-terminated argv array for the child process.
49 * @param output Destination for the allocated output buffer.
50 * @return Process exit status, or a non-zero launcher status on failure.
51 */
52int run_process_capture_native(char *const argv[], char **output);
53
54
55/** @} */
56#endif
int run_process_capture_native(char *const argv[], char **output)
Executes a process and captures its combined output text.
int capture_execv_output_env_native(char *const argv[], const char *env_keys[], const char *env_values[], size_t env_count, char **output, size_t *output_len)
Executes a process with injected environment values and captures its output.
int capture_execv_output_native(char *const argv[], char **output, size_t *output_len)
Executes a process and captures its combined output.
int capture_execv_output_split_env_native(char *const argv[], const char *env_keys[], const char *env_values[], size_t env_count, char **stdout_output, size_t *stdout_len, char **stderr_output, size_t *stderr_len)
Executes a process with injected environment values and captures stdout and stderr separately.