-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf.h
64 lines (59 loc) · 2.16 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vkinnune <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/02 13:26:37 by vkinnune #+# #+# */
/* Updated: 2022/02/08 12:27:31 by vkinnune ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include "libft/libft.h"
# include <stdarg.h>
# include <stdbool.h>
# define FALSE 0
# define TRUE 1
# define MAXBUF 64
typedef struct s_info
{
bool alt;
bool ladjust;
bool blank;
bool issign;
bool iswidth;
char sign;
char padc;
va_list *args;
int length;
int prec;
int bytes;
int base;
int capitals;
int size;
char *prefix;
} t_info;
int signed_int(t_info *var);
int donumber(t_info *var, unsigned long long u);
int ft_printf(const char *str, ...);
int doprint(t_info *var, char *ptr);
int init_print(t_info *var, char **ptr);
int unsigned_int(t_info *var, char *ptr);
int decimal(t_info *var);
int character(t_info *var);
int string(t_info *var);
char *check_flags(t_info *var, char *ptr);
char *get_width(t_info *var, char *ptr);
char *get_precision(t_info *var, char *ptr);
char *get_modifier(t_info *var, char *ptr);
void setdefaultvalues(t_info *var);
void init_unsigned(t_info *var, char *ptr);
char *ftoa(long double n, t_info *var, char *p);
long double mypow(long double x, long double y);
int printstring(t_info *var, char *str, int len);
int printnum(t_info *var, char buf[MAXBUF], char *p, int len);
void alt(t_info *var, unsigned long long u);
char *dodecimal(long double n, t_info *var, char *p);
#endif