20# include <sys/types.h>
22# define BUFFER_SIZE 128
23# define VECTOR_INIT_CAP 16
176# define HASHMAP_INIT_CAP 50
222 size_t (*
hash)(
const char *key);
403 void (*data_free)(
void *data));
450 __attribute__((format(printf, 2, 3)));
1020void print_err(
bool print_errno, const
char *message);
1042 __attribute__((format(printf, 3, 4)));
1072 void (*del)(
void *));
1298 bool (*select_function)(
void*));
1371 void (*del)(
void *));
1382 void (*del_content)(
void*));
1407void *
ft_calloc(
size_t count,
size_t size);
1420bool ft_realloc(
char **buff,
size_t cap,
size_t newcap);
1434long min(
long a,
long b);
1444long max(
long a,
long b);
1468long power(
int a,
int b);
1480size_t modulo(
long a,
size_t b);
1524void *
ft_memchr(const
void *s,
int c,
size_t n);
1535int ft_memcmp(const
void *s1, const
void *s2,
size_t n);
1548void *
ft_memcpy(
void *dst, const
void *src,
size_t n);
1559void *
ft_memmove(
void *dst, const
void *src,
size_t len);
1570void *
ft_memset(
void *b,
int c,
size_t len);
1585int ft_vdprintf(
int fd, const
char *fstring, va_list args);
1600int ft_dprintf(
int fd, const
char *fstring, ...)
1601 __attribute__((format(printf, 2, 3)));
1611int ft_vprintf(const
char *fstring, va_list args);
1626 __attribute__((format(printf, 1, 2)));
1691char *
str_chr(const
char *s,
int c);
1701int str_cmp(const
char *s1, const
char *s2);
1730void str_iteri(
char *s,
void (*f)(
unsigned int,
char*));
1742char *
str_join(
char const *s1,
char const *s2);
1753size_t str_lcat(
char *dst, const
char *src,
size_t dstsize);
1764size_t str_lcpy(
char *dst, const
char *src,
size_t dstsize);
1785char *
str_mapi(
char const *s,
char (*f)(
unsigned int,
char));
1796int str_ncmp(const
char *s1, const
char *s2,
size_t n);
1808char *
str_ndup(const
char *src,
size_t len);
1821char *
str_nstr(const
char *haystack, const
char *needle,
1835char *
str_rchr(const
char *s,
int c);
1861char *
str_sub(
char const *s,
unsigned int start,
size_t len);
1873char *
str_trim(
char const *s1,
char const *set);
1920 t_string *
string, const
char *fstring, ...)
1921 __attribute__((format(printf, 2, 3)));
1952 const
char *fstring,
2298 bool keep_empty_entries,
2330 bool keep_empty_entries,
2469 void (*item_free)(
void *item));
t_btree_node * btree_new(void *data)
Creates a new binary tree node.
Definition btree.c:16
void btree_set_left(t_btree_node *parent, t_btree_node *child)
Sets the left child of a parent node.
Definition btree.c:30
void btree_free(t_btree_node **node, void(*data_free)(void *data))
Recursively frees a node and its descendants.
Definition btree_free.c:16
t_btree_node * btree_detach_left(t_btree_node *parent)
Detaches and returns the left child of a parent node.
Definition btree.c:42
t_btree_node * btree_detach_right(t_btree_node *parent)
Detaches and returns the right child of a parent node.
Definition btree.c:52
void btree_set_right(t_btree_node *parent, t_btree_node *child)
Sets the right child of a parent node.
Definition btree.c:36
bool buff_insert_n(t_buff *b, size_t index, const char *str, long n)
Inserts n first bytes of a string in the buffer at specified index.
Definition buff_ops_n.c:46
bool buff_adjust(t_buff *buff)
Shrinks buffer capacity to match its current length.
Definition buff_utils.c:16
ssize_t buff_get_index_s(const t_buff *buff, const char *s, ssize_t slen)
Finds the first occurrence of a substring in the buffer.
Definition buff_utils.c:54
bool buff_prepend_n(t_buff *b, const char *str, long n)
Prepends n first bytes of a string to the beginning of the buffer.
Definition buff_ops_n.c:17
void buff_free(t_buff *buff)
Frees the buffer's internal data.
Definition buff_life_cycle.c:33
ssize_t buff_get_index_c(const t_buff *buff, char c)
Finds the index of the first occurrence of a character in the buffer.
Definition buff_utils.c:40
bool buff_read_all(t_buff *buff, int fd)
Reads all available data from a file descriptor into buffer.
Definition buff_read.c:50
void buff_free_void(void *buff)
Frees a t_buff item through a generic void* callback signature.
Definition buff_life_cycle.c:42
bool buff_read_until_n(t_buff *buff, int fd, size_t n)
Reads up to n bytes from a file descriptor into buffer.
Definition buff_read.c:39
void buff_rm_part(t_buff *buff, size_t i_start, ssize_t len)
Removes a portion of the buffer starting at i_start.
Definition buff_ops.c:36
bool buff_prepend(t_buff *dst, const t_buff *src)
Prepends a source buffer to the beginning of a buffer.
Definition buff_ops.c:16
char * buff_get_string(const t_buff *buff)
Returns a newly allocated copy of the buffer content.
Definition buff_utils.c:80
bool buff_append_format(t_buff *buff, const char *fstring,...)
Appends formatted string to buffer using variadic arguments.
Definition buff_format.c:16
bool buff_append_n(t_buff *b, const char *str, long n)
Appends n first bytes of a string to the end of the buffer.
Definition buff_ops_n.c:75
bool buff_append_vformat(t_buff *buff, const char *fstring, va_list args)
Appends formatted string to buffer using va_list.
Definition buff_format.c:27
bool buff_init(t_buff *buff, size_t initial_cap, const char *str, long n)
Initializes a buffer with the specified initial capacity.
Definition buff_life_cycle.c:16
bool buff_insert(t_buff *dst, size_t index, const t_buff *src)
Inserts a source buffer in a buffer at the specified index.
Definition buff_ops.c:21
bool buff_dup_n(t_buff *dst, const t_buff *src, size_t n)
Copies up to n bytes from a source buffer into an existing buffer.
Definition buff_ops_n.c:92
bool buff_read_until_s(t_buff *buff, int fd, const char *s, ssize_t slen)
Reads from a file descriptor until a specific substring is found.
Definition buff_read_until_s.c:76
bool buff_cmp(const t_buff *a, const t_buff *b)
Compares two buffers data byte by byte.
Definition buff_cmp.c:15
bool buff_dup(t_buff *dst, const t_buff *src)
Copies the content of a source buffer into an existing buffer.
Definition buff_ops.c:31
bool buff_append(t_buff *dst, const t_buff *src)
Appends the content of a source buffer to the end of a buffer.
Definition buff_ops.c:26
bool buff_read_until_c(t_buff *buff, int fd, char c)
Reads from a file descriptor until a specific character is found.
Definition buff_read.c:19
int ft_isdigit(int c)
Checks if a character is a digit ('0'-'9').
Definition ft_isdigit.c:13
bool ft_isincharset(char c, const char *charset)
Checks if a character is present in a character set.
Definition ft_isincharset.c:15
int ft_isalnum(int c)
Checks if a character is alphanumeric.
Definition ft_isalnum.c:13
int ft_tolower(int c)
Converts an uppercase letter to lowercase.
Definition ft_tolower.c:13
int ft_isprint(int c)
Checks if a character is printable (32-126).
Definition ft_isprint.c:13
int ft_isascii(int c)
Checks if a character is a valid ASCII character (0-127).
Definition ft_isascii.c:13
int ft_isalpha(int c)
Checks if a character is alphabetic.
Definition ft_isalpha.c:13
int ft_isspace(char c)
Checks if a character is whitespace (9-13).
Definition ft_isspace.c:13
int ft_toupper(int c)
Converts a lowercase letter to uppercase.
Definition ft_toupper.c:13
long ft_atol(const char *str)
Converts a string to a long integer.
Definition ft_atol.c:15
pid_t ft_atopid(const char *str)
Converts a string to a pid_t.
Definition ft_atopid.c:16
char * ft_ultoa_base(unsigned long n, const char *base)
Converts an unsigned long to a string in a given base.
Definition ft_ultoa_base.c:18
bool parse_int(char *s, int *out)
Parses a string to an integer with overflow detection.
Definition parse_int.c:16
char * ft_zutoa(size_t n)
Converts a size_t to a string.
Definition ft_zutoa.c:18
char * ft_itoa(int n)
Converts an integer to a string.
Definition variants.c:20
char * ft_ltoa(long n)
Converts a long integer to a string.
Definition ft_ltoa.c:18
char * ft_pidtoa(pid_t n)
Converts a pid_t to a string.
Definition ft_pidtoa.c:19
size_t ft_atozu(const char *str)
Converts a string to a size_t.
Definition ft_atozu.c:16
bool parse_long(char *s, long *out)
Parses a string to a long with overflow detection.
Definition parse_long.c:16
char * ft_utoa(unsigned int n)
Converts an unsigned integer to a string.
Definition variants.c:25
int ft_atoi(const char *str)
Converts a string to an integer.
Definition variants.c:15
void print_err(bool print_errno, const char *message)
Prints "Error\n" to stderr with optional message and errno.
Definition error.c:39
void fprint_err(bool print_errno, const char *safe, const char *fmt,...)
Prints "Error\n" to stderr with safe prefix + formatted suffix.
Definition error.c:22
bool hashmap_contains(const t_hashmap *map, const char *key)
Tests whether a key is present in the map.
Definition contains.c:16
bool hashmap_put(t_hashmap *map, const char *key, void *value)
Inserts a key/value pair, replacing any existing value for the key.
Definition put.c:16
t_key_value * key_value_new(const char *key, void *value)
Allocates a key/value pair.
Definition init.c:16
bool hashmap_remove(t_hashmap *map, const char *key)
Removes the pair associated with a key.
Definition remove.c:16
void hashmap_free(t_hashmap *map)
Frees a hash map and all of its contents.
Definition init.c:27
void key_value_free(t_key_value **pair, void(*del)(void *))
Frees a key/value pair and its contents.
Definition init.c:29
const t_key_value ** hashmap_get_all(const t_hashmap *map)
Collects every key/value pair stored in the map.
Definition get.c:38
bool hashmap_init(t_hashmap *map, size_t initial_cap, void(*del)(void *))
Initializes an empty hash map.
Definition init.c:17
const void * hashmap_get_const(const t_hashmap *map, const char *key)
Retrieves the value associated with a key.
Definition get.c:33
void hashmap_clear(t_hashmap *map)
Removes all key/value pairs from a hash map.
Definition init.c:33
t_list list_map(t_list list, void *(*f)(void *), void(*del)(void *))
Creates a new list by applying a function to each element.
Definition list_apply.c:30
void * list_get_content(t_list list, bool(*select_function)(void *))
Finds content in list matching a selection function.
Definition list_get.c:16
void list_iter(t_list lst, void(*f)(void *))
Applies a function to each element of the list.
Definition list_apply.c:16
size_t list_get_size(t_list list)
Calculates the number of nodes in the list.
Definition list_size.c:15
void * list_get_content_n(t_list list, size_t index)
Gets content at a specific index in the list.
Definition list_get.c:32
bool list_add_end(t_list *list, void *new_content)
Adds a new element at the end of the list.
Definition list_life_cycle.c:31
void list_rm(t_list *list, t_node *node, void(*del_content)(void *))
Removes a specific node from the list.
Definition list_life_cycle.c:54
t_node * list_get_node_last(t_list list)
Gets the last node in the list.
Definition list_get.c:69
t_node * node_new(void *content, t_node *prev, t_node *next)
Creates a new list node.
Definition node.c:16
void node_free(t_node **node, void(*del_content)(void *))
Frees a node and optionally its content.
Definition node.c:29
bool list_add_start(t_list *list, void *new_content)
Adds a new element at the start of the list.
Definition list_life_cycle.c:16
void list_rm_all(t_list *list, void(*del_content)(void *))
Removes all nodes from the list.
Definition list_life_cycle.c:74
void * list_get_content_last(t_list list)
Gets the content of the last node in the list.
Definition list_get.c:42
t_node * list_get_node_n(t_list list, size_t index)
Gets the node at a specific index in the list.
Definition list_get.c:52
bool ft_realloc(char **buff, size_t cap, size_t newcap)
Reallocates a buffer to a new capacity.
Definition ft_realloc.c:16
void * ft_calloc(size_t count, size_t size)
Allocates and zeroes memory for an array.
Definition ft_calloc.c:17
long min(long a, long b)
Returns the minimum of two long integers.
Definition min_max_abs.c:15
int square_root_exact(int nb)
Calculates the exact integer square root.
Definition square_root.c:13
size_t modulo(long a, size_t b)
Computes the modulo of a signed integer with an unsigned modulus.
Definition modulo.c:15
long max(long a, long b)
Returns the maximum of two long integers.
Definition min_max_abs.c:23
int square_root_rounded(int nb)
Calculates the nearest integer square root.
Definition square_root.c:29
long power(int a, int b)
Computes a raised to the power of b.
Definition power.c:13
size_t absolute(long nbr)
Returns the absolute value of a long integer.
Definition min_max_abs.c:31
int ft_memcmp(const void *s1, const void *s2, size_t n)
Compares two memory areas byte by byte.
Definition ft_memcmp.c:15
void * ft_memset(void *b, int c, size_t len)
Fills memory with a constant byte.
Definition ft_memset.c:15
void ft_bzero(void *s, size_t n)
Sets n bytes of memory to zero.
Definition ft_bzero.c:15
void * ft_memcpy(void *dst, const void *src, size_t n)
Copies n bytes from src to dst.
Definition ft_memcpy.c:15
void * ft_memchr(const void *s, int c, size_t n)
Locates the first occurrence of a byte in memory.
Definition ft_memchr.c:15
void * ft_memmove(void *dst, const void *src, size_t len)
Copies n bytes from src to dst, handling overlapping memory.
Definition ft_memmove.c:15
int ft_dprintf(int fd, const char *fstring,...)
Writes formatted output to a file descriptor.
Definition printer.c:35
int ft_vprintf(const char *fstring, va_list args)
Writes formatted output to stdout using va_list.
Definition printer.c:48
int ft_printf(const char *fstring,...)
Writes formatted output to stdout.
Definition printer.c:53
int ft_vdprintf(int fd, const char *fstring, va_list args)
Writes formatted output to a file descriptor using va_list.
Definition printer.c:18
void ft_putnbr_fd(int n, int fd)
Writes an integer to a file descriptor.
Definition ft_putnbr_fd.c:17
void ft_putstr_fd(char *s, int fd)
Writes a string to a file descriptor.
Definition ft_putstr_fd.c:16
void ft_putendl_fd(char *s, int fd)
Writes a string followed by newline to a file descriptor.
Definition ft_putendl_fd.c:16
char ** str_split(char const *s, char c)
Splits a string into an array of strings using a delimiter.
Definition str_split.c:18
char * str_join(char const *s1, char const *s2)
Concatenates two strings into a new string.
Definition str_join.c:16
size_t str_lcat(char *dst, const char *src, size_t dstsize)
Appends src to dst with size limit.
Definition str_lcat.c:15
size_t str_len(const char *s)
Calculates the length of a string.
Definition str_len.c:15
size_t str_lcpy(char *dst, const char *src, size_t dstsize)
Copies src to dst with size limit.
Definition str_lcpy.c:15
char * str_mapi(char const *s, char(*f)(unsigned int, char))
Creates a new string by applying a function to each character.
Definition str_mapi.c:16
char * str_ndup(const char *src, size_t len)
Duplicates the first len bytes of a string.
Definition str_ndup.c:15
char * str_nstr(const char *haystack, const char *needle, size_t len)
Locates a substring within a string, limited by length.
Definition str_nstr.c:15
char * str_sub(char const *s, unsigned int start, size_t len)
Extracts a substring from a string.
Definition str_sub.c:16
char * str_rchr(const char *s, int c)
Locates the last occurrence of a character in a string.
Definition str_rchr.c:15
char * str_chr(const char *s, int c)
Locates the first occurrence of a character in a string.
Definition str_chr.c:15
void str_iteri(char *s, void(*f)(unsigned int, char *))
Applies a function to each character of a string with its index.
Definition str_iteri.c:13
char * str_trim(char const *s1, char const *set)
Trims characters from the beginning and end of a string.
Definition str_trim.c:18
char * str_dup(const char *s1)
Duplicates a string.
Definition str_dup.c:16
int str_cmp(const char *s1, const char *s2)
Compares two strings.
Definition str_cmp.c:15
int str_ncmp(const char *s1, const char *s2, size_t n)
Compares at most n characters of two strings.
Definition str_ncmp.c:15
bool string_adjust(t_string *string)
Shrinks string capacity to match its current length plus NUL byte.
Definition string_utils.c:16
void string_trim_leading(t_string *string, char c)
Removes leading copies of a character from a string.
Definition string_ops_n.c:107
bool string_prepend(t_string *dst, const t_string *src)
Prepends a source string to the beginning of a string.
Definition string_ops.c:16
ssize_t string_get_index_c(const t_string *string, char c)
Finds the index of the first occurrence of a character in the string.
Definition string_utils.c:38
void string_rm_part(t_string *string, size_t i_start, ssize_t len)
Removes a portion of the string starting at i_start.
Definition string_ops.c:39
bool string_read_until_n(t_string *string, int fd, size_t n)
Reads up to n bytes from a file descriptor into string.
Definition string_read.c:42
void string_take(t_string *dst, char *src, size_t cap, ssize_t len)
Installs an existing buffer in a string without copying it.
Definition string_life_cycle.c:37
bool string_split_at(const t_string *src, size_t index, t_string *out_before, t_string *out_after)
Splits a string into two initialized strings at a byte index.
Definition string_split_at.c:15
bool string_dup_n(t_string *dst, const t_string *src, size_t n)
Copies up to n bytes from a source string into an existing string.
Definition string_ops_n.c:92
bool string_prepend_n(t_string *s, const char *str, long n)
Prepends n first bytes of a string to the beginning of a string.
Definition string_ops_n.c:17
bool string_cmp(const t_string *a, const t_string *b)
Compares two strings byte by byte.
Definition string_cmp.c:15
bool string_split_on_char(const t_string *src, char c, bool keep_empty_entries, t_vector *out)
Splits a string on a delimiter character into a t_vector.
Definition string_split_on_char.c:68
bool string_append_vformat(t_string *string, const char *fstring, va_list args)
Appends formatted text to string using va_list.
Definition string_format.c:28
void string_free_void(void *string)
Frees a t_string item through a generic void* callback signature.
Definition string_life_cycle.c:62
bool string_init(t_string *s, size_t initial_cap, const char *str, long n)
Initializes a string with the specified initial capacity.
Definition string_life_cycle.c:16
bool string_dup(t_string *dst, const t_string *src)
Copies the content of a source string into an existing string.
Definition string_ops.c:34
bool string_read_until_s(t_string *string, int fd, const char *s, ssize_t slen)
Reads from a file descriptor until a specific substring is found.
Definition string_read_until_s.c:76
ssize_t string_get_index_s(const t_string *string, const char *s, ssize_t slen)
Finds the first occurrence of a substring in the string.
Definition string_utils.c:52
void string_free(t_string *string)
Frees the string's internal data.
Definition string_life_cycle.c:53
void string_take_string(t_string *dst, t_string *src)
Move the internal storage of one string into another string.
Definition string_life_cycle.c:47
bool string_read_until_c(t_string *string, int fd, char c)
Reads from a file descriptor until a specific character is found.
Definition string_read.c:19
bool string_append(t_string *dst, const t_string *src)
Appends the content of a source string to the end of a string.
Definition string_ops.c:29
bool string_append_format(t_string *string, const char *fstring,...)
Appends formatted text to string using variadic arguments.
Definition string_format.c:16
bool string_read_all(t_string *string, int fd)
Reads all available data from a file descriptor into string.
Definition string_read.c:54
bool string_insert(t_string *dst, size_t index, const t_string *src)
Inserts a source string in a string at the specified index.
Definition string_ops.c:21
bool string_append_n(t_string *s, const char *str, long n)
Appends n first bytes of a string to the end of a dynamic string.
Definition string_ops_n.c:75
bool string_split_on_string(const t_string *src, const char *sep, bool keep_empty_entries, t_vector *out)
Splits a string on a delimiter C-string into a t_vector.
Definition string_split_on_string.c:76
bool string_insert_n(t_string *s, size_t index, const char *str, long n)
Inserts n first bytes of a string at the specified index.
Definition string_ops_n.c:46
bool vector_dup(t_vector *dst, const t_vector *src)
Duplicates a vector into another one.
Definition vector_life_cycle.c:81
bool vector_grow(t_vector *vector)
Grows vector capacity, usually by doubling it.
Definition vector_life_cycle.c:36
bool vector_push(t_vector *vector, const void *item)
Appends one item at the end of the vector.
Definition vector_ops_items.c:19
bool vector_pop(t_vector *vector, void *dst)
Removes the last item from the vector.
Definition vector_ops_items.c:32
void vector_free(t_vector *vector, void(*item_free)(void *item))
Frees the vector's internal storage.
Definition vector_life_cycle.c:95
bool vector_insert(t_vector *vector, size_t index, const void *item)
Inserts one item at a specific index.
Definition vector_ops_items.c:45
void vector_take(t_vector *dst, t_vector *src)
Transfers a vector state into another one without copying items.
Definition vector_ops_vectors.c:113
bool vector_merge(t_vector *dst, const t_vector *src, size_t index)
Inserts all items from src into dst at a specific index.
Definition vector_ops_vectors.c:20
bool vector_adjust(t_vector *vector)
Shrinks vector capacity to match its current length.
Definition vector_life_cycle.c:59
bool vector_remove(t_vector *vector, size_t index, void *dst)
Removes one item at a specific index.
Definition vector_ops_items.c:94
void vector_clear(t_vector *vector, void(*del)(void *))
Removes all items from a vector without freeing its storage.
Definition vector_ops_vectors.c:47
bool vector_init(t_vector *vector, size_t item_size, size_t cap)
Initializes a vector with a given item size and initial capacity.
Definition vector_life_cycle.c:17
bool buff_grow(t_buff *buff, size_t target_len)
Grows the buffer to accommodate the target length if necessary.
Definition buff_internal.c:37
union u_const_cast t_const_cast
Temporary pointer view used to reinterpret the same address with or without const qualification.
struct s_btree_node t_btree_node
t_node * t_list
Type alias for a pointer to a list node (list head).
Definition libft.h:115
size_t str_count_words(char const *s, char sep)
Counts words in a string separated by a delimiter.
Definition str_split.c:47
struct s_key_value t_key_value
void str_array_free(char ***tab_ptr)
Frees all strings in a null-terminated array and the tab itself.
Definition str_split.c:87
void * hashmap_get(const t_hashmap *map, const char *key)
Definition get.c:17
char * str_trim_leading(char const *s1, char const *set)
Definition str_trim_leading.c:18
void ft_putchar_fd(char c, int fd)
Writes a character to a file descriptor.
Definition ft_putchar_fd.c:15
bool string_grow(t_string *string, size_t target_cap)
Grows the string to accommodate the target length if necessary.
Definition string_internal.c:37
struct s_hashmap t_hashmap
Binary tree node structure.
Definition libft.h:130
void * data
Pointer to node payload (owned by the node, may be NULL).
Definition libft.h:138
struct s_btree_node * parent
Pointer to the parent node (borrowed, may be NULL).
Definition libft.h:132
struct s_btree_node * left
Pointer to the left child (borrowed, may be NULL).
Definition libft.h:134
struct s_btree_node * right
Pointer to the right child (borrowed, may be NULL).
Definition libft.h:136
Dynamic buffer structure for efficient string/data manipulation.
Definition libft.h:54
size_t cap
Current allocated capacity (in bytes).
Definition libft.h:58
size_t len
Current length of data in the buffer (in bytes).
Definition libft.h:60
char * data
Pointer to the allocated data (owned).
Definition libft.h:56
Separate-chaining hash map keyed by NUL-terminated strings.
Definition libft.h:216
t_vector buckets
Vector of t_list buckets (owned by the map).
Definition libft.h:220
size_t(* hash)(const char *key)
Hash function applied to keys (defaults to hash_string).
Definition libft.h:222
size_t size
Current number of stored key/value pairs.
Definition libft.h:218
void(* del_value)(void *)
Optional destructor for stored values (may be NULL).
Definition libft.h:224
Key/value pair stored inside a hashmap bucket.
Definition libft.h:192
char * key
Heap-allocated copy of the key string (owned by the pair).
Definition libft.h:194
void * value
Pointer to the stored value (owned by the pair).
Definition libft.h:196
Doubly linked list node structure.
Definition libft.h:102
void * content
Pointer to the node's content (owned by the node).
Definition libft.h:104
struct s_node * next
Pointer to the next node (borrowed, may be NULL).
Definition libft.h:108
struct s_node * prev
Pointer to the previous node (borrowed, may be NULL).
Definition libft.h:106
Dynamic string structure with NUL-terminated storage.
Definition libft.h:81
size_t len
Current length in bytes, excluding the trailing NUL.
Definition libft.h:88
char * data
Pointer to the string storage (borrowed or owned, NUL-terminated if not NULL).
Definition libft.h:84
size_t cap
Current capacity in bytes, also encoding storage ownership.
Definition libft.h:86
Dynamic array storing contiguous fixed-size items.
Definition libft.h:160
size_t len
Current number of stored items, expressed in items.
Definition libft.h:168
void * data
Pointer to the contiguous array of items (borrowed or owned by the vector, may be NULL).
Definition libft.h:164
size_t item_size
Size of each item, expressed in bytes.
Definition libft.h:170
size_t cap
Current capacity in items, also encoding storage ownership.
Definition libft.h:166
Temporary pointer view used to reinterpret the same address with or without const qualification.
Definition libft.h:38
const char * str
Definition libft.h:39
char * res
Definition libft.h:40