A subset of the libc comprised of my libft GNL and printf projects, with a few extras.
Compatible with GNU/Linux and MacOS with clang and hopefully GCC.
GNL
NAME
get_next_line - read from a fd line per line
SYNOPSIS
int get_next_line(const int fd, char **line)
DESCRIPTION
the get_next_line() function stores the content of a line (array of char ending with a newline or EOF) without the trailing newline read from fd into the address of line
RETURN VALUES
1 if a line has been read, 0 if the reading has been completed, -1 if an error happened
Printf
Handled types
cCsSpdDioOuUxXb%
Functions
ft_dprintf
ft_vdprintf
ft_printf
ft_vprintf
Libft
Bonus functions
Functions from the libc:
ft_islower
ft_isupper
ft_strndup
ft_rand (kind of)
Homebrewn functions:
NAME
ft_strrlen -- find length until character
SYNOPSIS
size_t ft_strrlen(const char **s, char c);
DESCRIPTION
The ft_strrlen() function computes the offset between the start of the string s and the character c.
RETURN VALUES
The number of characters that precede the given character, or ft_strlen() if the character isn't found in the string.
NAME
ft_cntword - count the number of words
SYNOPSIS
int ft_cntword(char const *s, char c);
DESCRIPTION
The ft_cntword() function computes the number of 'words' delimited by the character c in the NULL terminated string s. A 'word' is a section of a string delimited by a given character, excluding the first and the last character of the string.
RETURN VALUES
The number of words in the string pointed by s. Otherwise 0 if s is empty or 1 if c isn't found in s (or is '\0')
NAME
ft_cntdigit - count the number of digits
SYNOPSIS
int ft_cntdigit(int n);
DESCRIPTION
The ft_cntdigit() function computes the number of digits in the number n.
RETURN VALUE
The number of digits starting from 1
NAME
ft_strlowcase - converts to lowercase
SYNOPSIS
char ft_strlowcase(char *s);
DESCRIPTION
The ft_strlowcase() function converts uppercase characters in the string s to lowercase.
RETURN VALUE
The string converted to uppercase.
NAME
ft_strupcase - converts to uppercase
SYNOPSIS
char ft_strupcase(char *s);
DESCRIPTION
The ft_strupcase() function converts lowercase characters in the string s to uppercase.