-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.h
More file actions
29 lines (24 loc) · 1.22 KB
/
tree.h
File metadata and controls
29 lines (24 loc) · 1.22 KB
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
#ifndef PRAK_TREE_H
#define PRAK_TREE_H
#include "list.h"
enum type_of_next{
NXT, AND, OR // виды связей соседних команд в списке команд
};
struct cmd_inf {
int argc;
char **argv; // список из имени команды и аргументов
char *infile; // переназначенный файл стандартного ввода
char *outfile; // переназначенный файл стандартного вывода
int append;
int backgrnd; // =1, если команда подлежит выполнению в фоновом режиме
struct cmd_inf *psubcmd; // команды для запуска в дочернем shell
struct cmd_inf *pipe; // следующая команда после "|"
struct cmd_inf *next; // следующая после ";" (или после "&")
enum type_of_next type;// связь со следующей командой через ; или && или ||
};
struct cmd_inf* list_to_tree(string_list list);
struct cmd_inf *cmd_inf_constructor();
//void print_tree(struct cmd_inf* tree);
void print_tree(struct cmd_inf *t, int shift);
void delete_tree(struct cmd_inf *tree);
#endif //PRAK_TREE_H