docs(print): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the header is inclued
This commit is contained in:
parent
ed64bd73d6
commit
701ce57f84
6 changed files with 48 additions and 43 deletions
|
|
@ -6,18 +6,60 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/31 15:07:30 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
|
#ifndef PRINT_H
|
||||||
# define 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, ...);
|
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, ...);
|
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);
|
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);
|
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);
|
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);
|
void ft_putstr_fd(char *s, int fd);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/14 17:27:44 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);
|
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, ...)
|
int ft_dprintf(int fd, const char *s, ...)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
@ -77,12 +70,6 @@ int ft_dprintf(int fd, const char *s, ...)
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Print on the standard output
|
|
||||||
*
|
|
||||||
* @param s the string
|
|
||||||
* @return the number of character printable
|
|
||||||
*/
|
|
||||||
int ft_printf(const char *s, ...)
|
int ft_printf(const char *s, ...)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,12 @@
|
||||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/09 13:58:22 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 <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/**
|
|
||||||
* @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)
|
void ft_putchar_fd(char c, int fd)
|
||||||
{
|
{
|
||||||
write(fd, &c, 1);
|
write(fd, &c, 1);
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,12 @@
|
||||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/09 13:59:01 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"
|
#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)
|
void ft_putendl_fd(char *s, int fd)
|
||||||
{
|
{
|
||||||
ft_putstr_fd(s, fd);
|
ft_putstr_fd(s, fd);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/09 13:59:18 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);
|
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)
|
void ft_putnbr_fd(int n, int fd)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,13 @@
|
||||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/09 13:58:46 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 "str.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/**
|
|
||||||
* @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)
|
void ft_putstr_fd(char *s, int fd)
|
||||||
{
|
{
|
||||||
write(fd, s, ft_strlen(s));
|
write(fd, s, ft_strlen(s));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue