|
libft
|
Output utilities for writing to file descriptors. More...
Files | |
| file | ft_output.c |
| File descriptor-based output functions. | |
| file | ft_output.h |
| File descriptor-based output functions. | |
Functions | |
| void | ft_putchar_fd (char c, int fd) |
| Writes a single character to a file descriptor. | |
| void | ft_putendl_fd (char *s, int fd) |
| Writes a string followed by a newline to a file descriptor. | |
| void | ft_putnbr_fd (int n, int fd) |
| Writes an integer to a file descriptor. | |
| int | ft_putstr_fd (char *str, int fd) |
| Writes a string to a file descriptor. | |
Output utilities for writing to file descriptors.
Functions that output characters, strings, and integers to a given file descriptor. These are useful in systems without standard output libraries.
This group includes:
| void ft_putchar_fd | ( | char | c, |
| int | fd | ||
| ) |
#include <include/ft_output.h>
Writes a single character to a file descriptor.
This function writes the character c to the file specified by fd. It is primarily used for outputting a single character to a file or standard output.
| c | The character to write. |
| fd | The file descriptor to which the character will be written. |
| void ft_putendl_fd | ( | char * | s, |
| int | fd | ||
| ) |
#include <include/ft_output.h>
Writes a string followed by a newline to a file descriptor.
This function writes the string s followed by a newline character (\n) to the file descriptor fd. Commonly used to print lines of text.
| s | The string to write. |
| fd | The file descriptor to which the string and newline will be written. |
| void ft_putnbr_fd | ( | int | n, |
| int | fd | ||
| ) |
#include <include/ft_output.h>
Writes an integer to a file descriptor.
Outputs the integer n as a string of digits to the given fd. Handles negative numbers and the special case of INT_MIN.
| n | The integer to write. |
| fd | The file descriptor to which the integer will be written. |
| int ft_putstr_fd | ( | char * | str, |
| int | fd | ||
| ) |
#include <include/ft_output.h>
Writes a string to a file descriptor.
This function writes the null-terminated string str to the file descriptor fd. It handles system interruptions (e.g., EINTR) and retries as needed until the full string is written or an unrecoverable error occurs.
| str | The string to write. |
| fd | The file descriptor to which the string will be written. |