-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.h
More file actions
56 lines (46 loc) · 1.93 KB
/
Copy pathft_printf.h
File metadata and controls
56 lines (46 loc) · 1.93 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: viferrei <viferrei@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/21 14:40:36 by viferrei #+# #+# */
/* Updated: 2022/01/29 17:20:11 by viferrei ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <stdarg.h>
# include "./libft/libft.h"
typedef struct s_format
{
char *format;
int index;
va_list arg;
int len;
} t_format;
typedef struct s_holder
{
char *argument;
char specifier;
size_t len;
} t_holder;
int ft_printf(const char *format, ...);
int ft_vprintf(const char *format, va_list arg);
t_format *ft_init_format(const char *format, va_list arg);
t_holder *ft_init_holder(void);
void ft_placeholder(t_format *fmt, t_holder *holder);
void ft_specifier(t_format *fmt, t_holder *holder);
void ft_conversions(t_format *fmt, t_holder *holder);
/* CONVERSIONS */
void ft_convert_c(t_format *fmt, t_holder *holder);
void ft_convert_di(t_format *fmt, t_holder *holder);
void ft_convert_u(t_format *fmt, t_holder *holder);
void ft_convert_s(t_format *fmt, t_holder *holder);
void ft_convert_percent(t_holder *holder);
void ft_convert_p(t_format *fmt, t_holder *holder);
void ft_convert_x(t_format *fmt, t_holder *holder);
/* AUXILIARIES */
char *ft_itoa_base(unsigned long nbr, char *base);
#endif