{"id":18983195,"url":"https://github.com/marcusvinix/42libft","last_synced_at":"2025-07-06T05:35:01.687Z","repository":{"id":110128370,"uuid":"372838693","full_name":"MarcusVinix/42libft","owner":"MarcusVinix","description":"This is my C functions library, my first project as a cadet at School 42 São Paulo. It has functions to manipulate strings, memory, and linked list, and I will expand this in the future when necessary.","archived":false,"fork":false,"pushed_at":"2022-04-21T14:56:30.000Z","size":93,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T21:14:22.327Z","etag":null,"topics":["42","42school","c","libft42"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcusVinix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-01T13:24:39.000Z","updated_at":"2023-03-19T19:16:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d5ccfdb-ceb5-4717-9a91-cc2ce2fa283c","html_url":"https://github.com/MarcusVinix/42libft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MarcusVinix/42libft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcusVinix%2F42libft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcusVinix%2F42libft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcusVinix%2F42libft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcusVinix%2F42libft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcusVinix","download_url":"https://codeload.github.com/MarcusVinix/42libft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcusVinix%2F42libft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263853920,"owners_count":23520219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42school","c","libft42"],"created_at":"2024-11-08T16:16:15.688Z","updated_at":"2025-07-06T05:35:01.679Z","avatar_url":"https://github.com/MarcusVinix.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42libft\n\n\u003e This is my C functions library, my first project as a cadet at School 42 São Paulo. It has functions to manipulate strings, memory, and linked list, and I will expand this in the future when necessary.\n***\n\n## Makefile\n\n\u003e **[Makefile](/Makefile)**  \n\u003e The Makefile will compile the static library `libft.a`  \n\u003e\n\u003e **Rules**  \n\u003e\n\u003e 1. all - Make the `libft.a` of the mandatory functions\n\u003e 2. bonus - Make the `libft.a` of the bonus functions\n\u003e 3. clean - Delete all the objects(.o) of the folder.\n\u003e 4. fclean - Make clean and delete the `libft.a`\n\u003e 5. re - Remake the `libft.a`\n\n***\n\n## Included Functions\nThe functions is separate in base of they uses or standard library.\nSome of they is like the originals but others is my specific implementation.\n\n### CTYPE\n\n\u003e **[ft_isalpha](ctype/ft_isalpha.c), [ft_isdigit](ctype/ft_isdigit.c), [ft_isalnum](ctype/ft_isalnum.c), [ft_isascii](ctype/ft_isascii.c), [ft_isprint](ctype/ft_isprint.c)**  \n\u003e Check  whether  c,  which  must  have the value of an unsigned char or EOF, falls into a certain character class according to the  specified  locale.\n\u003e\n\u003e **[ft_isallspace](ctype/ft_isallspace.c)**  \n\u003e Check if the char passed is all space.\n\u003e\n\u003e **[ft_toupper](ctype/ft_toupper.c), [ft_tolower](ctype/ft_tolower.c)**  \n\u003e Convert lowercase letters to uppercase, and vice versa.\n\n### FREE\n\n\u003e **[ft_free_ptr](free/ft_free_ptr.c)**  \n\u003e Free a pointer.\n\u003e\n\u003e **[ft_free_split](free/ft_free_split.c)**  \n\u003e Free a double pointer char.\n\u003e\n\u003e **[ft_free_triple](free/ft_free_triple.c)**  \n\u003e Free a triple pointer char.\n\u003e\n\u003e **[ft_set_free_and_null](free/ft_set_free_and_null.c)**  \n\u003e Set free and null in a char pointer.\n\u003e\n\n### LINKED LIST\n\n\u003e **[ft_lstnew](linked_list/ft_lstnew.c)**  \n\u003e Allocates (with malloc) and returns a new element. The variable ’content’ is initialized with the value of the parameter ’content’. The variable ’next’ is initialized to NULL.\n\u003e\n\u003e **[ft_lstadd_front](linked_list/ft_lstadd_front.c)**  \n\u003e Adds the element ’new’ at the beginning of the list.\n\u003e\n\u003e **[ft_lstsize](linked_list/ft_lstsize.c)**  \n\u003e Counts the number of elements in a list.\n\u003e\n\u003e **[ft_lstlast](linked_list/ft_lstlast.c)**  \n\u003e Returns the last element of the list.\n\u003e\n\u003e **[ft_lstadd_back](linked_list/ft_lstadd_back.c)**  \n\u003e Adds the element ’new’ at the end of the list.\n\u003e\n\u003e **[ft_lstdelone](linked_list/ft_lstdelone.c)**  \n\u003e Takes as a parameter an element and frees the memory of the element’s content using the function ’del’ given as a parameter and free the element. The memory of ’next’ must not be freed.\n\u003e\n\u003e **[ft_lstclear](linked_list/ft_lstclear.c)**  \n\u003e Deletes and frees the given element and every successor of that element, using the function ’del’ and free(3). Finally, the pointer to the list must be set to NULL.\n\u003e\n\u003e **[ft_lstiter](linked_list/ft_lstiter.c)**  \n\u003e Iterates the list ’lst’ and applies the function ’f’ to the content of each element.\n\u003e\n\u003e **[ft_lstmap](linked_list/ft_lstmap.c)**  \n\u003e Iterates the list ’lst’ and applies the function ’f’ to the content of each element. Creates a new list resulting of the successive applications of the function ’f’. The ’del’ function is used to delete the content of an element if needed.\n\u003e\n\n### STDIO\n\n\u003e **[ft_putchar_fd](stdio/ft_putchar_fd.c)**  \n\u003e Outputs the character ’c’ to the given file descriptor.\n\u003e\n\u003e **[ft_putstr_fd](stdio/ft_putstr_fd.c)**  \n\u003e Outputs the string ’s’ to the given file descriptor.\n\u003e\n\u003e **[ft_putendl_fd](stdio/ft_putendl_fd.c)**  \n\u003e Outputs the string ’s’ to the given file descriptor, followed by a newline.\n\u003e\n\u003e **[ft_putnbr_fd](stdio/ft_putnbr_fd.c)**  \n\u003e Outputs the integer ’n’ to the given file descriptor.\n\u003e\n\u003e **[ft_putnbr_base_fd](stdio/ft_putnbr_base_fd.c.c)**  \n\u003e Outputs the integer ’n’ converted to the specified base to the given file descriptor.\n\u003e\n\n### STDLIB\n\n\u003e **[ft_atoi](stdlib/ft_atoi.c)**  \n\u003e Converts the initial portion of the string pointed to by nptr to int.\n\u003e\n\u003e **[ft_calloc](stdlib/ft_calloc.c)**  \n\u003e Allocates size bytes and returns a pointer to the allocated memory.\n\u003e\n\u003e **[ft_itoa](stdlib/ft_itoa.c)**  \n\u003e Allocates (with malloc) and returns a string representing the integer received as an argument. Negative numbers must be handled.\n\u003e\n\u003e **[ft_itoa_base](stdlib/ft_itoa_base.c)**  \n\u003e Allocates (with malloc) and returns a string converted for the base received representing the integer received as an argument. Negative numbers must be handled.\n\u003e\n\n### STRINGS\n\n\u003e **[ft_bzero](strings/ft_bzero.c)**  \n\u003e Erases the data in the n bytes of the memory starting at the location pointed to by s, by writing zeroes, (bytes containing '\\0') to that area.\n\u003e\n\u003e **[ft_memset](strings/ft_memset.c)**  \n\u003e Fills the first n bytes of the memory area pointed to by s with the constant byte c.\n\u003e\n\u003e **[ft_memcpy](strings/ft_memcpy.c)**  \n\u003e Copies  n bytes from memory area src to memory area dest.  The memory areas must not overlap.\n\u003e\n\u003e **[ft_memccpy](strings/ft_memccpy.c)**  \n\u003e Copies no more than n bytes from memory area src to memory area dest, stopping when the character c is found.\n\u003e\n\u003e **[ft_memmove](strings/ft_memmove.c)**  \n\u003e Copies n bytes from memory area src to memory area dest.  The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.\n\u003e\n\u003e **[ft_memchr](strings/ft_memchr.c)**  \n\u003e Scans  the  initial n bytes of the memory area pointed to by s for the first instance of c.  Both c and the  bytes  of the memory area pointed to by s are interpreted as unsigned char.\n\u003e\n\u003e **[ft_memcmp](strings/ft_memcmp.c)**  \n\u003e Returns  an  integer  less  than,  equal  to,  or greater than zero if the first n bytes of s1 is found, respectively, to be less than, to match, or be greater than the first n bytes of s2.\n\u003e\n\u003e **[ft_strlen](strings/ft_strlen.c)**  \n\u003e Calculates the length of the string pointed to by s, excluding the terminating null byte ('\\0').\n\u003e\n\u003e **[ft_strlen_split](strings/ft_strlen_split.c)**  \n\u003e Calculates the length of a splitted string pointed to by s, excluding the terminating null byte ('\\0').\n\u003e\n\u003e **[ft_strlcpy](strings/ft_strlcpy.c)**  \n\u003e Copies up to size - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result.\n\u003e\n\u003e **[ft_strlcat](strings/ft_strlcat.c)**  \n\u003e Appends the NULL-terminated string src to the end of dst. It will append at most size - strlen(dst) - 1 bytes, NULL-terminating the result.\n\u003e\n\u003e **[ft_strchr](strings/ft_strchr.c)**  \n\u003e Returns a pointer to the first occurrence of the character c in the string s.\n\u003e\n\u003e **[ft_strrchr](strings/ft_strrchr.c)**  \n\u003e Returns a pointer to the last occurrence of  the character c in the string s.\n\u003e\n\u003e **[ft_strnstr](ft_strnstr.c)**  \n\u003e Locates the first occurrence of the null-terminated string little in the string big, where not more than len characters are searched.\n\u003e\n\u003e **[ft_strncmp](strings/ft_strncmp.c)**  \n\u003e Compares the two strings s1 and s2.  It returns an integer less than, equal to, or greater than zero if  s1  is  found, respectively, to be less than, to match, or be greater than s2.\n\u003e\n\u003e **[ft_strdup](strings/ft_strdup.c)**  \n\u003e Returns a pointer to a new string which is a duplicate of the string s. Return NULL if has some error.\n\u003e\n\u003e **[ft_strdup2](strings/ft_strdup2.c)**  \n\u003e Returns a pointer to a new string which is a duplicate of the string s. Return an empty string if has some error.\n\u003e\n\u003e **[ft_substr](strings/ft_substr.c)**  \n\u003e Allocates (with malloc) and returns a substring from the string ’s’. The substring begins at index ’start’ and is of maximum size ’len’.\n\u003e\n\u003e **[ft_strjoin](strings/ft_strjoin.c)**  \n\u003e Allocates (with malloc) and returns a new string, which is the result of the concatenation of ’s1’ and ’s2’.\n\u003e\n\u003e **[ft_strtrim](strings/ft_strtrim.c)**  \n\u003e Allocates (with malloc) and returns a copy of ’s1’ with the characters specified in ’set’ removed from the beginning and the end of the string.\n\u003e\n\u003e **[ft_split](strings/ft_split.c)**  \n\u003e Allocates (with malloc) and returns an array of strings obtained by splitting ’s’ using the character ’c’ as a delimiter. The array must be ended by a NULL pointer.\n\u003e\n\u003e **[ft_split_rev](strings/ft_split_rev.c)**  \n\u003e Join a splited string.\n\u003e\n\u003e **[ft_concatenate_join](strings/ft_conactenate_join.c)**  \n\u003e Concatenate the first argument with the second using join.\n\u003e\n\n### UTILS\n\n\u003e **[ft_strmapi](utils/ft_strmapi.c)**  \n\u003e Applies the function ’f’ to each character of the string ’s’ to create a new string (with malloc(3)) resulting from successive applications of ’f’.\n\u003e\n\u003e **[ft_find_index](utils/ft_find_index.c)**  \n\u003e Go through the first parameter and find the c passed as second parameter. If the c is find it return the position otherwise returns -1.\n\u003e\n\u003e **[ft_line](utils/ft_line.c)**  \n\u003e Take the s parameter and copy n characters specified in second parameter and put the terminate null '\\0'. \n\u003e\n\u003e **[ft_line](utils/ft_swap.c)**  \n\u003e Swap to int pointers.\n\u003e\n\u003e **[get_next_line](utils/get_next_line.c)**  \n\u003e Return a line of the file descriptor passed. Return 1 if find a line, -1 if has an error, 0 if is the last line.\n\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusvinix%2F42libft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcusvinix%2F42libft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusvinix%2F42libft/lists"}