-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_bonus.h
61 lines (52 loc) · 2.24 KB
/
ft_printf_bonus.h
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: achane-l <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/07/14 12:05:33 by achane-l #+# #+# */
/* Updated: 2021/07/14 12:05:36 by achane-l ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_BONUS_H
# define FT_PRINTF_BONUS_H
# include <stdlib.h>
# include <unistd.h>
# include <stdarg.h>
typedef struct s_flags
{
int minus;
int zero;
int precision;
int width;
int space;
int number_sign;
int sharp;
int type_conv;
int char_count;
int error;
} t_flags;
int ft_printf(const char *str, ...);
void *parsing(const char *str, t_flags *flags, va_list elem);
void convert_type(t_flags *flags, va_list elem, char **str);
void convert_and_print(va_list elem, t_flags *flags);
void print_width_and_str(char *str, t_flags *flags);
void initialize_flags(t_flags *flags);
void append_flags(t_flags *flags, char c);
void change_state_flags(t_flags *flags);
char *ft_itoa_with_prec(int param, t_flags *flags);
char *ft_uitoa_with_prec(unsigned long param, t_flags *flags);
void treat_flags_sign_int(char **nbr_s, t_flags *flags, int param);
char *choose_base(char convert_type);
char *conv_to_hex_with_prec(unsigned int nbr, char *base, t_flags *flags);
void add_precision_to_hex(char **hex_conversion, t_flags *flags);
char *conv_to_pointer(void *pointer, t_flags *flags);
char *conv_char_to_str(t_flags *flags, va_list elem);
char *str_with_prec(char *str, t_flags *flags);
void append_char(char **str, char c);
int ft_strlen(char *str);
void putstr(char *str, t_flags *flags);
char *ft_strdup(const char *source);
int ft_is_in(char *str, char c);
#endif