aboutsummaryrefslogtreecommitdiff
path: root/include/system.h
blob: d744726ba3ee2f7123c62f6e6b14d9c1de9a8af0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Created by jhunk on 10/4/23.
//

#ifndef OMC_SYSTEM_H
#define OMC_SYSTEM_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include <sys/wait.h>
#include <sys/stat.h>

struct Process {
    char stdout[PATH_MAX];
    char stderr[PATH_MAX];
    int redirect_stderr;
    int returncode;
};

int shell(struct Process *proc, char *args[]);
int shell2(struct Process *proc, char *args);
int shell_safe(struct Process *proc, char *args[]);
char *shell_output(const char *command);

#endif //OMC_SYSTEM_H