blob: 2948aca56a886394a2d80123b90f2c6417725794 (
plain)
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
30
31
32
33
34
35
|
/*
*
*/
#ifndef H_HUSH_COMMAND
#define H_HUSH_COMMAND
#include <stdio.h>
#include "lexer.h"
#include "config.h"
typedef struct command {
const char *command;
const char *infile;
const char *outfile;
struct command *next;
struct command *prev;
pid_t pid;
int pipe[2];
const char *args[MAX_ARGUMENT_CNT + 2];
} command;
command *commands_from_tokens(token *parsed_cmdstr, size_t *cnt);
void print_commands(FILE *file, command *cmds);
void destroy_commands(command *cmds);
int execute_command(command *cmd);
#endif
|