Pharos
0.7.23
Modern Web Framework & Web App Hosting Service.
Toggle main menu visibility
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
*/
21
int
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
*/
32
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);
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
*/
45
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);
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
*/
52
int
run_process_capture_native
(
char
*
const
argv[],
char
**output);
53
54
55
/** @} */
56
#endif
run_process_capture_native
int run_process_capture_native(char *const argv[], char **output)
Executes a process and captures its combined output text.
Definition
native_process_capture.c:317
capture_execv_output_env_native
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.
Definition
native_process_capture.c:277
capture_execv_output_native
int capture_execv_output_native(char *const argv[], char **output, size_t *output_len)
Executes a process and captures its combined output.
Definition
native_process_capture.c:313
capture_execv_output_split_env_native
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.
Definition
native_process_capture.c:121
src
native_runtime
c
native_process_capture.h
Generated by
1.17.0