adding split substr strlen

This commit is contained in:
Maoake Teriierooiterai
2026-01-08 13:50:38 +01:00
parent 2f4498d2c5
commit 8dbf9f6c6e
6 changed files with 21 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ INSERTION = insertion.c
FLAGS_FILES = algorithms_sort.c flag.c
PARSING = ft_atoi.c parsing.c ft_strncmp.c
PARSING = ft_atoi.c parsing.c ft_strncmp.c ft_split.c ft_strlen.c ft_substr.c
STACK_UTILS = push.c rev_rotate.c rotate.c stack_add.c stack_remove.c stacks_len.c swap.c print_stacks.c

View File

@@ -13,8 +13,14 @@
#ifndef PARSING_H
# define PARSING_H
#include <stdlib.h>
#include "push_swap.h"
int ft_atoi(const char *nptr);
t_stacks *init_big_stacks(int argc, char **argv);
t_stacks *init_piles(int argc, char **argv, int mod);
int ft_strncmp(const char *s1, const char *s2, int n);
size_t ft_strlen(const char *s);
char *ft_substr(char const *s, unsigned int start, size_t len);
char **ft_split(char const *s, char c);
#endif

View File

@@ -10,7 +10,8 @@
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
#include "parsing.h"
static size_t count_words(char const *s, char c)
{

View File

@@ -10,7 +10,8 @@
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
#include "parsing.h"
char *ft_substr(char const *s, unsigned int start, size_t len)
{

View File

@@ -52,6 +52,14 @@ static t_stack *special_parsing(int argc, char **argv, int mod)
t_stacks *piles;
t_stack *first;
t_stack *new;
char **split_tab;
int i;
i = 0;
split_tab = ft_split(arv[wich_mod(mod)]);
if (!split_tab)
return (NULL);
while ()
}
t_stacks *init_piles(int argc, char **argv, int mod)

View File

@@ -24,11 +24,10 @@ int test1(int argc, char **argv)
piles = NULL;
if (argc > 1)
{
piles = init_big_stacks(argc, argv);
piles = init_piles(argc, argv, 0);
preset = get_tabs(piles->a, range_bucket(piles->a));
bucket_algo(piles, preset, range_bucket(piles->a));
}
free_all(piles);
free(piles);
return (0);
}