Lukas Jiriste [Fri, 21 Jun 2024 08:57:50 +0000 (10:57 +0200)]
Fix bug, where NULLs appear inside tree
This bug was caused because the tree nodes are filled from the end
when reducing. Instead of just inserting to the start it was inserting
at the final position.
When inserting to vector outside of range all the nonexistent entries
are initialized to 0. If another insertion happes after that, the
0 entries are not filled but moved to make space for the new entry.
Lukas Jiriste [Fri, 21 Jun 2024 07:43:38 +0000 (09:43 +0200)]
Fix the code to actually produce a tree
As the previous commit was only checked to compile there were some
minor defects. Notably the parser stack was not initialized properly.
It has to return state_num 0 when empty, which was solved by inserting
a dummy state 0 wih no node attached.
Lukas Jiriste [Thu, 20 Jun 2024 15:54:43 +0000 (17:54 +0200)]
Implement the ft_parse function
I did not yet try whether it actually functions (it probably does not).
Because managing ft_parse_inner.h was harder than I imagined
and I wanted to focus on the ft_parse function, I returned
almost everything to ft_parse.h.
Lukas Jiriste [Wed, 17 Jan 2024 13:56:09 +0000 (14:56 +0100)]
Improve matrix handling, remove VEC_INIT macro
Improve matrix insertion by patching bugs and adding bounds checking.
Insert VEC_INIT macro as it is forbidden by the Norm.
Add ft_mat_access as matrix analog to ft_vec_access.
Lukas Jiriste [Sun, 14 Jan 2024 16:16:47 +0000 (17:16 +0100)]
Add a macro for t_vec initialization
Add macro for static t_vec initialization, because it needs a
compilation-time constant, which functions cannot (?) achieve.
This macro resolves to compound literal and lacks a check but should
be good enough.
Lukas Jiriste [Sat, 23 Dec 2023 11:47:27 +0000 (12:47 +0100)]
Implement matrix t_mat as a wrapper around t_vec
Implement new struct for matrix and some basic utilities. Everything
passes strict compilation and norminette, but may contain bugs in logic.
Testing recommended (though it will probably happen when this is
needed).
Extract ft_vec_forget from ft_vec_erase which functions as ft_vec_erase
with free_el = NULL.
Lukas Jiriste [Mon, 11 Dec 2023 19:07:39 +0000 (20:07 +0100)]
Remove void* arithmetic, conform to the Norm
Add -Wpedantic option for compilation to Makefile to catch all mistakes.
Cast void* to char* for any arithmetic done.
Split lines that are too long to fit the 80 char limit of the 42 Norm.
Lukas Jiriste [Mon, 11 Dec 2023 09:27:36 +0000 (10:27 +0100)]
Add some t_vec functions and change name
Add functions for inserting and erasing multiple elements.
Rename dir ft_vec to ft_arr and rename ft_vec.h to ft_arr.h for future
implementation of other array structures (matrices).
Lukas Jiriste [Sat, 9 Dec 2023 14:56:42 +0000 (15:56 +0100)]
Enforce header inclusion rules
The following rules are (to be) used:
-Sort header inclusion from local to global
-Always include header which declares the functions in file
-Only include header when it is neccesary for compilation
Lukas Jiriste [Fri, 3 Nov 2023 16:03:35 +0000 (17:03 +0100)]
Change subproject handling, add advanced list funcs
Turn submodules into standard folder.
- Submodules were probably not the correct choice int the first place
- Makefile handling of submodules was bad and hacky
Turn list handling to subproject ft_lst, add advanced list handling.
Change Makefile and header accordingly.
Lukas Jiriste [Tue, 3 Oct 2023 16:46:16 +0000 (18:46 +0200)]
Added ft_printf as a submodule.
Quite some changes where made in Makefile to make it work
and it is not pretty.
Update to libft.h by the ft_printf function prototype.
This branch will contain functions that don't crash in cases in which the std functions probably crash.
This functionality may be useful but is held on separate branch in order to have "pure" std functionality also.
Changed the functions so that they pass the alelievr/libft-unit-test.
ft_strtrim needs to also handle empty strings and strings containing only chars from set.
Lukas Jiriste [Mon, 14 Aug 2023 11:45:12 +0000 (13:45 +0200)]
Added a couple of wanted functions.
Also added 2 additional functions - islower and isupper.
These functions naturaly fit in and are used for more readible implementation of other functions.
Each .c file includes the library header libft.h (libft.h is not added in this commit).