|
Libft
Custom implementation of core libc functions with additional utility helpers.
|
Error reporting utilities. More...
Functions | |
| void | print_err (bool print_errno, const char *message) |
| Prints "Error\n" to stderr with optional message and errno. | |
| void | fprint_err (bool print_errno, const char *safe, const char *fmt,...) |
| Prints "Error\n" to stderr with safe prefix + formatted suffix. | |
Error reporting utilities.
Functions to print formatted error messages to stderr.
| void fprint_err | ( | bool | print_errno, |
| const char * | safe, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Prints "Error\n" to stderr with safe prefix + formatted suffix.
Prints safe prefix always, then attempts to format and append fmt. If formatting fails, only the safe prefix is printed. '
' is always printed at the end.
| print_errno | If true, prints errno description using strerror(). |
| safe | Safe prefix printed unconditionally (borrowed). |
| fmt | Format string for suffix (borrowed). |
| ... | Variadic arguments for format specifiers. |

| void print_err | ( | bool | print_errno, |
| const char * | message | ||
| ) |
Prints "Error\n" to stderr with optional message and errno.
If print_errno is false and message is NULL, only "Error\n" is printed. If print_errno is true, uses strerror() to print the errno description. If message is not NULL, prints the message. '
' is always printed at the end.
| print_errno | If true, prints errno description using strerror(). |
| message | Optional message to print (borrowed, can be NULL). |
