diff --git a/includes/print.h b/includes/print.h index 690852d..7766698 100644 --- a/includes/print.h +++ b/includes/print.h @@ -6,18 +6,60 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/31 15:07:30 by rparodi #+# #+# */ -/* Updated: 2025/09/01 17:36:18 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:42 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef PRINT_H # define PRINT_H +/** + * @brief Print on a file descriptor + * + * @param fd the file descriptor + * @param s the string + * @return the number of character printable + */ int ft_dprintf(int fd, const char *s, ...); + +/** + * @brief Print on the standard output + * + * @param s the string + * @return the number of character printable + */ int ft_printf(const char *s, ...); + +/** + * @brief print an character on a file descriptor + * + * @param c the character to print + * @param fd the file descriptor + */ void ft_putchar_fd(char c, int fd); + +/** + * @brief Print a string follow by a new line on a file descriptor + * + * @param s the string to print + * @param fd the file descriptor + */ void ft_putendl_fd(char *s, int fd); + +/** + * @brief Print a number on a file descriptor + * + * @param n the number to print + * @param fd the file descriptor + */ void ft_putnbr_fd(int n, int fd); + +/** + * @brief print a string on a file descriptor + * + * @param s the string to print + * @param fd the file descriptor + */ void ft_putstr_fd(char *s, int fd); #endif diff --git a/print/ft_printf.c b/print/ft_printf.c index 4fec8bb..06583a5 100644 --- a/print/ft_printf.c +++ b/print/ft_printf.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/14 17:27:44 by rparodi #+# #+# */ -/* Updated: 2025/09/04 11:56:27 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -44,13 +44,6 @@ static int _check_args(int fd, char c, va_list args, int *ret) return (1); } -/** - * @brief Print on a file descriptor - * - * @param fd the file descriptor - * @param s the string - * @return the number of character printable - */ int ft_dprintf(int fd, const char *s, ...) { size_t i; @@ -77,12 +70,6 @@ int ft_dprintf(int fd, const char *s, ...) return (ret); } -/** - * @brief Print on the standard output - * - * @param s the string - * @return the number of character printable - */ int ft_printf(const char *s, ...) { size_t i; diff --git a/print/ft_putchar_fd.c b/print/ft_putchar_fd.c index 0bb8f44..c94d46c 100644 --- a/print/ft_putchar_fd.c +++ b/print/ft_putchar_fd.c @@ -6,18 +6,12 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 13:58:22 by rparodi #+# #+# */ -/* Updated: 2025/09/01 17:46:44 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include -/** - * @brief print an character on a file descriptor - * - * @param c the character to print - * @param fd the file descriptor - */ void ft_putchar_fd(char c, int fd) { write(fd, &c, 1); diff --git a/print/ft_putendl_fd.c b/print/ft_putendl_fd.c index 734c2b1..833c3ec 100644 --- a/print/ft_putendl_fd.c +++ b/print/ft_putendl_fd.c @@ -6,18 +6,12 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 13:59:01 by rparodi #+# #+# */ -/* Updated: 2025/09/01 17:46:30 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "print.h" -/** - * @brief Print a string follow by a new line on a file descriptor - * - * @param s the string to print - * @param fd the file descriptor - */ void ft_putendl_fd(char *s, int fd) { ft_putstr_fd(s, fd); diff --git a/print/ft_putnbr_fd.c b/print/ft_putnbr_fd.c index 220824f..dc81f28 100644 --- a/print/ft_putnbr_fd.c +++ b/print/ft_putnbr_fd.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 13:59:18 by rparodi #+# #+# */ -/* Updated: 2025/09/01 17:47:41 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,12 +41,6 @@ static int ft_check_sign(int n, char *str, size_t *i, int fd) return (n); } -/** - * @brief Print a number on a file descriptor - * - * @param n the number to print - * @param fd the file descriptor - */ void ft_putnbr_fd(int n, int fd) { size_t i; diff --git a/print/ft_putstr_fd.c b/print/ft_putstr_fd.c index 3a0782f..a935180 100644 --- a/print/ft_putstr_fd.c +++ b/print/ft_putstr_fd.c @@ -6,19 +6,13 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 13:58:46 by rparodi #+# #+# */ -/* Updated: 2025/09/01 17:48:07 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 16:23:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "str.h" #include -/** - * @brief print a string on a file descriptor - * - * @param s the string to print - * @param fd the file descriptor - */ void ft_putstr_fd(char *s, int fd) { write(fd, s, ft_strlen(s));