blob: 35e73557255a9c7d4361222b0e5769d5b5925cda (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#ifndef MS_EVAL_H
# define MS_EVAL_H
/*
** arg:
** type ARG
** value string
**
** redir in:
** type REDIRIN
** value fd
**
** redir out:
** type REDIROUT
** value fd
**
** redir append:
** type REDIRAPPEND
** value fd
*/
read state
if redir:
open file keep fd
typedef struct
{
t_status_type type;
union
{
char *str;
int code;
int fd;
} data;
} t_val;
typedef enum
{
STYPE_ERROR,
STYPE_ARG,
STYPE_FILE,
STYPE_SEXPR,
// ...
} t_status_type;
int ms_eval(t_path path, t_env env, t_ast *ast);
#endif
|