Skip to content

Hataxen/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libft

This project is a custom implementation of various standard C library functions, created as part of the 42 school curriculum. The library serves as a foundation for future C programming projects at 42.

Contents

The library includes:

  • Reimplementations of standard libc functions
  • Additional utility functions
  • Linked list manipulation functions (Bonus part)

Libc Functions

Function Description
ft_isalpha Check if character is alphabetic
ft_isdigit Check if character is a digit
ft_isalnum Check if character is alphanumeric
ft_isascii Check if character is in ASCII table
ft_isprint Check if character is printable
ft_strlen Calculate string length
ft_memset Fill memory with a constant byte
ft_bzero Zero a byte string
ft_memcpy Copy memory area
ft_memmove Copy memory area with overlap handling
ft_strlcpy Copy string to a specific size
ft_strlcat Concatenate string to a 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 from the end
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 ASCII string to integer

Additional Functions

Function Description
ft_strdup Create a duplicate of a string
ft_calloc Allocate memory and set to zero
ft_substr Extract substring from string
ft_strjoin Concatenate two strings
ft_strtrim Trim characters from string
ft_split Split string using a delimiter
ft_itoa Convert integer to ASCII string
ft_strmapi Apply function to each char of string
ft_striteri Apply function to each char of string with index
ft_putchar_fd Output char to given file descriptor
ft_putstr_fd Output string to given file descriptor
ft_putendl_fd Output string with newline to file descriptor
ft_putnbr_fd Output number to given file descriptor

Bonus Functions

Function Description
ft_lstnew Create new list node
ft_lstadd_front Add node at beginning of list
ft_lstsize Count elements in list
ft_lstlast Get last node of list
ft_lstadd_back Add node at end of list
ft_lstdelone Delete node with given function
ft_lstclear Delete sequence of nodes
ft_lstiter Apply function to content of all nodes
ft_lstmap Apply function and create new list

Getting Started

Prerequisites

  • GCC compiler
  • Make

Installation

  1. Clone the repository:
git clone https://github.com/Hataxen/libft libft
  1. Enter the project directory:
cd libft
  1. Compile the library:
make

This will create libft.a

Usage

  1. Include the header in your C files:
#include "libft.h"
  1. When compiling your programs with the library:
gcc your_program.c -L. -lft

Testing

  • The Makefile includes basic tests
  • Run make test to execute them
  • Additional testing can be done using your own test files

Norms

This project follows the 42 norm rules, including:

  • Functions under 25 lines
  • No more than 5 functions per file
  • Only allowed functions are write, malloc, and free

Author

Mario Arjona

License

This project is part of 42 school curriculum.

About

42 school Libft project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors