From cad4c0e70d39a6ad5637f629df28bf8e2088c168 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 1 Oct 2020 18:35:09 +0200 Subject: Normed multiple fs --- src/f_errno.c | 4 +--- src/f_errno.h | 6 +++--- src/f_exec.h | 6 +++--- src/f_fail.c | 21 ++++++--------------- src/f_fail.h | 24 ++++++++++++------------ src/f_file.c | 4 +--- src/f_file.h | 6 +++--- src/f_parse.c | 3 +-- src/f_parse.h | 4 ++-- src/f_redir.c | 4 +--- src/f_redir.h | 6 +++--- src/f_shlvl.c | 3 +-- src/f_shlvl.h | 6 +++--- 13 files changed, 40 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/f_errno.c b/src/f_errno.c index 4fd53a6..c621f3f 100644 --- a/src/f_errno.c +++ b/src/f_errno.c @@ -17,9 +17,7 @@ #include "s_struct.h" -void - f_dump_errno(const char concern[], - t_msh *msh) +void f_dump_errno(const char concern[], t_msh *msh) { ft_dprintf(STDERR_FILENO, "%s: %s: %s\n", msh->argv[0], concern, strerror(errno)); diff --git a/src/f_errno.h b/src/f_errno.h index bf9e36b..cc56518 100644 --- a/src/f_errno.h +++ b/src/f_errno.h @@ -10,10 +10,10 @@ /* */ /* ************************************************************************** */ -#ifndef F_ERRNO_H -#define F_ERRNO_H +#ifndef FT_F_ERRNO_H +# define FT_F_ERRNO_H -#include "s_struct.h" +# include "s_struct.h" void f_dump_errno(const char concern[], t_msh *msh); diff --git a/src/f_exec.h b/src/f_exec.h index 1ea0683..b1a8b36 100644 --- a/src/f_exec.h +++ b/src/f_exec.h @@ -10,10 +10,10 @@ /* */ /* ************************************************************************** */ -#ifndef F_EXEC_H -#define F_EXEC_H +#ifndef FT_F_EXEC_H +# define FT_F_EXEC_H -#include "s_struct.h" +# include "s_struct.h" void f_exec(const char fullpath[], const char bin[]); diff --git a/src/f_fail.c b/src/f_fail.c index 28f744b..7b48b03 100644 --- a/src/f_fail.c +++ b/src/f_fail.c @@ -19,32 +19,23 @@ #include "d_define.h" #include "s_struct.h" -static void - write_fail(const char concern[], - const char msg[], - t_msh *msh) +static void f_write_fail(const char concern[], const char msg[], t_msh *msh) { ft_dprintf(STDERR_FILENO, "%s: %s: %s\n", msh->argv[0], concern, msg); } -void - f_fail_no_options(const char concern[], - t_msh *msh) +void f_fail_no_options(const char concern[], t_msh *msh) { - write_fail(concern, F_NO_OPTIONS, msh); + f_write_fail(concern, F_NO_OPTIONS, msh); } -void - f_fail_identifier(const char concern[], - const char identifier[]) +void f_fail_identifier(const char concern[], const char identifier[]) { ft_dprintf(STDERR_FILENO, "minishell: %s: `%s': not a valid identifier\n", concern, identifier); } -void - f_fail_too_many_args(const char concern[], - t_msh *msh) +void f_fail_too_many_args(const char concern[], t_msh *msh) { - write_fail(concern, F_TOO_MANY_ARGS, msh); + f_write_fail(concern, F_TOO_MANY_ARGS, msh); } diff --git a/src/f_fail.h b/src/f_fail.h index 0046814..a733630 100644 --- a/src/f_fail.h +++ b/src/f_fail.h @@ -10,19 +10,19 @@ /* */ /* ************************************************************************** */ -#ifndef F_FAIL_H -#define F_FAIL_H +#ifndef FT_F_FAIL_H +# define FT_F_FAIL_H -#include "f_com.h" -#include "f_alloc.h" -#include "f_chdir.h" -#include "f_errno.h" -#include "f_exec.h" -#include "f_file.h" -#include "f_parse.h" -#include "f_redir.h" -#include "f_shlvl.h" -#include "s_struct.h" +# include "f_com.h" +# include "f_alloc.h" +# include "f_chdir.h" +# include "f_errno.h" +# include "f_exec.h" +# include "f_file.h" +# include "f_parse.h" +# include "f_redir.h" +# include "f_shlvl.h" +# include "s_struct.h" void f_fail_no_options(const char concern[], t_msh *msh); void f_fail_too_many_args(const char concern[], t_msh *msh); diff --git a/src/f_file.c b/src/f_file.c index 47b9ab6..d7fc195 100644 --- a/src/f_file.c +++ b/src/f_file.c @@ -19,9 +19,7 @@ #include "s_destroy.h" #include "s_struct.h" -void - f_open_file(char filename[], - t_msh *msh) +void f_open_file(char filename[], t_msh *msh) { ft_dprintf(STDERR_FILENO, "%s: %s: %s\n", msh->argv[0], filename, diff --git a/src/f_file.h b/src/f_file.h index f34f038..0f86bf1 100644 --- a/src/f_file.h +++ b/src/f_file.h @@ -10,10 +10,10 @@ /* */ /* ************************************************************************** */ -#ifndef F_FILE_H -#define F_FILE_H +#ifndef FT_F_FILE_H +# define FT_F_FILE_H -#include "s_struct.h" +# include "s_struct.h" void f_open_file(char filename[], t_msh *msh); diff --git a/src/f_parse.c b/src/f_parse.c index 67a7bf1..0b9faa9 100644 --- a/src/f_parse.c +++ b/src/f_parse.c @@ -13,8 +13,7 @@ #include #include -void - f_parse_token(char c) +void f_parse_token(char c) { ft_dprintf(STDERR_FILENO, "minishell: syntax error near unexpected token `%c'", diff --git a/src/f_parse.h b/src/f_parse.h index f6ac496..ba78918 100644 --- a/src/f_parse.h +++ b/src/f_parse.h @@ -10,8 +10,8 @@ /* */ /* ************************************************************************** */ -#ifndef F_PARSE_H -#define F_PARSE_H +#ifndef FT_F_PARSE_H +# define FT_F_PARSE_H void f_parse_token(char c); diff --git a/src/f_redir.c b/src/f_redir.c index 2883977..6bf02e7 100644 --- a/src/f_redir.c +++ b/src/f_redir.c @@ -19,9 +19,7 @@ #include "s_line.h" #include "s_destroy.h" -void - f_redir(const char path[], - t_msh *msh) +void f_redir(const char path[], t_msh *msh) { ft_dprintf(STDERR_FILENO, "%s: %s: %s\n", msh->argv[0], path, strerror(errno)); diff --git a/src/f_redir.h b/src/f_redir.h index 450fce5..ddb3c79 100644 --- a/src/f_redir.h +++ b/src/f_redir.h @@ -10,10 +10,10 @@ /* */ /* ************************************************************************** */ -#ifndef F_REDIR_H -#define F_REDIR_H +#ifndef FT_F_REDIR_H +# define FT_F_REDIR_H -#include "s_struct.h" +# include "s_struct.h" void f_redir(const char path[], t_msh *msh); diff --git a/src/f_shlvl.c b/src/f_shlvl.c index 0bd432a..986c1fe 100644 --- a/src/f_shlvl.c +++ b/src/f_shlvl.c @@ -13,8 +13,7 @@ #include #include -void - f_shlvl_too_high(int32_t shlvl) +void f_shlvl_too_high(int32_t shlvl) { ft_dprintf(2, "minishell: warning: shell level (%d) too high, resetting to 1\n", diff --git a/src/f_shlvl.h b/src/f_shlvl.h index 1b106f2..75a60bc 100644 --- a/src/f_shlvl.h +++ b/src/f_shlvl.h @@ -10,10 +10,10 @@ /* */ /* ************************************************************************** */ -#ifndef F_SHLVL_H -#define F_SHLVL_H +#ifndef FT_F_SHLVL_H +# define FT_F_SHLVL_H -#include +# include void f_shlvl_too_high(int32_t shlvl); -- cgit v1.2.3