|
libft
|
Go to the source code of this file.
Data Structures | |
| struct | s_list |
Typedefs | |
| typedef struct s_list | t_list |
Functions | |
| int | ft_atoi (const char *str) |
| ASCII to integer. | |
| void | ft_bzero (void *s, size_t n) |
| Zero a byte string. | |
| void * | ft_calloc (size_t count, size_t size) |
| Allocate and zero. | |
| int | ft_isalnum (int c) |
| Is an alphabet or a number. | |
| int | ft_isalpha (int c) |
| Check if char is alphabet. | |
| int | ft_isascii (int c) |
| Check if char is ASCII. | |
| int | ft_isdigit (int c) |
| Check if char is digit. | |
| int | ft_isprint (int c) |
| Check if char is printable. | |
| char * | ft_itoa (int n) |
| Integer to ASCII. | |
| void | ft_lstadd_back (t_list **lst, t_list *node) |
| List add back. | |
| void | ft_lstadd_front (t_list **lst, t_list *node) |
| List add front. | |
| void | ft_lstclear (t_list **lst, void(*del)(void *)) |
| Clear list. | |
| void | ft_lstdelone (t_list *lst, void(*del)(void *)) |
| Delete node. | |
| void | ft_lstiter (t_list *lst, void(*f)(void *)) |
| Iterate list. | |
| t_list * | ft_lstlast (t_list *lst) |
| Last node in a list. | |
| t_list * | ft_lstmap (t_list *lst, void *(*f)(void *), void(*del)(void *)) |
| List map. | |
| t_list * | ft_lstnew (void *content) |
| Create a new node. | |
| int | ft_lstsize (t_list *lst) |
| Size of a list. | |
| char * | ft_ltoa (long n) |
| Long to ASCII. | |
| void * | ft_memchr (const void *s, int c, size_t n) |
| Scan memory for a character. | |
| int | ft_memcmp (const void *s1, const void *s2, size_t n) |
| Memory compare. | |
| void * | ft_memcpy (void *dst, const void *src, size_t n) |
| Copies memory to destination. | |
| void * | ft_memmove (void *dst, const void *src, size_t len) |
| Copy memory area. | |
| void * | ft_memset (void *b, int c, int len) |
| Fill memory area with a contant byte. | |
| void | ft_putchar_fd (char c, int fd) |
| Writes char to file. | |
| void | ft_putendl_fd (char *s, int fd) |
| Writes new line to file. | |
| void | ft_putnbr_fd (int n, int fd) |
| Writes number to file. | |
| void | ft_putstr_fd (char *s, int fd) |
| Writes string to file. | |
| char ** | ft_split (char const *s, char c) |
| Splits string to substrings. | |
| char * | ft_strchr (const char *s, int c) |
| Search a character. | |
| char * | ft_strdup (const char *s1) |
| Duplicates a string. | |
| void | ft_striteri (char *s, void(*f)(unsigned int, char *)) |
| Calls a function for each char of a string. | |
| char * | ft_strjoin (char const *s1, char const *s2) |
| Joins two strings together. | |
| size_t | ft_strlcat (char *dst, const char *src, size_t dstsize) |
| Adds string to end of a string. | |
| size_t | ft_strlcpy (char *dst, const char *src, size_t dstsize) |
| Copies string to destination. | |
| size_t | ft_strlen (const char *s) |
| Length of the string. | |
| char * | ft_strmapi (char const *s, char(*f)(unsigned int, char)) |
| Create a copy of a string passing each char through a function. | |
| int | ft_strncmp (const char *s1, const char *s2, size_t n) |
| String compare. | |
| char * | ft_strnstr (const char *haystack, const char *needle, size_t len) |
| Search string from string. | |
| char * | ft_strrchr (const char *s, int c) |
| Search a character starting from the end. | |
| char * | ft_strtrim (char const *s1, char const *set) |
| Trim start and end of a string. | |
| char * | ft_substr (char const *s, unsigned int start, size_t len) |
| Gets a piece of string out of a string. | |
| int | ft_tolower (int c) |
| Changes char to lowercase. | |
| int | ft_toupper (int c) |
| Changes char to uppercase. | |
| char * | ft_ulongtohex (unsigned long n) |
| Unsigned long to lowercase hexadesimal string. | |
| int ft_atoi | ( | const char * | str | ) |
| void ft_bzero | ( | void * | s, |
| size_t | n | ||
| ) |
Zero a byte string.
Zeroes n number of bytes in memory starting from location pointed by s.
| s | Pointer to memory |
| n | Number of bytes |
Definition at line 15 of file ft_bzero.c.
| void * ft_calloc | ( | size_t | count, |
| size_t | size | ||
| ) |
Allocate and zero.
Allocates memory and sets every byte to 0.
| count | How many elements |
| size | Size of a element (eg. 4 bytes) |
Definition at line 15 of file ft_calloc.c.
| int ft_isalnum | ( | int | c | ) |
Is an alphabet or a number.
Checks if character is an alphabet or a number.
| c | Character as an ASCII desimal |
Definition at line 15 of file ft_isalnum.c.
| int ft_isalpha | ( | int | c | ) |
| int ft_isascii | ( | int | c | ) |
| int ft_isdigit | ( | int | c | ) |
| int ft_isprint | ( | int | c | ) |
| char * ft_itoa | ( | int | n | ) |
| void ft_lstclear | ( | t_list ** | lst, |
| void(*)(void *) | del | ||
| ) |
| void ft_lstdelone | ( | t_list * | lst, |
| void(*)(void *) | del | ||
| ) |
| void ft_lstiter | ( | t_list * | lst, |
| void(*)(void *) | f | ||
| ) |
| t_list * ft_lstnew | ( | void * | content | ) |
| int ft_lstsize | ( | t_list * | lst | ) |
| char * ft_ltoa | ( | long | n | ) |
| void * ft_memchr | ( | const void * | s, |
| int | c, | ||
| size_t | n | ||
| ) |
Scan memory for a character.
Scans n bytes of memory from address s for a character c.
| s | Starting address |
| c | Character to find |
| n | Till how many bytes from the starting address s |
Definition at line 15 of file ft_memchr.c.
| int ft_memcmp | ( | const void * | s1, |
| const void * | s2, | ||
| size_t | n | ||
| ) |
Memory compare.
Compares n number of bytes from two addresses s1 and s1.
| s1 | First address |
| s2 | Second address |
| n | Number of bytes |
Definition at line 15 of file ft_memcmp.c.
| void * ft_memcpy | ( | void * | dst, |
| const void * | src, | ||
| size_t | n | ||
| ) |
Copies memory to destination.
Copies n bytes of memory from source to destination.
| dst | Address of the destination |
| src | Address of the source |
Definition at line 15 of file ft_memcpy.c.
| void * ft_memmove | ( | void * | dst, |
| const void * | src, | ||
| size_t | len | ||
| ) |
Copy memory area.
Copies len bytes of memory from source to destination.
| dst | Address of the destination |
| src | Address of the source |
| len | Number of bytes |
Definition at line 15 of file ft_memmove.c.
| void * ft_memset | ( | void * | b, |
| int | c, | ||
| int | len | ||
| ) |
Fill memory area with a contant byte.
Fills len number of bytes of memory with c.
| b | Memory address |
| c | Value to set the bytes to |
| len | Number of bytes |
Definition at line 13 of file ft_memset.c.
| void ft_putchar_fd | ( | char | c, |
| int | fd | ||
| ) |
| void ft_putendl_fd | ( | char * | s, |
| int | fd | ||
| ) |
| void ft_putnbr_fd | ( | int | n, |
| int | fd | ||
| ) |
| void ft_putstr_fd | ( | char * | s, |
| int | fd | ||
| ) |
| char ** ft_split | ( | char const * | s, |
| char | c | ||
| ) |
Splits string to substrings.
Splits string s by character c to substrings.
| s | String |
| c | Character |
Definition at line 71 of file ft_split.c.
| char * ft_strchr | ( | const char * | s, |
| int | c | ||
| ) |
Search a character.
Searches a character from a string and returns it's address.
| s | String |
| c | Character |
Definition at line 15 of file ft_strchr.c.
| char * ft_strdup | ( | const char * | s1 | ) |
Duplicates a string.
| s1 | String to make a copy from |
Definition at line 15 of file ft_strdup.c.
| void ft_striteri | ( | char * | s, |
| void(*)(unsigned int, char *) | f | ||
| ) |
Calls a function for each char of a string.
Function f takes the index and address of a character in the string.
| s | String |
| f | Function |
Definition at line 15 of file ft_striteri.c.
| char * ft_strjoin | ( | char const * | s1, |
| char const * | s2 | ||
| ) |
Joins two strings together.
| s1 | String 1 |
| s2 | Strong 2 |
Definition at line 15 of file ft_strjoin.c.
| size_t ft_strlcat | ( | char * | dst, |
| const char * | src, | ||
| size_t | dstsize | ||
| ) |
Adds string to end of a string.
Adds source to end of the destination limited by the destination size.
| dst | String |
| src | String |
| dstsize | Size of the destination |
Definition at line 15 of file ft_strlcat.c.
| size_t ft_strlcpy | ( | char * | dst, |
| const char * | src, | ||
| size_t | dstsize | ||
| ) |
Copies string to destination.
Copies string to destination and makes sure it's null terminated.
| dst | String |
| src | String |
| dstsize | Size of the destination |
Definition at line 15 of file ft_strlcpy.c.
| size_t ft_strlen | ( | const char * | s | ) |
Length of the string.
| s | String |
Definition at line 15 of file ft_strlen.c.
| char * ft_strmapi | ( | char const * | s, |
| char(*)(unsigned int, char) | f | ||
| ) |
Create a copy of a string passing each char through a function.
Creates a new string and assigns the values to that string by taking a character from the string s and passing it trough the function f. Function f takes a character and index of that character as parameters.
| s | String |
| f | Function |
Definition at line 15 of file ft_strmapi.c.
| int ft_strncmp | ( | const char * | s1, |
| const char * | s2, | ||
| size_t | n | ||
| ) |
String compare.
Compares two strings and returns the difference of the first missmatch character or 0 if strings are equal.
| s1 | String |
| s2 | String |
| n | Number of characters to check |
Definition at line 15 of file ft_strncmp.c.
| char * ft_strnstr | ( | const char * | haystack, |
| const char * | needle, | ||
| size_t | len | ||
| ) |
Search string from string.
Searches string from a string and returns the address of the start of the found string.
| haystack | String |
| needle | String |
| len | How many char to check |
Definition at line 18 of file ft_strnstr.c.
| char * ft_strrchr | ( | const char * | s, |
| int | c | ||
| ) |
Search a character starting from the end.
Searches a character from a string and returns it's address.
| s | String |
| c | Character |
Definition at line 15 of file ft_strrchr.c.
| char * ft_strtrim | ( | char const * | s1, |
| char const * | set | ||
| ) |
Trim start and end of a string.
Trims set of characters from start and end of a string.
| s1 | String |
| set | Set of character to trim from the string |
Definition at line 15 of file ft_strtrim.c.
| char * ft_substr | ( | char const * | s, |
| unsigned int | start, | ||
| size_t | len | ||
| ) |
Gets a piece of string out of a string.
Gets len length piece of string from a strung starting at index start.
| s | String |
| start | Starting index |
| len | How many chars |
Definition at line 22 of file ft_substr.c.
| int ft_tolower | ( | int | c | ) |
| int ft_toupper | ( | int | c | ) |
| char * ft_ulongtohex | ( | unsigned long | n | ) |
Unsigned long to lowercase hexadesimal string.
| n | unsigned long |
Definition at line 47 of file ft_ulongtohex.c.