view include/str.h @ 12:0cc2555db371

*: make our string functions not stupid strncat() made everything slow! new addition internally: an EDL_header structure to make things not stupid. if we were using C++ it wouldn't really be necessary, but alas :)
author Paper <paper@paper.us.eu.org>
date Wed, 27 Mar 2024 13:38:30 -0400
parents 0c98b46eaf73
children 41b74137e201
line wrap: on
line source

#ifndef __edl__internal__str_h
#define __edl__internal__str_h

#include <stddef.h>

typedef struct {
    size_t size;
    size_t capacity;
    char* data;
} EDL_internal_string;

int EDL_internal_string_init(EDL_internal_string* str);
int EDL_internal_string_allocate(EDL_internal_string* str, size_t new_capacity);
int EDL_internal_string_append(EDL_internal_string* str, const char* data, const size_t length);
void EDL_internal_string_free(EDL_internal_string* str);

#endif /* __edl__internal__str_h */