-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf.h
72 lines (67 loc) · 2.82 KB
/
ft_printf.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
62
63
64
65
66
67
68
69
70
71
72
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_printf.h :+: :+: */
/* +:+ */
/* By: ksmorozo <ksmorozo@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2021/01/18 14:07:39 by ksmorozo #+# #+# */
/* Updated: 2021/02/17 13:31:52 by ksmorozo ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <stdarg.h>
typedef struct s_recipe
{
int minus_flag;
int zero_flag;
int space_flag;
int plus_flag;
int hash_flag;
int width;
int precision;
int null_precision;
char length;
char type;
} t_recipe;
int ft_printf(const char *print_me, ...);
int parse(va_list *arguments, const char **print_me,
t_recipe *recipe);
int parse_flag(t_recipe *recipe, const char **print_me);
int parse_precision(va_list *arguments, t_recipe *recipe,
const char **print_me);
int parse_width(va_list *arguments, t_recipe *recipe,
const char **print_me);
char parse_type(t_recipe *recipe, const char **print_me);
int parse_length(t_recipe *recipe, const char **print_me);
int print(va_list *arguments, t_recipe recipe);
int print_char(va_list *arguments, t_recipe recipe);
void write_padding(char padding_char, int len);
int count_num_length(long long int num, int base,
t_recipe recipe);
int print_hex(va_list *arguments, t_recipe recipe);
unsigned long long deal_with_length(va_list *arguments,
t_recipe recipe);
char *handle_conversion(unsigned long long num,
t_recipe recipe);
void deal_with_prefix(t_recipe *recipe,
unsigned long long num);
int print_d_i(va_list *arguments, t_recipe recipe);
int print_u(va_list *arguments, t_recipe recipe);
int count_num_length_unsigned(unsigned long long number,
int base);
char *ft_itoa_base_unsigned(unsigned long long number,
int base, char *digits_str);
long long deal_with_length_signed(va_list *arguments,
t_recipe recipe);
unsigned long long deal_with_length_unsigned(va_list *arguments,
t_recipe recipe);
unsigned long long handle_length_specifier(va_list *arguments,
t_recipe recipe);
int count_padding_len(t_recipe recipe, int num_length,
long long num);
int print_percent(t_recipe recipe);
int print_ptr(va_list *arguments, t_recipe recipe);
int print_str(va_list *arguments, t_recipe recipe);
#endif