Skip to content

dop42/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as partof the 42 curriculum by lmouta-g (dop42).

Description

This project is a reusable C utility library based on the 42 library exercise, with explicit function and file names.

It contains helpers for:

  • character checks and conversions;
  • memory and string handling;
  • linked lists, output helpers, formatted printing, and line reading.
  • fixed-size arena allocation.

The goal is to keep the library readable when reused in later projects.

Moulinette

This refactor is no longer designed to pass the 42 moulinette. As I move forward in the curriculum, this library changes with my needs: I optimize parts of it, change internal structures, and add new helpers when they become useful for later projects.

Instructions

Compilation

make

Useful rules:

make clean
make fclean
make re

The build creates:

utility_library.a

Usage

Include the header:

#include "utility_library.h"

Compile with the static library:

cc main.c utility_library.a -I includes

Structure

includes/utility_library.h
src/ctype
src/stdlib
src/string
src/memory
src/io
src/list
src/printf
src/arena
src/extra

Naming

The public API uses descriptive names.

Examples:

string_length
duplicate_string
string_to_int
print_formatted
create_node
copy_memory
get_next_line
create_arena
arena_alloc
arena_zalloc
destroy_arena

Credits

The arena allocator was inspired by Axel Margo's arena-lib: https://github.com/Axel-Margo/arena-lib.

About

Personal C library built during 42 curriculum. Extended version for future projects.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors