summaryrefslogtreecommitdiffstats
path: root/src/d_define.h
blob: fe3a15887fae9fc4c0af3943c6174e779dbb5240 (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
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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   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 M_BUILTINS_REF		"echo:cd:pwd:export:unset:env:exit:type:[:alias:h"
# define M_BUILTINS_REF_LEN	49

/*
** ====== PSX ======
*/

# define M_DEFAULT_PS_ONE	"minishell ~> "
# define M_DEFAULT_PS_TWO	"> "
# define M_DEFAULT_PS_THR	"> "
# define M_DEFAULT_PS_FOU	"> "

/*
** ====== PSX RICE ======
*/

# define M_PROGNAME		"minishell"
# define M_MSH_VERSION	"0.1"

/*
** ====== OPTIONS ======
*/

# define M_OPT_COMMAND	"-c"
# define M_OPT_INTERACT	"-i"

/*
** ====== VARS ======
*/

# define M_RET_VAR	"$?"
# define M_ARGC_VAR	"$#"

/*
** ====== FILES ======
*/

# define M_MINISHELLRC		".minishellrc"
# define M_DEFAULT_HISTFILE	".minishell_history"

/*
** ====== UTILS ======
*/

# define C_NUL		0x00
# define C_LF		0x0a
# define C_HT		0x09
# define C_SUB		0x1a
# define C_ESC		0x1b
# define C_DQUOTE	0x22
# define C_SHARP	0x23
# define C_DOLLAR	0x24
# define C_SQUOTE	0x27
# define C_AMP		0x26
# define C_PLUS		0x2b
# define C_SEMIC	0x3b
# define C_EQUALS	0x3d
# define C_BACKS	0x5c
# define C_PIPE		0x7c
# define C_TILDE	0x7e

/*
** ====== SQB OPTIONS ======
*/

# define B_SQB_B		"-b"
# define B_SQB_C		"-c"
# define B_SQB_D		"-d"
# define B_SQB_E		"-e"
# define B_SQB_F		"-f"
# define B_SQB_H		"-h"
# define B_SQB_N		"-n"
# define B_SQB_P		"-p"
# define B_SQB_R		"-r"
# define B_SQB_S		"-s"
# define B_SQB_W		"-w"
# define B_SQB_X		"-x"
# define B_SQB_Z		"-z"
# define B_SQB_L_MAJ	"-L"
# define B_SQB_S_MAJ	"-S"
# define B_SQB_NT		"-nt"
# define B_SQB_OT		"-ot"
# define B_SQB_EQUA		"="
# define B_SQB_DIFF		"!="
# define B_SQB_EQ		"-eq"
# define B_SQB_NE		"-ne"
# define B_SQB_GT		"-gt"
# define B_SQB_GE		"-ge"
# define B_SQB_LT		"-lt"
# define B_SQB_LE		"-le"

/*
** ====== FAIL MSG ======
*/

# define F_COMMAND_NOT_FOUND	"command not found"
# define F_NO_OPTIONS			"no options required"
# define F_TOO_MANY_ARGS		"too many arguments"
# define F_HOME_NOT_SET			"HOME not set"

#endif