-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printf.h
89 lines (85 loc) · 3.5 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: moboustt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/18 10:11:08 by moboustt #+# #+# */
/* Updated: 2019/12/21 15:06:58 by moboustt ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <unistd.h>
# include <stdarg.h>
# include <stdlib.h>
# include <stdio.h>
# define CCONVERSIONS "cspdiuxX%"
# define CFLAGS "-.*0123456789"
# define ALLSYMBOLS "cspdiuxX%-.*0123456789"
typedef struct s_struct
{
int n;
int h;
int i;
int minus;
int zero;
int width;
int dot;
int precision;
int asterisk;
} t_struct;
int ft_printf(const char *fmt, ...);
void ft__flag(const char *fmt, t_struct *list,
va_list ap, int i);
void conversion(const char *fmt, t_struct *list, va_list ap);
void is_int_handle(t_struct *list, long out_int,
int refer, int int_len);
void is_int(t_struct *list, va_list ap);
void is_char(t_struct *list, va_list ap);
int is_string(t_struct *list, va_list ap);
void goto_right(t_struct *list, char *out_str, int str_len);
void goto_left(t_struct *list, char *out_str, int str_len);
void specify_widthprecision(t_struct *list, char *out_str,
int str_len);
void is_hexa(const char *fmt, t_struct *list, va_list ap);
void is_pointer(t_struct *list, va_list ap);
void handle_widthprecision(t_struct *list,
unsigned int hexa_len);
int is_unsigned(t_struct *list, va_list ap);
void widthprecisionhandle(t_struct *list,
unsigned int unsigned_len);
void unsigned_rightparese(t_struct *list, char *s,
unsigned int unsigned_len);
void unsigned_leftparese(t_struct *list, char *s,
unsigned int unsigned_len);
int goto_percent(t_struct *list);
int print_flag_char(t_struct *list, int kind);
int pppp(t_struct *list, unsigned int hexa_len, char *tb);
int print_flag_str(t_struct *list, char *out_str, int kind);
char *hexa_convert(t_struct *list, unsigned long hexa_len,
char s, char *r);
void int_righthand(t_struct *list, int out_int, int refer, char *s);
void int_lefthand(t_struct *list, int out_int, int refer, char *s);
void print_base(const char *fmt, t_struct *list, int i_pos);
int zero_input(t_struct *list, int out_int);
int zero_input_u(t_struct *list, unsigned int out_int);
int zero_input_x(t_struct *list, long out_hexa);
int zero_input_p(t_struct *list, void *out_pointer);
void left_hexa(t_struct *list, char *tb);
void right_hexa(t_struct *list, char *tb);
void zerolist(t_struct *list);
void zerolistll(t_struct *list);
int print_hexa(char *tb);
char *ft_strrev(char *str);
int ft_intlen(long x);
void if_null(t_struct *list, void *s);
size_t ft_strlen(const char *str);
char *ft_strjoin(char *s1, char *s2);
char *ft_strchr(const char *s, int c);
char *ft_strdup(const char *s1);
char *ft_itoa(long n);
int ft_atoi(const char *s);
void *ft_memset(void *b, int c, size_t len);
#endif