ajout de ft_printf a la librairie

This commit is contained in:
hugogogo
2021-05-19 18:06:12 +02:00
parent b7340d9324
commit f1ce5b8b9e
10 changed files with 770 additions and 9 deletions

View File

@@ -13,10 +13,6 @@
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <string.h>
# include <unistd.h>
# include <stdlib.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 1
# endif

62
includes/ft_printf.h Normal file
View File

@@ -0,0 +1,62 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/27 12:07:47 by hulamy #+# #+# */
/* Updated: 2020/03/12 20:35:10 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_H
# define FT_PRINTF_H
# include <stdarg.h> // to use va_arg
/*
** ft_printf.c
*/
char *specifier(char *s);
int ft_expand_star(int nbr, char **string);
int ft_put_word(char *s, char *type, int size);
char *convert_with_flags(char *s, va_list ap, char *type, int *size);
int ft_printf(char *string, ...);
/*
** ft_next_word.c
*/
int width_precision(char *s);
int word_length(char *s);
char *next_word(char **s);
/*
** ft_convert.c
*/
char *conv_i(char c, long int i);
char *conv_u(char c, unsigned long int i);
char *ft_convert(va_list ap, char *type, char **s);
/*
** ft_flag_transform.c
*/
char *precision_int(char *print, int precision);
char *ft_precision(char *s, char *print, char *type);
char *width_flags(char *print, char *s, int width, int zero);
char *ft_width(char *s, char *print, int *size, char *type);
char *ft_flag_transform(char *s, char *print, char *type, int *size);
/*
** ft_flag_transform_bonus.c
*/
char *ft_plus(char *s, char *print, char *type);
char *ft_sharp(char *s, char *print, char *type);
char *ft_sharp_again(char *s, char *print, char *type);
char *ft_space(char *s, char *print, char *type, int *size);
#endif

View File

@@ -15,7 +15,9 @@
# include <string.h>
# include <unistd.h>
# include <stdlib.h>
# include "get_next_line.h"
# include "ft_get_next_line.h"
# include "ft_printf.h"
# include <stdarg.h> // to use va_arg in ft_printf
void *ft_memset(void *b, int c, size_t len);
void ft_bzero(void *s, size_t n);
@@ -103,7 +105,61 @@ int ft_issort(int *tab, int length, int (*f)(int, int));
int *ft_arraymap(int *tab, int length, int(*f)(int));
void ft_putnbrendl(int n);
void ft_putnbrendl_fd(int n, int fd);
int get_next_line(const int fd, char **line);
int ft_get_next_line(const int fd, char **line);
char *ft_concat_free(char *str1, char *str2);
# include <stdarg.h> // to use va_arg
/*
** ft_printf.c
*/
char *specifier(char *s);
int ft_expand_star(int nbr, char **string);
int ft_put_word(char *s, char *type, int size);
char *convert_with_flags(char *s, va_list ap, char *type, int *size);
int ft_printf(char *string, ...);
/*
** ft_next_word.c
*/
int width_precision(char *s);
int word_length(char *s);
char *next_word(char **s);
/*
** ft_convert.c
*/
char *conv_i(char c, long int i);
char *conv_u(char c, unsigned long int i);
char *ft_convert(va_list ap, char *type, char **s);
/*
** ft_flag_transform.c
*/
char *precision_int(char *print, int precision);
char *ft_precision(char *s, char *print, char *type);
char *width_flags(char *print, char *s, int width, int zero);
char *ft_width(char *s, char *print, int *size, char *type);
char *ft_flag_transform(char *s, char *print, char *type, int *size);
/*
** ft_flag_transform_bonus.c
*/
char *ft_plus(char *s, char *print, char *type);
char *ft_sharp(char *s, char *print, char *type);
char *ft_sharp_again(char *s, char *print, char *type);
char *ft_space(char *s, char *print, char *type, int *size);
#endif