Files
odwetalibc/include/string.h
T
2024-02-04 18:51:42 +01:00

27 lines
981 B
C

#ifndef STRING_H
#define STRING_H
#include <odweta/util.h>
typedef struct {
char *content;
size_t length;
} string_t;
string_t *string_new(); // create a new empty string
string_t *string_from(char *chars); // create a new string from a given char_sequence
bool string_push_chars(string_t *this, char *chars); // append a char_sequence to a string
bool string_push(string_t *this, string_t *other); // append a string to a string
compare_e string_compare(string_t *left, string_t* right); // compare two strings
void string_print(string_t *this); // print a string
void string_println(string_t *this); // print a string with a \n
bool string_is_empty(string_t *this); // return true when s->content == ""
void string_cleanup(string_t *this); // memory cleanup
#endif