| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* pf_putstr.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2016/02/27 00:48:09 by bchanot #+# #+# */
- /* Updated: 2018/10/14 03:36:14 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libftprintf.h"
- #include <unistd.h>
- int pf_xlong2(int len, t_inf *inf, unsigned long long nb)
- {
- len += pf_putuhex(nb, inf->fd);
- if (inf->width > 0 && inf->min == 1)
- while (len < inf->width && len++ >= 0)
- ft_putchar_fd(' ', inf->fd);
- return (len);
- }
- int pf_x_uplong2(int len, t_inf *inf, unsigned long long nb)
- {
- len += pf_putuhexm(nb, inf->fd);
- if (inf->width > 0 && inf->min == 1)
- while (len < inf->width && len++ >= 0)
- ft_putchar_fd(' ', inf->fd);
- return (len);
- }
- int pf_putstr(const char *s, int fd)
- {
- int len;
- len = -1;
- while (s[++len])
- ft_putchar_fd(s[len], fd);
- return (len);
- }
- int pf_putnstr(const char *s, int n, int fd)
- {
- write(fd, s, n);
- return (n);
- }
|