diff options
| author | realtradam <[email protected]> | 2023-03-08 05:16:04 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-03-08 05:16:04 -0500 |
| commit | 3f36ef9b24e2ce978461291d84e293776c41eb66 (patch) | |
| tree | be531c569f3a1cedebd66ec7b2dd389ad94d4b37 /include/rodeo.h | |
| parent | 4b410af18ed7e76b42be1d2ab2ebdfe8e5bf97e8 (diff) | |
| download | RodeoKit-3f36ef9b24e2ce978461291d84e293776c41eb66.tar.gz RodeoKit-3f36ef9b24e2ce978461291d84e293776c41eb66.zip | |
added logging system and improved string integration
Diffstat (limited to 'include/rodeo.h')
| -rw-r--r-- | include/rodeo.h | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/include/rodeo.h b/include/rodeo.h index bd156cb..ef9c94f 100644 --- a/include/rodeo.h +++ b/include/rodeo.h @@ -6,6 +6,7 @@ #include <stdbool.h> #include <stdio.h> #include <stdint.h> +#include <stdarg.h> #include <string.h> #include <limits.h> @@ -15,7 +16,15 @@ #define mrodeo_defer_do(start, end) for( \ int mrodeo_macrovar(_macrovar_) = (start, 0); \ !mrodeo_macrovar(_macrovar_); \ - (mrodeo_macrovar(_macrovar_) += 1), end) \ + (mrodeo_macrovar(_macrovar_) += 1), end) \ + +#define \ +mrodeo_vargs_do(final_arg) \ + va_list vargs; \ + mrodeo_defer_do( \ + va_start(vargs, final_arg), \ + va_end(vargs) \ + ) \ /// --- Math --- @@ -66,7 +75,7 @@ rodeo_frame_end(void); void rodeo_mainloop_run( - rodeo_mainloop_func main_loop_function + rodeo_mainloop_function main_loop_func ); bool @@ -78,7 +87,7 @@ rodeo_set_quit(bool quit); void rodeo_debug_text_draw(uint16_t x, uint16_t y, const char *format, ...); -rodeo_string_p +rodeo_string_t rodeo_renderer_name_get(void); void @@ -92,39 +101,54 @@ rodeo_rectangle_draw( /// --- String --- -rodeo_string_p +rodeo_string_t rodeo_string_create(const char *c_string); void -rodeo_string_destroy(rodeo_string_p self); +rodeo_string_destroy(rodeo_string_t *self); char* -rodeo_string_to_cstr(rodeo_string_p self); +rodeo_string_to_cstr(rodeo_string_t *self); const char* -rodeo_string_to_constcstr(rodeo_string_p self); +rodeo_string_to_constcstr(const rodeo_string_t *self); void rodeo_string_insert( - rodeo_string_p self, - const rodeo_string_p insert, + rodeo_string_t *self, + const rodeo_string_t insert, intptr_t position ); void rodeo_string_append( - rodeo_string_p self, - const rodeo_string_p append + rodeo_string_t *self, + const rodeo_string_t append ); void rodeo_string_prepend( - rodeo_string_p self, - const rodeo_string_p prepend + rodeo_string_t *self, + const rodeo_string_t prepend ); void -rodeo_string_clear(rodeo_string_p self); +rodeo_string_clear(rodeo_string_t *self); void -rodeo_string_set(rodeo_string_p self, char* value); +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, ...); + +/// --- Log --- + +void +rodeo_log( + rodeo_loglevel_t loglevel, + const char *format, + ... +); |
