Libft.git
4 months agoImplement red-black tree
Lukáš Jiřiště [Thu, 31 Jul 2025 13:10:54 +0000 (15:10 +0200)]
Implement red-black tree

This is an untested implementation.

4 months agoRemove the parent member from t_tree
Lukáš Jiřiště [Thu, 31 Jul 2025 13:09:59 +0000 (15:09 +0200)]
Remove the parent member from t_tree

I see little use for this now. It is trivial to add it later.

4 months agoRevert back to using separate tree and node
Lukáš Jiřiště [Thu, 31 Jul 2025 12:12:53 +0000 (14:12 +0200)]
Revert back to using separate tree and node

Because the node uses flexible array member it should not be
instantiated on stack. Hence a separate type for t_tree is needed so
that user may use tree on stack (as it is convenient).

4 months agoAdd the ft_tree_set_data function
Lukáš Jiřiště [Thu, 31 Jul 2025 11:28:51 +0000 (13:28 +0200)]
Add the ft_tree_set_data function

4 months agoRename ft_tree_erase_child to ft_tree_erase_subtree
Lukáš Jiřiště [Thu, 31 Jul 2025 10:21:22 +0000 (12:21 +0200)]
Rename ft_tree_erase_child to ft_tree_erase_subtree

4 months agoHarden ft_tree and change it a little
Lukáš Jiřiště [Thu, 31 Jul 2025 10:11:55 +0000 (12:11 +0200)]
Harden ft_tree and change it a little

The change is to return t_tree from pointer to t_tree_node to just
t_tree_node. I don't yet have much grasp on ergonomics of this but I
think this is the better choice.

4 months agoRemove indirection from t_tree_node to data
Lukáš Jiřiště [Thu, 31 Jul 2025 06:22:39 +0000 (08:22 +0200)]
Remove indirection from t_tree_node to data

This (probably) leads to faster access. I wanted to try to implement it
like this.
This is still not hardened and untested.

4 months agoAdd insertion of "empty" elements to t_vec
Lukáš Jiřiště [Thu, 31 Jul 2025 05:26:05 +0000 (07:26 +0200)]
Add insertion of "empty" elements to t_vec

4 months agoAdd a ft_tree structure
Lukáš Jiřiště [Wed, 30 Jul 2025 19:05:55 +0000 (21:05 +0200)]
Add a ft_tree structure

Add a non-hardened naive untested ft_tree structure.

4 months agoRemove the parsing table generator
Lukáš Jiřiště [Mon, 28 Jul 2025 11:22:09 +0000 (13:22 +0200)]
Remove the parsing table generator

It was moved to a separate project because it feels more like a
standalone tool than as a useful part of a library.
The project can be found at
git://ljiriste.work/parsing_table_generator

8 months agoMake Libft C++ aware and compilable
Lukas Jiriste [Wed, 26 Mar 2025 19:55:47 +0000 (20:55 +0100)]
Make Libft C++ aware and compilable

Though compilation is only possible with the -fpermissive flag.
It is not a great idea to use everything (or even most things) in C++,
but it is better to be consistent and it also makes it easier to migrate
a project using Libft from C to C++.

10 months agoFix Norm formatting problem
Lukas Jiriste [Mon, 13 Jan 2025 18:47:29 +0000 (19:47 +0100)]
Fix Norm formatting problem

11 months agoImprove ft_vec_find and ft_vec_find_index
Lukas Jiriste [Tue, 17 Dec 2024 19:36:22 +0000 (20:36 +0100)]
Improve ft_vec_find and ft_vec_find_index

I have no idea, why I have not allowed the users to provide their own
comparison function for finding an element...

12 months agoMake parse_tree traversal a little bit easier
Lukas Jiriste [Thu, 28 Nov 2024 14:31:39 +0000 (15:31 +0100)]
Make parse_tree traversal a little bit easier

The ft_get_node_child function is very simple but may save a lot of
code, because ft_vec_access returns void* which needs to be cast before
further actions can be done.
(And casting to (t_parse_tree_node *) is a lot of code).

12 months agoBreak line in Makefile to fit in 80 chars
Lukas Jiriste [Thu, 28 Nov 2024 11:11:19 +0000 (12:11 +0100)]
Break line in Makefile to fit in 80 chars

12 months agoMove g_empty_token and g_eof_token definition
Lukas Jiriste [Thu, 28 Nov 2024 11:09:14 +0000 (12:09 +0100)]
Move g_empty_token and g_eof_token definition

This is done so that the actions.c file does not need its own
definition.

12 months agoMerge parsing_table_constructor into no_crash
Lukas Jiriste [Thu, 28 Nov 2024 10:58:17 +0000 (11:58 +0100)]
Merge parsing_table_constructor into no_crash

12 months agoAlign slashes in Makefile parsing_table_constructor
Lukas Jiriste [Thu, 28 Nov 2024 10:32:54 +0000 (11:32 +0100)]
Align slashes in Makefile

I really should use spaces instead of tabs for alignment...

12 months agoMake this branch fully Norm compliant
Lukas Jiriste [Thu, 28 Nov 2024 10:23:25 +0000 (11:23 +0100)]
Make this branch fully Norm compliant

I needed to split the main file a little yet. The grouping may not make
much sense, I did not want to spend any brain power on this anymore.

12 months agoAdd -fPIE flag to Makefile
Lukas Jiriste [Thu, 28 Nov 2024 10:03:09 +0000 (11:03 +0100)]
Add -fPIE flag to Makefile

The -fPIE flag has something to do with position independent code. I
think I've encountered this problem before when using ft_printf, because
its ability to print pointer values (addresses).

12 months agoRefactor ft_parsing_table_generate.c
Lukáš Jiřiště [Wed, 27 Nov 2024 10:33:23 +0000 (11:33 +0100)]
Refactor ft_parsing_table_generate.c

12 months agoSplit functions too large to comply with the Norm
Lukáš Jiřiště [Tue, 26 Nov 2024 14:43:52 +0000 (15:43 +0100)]
Split functions too large to comply with the Norm

12 months agoBreak long lines, fix indentation and g_var naming
Lukáš Jiřiště [Tue, 26 Nov 2024 12:03:43 +0000 (13:03 +0100)]
Break long lines, fix indentation and g_var naming

Bring the code closer to compliance with the Norm.

16 months agoImprove Makefile debug functionality
Lukas Jiriste [Fri, 2 Aug 2024 13:09:59 +0000 (15:09 +0200)]
Improve Makefile debug functionality

Makefile now creates .debug file when "make debug" is executed.
This make Makefile able to remember the debug mode for futher builds
and rebuilds. The debug mode can be disabled by removing the .debug file
or by executing "make nodebug" which will also build the project.

16 months agoExtend the input possibilities for parsing table
Lukas Jiriste [Fri, 2 Aug 2024 12:14:20 +0000 (14:14 +0200)]
Extend the input possibilities for parsing table

This is done so that a parsing table may be included inside a source
file as a string.
Addition new (long) filename to Makefile lead to change of alignment
depth.

16 months agoHarden ft_split, provide ft_free_split
Lukas Jiriste [Fri, 2 Aug 2024 12:04:56 +0000 (14:04 +0200)]
Harden ft_split, provide ft_free_split

16 months agoFix invalid read in ft_split
Lukas Jiriste [Thu, 1 Aug 2024 10:03:40 +0000 (12:03 +0200)]
Fix invalid read in ft_split

This read happens when the last word ends with the terminating '\0'.
After advancing the index to the '\0' it is then increased once more to
regions not accessible. This is fixed by simple skipping the ++i after a
word has been processed.

16 months agoAdd ft_swap_int
Lukas Jiriste [Sun, 21 Jul 2024 19:44:35 +0000 (21:44 +0200)]
Add ft_swap_int

16 months agoMerge some t_vec functions into no_crash
Lukas Jiriste [Sun, 21 Jul 2024 18:26:51 +0000 (20:26 +0200)]
Merge some t_vec functions into no_crash

I dont want to merge parsing generator so that I don't have to make it
comply with the Norm yet.

16 months agoAdd a function to save a table as a file
Lukas Jiriste [Fri, 19 Jul 2024 11:57:12 +0000 (13:57 +0200)]
Add a function to save a table as a file

This file is then readable by ft_parsing_table_load.
Some lazy checks are written to check that something was written to the
file, but if only partial write happens, those will not notice.

16 months agoFix infinite recursion
Lukas Jiriste [Thu, 18 Jul 2024 11:32:26 +0000 (13:32 +0200)]
Fix infinite recursion

The previous commit solved some wierd things around the add_first
function. These were created because of my misunderstanding of the
process but also (almost) prevented infinite recursion.

The infinite recurson is caused when a search for a first (nonterminal)
tokens encounteres the original token, because then it searches for it
again and is able to again find the token along the search.

The solution is to make the algorithm log what nonterminals it already
went through so that it does not try to find their first tokens during
the search for their first tokens.

16 months agoRepair some oddities in finding the first tokens
Lukas Jiriste [Thu, 18 Jul 2024 09:49:55 +0000 (11:49 +0200)]
Repair some oddities in finding the first tokens

16 months agoMake ft_parse ablle to follow rule to empty token
Lukas Jiriste [Thu, 11 Jul 2024 20:44:57 +0000 (22:44 +0200)]
Make ft_parse ablle to follow rule to empty token

16 months agoRemove collapse_closure function and attributes
Lukas Jiriste [Thu, 11 Jul 2024 18:16:11 +0000 (20:16 +0200)]
Remove collapse_closure function and attributes

The collapse_closure is not needed for correct function. It may be added
later on as an memory optimization.

16 months agoFix handling if the zeroth rule
Lukas Jiriste [Thu, 11 Jul 2024 18:08:39 +0000 (20:08 +0200)]
Fix handling if the zeroth rule

Removing the zeroth rule before the translation makes all the items
point one rule ahaed. So instead the rule number is decreased by one
the zeroth rule reduce is converted to accept.

16 months agoAdd empty token recognition in translation to table
Lukas Jiriste [Thu, 11 Jul 2024 17:58:27 +0000 (19:58 +0200)]
Add empty token recognition in translation to table

16 months agoFix initialization of table rows
Lukas Jiriste [Wed, 10 Jul 2024 19:36:35 +0000 (21:36 +0200)]
Fix initialization of table rows

The initialization was caused by an inappropriate use of
ft_vec_insert_range. I was not sure whether it fills the range with the
single element or whether it insert range and I misread the source code

16 months agoFix wrong pointer depth and gotos offset
Lukas Jiriste [Wed, 10 Jul 2024 18:41:35 +0000 (20:41 +0200)]
Fix wrong pointer depth and gotos offset

The translation function accessed t_generator_state * instead of the
correct t_generator_state**.
The gotos vector in the table rows is indexed from 0 but uses the tokens
after the eof_token hence the index needs to be offset.

16 months agoAdd the translation from state graph to table
Lukas Jiriste [Wed, 10 Jul 2024 17:34:30 +0000 (19:34 +0200)]
Add the translation from state graph to table

This compiles but crashes.

16 months agoFree item copy in fill_closure
Lukas Jiriste [Tue, 9 Jul 2024 09:08:27 +0000 (11:08 +0200)]
Free item copy in fill_closure

16 months agoFix segmentation fault in fill_closure
Lukas Jiriste [Mon, 8 Jul 2024 07:21:58 +0000 (09:21 +0200)]
Fix segmentation fault in fill_closure

When the add_predictions inside fill_closure has to enlarge closure to
add a new item, the original item pointer points to freed memory.
This is solved by making a copy.

16 months agoMake the generator count the terminal symbols
Lukas Jiriste [Sun, 7 Jul 2024 07:48:11 +0000 (09:48 +0200)]
Make the generator count the terminal symbols

16 months agoFix double free
Lukas Jiriste [Sun, 7 Jul 2024 07:18:47 +0000 (09:18 +0200)]
Fix double free

Because the goto_tokens used tokens from table instead of their copies
and were freed when generator states were cleared, the table tokens
then contained pointers to freed memory which were to be used.

There are two ways to fix this. Either not free the tokens in
goto_tokens or append copies. I opted for the latter because every part
of the generator code uses copies too. It may be rewritten to use the
table tokens later on to save memory.

16 months agoFix function freeing the parsing generator states
Lukas Jiriste [Fri, 5 Jul 2024 10:23:05 +0000 (12:23 +0200)]
Fix function freeing the parsing generator states

This function was made under wrong assumptions.

16 months agoFix index reset before new loop
Lukas Jiriste [Fri, 5 Jul 2024 10:18:09 +0000 (12:18 +0200)]
Fix index reset before new loop

16 months agoChange the way tokens are compared for zeroth rule
Lukas Jiriste [Fri, 5 Jul 2024 10:16:03 +0000 (12:16 +0200)]
Change the way tokens are compared for zeroth rule

The zeroth rule contains a token which has NULL at type. Because the
function cmp_token_type is used when comparing rules (items) it has to
be able to handle this NULL.

16 months agoFix accessing generator states
Lukas Jiriste [Fri, 5 Jul 2024 10:13:52 +0000 (12:13 +0200)]
Fix accessing generator states

This part was written under the assumption that t_vec states holds
t_generator_state instead of the t_generator_state*

16 months agoFix wrong element insertion
Lukas Jiriste [Fri, 5 Jul 2024 07:41:49 +0000 (09:41 +0200)]
Fix wrong element insertion

Instead of a copy the original token was inserted. This caused the
elements sharing a token to be changed when only one shoud have been
changed.

16 months agoFix infinite loop
Lukas Jiriste [Fri, 5 Jul 2024 08:33:01 +0000 (10:33 +0200)]
Fix infinite loop

16 months agoFix some aspects of fill_closure function
Lukas Jiriste [Thu, 4 Jul 2024 15:03:13 +0000 (17:03 +0200)]
Fix some aspects of fill_closure function

16 months agoFix wrong malloc and infinite loop in ft_vec
Lukas Jiriste [Thu, 4 Jul 2024 14:38:34 +0000 (16:38 +0200)]
Fix wrong malloc and infinite loop in ft_vec

16 months agoChange the code to accommodate the zeroth rule
Lukas Jiriste [Thu, 4 Jul 2024 12:45:37 +0000 (14:45 +0200)]
Change the code to accommodate the zeroth rule

16 months agoImplement is_at_mark
Lukas Jiriste [Thu, 4 Jul 2024 12:25:53 +0000 (14:25 +0200)]
Implement is_at_mark

I've probably just forgotten to implement this function earlier.

16 months agoImplement token_categorize
Lukas Jiriste [Thu, 4 Jul 2024 11:27:40 +0000 (13:27 +0200)]
Implement token_categorize

This function fills the tokens t_vec with the language tokens.
It first lists terminal tokens, then end of file token, then
nonterminal tokens.

16 months agoAdd first kernel construction and its support
Lukas Jiriste [Thu, 4 Jul 2024 10:32:26 +0000 (12:32 +0200)]
Add first kernel construction and its support

The supporting changes consist of changing the ft_token_dup function to
take pointer to token as input. Taking global static token caused some
error but was solved by passing pointer.
Function to free structs now handle NULL gracefully. This was
encountered because not all used structures are initialized yet.

The zeroth rule is added to generate a table, that returns the original
first token as a root of the table. The type of NULL cannot be achieved
any other way inside the table.rules.

16 months agoImplement another part of the generator
Lukas Jiriste [Thu, 4 Jul 2024 08:28:43 +0000 (10:28 +0200)]
Implement another part of the generator

This commit mainly concerns itself with the construction of the closure
table - the closures and the "first" tokens.
The first tokens could be precalculated but I did not want to do that
as that would require to either have a function with some static
variable (which is meh to clean up) or I would have create another
structure and pass it everywhere. It can be added later on.

16 months agoImplement a big part of the parsing table generator
Lukáš Jiřiště [Thu, 27 Jun 2024 18:50:02 +0000 (20:50 +0200)]
Implement a big part of the parsing table generator

16 months agoAdd the ft_vec_setinsert
Lukas Jiriste [Thu, 4 Jul 2024 08:24:45 +0000 (10:24 +0200)]
Add the ft_vec_setinsert

This function could have been named ft_vec_insert_unique,
but that would invoke the need for insertion index which
I wanted to avoid because of the usage a set.

16 months agoHarden the ft_strchr and ft_strrchr functions
Lukas Jiriste [Sun, 21 Jul 2024 16:57:01 +0000 (18:57 +0200)]
Harden the ft_strchr and ft_strrchr functions

This makes them return NULL when the haystack is NULL.

16 months agoAdapt the transplanted ft_split to libft
Lukas Jiriste [Sun, 21 Jul 2024 16:54:44 +0000 (18:54 +0200)]
Adapt the transplanted ft_split to libft

16 months agoTransplant a better split function to Libft
Lukas Jiriste [Sun, 21 Jul 2024 16:50:28 +0000 (18:50 +0200)]
Transplant a better split function to Libft

This function was created during the 42 Piscine.

16 months agoRemove structure comments that offend the Norm
Lukas Jiriste [Sun, 21 Jul 2024 06:42:32 +0000 (08:42 +0200)]
Remove structure comments that offend the Norm

17 months agoAdd function for equating two t_vecs
Lukas Jiriste [Fri, 28 Jun 2024 12:13:22 +0000 (14:13 +0200)]
Add function for equating two t_vecs

17 months agoAdd some set functions defined on t_vec
Lukas Jiriste [Fri, 28 Jun 2024 11:51:06 +0000 (13:51 +0200)]
Add some set functions defined on t_vec

The functions are defined on t_vec instead of implementing t_set
because the t_set struct would not be very useful. The lack of
structure is easy to emulate wth t_vec. The only advantage would be
uniqueness of elements.

17 months agoAdd a function to deep copy a t_vec
Lukas Jiriste [Fri, 28 Jun 2024 10:35:06 +0000 (12:35 +0200)]
Add a function to deep copy a t_vec

17 months agoPrint also the contents of tokens
Lukas Jiriste [Thu, 27 Jun 2024 07:13:43 +0000 (09:13 +0200)]
Print also the contents of tokens

This makes debugging easier, though the output is harder to read

17 months agoChange function names to prevent naming colision
Lukas Jiriste [Fri, 21 Jun 2024 14:47:58 +0000 (16:47 +0200)]
Change function names to prevent naming colision

17 months agoAdd tags to .gitignore
Lukas Jiriste [Fri, 21 Jun 2024 13:51:15 +0000 (15:51 +0200)]
Add tags to .gitignore

17 months agoImprove the documentation of limitations
Lukas Jiriste [Fri, 21 Jun 2024 13:49:15 +0000 (15:49 +0200)]
Improve the documentation of limitations

17 months agoRefactor ft_parse.c to comply with the Norm
Lukas Jiriste [Fri, 21 Jun 2024 13:44:09 +0000 (15:44 +0200)]
Refactor ft_parse.c to comply with the Norm

17 months agoFix indentation
Lukas Jiriste [Fri, 21 Jun 2024 13:24:52 +0000 (15:24 +0200)]
Fix indentation

17 months agoRefactor functions to comply with the Norm
Lukas Jiriste [Fri, 21 Jun 2024 13:23:51 +0000 (15:23 +0200)]
Refactor functions to comply with the Norm

17 months agoRefactor to better comply with the Norm
Lukas Jiriste [Fri, 21 Jun 2024 12:08:22 +0000 (14:08 +0200)]
Refactor to better comply with the Norm

17 months agoMake ft_parse_tree_print comply with the Norm
Lukas Jiriste [Fri, 21 Jun 2024 11:09:19 +0000 (13:09 +0200)]
Make ft_parse_tree_print comply with the Norm

17 months agoImprove formatting of ft_parsing_table_printf
Lukas Jiriste [Fri, 21 Jun 2024 11:03:35 +0000 (13:03 +0200)]
Improve formatting of ft_parsing_table_printf

The token names in the output header are now limitedr
to the column width.

17 months agoMake ft_parse inputs const, move token_free
Lukas Jiriste [Fri, 21 Jun 2024 09:49:45 +0000 (11:49 +0200)]
Make ft_parse inputs const, move token_free

After playing a little with the functions I thought it stupid to have
all tokens have their own memory for types that repeat so much.
The token_free function I implemented frees both members of token
which leads to multi-frees when reusing a string for type.

This is why I think it will be better to hide token_free again
and the user can decide what to allocate and what to free.

For this to be possible I have guarantee the tokens vector is not
changed inside the ft_parse function, so I've rewriten it a little
to use const.

17 months agoAdd const version of ft_vec_access
Lukas Jiriste [Fri, 21 Jun 2024 09:48:16 +0000 (11:48 +0200)]
Add const version of ft_vec_access

17 months agoFix memory leak
Lukas Jiriste [Fri, 21 Jun 2024 09:22:40 +0000 (11:22 +0200)]
Fix memory leak

This leak was caused by carelessness when working with malloc and t_vec
at the same time.

17 months agoMake ft_parse_tree_print handle NULLs gracefully
Lukas Jiriste [Fri, 21 Jun 2024 09:09:49 +0000 (11:09 +0200)]
Make ft_parse_tree_print handle NULLs gracefully

17 months agoFix bug, where NULLs appear inside tree
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.

17 months agoImplement printing function for parsing tree
Lukas Jiriste [Fri, 21 Jun 2024 08:34:09 +0000 (10:34 +0200)]
Implement printing function for parsing tree

This is mainly done for debugging. This does not scale to arbitrary
large trees automatically - the output will be garbled.

17 months agoFix forward declaration to be usable by user
Lukas Jiriste [Fri, 21 Jun 2024 07:48:48 +0000 (09:48 +0200)]
Fix forward declaration to be usable by user

17 months agoFix the code to actually produce a tree
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.

17 months agoImplement the ft_parse function
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.

17 months agoAdd a stack structure
Lukas Jiriste [Thu, 20 Jun 2024 15:50:54 +0000 (17:50 +0200)]
Add a stack structure

Add a classic FILO stack with push, top, pop and some other functions.
It is basically just a wrapper for t_vec.

It is added into a new directory ft_struct. I should have made it
instead of the ft_arr dir. I may later move t_vec and t_mat to
ft_struct.

17 months agoFix indentation
Lukas Jiriste [Thu, 20 Jun 2024 11:58:48 +0000 (13:58 +0200)]
Fix indentation

17 months agoRefactor parsing table loading
Lukas Jiriste [Thu, 20 Jun 2024 11:57:51 +0000 (13:57 +0200)]
Refactor parsing table loading

17 months agoAlign the ft_parse style with that of f_arr
Lukas Jiriste [Thu, 20 Jun 2024 11:19:52 +0000 (13:19 +0200)]
Align the ft_parse style with that of f_arr

17 months agoAdd comment about the parsing table structure
Lukas Jiriste [Thu, 20 Jun 2024 08:48:40 +0000 (10:48 +0200)]
Add comment about the parsing table structure

Parsing table shoud not contain any non-ASCII whitespace as
getting rid of multi-character whitespace is more challeging.

I mention it as I have encountered this problem and it was
somewhat difficult to find the cause.

17 months agoFix logic bug
Lukas Jiriste [Thu, 20 Jun 2024 08:47:16 +0000 (10:47 +0200)]
Fix logic bug

17 months agoFix initialization and formatting of output
Lukas Jiriste [Thu, 20 Jun 2024 06:56:32 +0000 (08:56 +0200)]
Fix initialization and formatting of output

17 months agoRefactor to make functions comply with 42 Norm
Lukas Jiriste [Sun, 16 Jun 2024 08:27:37 +0000 (10:27 +0200)]
Refactor to make functions comply with 42 Norm

17 months agoAdd printing for parsing table, fix formatting
Lukas Jiriste [Sun, 16 Jun 2024 06:18:32 +0000 (08:18 +0200)]
Add printing for parsing table, fix formatting

The ft_print_parsing_table is useful for debugging.

17 months agoFix interpretting the end of row as 0
Lukas Jiriste [Sun, 16 Jun 2024 05:16:08 +0000 (07:16 +0200)]
Fix interpretting the end of row as 0

17 months agoFix some bugs
Lukas Jiriste [Sat, 15 Jun 2024 12:34:03 +0000 (14:34 +0200)]
Fix some bugs

These bugs include:
 infinite loop
 not freeing alocated memory
 not initializing a struct before it may be returned

17 months agoFix a logic bug
Lukas Jiriste [Sat, 15 Jun 2024 08:17:54 +0000 (10:17 +0200)]
Fix a logic bug

17 months agoImplement parse_header, minor fixes
Lukas Jiriste [Sat, 15 Jun 2024 07:39:27 +0000 (09:39 +0200)]
Implement parse_header, minor fixes

17 months agoImplement ft_remove_space function
Lukas Jiriste [Sat, 15 Jun 2024 07:37:30 +0000 (09:37 +0200)]
Implement ft_remove_space function

17 months agoImplement most of parsing table loading
Lukas Jiriste [Fri, 14 Jun 2024 13:57:01 +0000 (15:57 +0200)]
Implement most of parsing table loading

Also change Makefile to include ft_parse.c in compilation.
Minor changes to ft_parse.h.

17 months agoAdd description of the format of parsing table
Lukas Jiriste [Fri, 14 Jun 2024 10:36:31 +0000 (12:36 +0200)]
Add description of the format of parsing table