-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printf.h
68 lines (59 loc) · 1.7 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: youkim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/06/17 15:12:45 by youkim #+# #+# */
/* Updated: 2021/07/08 10:19:09 by youkim ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <stdarg.h>
# include <unistd.h>
# include <stdlib.h>
# include "./libft/libft.h"
# include <stdbool.h>
# define TYPES "csdiupxX%"
# define NOPREC -1
# define INITPREC 0
/*
** INFO STRUCT
*/
/*
** STRUCT INFO
*/
typedef struct s_info
{
char type;
int width;
int prec;
bool lalign;
bool zeropad;
bool num_minus;
} t_info;
/*
** int is_zero;
** int dosign;
** int nbr_sign;
*/
/*
** PRINTF
*/
int ft_printf(const char *format, ...);
/*
** PRINT TYPES
*/
int print_char(int c, t_info *info);
int print_string(char *s, t_info *info);
int print_number(long long n, t_info *info);
/*
** UTILS
*/
void init_info(t_info *info);
int print_type(va_list ap, t_info *info);
void check_info(va_list ap, char *format, t_info *info, int i);
char *get_baseset(char type);
#endif