23 lines
366 B
C
23 lines
366 B
C
#ifndef RZ_STR_H
|
|
#define RZ_STR_H
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
|
|
typedef struct {
|
|
char* data;
|
|
size_t size;
|
|
size_t cap;
|
|
} str_t;
|
|
|
|
void str_init(str_t* str);
|
|
void str_free(str_t* str);
|
|
|
|
void str_resize(str_t* str);
|
|
void str_push(str_t* str, char c);
|
|
void str_append(str_t* str, char const* src);
|
|
int str_empty(str_t* str);
|
|
|
|
#endif
|