ft_printf/includes/libftprintf.h
2019-02-11 06:20:04 +00:00

60 lines
1.8 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libftprintf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/07 13:03:44 by tmaze #+# #+# */
/* Updated: 2019/02/09 14:38:22 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef LIBFTPRINTF_H
# define LIBFTPRINTF_H
# include <unistd.h>
# include <stdarg.h>
typedef struct s_flags
{
enum e_convtype
{
none = -1,
per = '%',
c = 'c',
s = 's',
p = 'p',
d = 'd',
i = 'i',
o = 'o',
u = 'u',
x = 'x',
X = 'X',
f = 'f'
} convtype;
char minus;
char sign;
char hash;
int width;
int precision;
char size;
} t_flags;
void pf_putflags(t_flags *flags);
size_t pf_getflags(const char *format, t_flags *flags);
int pf_convc(t_flags *flags, va_list *ap);
int pf_convs(t_flags *flags, va_list *ap);
int pf_convp(t_flags *flags, va_list *ap);
int pf_convd(t_flags *flags, va_list *ap);
int pf_convi(t_flags *flags, va_list *ap);
int pf_convo(t_flags *flags, va_list *ap);
int pf_convu(t_flags *flags, va_list *ap);
int pf_convx(t_flags *flags, va_list *ap);
int pf_convf(t_flags *flags, va_list *ap);
int ft_printf(const char *format, ...);
#endif