Giter Club home page Giter Club logo

ft_libft's Introduction

42 São Paulo - libft

42 São Paulo License Code size in bytes Lines of code Top language Last commit

Build Norminette v3

A reasonably-complete implementation of stdlib.h, and much much more.


📜 Table of Contents

🧐 About

This was my first project at 42 São Paulo: an implementation of many stdlib.h functions from scratch.

I've used it on most projects so far. I learned about memory manipulations, string utilities and linked lists. As a developer I've been using these functions for years in some form or another, yet I had no idea how they really work. Figuring them out was an initiation of sorts.

It has over 300 functions so far, including a heap-less printf that handles floats and long doubles. All functions have a doxygen-style documentation comment, and most have an example main. I prioritize modularity and readability: small functions with catchy names that do one thing well.

🏁 Getting Started

⚙️ Prerequisites

All you need is a shell and a C compiler like gcc or clang.

🖥️ Installing

To compile the entire thing just clone the repo and run make:

$ git clone https://github.com/librity/ft_libft.git
$ cd ft_libft
$ make

This will generate a libft.a archive, which you can compile with any of the example files:

$ cp examples/ft_itoa.c examples/example.c
$ gcc -g -I ./includes examples/example.c libft.a
$ ./a.out

🎈 Usage

You can call most stdlib.h functions as you normally would but with the prefix ft_:

ft_putstr("Hello, world!\n");

✅ Tests

This project is partly tested with the Unity framework. To run all tests, run make's test rule:

make tests

✅ To Do

  • Implement missing stdlib.h functions
    • atof()
    • atoi()
    • atol()
    • atoll()
    • strtod()
    • strtof()
    • strtol()
    • strtold()
    • strtoll()
    • strtoul()
    • strtoull()
    • rand()
    • srand()
    • calloc()
    • free()
    • malloc()
    • realloc()
    • abort()
    • atexit()
    • at_quick_exit()
    • exit()
    • getenv()
    • quick_exit()
    • system()
    • _Exit()
    • bsearch()
    • qsort()
    • abs()
    • div()
    • labs()
    • ldiv()
    • llabs()
    • lldiv()
    • mblen()
    • mbtowc()
    • wctomb()
    • mbstowcs()
    • wcstombs()

🐙 Github Actions

Norminette Github Action by @AdrianWR

🛸 42 São Paulo

Part of the larger 42 Network, 42 São Paulo is a software engineering school that offers a healthy alternative to traditional education:

  • It doesn't have any teachers and classes.
  • Students learn by cooperating and correcting each other's work (peer-to-peer learning).
  • Its focus is as much on social skills as it is on technical skills.
  • It's completely free to anyone that passes its selection process - The Piscine

It's an amazing school, and I'm grateful for the opportunity.

ft_libft's People

Contributors

librity avatar wagratom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.