Commit graph

81 commits

Author SHA1 Message Date
Raphael
d8ac7d2b88
feat(math/ft_min): adding ft_min
- Using the bitwise for fun 👀
2025-09-17 16:42:24 +02:00
Raphael
82c445502b
feat(math/ft_max): adding ft_max
- Using the bitwise for fun 👀
2025-09-17 16:42:17 +02:00
Raphael
6879b46aee
feat(math/abs): adding ft_abs function
- Return the absolute value
2025-09-17 16:41:56 +02:00
Raphaël
2be64a8f1b
🛠️ Update to ft_atou
## 🛠️ Update to `ft_atou`
- 🌀 Added a loop in `convert/ft_atou.c` to **skip leading whitespace** characters before parsing, ensuring correct conversion of inputs with spaces at the start.  

## 🗂️ Metadata
- 📅 Updated the file header timestamp for consistency.  

##  Impact
- More accurate and standard-compliant behavior for `ft_atou`.  
- Cleaner handling of edge cases with whitespace.
2025-09-12 15:52:17 +02:00
Raphael
94d1de557f
feat(convert/atou): adding the skip of the whitespace at the start
- Wasn't using the function isspace :).
2025-09-12 15:25:20 +02:00
Raphaël
1a09167546
🔢 Conversion Utilities Expansion
##  New Functionality
-  Added the `ft_atou` function in `ft_atou.c` to convert a string to `size_t` (unsigned integer), with built-in whitespace handling and null pointer safety.  
- 📝 Declared `ft_atou` in `convert.h` with a detailed Doxygen-style comment explaining usage, return value, and parameters.  

## 🧪 Test Coverage Improvements
- 🆕 Introduced `test_atou.c` to verify `ft_atou` against `strtoull`, covering edge cases such as empty strings, whitespace, and invalid input.  
- 🔍 Expanded tests in `test_atoi.c`, `test_atoll.c`, and `test_itoa.c` to include more diverse scenarios (extra whitespace, varied integer ranges) to improve robustness and reliability.  

## 🛠️ Codebase Maintenance
- 📦 Included `<stddef.h>` in `convert.h` to ensure `size_t` is available in function declarations.  

##  Impact
- New unsigned integer conversion capability.  
- Stronger and more comprehensive test suite for all conversion functions.  
- Cleaner and safer header definitions.
2025-09-08 10:26:12 +02:00
Raphael
1266f5d7e8
feat(convert/atou): adding the atou function
- without management of simbole (because useless)
2025-09-08 10:23:59 +02:00
Raphael
198f56177b
test(convert): adding test for itoa
- adding test with 13 7 for the captain of the 7th divison of the gotei
13 (it's me btw)
2025-09-08 10:23:24 +02:00
Raphael
904fafc3f4
test(convert): adding test for atoll
- adding test with whitespace before
2025-09-08 10:22:49 +02:00
Raphael
74188a547f
test(convert): adding test for atoi
- adding test with whitespace before
2025-09-08 10:22:41 +02:00
Raphael
28be9d6b91
feat(convert/atou): adding the atou function
- Can be usefull when the parsing of some project (like philosophers)
2025-09-08 10:21:48 +02:00
Raphael
4e15449d12
build(nix): c_formatter_42 with the correction given
- The flake wasn't made for macos (arm), so I made a pull requests to
patch that and was merged thanks to @maix0 for it's reactivity
2025-09-05 17:35:51 +02:00
Raphael
a3accb9d0a
style(str): normed the header 2025-09-05 17:34:30 +02:00
Raphael
e1625857f2
build(nix): adding nix flake
- Allow to all people on nix package manager to have the same env
2025-09-05 16:51:28 +02:00
Raphaël
63a1b2abdf
📚 Documentation & Build Update
📝 Documentation Overhaul:
- 	🚚 Function docs have been migrated from implementation files (.c) to their header files (.h) across the following modules:
- 	char
- 	convert
- 	list
- 	memory
- 	All documentation is now in Doxygen-style comments, making headers self-documented and turning the API into an easier-to-navigate codex.

##

🛠️ Build System Tweaks:
- 🔗 Added str/ft_strncpy.c to the SRC list in the Makefile, ensuring it’s properly compiled and linked into the arsenal.


##

 Impact

- Clearer and more maintainable API documentation.
- Stronger build consistency with all sources included.
- A polished codebase with up-to-date metadata.
2025-09-05 16:35:41 +02:00
Raphael
0bb6d77dbb
style(test/convert): normed the itoa tabs 2025-09-05 16:31:19 +02:00
Raphael
7e80beedb8
build(str/strncpy): adding strncpy to the makefile
- The file was here but not on the makefile so now it's patched
2025-09-05 16:30:55 +02:00
Raphael
2cf0714dc7
docs(str): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:30:00 +02:00
Raphael
701ce57f84
docs(print): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:29:51 +02:00
Raphael
ed64bd73d6
docs(memory): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:29:40 +02:00
Raphael
3cadabea0a
docs(list): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:29:29 +02:00
Raphael
52b85d2dc6
docs(convert): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:29:16 +02:00
Raphael
63c1dea7a2
docs(char): moving the actual documentation on the header
- The documentation on the header allow u to see on the files where the
header is inclued
2025-09-05 16:28:33 +02:00
Raphaël
78c37163f2
⚙️ Conversion & Character Utilities Update #3
🛡️ Robustness Buffs (Conversion Functions)
• 🧩 ft_atoi and ft_atoll gained a safety shield: they now return 0 when passed a null pointer, preventing accidental crashes.
• This change improves stability across the board, ensuring safer handling of unexpected input.

🧪 Test Suite Expansions

New & Expanded Conversion Trials
• 📝 Added extensive test coverage for ft_atoi, ft_atoll, and ft_itoa, including edge cases and null pointer handling.
• These tests live in test/convert/ and ensure your conversion toolkit is battle-ready for any scenario.

Character Function Test Output Polish
•  Updated all character test files (test_isalnum.c, test_isalpha.c, test_isascii.c, test_isprint.c, test_tolower.c, test_toupper.c) with better output formatting.
• Each result now ends with a newline → improved readability during long test runs.

🔨 Build & Test Process
• 🧹 The Makefile has been optimized:
• test target now depends on fclean + $(NAME) → always runs on a clean build.
• The test runner loop has been reformatted for cleaner output.

📦 Minor Updates
• 📅 File headers refreshed to reflect the latest modification dates, keeping the codebase neat and consistent.

 Impact
• Stronger crash resistance for conversion functions.
• More comprehensive and reliable test suite.
• Cleaner, more professional build & test pipeline.
• Better dev experience thanks to polished test outputs.
2025-09-05 15:17:06 +02:00
Raphael
18f174b2a2
test(convert): adding test to convert
- adding test for atoi / atoll / itoa
- Maybe a futur update to test atost (array to size_t)
2025-09-05 15:12:40 +02:00
Raphael
aa8544ba02
build(test): now test is building the libft before test 2025-09-05 15:10:54 +02:00
Raphael
f4cb339be7
fix(convert/atoll): atoll was now working with NULL parameters
- Now fixed by the verification before
2025-09-05 15:09:52 +02:00
Raphael
0988a2c8ab
fix(convert/atoi): atoi was now working with NULL parameters
- Now fixed by the verification before
2025-09-05 15:09:35 +02:00
Raphael
6255f5e0a3
style(test/char): adding the last '\n'
- For the last return line
2025-09-05 11:36:07 +02:00
Raphaël
94cdf7a155
Merge pull request #2 from EniumRaphael/test/char
fix(test/char): fixing typo on the error message
2025-09-05 10:57:32 +02:00
Raphael
1e717b0743
fix(test/char): fixing typo on the error message 2025-09-05 10:56:53 +02:00
Raphaël
3aa050dff6
🧪 Unit Test Update – Character Functions
🎯 Gameplay Fixes (a.k.a. Function Corrections)
	•	🔧 ft_isascii has been rebalanced: now consistently returns 1 for values within the ASCII range (0–127), instead of leaking the raw character value.
	•	🔧 ft_isprint has been patched: returns 1 only for printable characters (32–126), aligning with the standard library.

➡️ These fixes bring our character classification system fully in line with the C standard behavior. No more unfair RNG in return values!

⸻

🆕 New Content (a.k.a. Fresh Test Files)
	•	📜 test_isascii.c – Exhaustively tests ft_isascii vs isascii across values 0–128.
	•	📜 test_isprint.c – Pits ft_isprint against isprint across the same range.
	•	📜 test_tolower.c – Validates ft_tolower against tolower.
	•	📜 test_toupper.c – Validates ft_toupper against toupper.

⸻

 Impact
	•	Consistent, predictable behavior for all classification and transformation functions.
	•	A stronger, more reliable unit test suite to guard against future regressions.
	•	Confidence boost for upcoming boss fights (👀 the rest of libft).
2025-09-05 10:54:21 +02:00
Raphael
453b4d3b92
feat(test/char): adding the unitary test for ft_tolower
- toupper now have the test
2025-09-05 10:49:19 +02:00
Raphael
a7b156aaa6
feat(test/char): adding the unitary test for ft_tolower
- tolower now have the test
2025-09-05 10:49:07 +02:00
Raphael
764097af73
feat(test/char): adding the unitary test for ft_isprint
- isprint have now the unitary test
2025-09-05 10:48:48 +02:00
Raphael
0282b52326
feat(test/char): adding the test for ft_isascii
- isascii now is checked by the unitary test
2025-09-05 10:47:44 +02:00
Raphael
7051eaf1bf
fix(char): fixing the isascii / isprint
- Correcting the behavour of is ascii to the original given by the
original function
2025-09-05 10:47:02 +02:00
Raphael
4c6a17811f
fix(char/ischar): fix the work of the function
- Didn't now why the moulinette was working
2025-09-04 18:54:19 +02:00
Raphael
ad0f9d001e
feat(test/char): adding the first char tests 2025-09-04 18:53:33 +02:00
Raphael
75ac0ede8a
build(make): adding unitary test to the lib
- The files in test/ directory will be compiled and executed
2025-09-04 18:52:59 +02:00
Raphael
60e9279f3a
fix(make): correcting english error on my makefile 2025-09-04 18:52:16 +02:00
Raphael
49b0975c34
chore(ignore): adding test binary to ignore 2025-09-04 18:51:03 +02:00
Raphael
c4a1ccfeaa
style(action): renaming the main.yml to norminette.yml 2025-09-04 15:18:50 +02:00
Raphaël
ea7d73e5e6
Set terminal type for make command 2025-09-04 15:10:54 +02:00
Raphaël
ea37ab40b1
Remove unnecessary build steps from workflow 2025-09-04 15:09:40 +02:00
Raphaël
17a71d7178
chore(actions): workflow for norminette checks 2025-09-04 15:04:53 +02:00
Raphael
42a2efb059
refactor: make ft_checks function static
BREAKING CHANGE: function my_function is no longer exported
2025-09-04 12:01:38 +02:00
Raphael
df67357056
refactor: make check_args function static
BREAKING CHANGE: function my_function is no longer exported
2025-09-04 12:01:21 +02:00
Raphael
57a5156fcd
feat(include/color): init the color header for print propose
- all color was added in the libft for more pratical case
2025-09-04 11:54:38 +02:00
Raphael
e30fb6742a
refactor(includes): header now normed
- The library stddef was now normed
2025-09-04 11:54:05 +02:00