kekw
This commit is contained in:
@ -6,22 +6,22 @@
|
||||
# By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2022/09/27 08:39:27 by cchauvet #+# #+# #
|
||||
# Updated: 2023/01/04 15:36:08 by cchauvet ### ########.fr #
|
||||
# Updated: 2023/01/05 18:25:05 by cchauvet ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
CC = clang
|
||||
|
||||
SRCS = ft_dprintul_base.c ft_isdigit.c ft_dprintul.c ft_dprintx.c ft_dprintflag.c ft_skipflag.c ft_vdprintf.c ft_dprintl_base.c ft_dprintX.c ft_dprintptr.c ft_strlen.c ft_putstr_fd.c ft_dprintarg.c ft_printf.c ft_putchar_fd.c ft_isarg.c
|
||||
SRCS = ft_dprintarg.c ft_dprintflag.c ft_dprintl_base.c ft_dprintptr.c ft_dprintstrtab.c ft_dprintul_base.c ft_dprintul.c ft_dprintx.c ft_dprintX.c ft_isarg.c ft_isdigit.c ft_printf.c ft_putchar_fd.c ft_putstr_fd.c ft_skipflag.c ft_strlen.c ft_vdprintf.c
|
||||
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
|
||||
NAME = ft_printf.a
|
||||
|
||||
CFLAG = -Wall -Werror -Wextra
|
||||
CFLAG = -Wall -Werror -Wextra -g
|
||||
|
||||
%.o: %.c
|
||||
${CC} ${CFLAGS} -c -o $@ $<
|
||||
${CC} ${CFLAG} -c -o $@ $<
|
||||
|
||||
all: ${NAME}
|
||||
|
||||
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/23 18:08:31 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/10/23 18:54:41 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/05 17:37:12 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -24,6 +24,8 @@ int ft_dprintarg(int fd, int arg, va_list args)
|
||||
return (ft_dprintul(fd, va_arg(args, unsigned int)));
|
||||
if (arg == 'c')
|
||||
return (ft_putchar_fd(fd, va_arg(args, int)));
|
||||
if (arg == 'S')
|
||||
return (ft_dprintstrtab(fd, va_arg(args, char **)));
|
||||
if (arg == 's')
|
||||
return (ft_putstr_fd(fd, va_arg(args, char *)));
|
||||
if (arg == '%')
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29
libftx/printf/ft_dprintstrtab.c
Normal file
29
libftx/printf/ft_dprintstrtab.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_dprintstrtab.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/05 17:26:55 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/05 18:52:56 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_printf.h"
|
||||
|
||||
int ft_dprintstrtab(int fd, char **tab)
|
||||
{
|
||||
size_t index;
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
index = 0;
|
||||
while (tab[index] != NULL)
|
||||
{
|
||||
i += ft_putstr_fd(fd, tab[index]) + 1;
|
||||
ft_putchar_fd(fd, '\n');
|
||||
index++;
|
||||
}
|
||||
return (i);
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/11 22:37:41 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/10/12 16:09:22 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/05 18:26:24 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -18,7 +18,7 @@ int ft_isarg(int c)
|
||||
|
||||
if (c == '\0')
|
||||
return (1);
|
||||
flags = "cspdiuxX%";
|
||||
flags = "cspdiuxX%S";
|
||||
while (*flags)
|
||||
{
|
||||
if (*flags == c)
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/09/26 14:47:54 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/11/07 19:41:50 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/05 17:36:39 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -29,6 +29,7 @@ int ft_dprintx(int fd, unsigned int n);
|
||||
int ft_dprint_upperx(int fd, unsigned int n);
|
||||
int ft_dprintflag(int fd, const char *flag, va_list va);
|
||||
int ft_dprintarg(int fd, int c, va_list va);
|
||||
int ft_dprintstrtab(int fd, char **tab);
|
||||
|
||||
int ft_printf(const char *format, ...);
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user