-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.h
More file actions
72 lines (61 loc) · 1.94 KB
/
ft_printf.h
File metadata and controls
72 lines (61 loc) · 1.94 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dporhomo <dporhomo@student.42prague.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/02 12:04:02 by dporhomo #+# #+# */
/* Updated: 2025/12/09 18:43:55 by dporhomo ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <unistd.h>
# include <stdlib.h>
# include <stdarg.h>
# ifdef __APPLE__
# define PTRNULL "0x0"
# else
# define PTRNULL "(nil)"
# endif
/*
(%-#0 +*5.5d)
*/
typedef struct s_flags
{
int spec;
int precision;
int width;
int star;
int plus;
int zero;
int space;
int hash;
int left;
} t_flags;
typedef struct s_print
{
int i;
int count;
} t_print;
typedef struct s_layout
{
int len;
int zeros;
int sign;
} t_layout;
int ft_printf(const char *format, ...);
t_flags ft_flags_init(void);
void ft_parse_format(const char *format, va_list args, t_print *tab);
int ft_isdigit(int c);
int ft_isspec(int c);
size_t ft_strlen(const char *s);
int ft_print_padding(int width, int size, int zero);
int ft_print_char(char c, t_flags flags);
int ft_print_str(const char *str, t_flags flags);
int ft_print_int(int n, t_flags flags);
int ft_print_unsigned(unsigned int n, t_flags flags);
int ft_print_hex(unsigned int n, int is_upper, t_flags flags);
int ft_print_ptr(unsigned long n, t_flags flags);
#endif /* FT_PRINTF_H */