16 lines
389 B
C
16 lines
389 B
C
#ifndef STRING_HEADER
|
|
#define STRING_HEADER
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef struct String {
|
|
unsigned char const *buffer;
|
|
size_t size;
|
|
} String;
|
|
|
|
#define STRING(content) ((String){.buffer=#content, .size=sizeof(#content)-1})
|
|
|
|
bool StringSub(String string, int start, int end, String *out_substr);
|
|
String StringFromCString(unsigned char const *s);
|
|
#endif// STRING_HEADER
|