hidden norm cleanup
This commit is contained in:
151
libft.h
151
libft.h
@@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/08 00:12:36 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/08 13:27:16 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/15 14:48:19 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
# define FT_RESET "\x1b[0m"
|
||||
# define FT_BOLD "\x1b[1m"
|
||||
# define FT_CLEAR "\x1b[2J"
|
||||
|
||||
# define FT_COLOR_BLACK "\x1b[30m"
|
||||
# define FT_COLOR_RED "\x1b[31m"
|
||||
@@ -66,13 +67,13 @@ typedef struct s_list
|
||||
** definition type t_file
|
||||
*/
|
||||
|
||||
typedef struct s_file
|
||||
typedef struct s_file
|
||||
{
|
||||
int fd;
|
||||
char buff[BUFF_SIZE + 1];
|
||||
} t_file;
|
||||
int fd;
|
||||
char buff[BUFF_SIZE + 1];
|
||||
} t_file;
|
||||
|
||||
enum e_size
|
||||
enum e_size
|
||||
{
|
||||
h,
|
||||
hh,
|
||||
@@ -83,7 +84,7 @@ enum e_size
|
||||
L
|
||||
};
|
||||
|
||||
enum e_type
|
||||
enum e_type
|
||||
{
|
||||
p,
|
||||
d,
|
||||
@@ -103,134 +104,136 @@ enum e_type
|
||||
f
|
||||
};
|
||||
|
||||
typedef struct s_conv
|
||||
typedef struct s_conv
|
||||
{
|
||||
int fl_minus;
|
||||
int fl_plus;
|
||||
int fl_zero;
|
||||
int fl_hashtag;
|
||||
int fl_space;
|
||||
int fl_witdth;
|
||||
int fl_prec;
|
||||
enum e_size fl_size;
|
||||
enum e_type fl_type;
|
||||
char *str;
|
||||
int str_size;
|
||||
} t_conv;
|
||||
int fl_minus;
|
||||
int fl_plus;
|
||||
int fl_zero;
|
||||
int fl_hashtag;
|
||||
int fl_space;
|
||||
int fl_witdth;
|
||||
int fl_prec;
|
||||
enum e_size fl_size;
|
||||
enum e_type fl_type;
|
||||
char *str;
|
||||
int str_size;
|
||||
} t_conv;
|
||||
|
||||
/*
|
||||
** Print functions
|
||||
*/
|
||||
|
||||
int ft_printf(const char *format, ...);
|
||||
void ft_putchar(char c);
|
||||
void ft_putnbr(int n);
|
||||
void ft_putstr(char const *s);
|
||||
int ft_printf(const char *format, ...);
|
||||
void ft_putchar(char c);
|
||||
void ft_putnbr(int n);
|
||||
void ft_putstr(char const *s);
|
||||
|
||||
/*
|
||||
** ft_printf tools
|
||||
*/
|
||||
|
||||
void init_struct_conv(t_conv *field);
|
||||
void ft_align_str_zero(char *str, t_conv *field);
|
||||
void ft_align_str(char *str, t_conv *field);
|
||||
void set_malloc_sizes(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeu(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeo(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeu(uintmax_t nb, t_conv *field);
|
||||
int set_malloc_sizef(long double nb, char *nbrstr, t_conv *field);
|
||||
void init_handler_tab(char *(*f[14])(t_conv *, va_list));
|
||||
int ft_wstrlen(const wint_t *str);
|
||||
uint64_t dmod(long double nb, long double mod);
|
||||
void init_struct_conv(t_conv *field);
|
||||
void ft_align_str_zero(char *str, t_conv *field);
|
||||
void ft_align_str(char *str, t_conv *field);
|
||||
void set_malloc_sizes(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeu(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeo(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeu(uintmax_t nb, t_conv *field);
|
||||
int set_malloc_sizef(long double nb, char *nbrstr
|
||||
, t_conv *field);
|
||||
void init_handler_tab(char *(*f[14])(t_conv *, va_list));
|
||||
int ft_wstrlen(const wint_t *str);
|
||||
uint64_t dmod(long double nb, long double mod);
|
||||
|
||||
/*
|
||||
** Check Flags
|
||||
*/
|
||||
|
||||
void check_flags(const char **str, t_conv *field);
|
||||
void check_width(const char **str, t_conv *field, va_list ap);
|
||||
ssize_t check_precision(const char **str, t_conv *field, va_list ap);
|
||||
void check_size(const char **str, t_conv *field);
|
||||
ssize_t check_type_one(const char **str, t_conv *field);
|
||||
ssize_t check_type_two(const char **str, t_conv *field);
|
||||
ssize_t check_fields(const char **str, va_list ap, t_conv *field);
|
||||
void check_flags(const char **str, t_conv *field);
|
||||
void check_width(const char **str, t_conv *field, va_list ap);
|
||||
ssize_t check_precision(const char **str, t_conv *field
|
||||
, va_list ap);
|
||||
void check_size(const char **str, t_conv *field);
|
||||
ssize_t check_type_one(const char **str, t_conv *field);
|
||||
ssize_t check_type_two(const char **str, t_conv *field);
|
||||
ssize_t check_fields(const char **str, va_list ap, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type i and d
|
||||
*/
|
||||
|
||||
char *handler_int(uintmax_t nb, t_conv *field);
|
||||
char *select_int_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_i_d(t_conv *field, va_list ap);
|
||||
char *handler_int(uintmax_t nb, t_conv *field);
|
||||
char *select_int_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_i_d(t_conv *field, va_list ap);
|
||||
|
||||
/*
|
||||
** Handle type u
|
||||
*/
|
||||
|
||||
char *select_uns_int_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_u(t_conv *field, va_list ap);
|
||||
char *handler_uns(uintmax_t nb, t_conv *field);
|
||||
char *select_uns_int_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_u(t_conv *field, va_list ap);
|
||||
char *handler_uns(uintmax_t nb, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type x and X
|
||||
*/
|
||||
|
||||
char *handler_hexa(uintmax_t nb, t_conv *field);
|
||||
char *select_hexa_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_hexa(t_conv *field, va_list ap);
|
||||
void ft_align_hex_zero(char *str, t_conv *field);
|
||||
void ft_align_hex(char *str, t_conv *field);
|
||||
int set_precision_sizex(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeh(uintmax_t nb, t_conv *field);
|
||||
char *handler_hexa(uintmax_t nb, t_conv *field);
|
||||
char *select_hexa_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_hexa(t_conv *field, va_list ap);
|
||||
void ft_align_hex_zero(char *str, t_conv *field);
|
||||
void ft_align_hex(char *str, t_conv *field);
|
||||
int set_precision_sizex(uintmax_t nb, t_conv *field);
|
||||
void set_malloc_sizeh(uintmax_t nb, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type o
|
||||
*/
|
||||
|
||||
char *handler_oct(uintmax_t nb, t_conv *field);
|
||||
char *select_oct_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_oct(t_conv *field, va_list ap);
|
||||
void ft_align_oct_zero(char *str, t_conv *field);
|
||||
void ft_align_oct(char *str, t_conv *field);
|
||||
int set_precision_sizeo(uintmax_t nb, t_conv *field);
|
||||
char *handler_oct(uintmax_t nb, t_conv *field);
|
||||
char *select_oct_handler(t_conv *field, va_list ap);
|
||||
char *handle_output_oct(t_conv *field, va_list ap);
|
||||
void ft_align_oct_zero(char *str, t_conv *field);
|
||||
void ft_align_oct(char *str, t_conv *field);
|
||||
int set_precision_sizeo(uintmax_t nb, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type c
|
||||
*/
|
||||
|
||||
char *handle_output_char(t_conv *field, va_list ap);
|
||||
char *handle_output_char(t_conv *field, va_list ap);
|
||||
|
||||
/*
|
||||
** Handle type C
|
||||
*/
|
||||
|
||||
unsigned int ft_bin_size(unsigned int nb);
|
||||
void ft_align_wchar(char *str, t_conv *field);
|
||||
char *handler_2oct_char(wint_t c, t_conv *field);
|
||||
char *handler_3oct_char(wint_t c, t_conv *field);
|
||||
char *handler_4oct_char(wint_t c, t_conv *field);
|
||||
char *handle_output_wchar(t_conv *field, va_list ap);
|
||||
unsigned int ft_bin_size(unsigned int nb);
|
||||
void ft_align_wchar(char *str, t_conv *field);
|
||||
char *handler_2oct_char(wint_t c, t_conv *field);
|
||||
char *handler_3oct_char(wint_t c, t_conv *field);
|
||||
char *handler_4oct_char(wint_t c, t_conv *field);
|
||||
char *handle_output_wchar(t_conv *field, va_list ap);
|
||||
|
||||
/*
|
||||
** Handle type s
|
||||
*/
|
||||
|
||||
char *handle_output_str(t_conv *field, va_list ap);
|
||||
void ft_align_wstr(char *str, t_conv *field);
|
||||
int set_precision_sizes(uintmax_t nb, t_conv *field);
|
||||
char *handle_output_str(t_conv *field, va_list ap);
|
||||
void ft_align_wstr(char *str, t_conv *field);
|
||||
int set_precision_sizes(uintmax_t nb, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type S
|
||||
*/
|
||||
|
||||
char *handle_output_wstr(t_conv *field, va_list ap);
|
||||
int set_prec_size_wstr(const wint_t *str, t_conv *field);
|
||||
char *handle_output_wstr(t_conv *field, va_list ap);
|
||||
int set_prec_size_wstr(const wint_t *str, t_conv *field);
|
||||
|
||||
/*
|
||||
** Handle type f
|
||||
*/
|
||||
|
||||
char *handle_output_float(t_conv *field, va_list ap);
|
||||
char *handle_output_float(t_conv *field, va_list ap);
|
||||
|
||||
/*
|
||||
** fonctions obligatoires
|
||||
|
Reference in New Issue
Block a user