/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putchars.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/27 09:17:03 by narnaud #+# #+# */ /* Updated: 2021/11/17 09:57:53 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_printf.h" int ft_putchar(int ch) { char c; c = (char)ch; write(1, &c, 1); return (1); } int ft_putstr(char *str) { int i; i = 0; if (!str) { ft_putstr("(null)"); return (6); } while (str[i]) ft_putchar(str[i++]); return (i); } int va_putchar(va_list va_ch, const char *str) { (void)*str; ft_putchar(va_arg(va_ch, int)); return (1); } int va_putstr(va_list va_str, const char *str) { (void)*str; return (ft_putstr(va_arg(va_str, char *))); } int va_putperc(va_list va, const char *str) { (void)*str; (void)va; ft_putchar('%'); return (1); }