Libft is an project that requieres us to re-create some standard C library functions for future projects, and have a deeper understanding of data structures and basic algorithms. We are not allowed to use some standard libraries on our projects, so we have to keep growing this libary with our own functions as we go farther in the program.
- Part1: Some of the standard C functions.
- Part1: Functions that will be useful for later projects.
- Bonus Part: Functions that will be useful for linked list manipulation.
- Other and Personal: Functions I believe will be useful later.
- ft_isalpha - checks for an alphabetic character
- ft_isdigit - checks for a digit (0 through 9).
- ft_isalnum - checks for an alphanumeric character
- ft_isascii - checks whether c fits into the ASCII character set
- ft_isprint - checks for any printable character
- ft_strlen - calculate the length of a string
- ft_memset - fill memory with a constant byte
- ft_bzero - zero a byte string
- ft_memcpy - copy memory area
- ft_memmove - copy memory area
- ft_strlcpy - copy string to an specific size
- ft_strlcat - concatenate string to an specific size
- ft_toupper - convert char to uppercase
- ft_tolower - convert char to lowercase
- ft_strchr - locate character in string
- ft_strrchr - locate character in string
- ft_strncmp - compare two strings
- ft_memchr - scan memory for a character
- ft_memcmp - compare memory areas
- ft_strnstr - locate a substring in a string
- ft_atoi - convert a string to an integer
- ft_calloc - allocates memory and sets its bytes' values to 0
- ft_strdup - creates a dupplicate for the string passed as parameter
- ft_substr - returns a substring from a string
- ft_strjoin - concatenates two strings
- ft_strtrim - trims the beginning and end of string with specific set of chars
- ft_split - splits a string using a char as parameter
- ft_itoa - converts a number into a string
- ft_strmapi - applies a function to each character of a string
- ft_striteri - applies a function to each character of a string
- ft_putchar_fd - output a char to a file descriptor
- ft_putstr_fd - output a string to a file descriptor
- ft_putendl_fd - output a string to a file descriptor, followed by a new line
- ft_putnbr_fd - output a number to a file descriptor
- ft_lstnew - creates a new list element
- ft_lstadd_front - adds an element at the beginning of a list
- ft_lstsize - counts the number of elements in a list
- ft_lstlast - returns the last element of the list
- ft_lstadd_back - adds an element at the end of a list
- ft_lstclear - deletes and free list
- ft_lstiter - applies a function to each element of a list
- ft_lstmap - applies a function to each element of a list
- ft_freelst - frees the memory space pointed to by list
- ft_getword_mod - the ft_getword() function takes a string and a delimiter and returns a string with the letters between the start point of the string and the next delimiter
- ft_isspace - checks if a given character is a space character
- ft_strcat - the strcat() function adds the string str to the string dest, overwriting the
\0' character at the end of dest and adding the
\0' ending character to the string. The strings cannot overlap, and the dest string must have enough free space to accommodate the concatenated strings - ft_strcdup - allocates a specific amount of memory to copy a string until the occurence of c
- ft_strstr - locate substring. Finds the first occurrence of the substring 'needle' in the string 'haystack'. The terminating null bytes ('\0') are not compared
- get_next_line - Function that returns a line, read from a file descriptor
Clone this repository in your local computer:
git clone https://github.com/scainet7/libft.git
cd libft
make
Libft — это проект, который требует от нас воссоздания некоторых стандартных функций библиотеки C для будущих проектов и более глубокого понимания структур данных и основных алгоритмов. Нам не разрешено использовать некоторые стандартные библиотеки в наших проектах, поэтому мы должны продолжать расширять эту библиотеку своими собственными функциями по мере продвижения в программе.
- Часть1: стандартные функции C.
- Часть2: функции, которые будут полезны для последующих проектов.
- Бонусная часть: функции, которые будут полезны для работы со связанными списками.
- Остальные и индивидуальные функции: Функции, которые, как мне кажется, пригодятся позже.
- ft_isalpha - проверяет буквенный символ
- ft_isdigit — проверяет наличие цифры (от 0 до 9).
- ft_isalnum — проверяет буквенно-цифровой символ
- ft_isascii — проверяет, соответствует ли c набору символов ASCII
- ft_isprint — проверяет любой печатный символ
- ft_strlen - вычислить длину строки
- ft_memset - заполнить память постоянным байтом
- ft_bzero - обнулить байтовую строку
- ft_memcpy - копировать область памяти
- ft_memmove - копировать область памяти
- ft_strlcpy - скопировать строку определенного размера
- ft_strlcat — объединение строк определенного размера
- ft_toupper - преобразовать char в верхний регистр
- ft_tolower - преобразовать char в нижний регистр
- ft_strchr - найти символ в строке
- ft_strrchr - найти символ в строке
- ft_strncmp - сравнить две строки
- ft_memchr - сканирование памяти на наличие персонажа
- ft_memcmp - сравнение областей памяти
- ft_strnstr — найти подстроку в строке
- ft_atoi - преобразовать строку в целое число
- ft_calloc - выделяет память и устанавливает значения ее байтов в 0
- ft_strdup — создает дубликат для строки, переданной в качестве параметра
- ft_substr - возвращает подстроку из строки
- ft_strjoin — объединяет две строки
- ft_strtrim - обрезает начало и конец строки определенным набором символов
- ft_split - разбивает строку, используя char в качестве параметра
- ft_itoa - преобразует число в строку
- ft_strmapi - применяет функцию к каждому символу строки
- ft_striteri — применяет функцию к каждому символу строки
- ft_putchar_fd - вывести char в файловый дескриптор
- ft_putstr_fd - вывести строку в дескриптор файла
- ft_putendl_fd - вывести строку в дескриптор файла, за которой следует новая строка
- ft_putnbr_fd - вывод числа в дескриптор файла
- ft_lstnew - создает новый элемент списка
- ft_lstadd_front — добавляет элемент в начало списка
- ft_lstsize - подсчитывает количество элементов в списке
- ft_lstlast - возвращает последний элемент списка
- ft_lstadd_back — добавляет элемент в конец списка
- ft_lstclear - удаляет и освобождает список
- ft_lstiter — применяет функцию к каждому элементу списка
- ft_lstmap — применяет функцию к каждому элементу списка
- ft_freelst — освобождает место в памяти, на которое указывает список
- ft_getword_mod — функция ft_getword() принимает строку и разделитель и возвращает строку с буквами между начальной точкой строки и следующим разделителем
- ft_isspace — проверяет, является ли данный символ пробелом
- ft_strcat - функция strcat() добавляет строку str к строке dest, перезаписывая символ
\0' в конце dest и добавляя завершающий символ
\0' к строке. Строки не могут перекрываться, а в строке назначения должно быть достаточно свободного места для размещения объединенных строк - ft_strcdup — выделяет определенный объем памяти для копирования строки до появления c
- ft_strstr - найти подстроку. Находит первое вхождение подстроки "игла" в строку "стог сена". Завершающие нулевые байты ('\0') не сравниваются
- get_next_line — функция, возвращающая строку, прочитанную из дескриптора файла
Клонируйте этот репозиторий на свой локальный компьютер:
git clone https://github.com/scainet7/libft.git
cd libft
make