Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

The libft project takes up the concept of the D06 of the swimming pool, to make you write a library of useful functions that you can then use in the vast majority of your C projects this year and save you a lot of time.

This project ask you to write a lot of code that you have already done during the pool, which makes it a great time to take stock of your progress.

ft_printf compilation

make FT_PRINTF=true

debug compilation

make DEBUG=true

Function

Char function

name man
ft_charcatindex Put a char into a buffer in an index and put a \0.
ft_isalnum Check for any character for which ft_isalpha or ft_isdigit is true.
ft_isalpha Check for any character for which ft_isupper or ft_islower is true.
ft_isascii Check for an ASCII character.
ft_isblank Check for a space or tab character.
ft_iscntrl Check for any control character.
ft_isdigit Check for a decimal digit character.
ft_isgraph Check for any printing character except space
ft_islower Check for any lower-case letters.
ft_isprint Check for any printing character, including space.
ft_isspace Check for the white-space characters.
ft_isupper Check tests for any upper-case letter.
ft_isxdigit Check tests for any hexadecimal-digit character.
ft_tolower Converts an upper-case letter to the corresponding lowercase letter.
ft_toupper Converts a lower-case letter to the corresponding uppercase letter.

Conversion functions

nom man
ft_llonglen_base Function calculate the length of a long long with a base.
ft_ullonglen_base Function calculate the length of a unsigned long long with a base.
ft_atos Function converts the initial portion of the string pointed to by str to a short representation.
ft_atos_base Function converts the initial portion of the string pointed to by str with a base to a short representation.
ft_stoa Function converts a short into a allocate string.
ft_stoa_base Function converts a short with a base into a allocate string.
ft_stoa_base_no_malloc Function converts a short with a base into buffer.
ft_stoa_no_malloc Function converts a short with into buffer.
ft_atous Function converts the initial portion of the string pointed to by str to unsigned short representation.
ft_atous_base Function converts the initial portion of the string pointed to by str with a base to unsigned short representation.
ft_ustoa Function converts an unsigned short into a allocate string.
ft_ustoa_base Function converts an unsigned short with a base into a allocate string.
ft_ustoa_base_no_malloc Function converts an unsigned short with a base into buffer.
ft_ustoa_no_malloc Function converts an unsigned short with into buffer.
ft_atoi Function converts the initial portion of the string pointed to by str to an int representation.
ft_atoi_base Function converts the initial portion of the string pointed to by str with a base to an int representation.
ft_itoa Function converts an int into a allocate string.
ft_itoa_base Function converts an int with a base into a allocate string.
ft_itoa_base_no_malloc Function converts an int with a base into buffer.
ft_itoa_no_malloc Function converts an int with into buffer.
ft_atou Function converts the initial portion of the string pointed to by str to an unsigned int representation.
ft_atou_base Function converts the initial portion of the string pointed to by str with a base to an unsigned int representation.
ft_utoa Function converts an unsigned int into a allocate string.
ft_utoa_base Function converts an unsigned int with a base into a allocate string.
ft_utoa_base_no_malloc Function converts an unsigned int with a base into buffer.
ft_utoa_no_malloc Function converts an unsigned int with into buffer.
ft_atol Function converts the initial portion of the string pointed to by str to a long representation.
ft_atol_base Function converts the initial portion of the string pointed to by str with a base to a long representation.
ft_ltoa Function converts a long into a allocate string.
ft_ltoa_base Function converts a long with a base into a allocate string.
ft_ltoa_base_no_malloc Function converts a long with a base into buffer.
ft_ltoa_no_malloc Function converts a long with into buffer.
ft_atoul Function converts the initial portion of the string pointed to by str to an unsigned long representation.
ft_atoul_base Function converts the initial portion of the string pointed to by str with a base to an unsigned long representation.
ft_ultoa Function converts an unsigned long into a allocate string.
ft_ultoa_base Function converts an unsigned long with a base into a allocate string.
ft_ultoa_base_no_malloc Function converts an unsigned long with a base into buffer.
ft_ultoa_no_malloc Function converts an unsigned long with into buffer.
ft_atoll Function converts the initial portion of the string pointed to by str to a long long representation.
ft_atoll_base Function converts the initial portion of the string pointed to by str with a base to a long long representation.
ft_lltoa Function converts a long long into a allocate string.
ft_lltoa_base Function converts a long long with a base into a allocate string.
ft_lltoa_base_no_malloc Function converts a long long with a base into buffer.
ft_lltoa_no_malloc Function converts a long long with into buffer.
ft_atoull Function converts the initial portion of the string pointed to by str to an unsigned long long representation.
ft_atoull_base Function converts the initial portion of the string pointed to by str with a base to an unsigned long long representation.
ft_ulltoa Function converts an unsigned long long into a allocate string.
ft_ulltoa_base Function converts an unsigned long long with a base into a allocate string.
ft_ulltoa_base_no_malloc Function converts an unsigned long long with a base into buffer.
ft_ulltoa_no_malloc Function converts an unsigned long long with into buffer.

ft_printf

name man
ft_asprintf Function set *ret to be a pointer to a buffer sufficiently large to hold the formatted string.
ft_dprintf Write output to the given file descriptor.
ft_fprintf Write output to the given output stream.
ft_printf Function write output to stdout.
ft_snprintf Function will write at most size - 1 of the characters printed into the output string.
ft_sprintf Function effectively assume a size of INT_MAX + 1.

Memory function

name man
ft_bzero Writes n zeroed bytes to the string s. If n is zero, ft_bzero does nothing.
ft_calloc Contiguously allocates enough space for count objects that are size bytes of memory each and returns a pointer to the allocated memory. The allocated memory is filled with bytes of value zero.
ft_memalloc Allocated memory and filled with bytes of value zero.
ft_memccpy Copies bytes from string src to string dst.
ft_memchr Locates the first occurrence of c (converted to an unsigned char) in string s.
ft_memcmp Compares byte string s1 against byte string s2. Both strings are assumed to be n bytes long.
ft_memcpy Copies n bytes from memory area src to memory area dst. If dst and src overlap, behavior is undefined.
ft_memdel Free a memory zone.
ft_memmem Locates the first occurrence of the byte string little in the byte string big.
ft_memmove Copies len bytes from string src to string dst. The two strings may overlap; the copy is always done in a non-destructive manner.
ft_memrchr Locates the first occurrence of c (converted to an unsigned char) in string s starting at the end.
ft_memset Writes len bytes of value c (converted to an unsigned char) to the string b.

Print Function

name man
ft_putchar Write a char.
ft_putchar_fd Write a char to a file descriptor.
ft_putendl Write a string with a newline.
ft_putendl_fd Write a string with a newline to a file descriptor.
ft_putnbr Write a int.
ft_putnbr_fd Write a int to a file descriptor.
ft_puts Write a string with a newline and return an EOF.
ft_putstr Write a string.
ft_putstr_fd Write a string to a file descriptor.

String function

name man
ft_split Split a strings with the char c delimiter to a tab was allocate.
ft_str_is_alpha Check if any character are alphanumeric.
ft_str_is_lowercase Check if any character are lowercase.
ft_str_is_numeric Check if any character are numeric.
ft_str_is_printable Check if any character are printable.
ft_str_is_uppercase Check if any character are uppercase.
ft_strcasecmp Function lexicographically compare the null-terminated strings s1 and s2 with no case sensitive.
ft_strcasestr Function locates the first occurrence of the null-terminated string needle in the null-terminated string haystack with no case sensitive.
ft_strcat Function append a copy. of the null-terminated string s2 to the end of the null-terminated string s1, then add a terminating \0.
ft_strchr Function locates the first occurrence of c in string s.
ft_strclr Cleans by putting \0.
ft_strcmp Function lexicographically compare the null-terminated strings s1 and s2.
ft_strcpy Function copy the string src to dst.
ft_strdel Take a ptr in param to free and put NULL.
ft_strdup Function allocates sufficient memory for a copy of the string s1, does the copy, and returns a pointer to it.
ft_strequ Function lexicographically compare the null-terminated strings s1 and s2.
ft_striter Applies the function f to each character of the character string passed in parameter.
ft_striteri Applies the function f to each character in the character string passed as a parameter, specifying its index as the first argument.
ft_strjoin Allocate a new string of size s1 + s2 After that s1 was copy to the new allocate, and s2 was concatenate.
ft_strjoinfree Allocate a new string of size s1 + s2 After that s1 was copy to the new allocate, and s2 was concatenate. And free s1 or s2 or both with param tofree
ft_strlcat Concatenate strings with the same input parameters and output result as ft_snprintf.
ft_strlcpy Function copy strings with the same input parameters and output result as ft_snprintf.
ft_strlen Function computes the length of the string s.
ft_strlen_c Function computes the length of the string s until char c.
ft_strlowcase Put uppercase to lowercase on place.
ft_strmap Apply the function f to each character in the character string passed as a parameter to create a new “fresh” string resulting from the successive applications of f.
ft_strmapi Apply the function f to each character of the character string passed in parameter by specifying its index to create a new “fresh” string resulting from the successive applications of f.
ft_strncasecmp Function lexicographically compare the null-terminated strings s1 and s2 with no case sensitive.
ft_strncat Function append a copy of the null-terminated string s2 to the end of the null-terminated str s1, then add a terminating \0.
ft_strncatindex Function start to index in paramater and append a copy of the null-terminated string s2 to the end of the null-terminated str s1, then add a terminating \0.
ft_strncmp Function compares not more than n characters.
ft_strncpy Function copy at most len characters from src into dst.
ft_strndup Function copies at most n characters from the string s1 always NULL terminating the copied string.
ft_strnequ Function lexicographically compare the null-terminated strings s1 and s2 of size n.
ft_strnew Allocate a new string of size size.
ft_strnlen Function attempts to compute the length of s, but never scans beyond the first maxlen bytes of s.
ft_strnstr Function locates the first occurrence of the null-terminated string needle in the null-terminated string haystack with length len.
ft_strpbrk Function locates in the null-terminated string s the first occurrence of any character in the string charset and returns a pointer to this character. If no characters from charset occur anywhere in s ft_strpbrk returns NULL.
ft_strrchr Function locates the first occurrence of c (converted to an unsigned char) in string s.
ft_strstr Function locates the first occurrence of the null-terminated string needle in the null-terminated string haystack.
ft_strsub Allocate a new string of size n. After that s1 was copy to the new allocate at start 'start', and copy n char.
ft_strtrim Remove whitespaces (\n, \t, ) at start and and end of string s1.
ft_strupcase Function converts a lower-case letter to the corresponding upper-case letter.
ft_substr Allocate a new string of size n. After that s1 was copy to the new allocate at start 'start', and copy n char.

Tab function

name man
ft_tabdup Function allocates sufficient memory for a copy of the tab s1, does the copy, and returns a pointer to it.
ft_tablen Function computes the length of the tab s.
ft_tabndup Function allocates size n memory for a copy of the tab s1, does the copy, and returns a pointer to it.
ft_tabnew Function allocate a new tab of size size.
ft_tabtostr Transform an array into a string with a space in separation.
ft_tabtostr_c Transform an array into a string with a char c in separation.

About

The libft project takes up the concept of the D06 of the swimming pool

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages