2026-01-28 19:34:39 +01:00
|
|
|
// retoor <retoor@molodetz.nl>
|
|
|
|
|
#ifndef R_BASH_EXECUTOR_H
|
|
|
|
|
#define R_BASH_EXECUTOR_H
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
2026-01-29 06:54:10 +01:00
|
|
|
typedef struct {
|
|
|
|
|
int pid;
|
|
|
|
|
char *output;
|
|
|
|
|
char *log_path;
|
|
|
|
|
bool is_running;
|
|
|
|
|
int exit_status;
|
|
|
|
|
bool timed_out;
|
|
|
|
|
} r_process_result_t;
|
|
|
|
|
|
2026-01-29 06:01:05 +01:00
|
|
|
char *r_bash_execute(const char *command, bool interactive, int timeout_seconds);
|
2026-01-28 19:34:39 +01:00
|
|
|
|
2026-01-29 06:54:10 +01:00
|
|
|
/**
|
|
|
|
|
* Advanced execution with async support.
|
|
|
|
|
* Always returns a result object that must be freed.
|
|
|
|
|
*/
|
|
|
|
|
r_process_result_t *r_bash_execute_ext(const char *command, int timeout_seconds, bool async);
|
|
|
|
|
|
|
|
|
|
void r_process_result_free(r_process_result_t *res);
|
|
|
|
|
|
2026-01-28 19:34:39 +01:00
|
|
|
#endif
|