blob: f1cdfa052315287d0ca640cc118265e5a30440ea (
plain) (
tree)
|
|
//
// Created by stefan on 21.05.20.
//
#ifndef SHELL_PROCESS_H
#define SHELL_PROCESS_H
#include <stdbool.h>
#include <stddef.h>
typedef struct {
char **argv;
size_t argc;
int in_fd;
int out_fd;
int pid;
bool blocking;
} process;
//Parses the given line and creates an array of processes at *processes
// Expects tail -F file | grep panic & to mean that both processes should
// run in the background
int parse_line(char const *line, process ** processes);
// returns the return code of the executed program
int exec_command(process p, unsigned timeout);
int free_processes(process ** processes);
#endif // SHELL_PROCESS_H
|