feat: added configuration and USE_SLIST
This commit is contained in:
parent
14adc54215
commit
721a840908
16 changed files with 57 additions and 9 deletions
15
hdrs/libft.h
15
hdrs/libft.h
|
|
@ -1,7 +1,14 @@
|
|||
#ifndef LIBFT_H
|
||||
# define LIBFT_H
|
||||
|
||||
# include <stdlib.h>
|
||||
#define LIBFT_H
|
||||
#include <stdlib.h>
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
#define DEBUG_PRINT(fmt, ...) \
|
||||
fprintf(stderr, "[DEBUG] %s:%d:%s(): " fmt "\n", \
|
||||
__FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_PRINT(fmt, ...) ((void)0)
|
||||
#endif
|
||||
|
||||
void *ft_realloc(void *ptr, size_t old_size, size_t new_size);
|
||||
|
||||
|
|
@ -50,6 +57,7 @@ typedef struct s_string
|
|||
} t_string;
|
||||
|
||||
/* Single Linked List */
|
||||
#if USE_SLIST
|
||||
typedef struct s_slist
|
||||
{
|
||||
void *data;
|
||||
|
|
@ -71,6 +79,7 @@ t_slist *ft_slist_find(t_slist *lst, void *data, int (*cmp)(void *, void *));
|
|||
int ft_slist_insert(t_slist **lst, t_slist *node, int index);
|
||||
t_slist *ft_slist_get(t_slist *lst, int index);
|
||||
|
||||
#endif
|
||||
/* Vector */
|
||||
typedef struct s_vec
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue