Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clemedon/libft
[documented code / -pedantic -std=c89] - Libft project aims to recode some useful functions from libc as well as new functions of my choice.
https://github.com/clemedon/libft
42 42born2code 42cursus 42libft 42network 42paris 42projects 42school ansi ansic c c89 libft libft42
Last synced: 4 months ago
JSON representation
[documented code / -pedantic -std=c89] - Libft project aims to recode some useful functions from libc as well as new functions of my choice.
- Host: GitHub
- URL: https://github.com/clemedon/libft
- Owner: clemedon
- Created: 2021-12-07T16:48:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T14:32:52.000Z (about 2 years ago)
- Last Synced: 2024-09-24T21:20:15.218Z (4 months ago)
- Topics: 42, 42born2code, 42cursus, 42libft, 42network, 42paris, 42projects, 42school, ansi, ansic, c, c89, libft, libft42
- Language: C
- Homepage:
- Size: 2.14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
LIBFT 42
Summary
·
Usage
·
Tester
·
Tools## Summary
First project of [42Paris](https://42.fr/) aims to create its own standard
library based on `libc` by creating certain existing and non-existing functions
from scratch. This library is also intended to be used and enriched with the
functions of our choice throughout the curriculum.> *"It will contain a lot of general purpose functions your programs will rely
> upon."* - [Subject](https://cdn.intra.42.fr/pdf/pdf/57361/en.subject.pdf)
>
External functions: `malloc`, `free`, `write`Code written in accordance with **42 C** coding style, **ANSI C89** compliant and entirely **documented with docstrings**.
I chose not to protect the functions from NULL pointers passed to them as a
parameter, indeed I prefer to let an explicit `SEGV` happen rather than obscure
the problem behind a `return (NULL);` making it more tedious to debug from a
superior layer of abstraction.This choice is also observable in the `libc`. For example `STRLEN(3)`
implementation from `` will crash a program that tries to pass it a
`NULL` string instead of returning `NULL` as it would if it was protected.## Usage
Compile the library with a simple `make -j` then add `#include "libft.h"` to
your project and compile it with these additional flags:-I
-L
-l ft***Makefile rules***
- `make` -- compiles get_next_line.
- `make clean` -- deletes object files.
- `make fclean` -- deletes object files and get_next_line.
- `make re` -- fclean + make.## Tester
- **[libftTester](https://github.com/Tripouille/libftTester)**
- **[libft-unit-test](https://github.com/alelievr/libft-unit-test)**
## Tools
- **sanitizer**: `-fsanitize=address`
*Add `-g` flag when compiling with `-fsanitize=address` to print errors line numbers instead of addresses in hexadecimal.*