added c conversion suport

This commit is contained in:
Tanguy MAZE
2019-02-11 14:06:37 +01:00
parent 973ac2479a
commit dcb8f8ea1d
13 changed files with 257 additions and 95 deletions

View File

@@ -6,7 +6,7 @@
/* 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 */
/* Updated: 2019/02/11 10:06:43 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,8 +14,11 @@
# define LIBFTPRINTF_H
# include <unistd.h>
# include <stdlib.h>
# include <stdarg.h>
# include <stdio.h>
typedef struct s_flags
{
enum e_convtype
@@ -39,8 +42,17 @@ typedef struct s_flags
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);

View File

@@ -1,41 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libftprintf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/07 13:03:44 by tmaze #+# #+# */
/* Updated: 2019/02/07 13:12:20 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef LIBFTPRINTF_H
# define LIBFTPRINTF_H
# include <unistd.h>
# include <stdarg.h>
typedef struct s_flags
{
enum e_convtype
{
c,
s,
p,
d,
i,
o,
u,
x,
X,
f
} convtype;
char minus;
char sign;
int width;
int precision;
}
#endif