Skip to content

Commit 2ed8374

Browse files
committed
update
1 parent 9d3eb65 commit 2ed8374

File tree

13 files changed

+264
-292
lines changed

13 files changed

+264
-292
lines changed

.vscode/c_cpp_properties.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"defines": [],
9+
"compilerPath": "/usr/bin/clang",
10+
"cStandard": "c17",
11+
"cppStandard": "c++14",
12+
"intelliSenseMode": "linux-clang-x64",
13+
"configurationProvider": "ms-vscode.makefile-tools"
14+
}
15+
],
16+
"version": 4
17+
}

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"ms-vscode.cpptools"
4+
]
5+
}

.vscode/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"makefile.extensionOutputFolder": "./.vscode",
3+
"files.associations": {
4+
"push_swap.h": "c",
5+
"libft.h": "c",
6+
"minishell.h": "c",
7+
"readline.h": "c",
8+
"history.h": "c",
9+
"*.c": "c",
10+
"hash.h": "c",
11+
"wait.h": "c",
12+
"stddef.h": "c"
13+
},
14+
"C_Cpp.formatting": "Disabled",
15+
"editor.detectIndentation": true,
16+
"editor.formatOnSave": true,
17+
"C_Cpp.errorSquiggles": "Disabled",
18+
}

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ SRC= src/main.c \
4444
src/tools/tokenizer/tokenizer.c \
4545
src/tools/tokenizer/check_command_table.c \
4646
src/tools/tokenizer/define_type.c \
47-
src/tools/tokenizer/quotes.c \
47+
src/tools/tokenizer/quotes/quotes.c \
4848
src/tools/tokenizer/special_case.c \
49-
src/tools/tokenizer/quotes_remove_quotes.c \
50-
src/tools/tokenizer/ft_handle_quotes.c \
51-
src/tools/tokenizer/ft_quotes_str.c \
49+
src/tools/tokenizer/quotes/quotes_remove_quotes.c \
50+
src/tools/tokenizer/quotes/ft_handle_quotes.c \
51+
src/tools/tokenizer/quotes/ft_quotes_str.c \
5252
src/tools/tokenizer/expand_parameters.c \
5353
src/utils/msg.c \
5454
src/utils/ft_free.c \
@@ -73,6 +73,7 @@ $(OBJ_DIR)%.o:%.c $(MINISHELL_HEADER)
7373
@mkdir -p $(OBJ_DIR)/src/tools/builtins
7474
@mkdir -p $(OBJ_DIR)/src/tools/hash
7575
@mkdir -p $(OBJ_DIR)/src/tools/tokenizer
76+
@mkdir -p $(OBJ_DIR)/src/tools/tokenizer/quotes
7677
@mkdir -p $(OBJ_DIR)/src/utils
7778
@echo "Compiling $@"
7879
@$(CC) $(CC_FLAG) -c $< -o $@

include/minishell.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,12 @@ typedef struct s_cmdt
4444
int token_count;
4545
int arg_count;
4646
} t_cmdt;
47-
/*
48-
line = "grep src > file"
49-
msh->cmd_table[0]->cmd = {"grep", "src", ">", "file"}
50-
msh->cmd_table[0]->tok = {["grep", -1 ],["src", -1],["RDOUT", '>']}
51-
msh->cmd_table[0]->exec = {"grep", "src"}
52-
msh->cmd_table[0]->filename = {"file"}
53-
msh->token_count = 1
54-
msh->command_type = BIN or BUILTIN
55-
*/
47+
48+
typedef struct s_counter{
49+
int s_i;
50+
int s_j;
51+
int s_k;
52+
} t_counter;
5653

5754
typedef struct s_minishell
5855
{
@@ -145,8 +142,9 @@ int q_count_quotes(t_minishell *msh);
145142
char *ft_strinsert(char *str, char *in, char *key);
146143
char *expand_parameters(t_minishell *msh, char *str);
147144
char *expand_cmd(t_minishell *msh, char *str);
148-
char *find_hash(t_minishell *msh, t_hash_table *env_table, char *key);
149-
bool q_handle_all(t_minishell *msh, int i, int *j, int *k);
145+
char *find_hash(t_minishell *msh, \
146+
t_hash_table *env_table, char *key);
147+
bool q_handle_all(t_minishell *msh, t_counter *cnt);
150148
//builtin functions
151149
void ft_echo(t_minishell *msh, int i);
152150
void ft_env(t_minishell *msh, int i);

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void read_line(t_minishell *msh)
1919
define_input_signals(msh);
2020
if (msh->line)
2121
{
22-
ft_command_table_free(msh);
22+
// ft_command_table_free(msh);
2323
add_history(msh->line);
2424
}
2525
free(msh->user_info);

src/tools/tokenizer/ft_handle_quotes.c

Lines changed: 0 additions & 193 deletions
This file was deleted.

src/tools/tokenizer/get_next_line_utils.c

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)