57 lines
1.4 KiB
C
Executable file
57 lines
1.4 KiB
C
Executable file
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* output.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: ykolomie <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/11/16 17:58:15 by ykolomie #+# #+# */
|
|
/* Updated: 2016/11/16 21:53:11 by ykolomie ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "output.h"
|
|
#include <unistd.h>
|
|
|
|
void ft_putchar(char c)
|
|
{
|
|
write(1, &c, 1);
|
|
}
|
|
|
|
void ft_putstr(char *str)
|
|
{
|
|
while (*str)
|
|
write(1, str++, 1);
|
|
}
|
|
|
|
void ft_puterror(char *str)
|
|
{
|
|
while (*str)
|
|
write(2, str++, 1);
|
|
}
|
|
|
|
void print_map(char **map)
|
|
{
|
|
int i;
|
|
int j;
|
|
|
|
i = 0;
|
|
while (map[i])
|
|
{
|
|
j = 0;
|
|
while (map[i][j] != '\0')
|
|
write(1, &map[i][j++], 1);
|
|
write(1, "\n", 1);
|
|
i++;
|
|
}
|
|
}
|
|
|
|
int ft_strlen(char *str)
|
|
{
|
|
int length;
|
|
|
|
length = 0;
|
|
while (str[length])
|
|
length++;
|
|
return (length);
|
|
}
|