adding atoi_superscript and isdigit_superscript

This commit is contained in:
hugogogo
2026-05-06 20:02:44 +02:00
parent b64ede50af
commit f93c635234
10 changed files with 269 additions and 82 deletions

View File

@@ -14,6 +14,8 @@
#define LIBFT_H
#include <unistd.h> // for write
#include <stdlib.h> // for malloc and free
#include <stdint.h> // for uint8_t for utf8 characters
#include <limits.h> // for INT_MAX, LONG_MAX, etc
#include "ft_gnl.h"
#include "ft_printf.h"
@@ -27,6 +29,7 @@ int ft_memcmp(const void *s1, const void *s2, size_t n);
size_t ft_strlen(const char *str);
int ft_isalpha(int c);
int ft_isdigit(int c);
int ft_isdigit_superscript(const char *input, int *size);
int ft_isnumber(char *nb);
int ft_isalnum(int c);
int ft_isascii(int c);
@@ -42,7 +45,11 @@ size_t ft_strlcpy(char *dst, const char *src, size_t size);
size_t ft_strlcat(char *dst, const char *src, size_t size);
char *ft_strnstr(const char *b, const char *l, size_t s);
int ft_atoi(const char *str);
int ft_atoi_superscript(const char *str);
long ft_atol(const char *str);
long ft_atol_superscript(const char *str);
long long ft_atoll(const char *str);
long long ft_atoll_superscript(const char *str);
double ft_atof(const char *str);
void *ft_calloc(size_t count, size_t size);
char *ft_strdup(const char *s1);
@@ -65,9 +72,6 @@ void ft_putstr_fd(const char *s, int fd);
void ft_putnbr_fd(int n, int fd);
void ft_putnbrbase_fd(int nbr, const char *base, int fd);
// void ft_putendl(char const *str);
// void ft_putendl_fd(char *s, int fd);
typedef struct s_list
{
void *content;
@@ -75,19 +79,6 @@ typedef struct s_list
struct s_list *next;
} t_list;
// t_list *ft_lstnew(void *content);
// void ft_lstadd_front(t_list **alst, t_list *n);
// void *ft_lstadd_back(t_list **alst, t_list *n);
// int ft_lstsize(t_list *lst);
// t_list *ft_lstlast(t_list *lst);
// void ft_lstdelone(t_list *lst, void (*del)(void *));
// void ft_lstclear(t_list **lst, void (*del)(void *));
// void ft_lstiter(t_list *lst, void (*f)(void *));
// t_list *ft_lstmap(t_list *l, void *(*f)(void *), void (*d)(void *));
// void ft_lstremove(t_list *lst, void (*del)(void *));
// t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void *, void *));
t_list *ft_lstcreate(void *content);
void *ft_lstpush_back(t_list **lst, t_list *new);
void ft_lstpush_front(t_list **alst, t_list *new);