codebased/include/common/string_array.h
2023-04-14 02:17:45 +02:00

37 lines
858 B
C

#ifndef COMMON_STRING_ARRAY_H
#define COMMON_STRING_ARRAY_H
#include "common/generic_array.h"
#include "common/string.h"
#include <stdlib.h>
GENERIC_ARRAY(StringView, StringViewArray, stringview_array)
static inline StringViewArray* stringview_array_new(void)
{
StringViewArray* array = malloc(sizeof(StringViewArray));
stringview_array_construct(array);
return array;
}
static inline void stringview_array_delete(StringViewArray* array)
{
stringview_array_destroy(array);
free(array);
}
GENERIC_ARRAY(HeapString, HeapStringArray, heapstring_array)
static inline HeapStringArray* heapstring_array_new(void)
{
HeapStringArray* array = malloc(sizeof(HeapStringArray));
heapstring_array_construct(array);
return array;
}
static inline void heapstring_array_delete(HeapStringArray* array)
{
heapstring_array_destroy(array);
free(array);
}
#endif