-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.h
More file actions
64 lines (54 loc) · 2.01 KB
/
ft_printf.h
File metadata and controls
64 lines (54 loc) · 2.01 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ecarvalh <ecarvalh@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/11 15:12:09 by ecarvalh #+# #+# */
/* Updated: 2024/01/10 15:08:25 by ecarvalh ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <stdarg.h>
# include <unistd.h>
/* Conversions */
# define CNV "cspdiuxX%"
# define FLG "-0# +"
# define FLL 6
/* Bases */
# define DEC "0123456789"
# define LHX "0123456789abcdef"
# define UHX "0123456789ABCDEF"
/* Types */
typedef struct s_arg t_arg;
struct s_arg
{
char cnv;
char flg[FLL + 1];
int flp;
int wid;
int prc;
int len;
};
/* <'-' > */
int ft_printf(const char *format, ...);
/* Lib */
int ft_based(size_t n, char *base); /* BASED */
char *ft_strchr(char *str, int c);
int ft_isnbr(int c);
int ft_strlen(char *str);
int ft_nbrlen(size_t nbr, int base_len);
/* Eval */
int ft_eval(va_list args, const char *fmt, int *j);
/* ConvFun */
void ft_chr(va_list args, t_arg *a); /* char */
void ft_str(va_list args, t_arg *a); /* string */
void ft_ptr(va_list args, t_arg *a); /* pointer */
void ft_dig(va_list args, t_arg *a); /* digit */
void ft_uns(va_list args, t_arg *a); /* unsigned */
void ft_hxl(va_list args, t_arg *a); /* hex lower */
void ft_hxu(va_list args, t_arg *a); /* hex upper */
void ft_def(va_list args, t_arg *a); /* default (%) */
#endif