feat: added new functions and incomplete functions
This commit is contained in:
parent
2a34720f4d
commit
8d087d989f
1 changed files with 60 additions and 11 deletions
71
hdrs/libft.h
71
hdrs/libft.h
|
|
@ -3,21 +3,22 @@
|
|||
|
||||
# include <stdlib.h>
|
||||
|
||||
typedef struct s_string
|
||||
{
|
||||
size_t len;
|
||||
char *data;
|
||||
} t_string;
|
||||
void *ft_realloc(void *ptr, size_t old_size, size_t new_size);
|
||||
|
||||
int ft_strcmp(const char *s1, const char *s2);
|
||||
/* String functions */
|
||||
size_t ft_strlen(const char *s);
|
||||
int ft_putstr(const char *s);
|
||||
char *ft_strdup(const char *s);
|
||||
int ft_strcmp(const char *s1, const char *s2);
|
||||
|
||||
/* Character checks and conversions */
|
||||
int ft_isalpha(int c);
|
||||
int ft_isdigit(int c);
|
||||
int ft_islower(int c);
|
||||
int ft_isupper(int c);
|
||||
int ft_tolower(int c);
|
||||
int ft_toupper(int c);
|
||||
int ft_isdigit(int c);
|
||||
int ft_isalpha(int c);
|
||||
|
||||
/* Memory functions */
|
||||
void ft_bzero(void *s, size_t n);
|
||||
void *ft_memset(void *s, int c, size_t n);
|
||||
void *ft_memset32(void *s, int c, size_t n);
|
||||
|
|
@ -25,13 +26,61 @@ void *ft_memset64(void *s, int c, size_t n);
|
|||
void *ft_memcpy(void *dst, const void *src, size_t n);
|
||||
void *ft_memcpy32(void *dst, const void *src, size_t n);
|
||||
void *ft_memcpy64(void *dst, const void *src, size_t n);
|
||||
int ft_memcmp(const void *s1, const void *s2, size_t n);
|
||||
void *ft_memmove(void *dst, const void *src, size_t n);
|
||||
void *ft_memchr(const void *s, int c, size_t n);
|
||||
/* Conversion */
|
||||
int ft_atoi(const char *str);
|
||||
|
||||
/* Output functions */
|
||||
int ft_putchar(char c);
|
||||
int ft_putstr(const char *s);
|
||||
int ft_putnbr(int n);
|
||||
int ft_putunbr(unsigned int n);
|
||||
int ft_puthex(unsigned int n, int uppercase);
|
||||
void ft_putptr(void *ptr);
|
||||
int ft_printf(const char *format, ...);
|
||||
int ft_putaddr(unsigned long n);
|
||||
int ft_putptr(void *ptr);
|
||||
int ft_printf(const char *format, ...);
|
||||
|
||||
/* String */
|
||||
typedef struct s_string
|
||||
{
|
||||
size_t len;
|
||||
char *data;
|
||||
} t_string;
|
||||
|
||||
/* List */
|
||||
typedef struct s_list
|
||||
{
|
||||
void *data;
|
||||
struct s_list *next;
|
||||
} t_list;
|
||||
|
||||
/* List functions */
|
||||
t_list *ft_lstnew(void *data);
|
||||
void ft_lstpush(t_list **lst, t_list *node);
|
||||
void ft_lstunshift(t_list **lst, t_list *node);
|
||||
t_list *ft_lstpop(t_list **lst);
|
||||
t_list *ft_lstshift(t_list **lst);
|
||||
int ft_lstsize(t_list *lst);
|
||||
void ft_lstclear(t_list **lst);
|
||||
void ft_lstreverse(t_list **lst);
|
||||
int ft_lstempty(t_list *lst);
|
||||
void ft_lstiter(t_list *lst, void (*f)(void *));
|
||||
void ft_lstrm(t_list **lst, void *data, int (*cmp)(void *, void *), void (*del)(void *));
|
||||
t_list *ft_lstfind(t_list *lst, void *data, int (*cmp)(void *, void *));
|
||||
int ft_lstinsert(t_list **lst, t_list *node, int index);
|
||||
t_list *ft_lstget(t_list *lst, int index);
|
||||
|
||||
/* Vector */
|
||||
typedef struct s_vec
|
||||
{
|
||||
void *data;
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
size_t element_size;
|
||||
} t_vec;
|
||||
|
||||
/* Vector functions*/
|
||||
t_vec *ft_vecnew(size_t element_size);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue