Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Open Libft

logo

Build StatusNorminetteStandardLicense

Table of Content

  1. About Open Libft
  2. Norminette
  3. Functions
  4. Setup
  5. Install
    1. local
    2. global
  6. Manual Tests
    1. arrays
    2. printf
    3. errno
  7. License

About Open Libft

An open source library with over 200 functions. This library has been used throughout my academic career in École 42 Silicon Valley. It incorporates very useful functions, including binary trees, linked lists, stacks, arrays, bit manipulation, and more. By developing this library, I gained a thorough understanding of data structures, algorithms, unit testing, continuous integration, troubleshooting, and proper documentation.

Norminette

All of these functions follows the applicable styleguide standard (the norm).

Read the pdf provided to learn more:resources/norminette.pdf.

To install norminette, run the following commands:

  • gem install norminette --pre
  • gem install --user-install json -v 1.8.3

Run it in the following way:

  • norminette <path-to-c-files>

Functions

For the sake of keeping everything neat and in order, I separated the functions' declarations into different header files, corresponding to the behavior of such functions. For instance, ft_strlen can be found in ft_string.h. Also, some of the functions included don't exist in the Standard C Library, but I still kept them defined by there behavior. For example, ft_strnew can also be in ft_string.h.

Header FileList of Functions
btree.hbtree_create_node, btree_level_count, btree_add_node, btree_apply_infix, btree_apply_suffix, btree_apply_prefix, btree_search_item
ft_math.hft_abs, ft_min, ft_min, ft_isprime, ft_sqrt, ft_trunc, ft_ceil, ft_round, ft_floor, ft_pow, ft_hypot, ft_sqrtl, ft_truncl, ft_ceill, ft_roundl, ft_floorl, ft_powl, ft_hypotl, ft_collatz_conjecture, ft_nextprime, ft_nbrlen, ft_factorial, ft_fibonacci, ft_find_next_prime
ft_list.hft_lstfree, ft_lstadd, ft_lstaddback, ft_lstappend, ft_lstiter, ft_lstdel, ft_lstdelone, ft_lstreverse, ft_lstnew, ft_lstmap
ft_wchar.hft_wclen, ft_putwchar, ft_putwchar_fd, ft_putwstr, ft_putwstr_fd, ft_wcslen, ft_wcsdup, ft_wcscpy, ft_wcsnew, ft_wcsncpy
ft_array.hft_array_max_value, ft_array_new, ft_array_copy, ft_array_rotate_left, ft_array_rotate_right, ft_array_pop, ft_array_do_op, ft_array_delete, ft_array_print, ft_array_bubble_sort, ft_array_insertion_sort, ft_array_repeated_count
ft_stack.hft_stck_show, ft_stck_push, ft_stck_pop
ft_errno.hft_errno, ft_strerror
ft_ctype.hft_isascii, ft_isalnum, ft_isalpha, ft_isblank, ft_iscntrl, ft_isdigit, ft_isgraph, ft_islower, ft_isspace, ft_tolower, ft_toupper, ft_isprint, ft_ispunct, ft_isupper, ft_islower, ft_isxdigit, ft_iswspace, ft_ismathop
ft_stdio.hft_putchar, ft_putchar_fd, ft_putnchar, ft_putnchar_fd, t_putstr, t_putstr_fd, ft_putendl, ft_putendl_fd, ft_putnbr, ft_putnbr_fd, ft_putnbr_base, ft_putnbr_base_fd, ft_putunbr, ft_putnstr, ft_putnstr_fd
ft_matrix.hft_matrix_new, ft_matrix_delete
ft_printf.hft_printf, parse_specifier, print_spaces, get_attributes, get_nbr_zeroes, get_nbr_spaces, get_nbr_unsigned, format_signed, format_unsigned, print_string, print_wide_string, print_hexadecimal, print_decimal, print_octal, print_character, print_wide_character, print_binary
ft_stdlib.hft_atoi, ft_atoi_base, ft_itoa, ft_itoa_base, ft_realloc, ft_calloc
ft_string.hft_strequ, ft_strnequ, ft_memcmp, ft_strcmp, ft_strncmp, ft_strcat, t_strncat, ft_strchr, ft_strrchr, ft_strnchr, ft_strcpy, ft_strncpy, ft_strstr, ft_strnstr, ft_strdup, ft_strndup, ft_strnew, ft_strjoin, ft_strmap, ft_strmapi, ft_strrev, ft_strsub, ft_strtrim, ft_strtok, ft_strsplit, ft_strclr, ft_strdel, ft_striter, ft_striteri, ft_memdel, ft_memcpy, ft_memccpy, ft_memchr, ft_memmove, ft_memset, ft_memalloc, ft_strlen, ft_strnlen, ft_strlcat, ft_strlcpy
ft_strings.hft_bzero
ft_classics.hft_active_bits, ft_angle_to_degrees, ft_compact, ft_is_big_endian, ft_is_little_endian, ft_str_is_lowercase, ft_str_is_numeric, ft_str_is_printable, ft_str_is_uppercase, ft_str_is_palindrome, ft_str_starts_with, ft_str_ends_with, ft_do_op, ft_file_extension, ft_str_capitalize, ft_str_to_upcase, ft_str_to_lowcase, ft_program_name, ft_remove_extension, ft_str_remove_whitespace, ft_separated_values, ft_swap, ft_textstyle, ft_textstyle_reset, ft_puterror, ft_puterror_fd, ft_nbrcount, ft_wordcount, ft_wordlen, ft_char_count, ft_values_count
get_next_line.hget_next_line

Setup

Download the repository, and compile the library using the Makefile. You can use the following commands:

CommandDescription
makeCompile the library.
make cleanRemove objects files.
make fcleanRemove objects files and the library.
make reRe-compile the library.
make testCompile the library, runs a series of tests.
make installInstall the library.

The binary libft.a will be created at the root of the project's directory.

Install

Local

Copy the includes/ directory into the root of your project, and make sure to compile your source code with the following flags:

gcc libft.a -I./includes <your_file.c> -o <output_name>

Global

Run the following command :

make install

Now you can add the <libft.h> header in your .c files!

Manual Tests

You can also run some manual tests, like the following way:

Arrays

Run it with assets/array_test.c, a test file used for my array type functions.

  1. make
  2. gcc libft.a -I./includes ./assets/array_test.c -o array_test.o
  3. ./array_test.o

Printf

Run it with assets/printf_test.c, a test file used to test ft_printf.

  1. make
  2. gcc libft.a -I./includes ./assets/printf_test.c -o printf_test.o
  3. ./printf_test.o

Errno

Run it with assets/errno_test.c, a test file used for to test ft_errno.h.

  1. make
  2. gcc libft.a -I./includes ./assets/errno_test.c -o errno_test.o
  3. ./errno_test.o

TODO

Support

All my projects are free to read/clone on GitHub. I don't expect anyone to support me, but if you want, I really appreciate it from the bottom of my heart. ❤️

donate-button

⌄ You can also scan the code below if you would like to support me with a small amount.

qr-code

I thank you in advance. 🐢 🐢 🐢

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source C library that incorporates useful functions, such as binary trees, linked lists, stacks, arrays, bit manipulation.

Topics

Resources

Stars

64 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages