tgrekov-fdf
HIVE fdf May 2024
|
Definition in file utils.h.
#include "internal_types.h"
Go to the source code of this file.
Functions | |
int | u_len_base (t_ubiggest n, int base) |
Determine the length of unsigned number n in base base . | |
int | u_put_base (t_ubiggest n, char *base, int fd) |
Write unsigned number n on descriptor fd in base base . | |
int | repeat_str_n (const char *str, int n, int fd) |
Write exactly n characters from str on descriptor fd . Repeats string if ft_strlen(str) is greater than n . | |
int | wrap_err (int n, int *total) |
Wrapper for handling functions that return a positive integer on success and -1 on failure. Either adds positive integer n to the value at total , or sets it to -1 . | |
int repeat_str_n | ( | const char * | str, |
int | n, | ||
int | fd | ||
) |
Write exactly n
characters from str
on descriptor fd
. Repeats string if ft_strlen(str)
is greater than n
.
[in] | str | |
[in] | n | |
[in] | fd |
int | Number of characters written, or -1 on error. |
Definition at line 50 of file repeat_str_n.c.
References ft_strlen().
int u_len_base | ( | t_ubiggest | n, |
int | base | ||
) |
Determine the length of unsigned number n
in base base
.
[in] | n | |
[in] | base |
int | Length of n . |
Definition at line 29 of file u_len_base.c.
int u_put_base | ( | t_ubiggest | n, |
char * | base, | ||
int | fd | ||
) |
Write unsigned number n
on descriptor fd
in base base
.
[in] | n | |
[in] | base | |
[in] | fd |
int | Number of characters written, or -1 on error. |
Definition at line 49 of file u_put_base.c.
int wrap_err | ( | int | n, |
int * | total | ||
) |
Wrapper for handling functions that return a positive integer on success and -1
on failure. Either adds positive integer n
to the value at total
, or sets it to -1
.
[in] | n | |
[in,out] | total |
int | If n is positive, returns 1 . Return 0 if it is -1 . |
Definition at line 29 of file wrap_err.c.
References wrap_err().