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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* d_define.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */
/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
#ifndef D_DEFINE_H
#define D_DEFINE_H
#include "d_enum.h"
/*
** ====== CLASSICS ======
*/
#define FT_BUILTINS "echo|cd|pwd|export|unset|env|exit|type|["
/*
** ====== PSX ======
*/
#define FT_DEFAULT_PS_ONE "minishell ~> "
#define FT_DEFAULT_PS_TWO "> "
#define FT_DEFAULT_PS_THR "> "
#define FT_DEFAULT_PS_FOU "> "
/*
** ====== PSX RICE ======
*/
#define FT_PROGNAME "minishell"
#define FT_MSH_VERSION "0.1"
/*
** ====== OPTIONS ======
*/
#define FT_OPT_INTERACT "-i"
#define FT_OPT_COMMAND "-c"
/*
** ====== VARS ======
*/
#define FT_ZER_VAR "$0"
#define FT_RET_VAR "$?"
#define FT_PID_VAR "$$"
/*
** ====== FAIL MSG ======
*/
#define FT_FAIL_COMMAND_NOT_FOUND "command not found"
#define FT_FAIL_NO_OPTIONS "no options required"
#define FT_FAIL_TOO_MANY_ARGS "too many arguments"
#define FT_FAIL_HOME_NOT_SET "HOME not set"
/*
** ====== UTILS ======
*/
#define C_SQUOTE '\''
#define C_DQUOTE '"'
#define C_BS '\\'
#define C_NULL '\000'
/*
** ====== FILES ======
*/
#define FT_MINISHELLRC ".minishellrc"
#define FT_DEFAULT_HISTFILE ".minishell_history"
/*
** ====== SQB OPTIONS ======
*/
#define FT_SQB_B "-b"
#define FT_SQB_C "-c"
#define FT_SQB_D "-d"
#define FT_SQB_E "-e"
#define FT_SQB_F "-f"
#define FT_SQB_H "-h"
#define FT_SQB_N "-n"
#define FT_SQB_P "-p"
#define FT_SQB_R "-r"
#define FT_SQB_S "-s"
#define FT_SQB_W "-w"
#define FT_SQB_X "-x"
#define FT_SQB_Z "-z"
#define FT_SQB_L_MAJ "-L"
#define FT_SQB_S_MAJ "-S"
#define FT_SQB_NT "-nt"
#define FT_SQB_OT "-ot"
#define FT_SQB_EQUA "="
#define FT_SQB_DIFF "!="
#define FT_SQB_EQ "-eq"
#define FT_SQB_NE "-ne"
#define FT_SQB_GT "-gt"
#define FT_SQB_GE "-ge"
#define FT_SQB_LT "-lt"
#define FT_SQB_LE "-le"
enum
{
FT_ID_SQB_B,
FT_ID_SQB_C,
FT_ID_SQB_D,
FT_ID_SQB_E,
FT_ID_SQB_F,
FT_ID_SQB_H,
FT_ID_SQB_N,
FT_ID_SQB_P,
FT_ID_SQB_R,
FT_ID_SQB_S,
FT_ID_SQB_W,
FT_ID_SQB_X,
FT_ID_SQB_Z,
FT_ID_SQB_L_MAJ,
FT_ID_SQB_S_MAJ,
FT_ID_SQB_NT,
FT_ID_SQB_OT,
FT_ID_SQB_EQUA,
FT_ID_SQB_DIFF,
FT_ID_SQB_EQ,
FT_ID_SQB_NE,
FT_ID_SQB_GT,
FT_ID_SQB_GE,
FT_ID_SQB_LT,
FT_ID_SQB_LE,
FT_ID_SQB_COUNT
};
#endif
|