ft_printf/includes/libftprintf.h
2019-02-11 14:06:37 +01:00

72 lines
2.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libftprintf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/07 13:03:44 by tmaze #+# #+# */
/* Updated: 2019/02/11 10:06:43 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef LIBFTPRINTF_H
# define LIBFTPRINTF_H
# include <unistd.h>
# include <stdlib.h>
# include <stdarg.h>
# include <stdio.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;
char *buffer;
} t_flags;
void *pf_memset(void *b, int c, size_t len);
size_t pf_strlen(const char *s);
char *pf_strnew(size_t size);
char *pf_strchr(const char *s, int c);
int pf_isdigit(int c);
int pf_atoi(const char *str);
int pf_toupper(int c);
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