Exported libsdl3game from the sdl3-gametest demo project

This commit is contained in:
2025-08-03 10:07:35 -04:00
commit 5bd7803051
40 changed files with 4545 additions and 0 deletions

15
src/staticstring.c Normal file
View File

@@ -0,0 +1,15 @@
#include <sdlerror.h>
#include "staticstring.h"
ErrorContext *string_initialize(string *obj, char *init)
{
PREPARE_ERROR(errctx);
FAIL_ZERO_RETURN(errctx, obj, ERR_NULLPOINTER, "Attempted to initialize NULL string reference");
if ( init != NULL ) {
strncpy((char *)&obj->data, init, MAX_STRING_LENGTH);
} else {
memset(&obj->data, 0x00, sizeof(string));
}
obj->refcount = 1;
SUCCEED_RETURN(errctx);
}