summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-04-12 19:18:59 -0400
committerrealtradam <[email protected]>2023-04-12 19:18:59 -0400
commitf250a4090cf4d535a163388fb5faea5ff1ce48e4 (patch)
treeabccaee35e10fb05ec06f621ea14adf598ff53cc /include
parent231185997aef8b675033cf1a32db79e140bcef06 (diff)
downloadRodeoKit-f250a4090cf4d535a163388fb5faea5ff1ce48e4.tar.gz
RodeoKit-f250a4090cf4d535a163388fb5faea5ff1ce48e4.zip
remove string wrapper, use STC directly instead
Diffstat (limited to 'include')
-rw-r--r--include/rodeo.h57
-rw-r--r--include/rodeo_types.h17
2 files changed, 10 insertions, 64 deletions
diff --git a/include/rodeo.h b/include/rodeo.h
index 1adb258..1fd27a6 100644
--- a/include/rodeo.h
+++ b/include/rodeo.h
@@ -3,6 +3,9 @@
// public
#include "rodeo_types.h"
+// -- external --
+#include "stc/cstr.h"
+
// -- system --
#include <stdbool.h>
#include <stdio.h>
@@ -68,7 +71,7 @@ void
rodeo_window_init(
uint16_t screen_height,
uint16_t screen_width,
- rodeo_string_t title
+ cstr title
);
void
@@ -109,7 +112,7 @@ rodeo_window_quit_set(bool quit);
void
rodeo_debug_text_draw(uint16_t x, uint16_t y, const char *format, ...);
-rodeo_string_t
+cstr
rodeo_renderer_name_get(void);
void
@@ -126,7 +129,7 @@ rodeo_texture_2d_create_from_RGBA8(
);
rodeo_texture_2d_t
-rodeo_texture_2d_create_from_path(rodeo_string_t path);
+rodeo_texture_2d_create_from_path(cstr path);
void
rodeo_texture_2d_destroy(rodeo_texture_2d_t *texture);
@@ -145,54 +148,6 @@ rodeo_texture_2d_draw(
const rodeo_texture_2d_t *texture
);
-/// --- String ---
-
-rodeo_string_t
-rodeo_string_create(const char *c_string);
-
-void
-rodeo_string_destroy(rodeo_string_t *self);
-
-char*
-rodeo_string_to_cstr(rodeo_string_t *self);
-
-const char*
-rodeo_string_to_constcstr(const rodeo_string_t *self);
-
-void
-rodeo_string_insert(
- rodeo_string_t *self,
- const rodeo_string_t insert,
- intptr_t position
-);
-
-void
-rodeo_string_append(
- rodeo_string_t *self,
- const rodeo_string_t append
-);
-
-void
-rodeo_string_prepend(
- rodeo_string_t *self,
- const rodeo_string_t prepend
-);
-
-void
-rodeo_string_clear(rodeo_string_t *self);
-
-void
-rodeo_string_set(rodeo_string_t *self, char *value);
-
-rodeo_string_t
-rodeo_string_clone(const rodeo_string_t self);
-
-rodeo_string_t
-rodeo_string_format(const char *format, ...);
-
-rodeo_string_t
-rodeo_string_vargs_format(const char *format, va_list vargs);
-
/// --- Log ---
void
diff --git a/include/rodeo_types.h b/include/rodeo_types.h
index a75da40..4ed7767 100644
--- a/include/rodeo_types.h
+++ b/include/rodeo_types.h
@@ -1,5 +1,8 @@
#pragma once
+// external
+#include "stc/cstr.h"
+
// system
#include <stdbool.h>
#include <stdint.h>
@@ -86,18 +89,6 @@ typedef struct
rodeo_frameBuffer_2d_t;
*/
-/// --- String ---
-
-// taken from STC library
-// must match their layout exactly as it will be cast to it.
-// (TODO should write test cases for the string funcs)
-typedef char rodeo_string_value_t;
-typedef struct { rodeo_string_value_t* data; intptr_t size, cap; } rodeo_string_buffer_t;
-typedef union {
- struct { rodeo_string_value_t data[sizeof(rodeo_string_buffer_t) - 1]; unsigned char size; } sml;
- struct { rodeo_string_value_t* data; size_t size, ncap; } lon;
-} rodeo_string_t;
-
/// --- Log ---
typedef
@@ -111,7 +102,7 @@ rodeo_logLevel_t;
typedef
void
-(*rodeo_log_function)(rodeo_string_t text);
+(*rodeo_log_function)(cstr text);
typedef
union