mise a la norme
This commit is contained in:
11
ft_printf.c
11
ft_printf.c
@@ -1,3 +1,14 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_printf.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/03/12 22:31:29 by hulamy #+# #+# */
|
||||||
|
/* Updated: 2020/03/12 22:31:31 by hulamy ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "ft_printf.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_convert.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/03/12 22:30:05 by hulamy #+# #+# */
|
||||||
|
/* Updated: 2020/03/12 22:30:20 by hulamy ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "ft_printf.h"
|
||||||
|
|
||||||
@@ -81,10 +92,7 @@ char *ft_convert(va_list ap, char *type, char **s)
|
|||||||
if ((tmp = ft_strchrset(type, "dic")) && ft_strchr(type, 'l'))
|
if ((tmp = ft_strchrset(type, "dic")) && ft_strchr(type, 'l'))
|
||||||
return (conv_i(tmp[0], va_arg(ap, long int)));
|
return (conv_i(tmp[0], va_arg(ap, long int)));
|
||||||
if ((tmp = ft_strchrset(type, "dic")))
|
if ((tmp = ft_strchrset(type, "dic")))
|
||||||
{
|
|
||||||
// ft_putstr("OK");
|
|
||||||
return (conv_i(tmp[0], va_arg(ap, int)));
|
return (conv_i(tmp[0], va_arg(ap, int)));
|
||||||
}
|
|
||||||
if ((tmp = ft_strchrset(type, "uxXps")) && ft_strchrset(type, "lps"))
|
if ((tmp = ft_strchrset(type, "uxXps")) && ft_strchrset(type, "lps"))
|
||||||
return (conv_u(tmp[0], va_arg(ap, unsigned long int)));
|
return (conv_u(tmp[0], va_arg(ap, unsigned long int)));
|
||||||
if ((tmp = ft_strchrset(type, "uxX")))
|
if ((tmp = ft_strchrset(type, "uxX")))
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_flag_transform.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/03/12 22:30:28 by hulamy #+# #+# */
|
||||||
|
/* Updated: 2020/03/12 22:30:41 by hulamy ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "ft_printf.h"
|
||||||
|
|
||||||
@@ -65,7 +76,6 @@ char *ft_precision(char *s, char *print, char *type)
|
|||||||
if ((tmp = ft_strchr(s, '.')))
|
if ((tmp = ft_strchr(s, '.')))
|
||||||
{
|
{
|
||||||
precision = ft_atoi(tmp + 1);
|
precision = ft_atoi(tmp + 1);
|
||||||
// *tmp = '\0';
|
|
||||||
while (*s && ft_strchr("#- +'0", *(++s)))
|
while (*s && ft_strchr("#- +'0", *(++s)))
|
||||||
if (*s == '0')
|
if (*s == '0')
|
||||||
*s = '/';
|
*s = '/';
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_flag_transform_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/03/12 22:30:50 by hulamy #+# #+# */
|
||||||
|
/* Updated: 2020/03/12 22:30:57 by hulamy ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "ft_printf.h"
|
||||||
|
|
||||||
@@ -39,8 +50,9 @@ char *ft_sharp_again(char *s, char *print, char *type)
|
|||||||
|
|
||||||
char *ft_space(char *s, char *print, char *type, int *size)
|
char *ft_space(char *s, char *print, char *type, int *size)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
if (print[0] == ' ' || !ft_strchr(s, ' ') || !ft_strchrset(type, "diuxX"))
|
if (print[0] == ' ' || !ft_strchr(s, ' ') || !ft_strchrset(type, "diuxX"))
|
||||||
return (print);
|
return (print);
|
||||||
while (print[i] == ' ')
|
while (print[i] == ' ')
|
||||||
|
|||||||
Reference in New Issue
Block a user