Add all the files I think I need to the .apk, and add zlib, so I can attempt to access them using minizip.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4205 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-03-08 17:46:19 +00:00
parent 9127a18ff0
commit 50e48af7c4
245 changed files with 80258 additions and 43 deletions

View File

@ -854,47 +854,6 @@ static void _tf_ssb_on_broadcasts_changed_callback(tf_ssb_t* ssb, void* user_dat
JS_FreeValue(context, response);
}
void tf_ssb_run_file(JSContext* context, const char* file_name)
{
FILE* file = fopen(file_name, "rb");
if (!file)
{
tf_printf("Unable to open %s: %s.", file_name, strerror(errno));
return;
}
char* source = NULL;
fseek(file, 0, SEEK_END);
long file_size = ftell(file);
fseek(file, 0, SEEK_SET);
source = tf_malloc(file_size + 1);
int bytes_read = fread(source, 1, file_size, file);
source[bytes_read] = '\0';
fclose(file);
JSValue result = JS_Eval(context, source, file_size, file_name, 0);
if (tf_util_report_error(context, result))
{
tf_printf("Error running %s.\n", file_name);
}
JSRuntime* runtime = JS_GetRuntime(context);
while (JS_IsJobPending(runtime))
{
JSContext* context2 = NULL;
int r = JS_ExecutePendingJob(runtime, &context2);
JSValue result = JS_GetException(context2);
tf_util_report_error(context, result);
if (r == 0)
{
break;
}
}
JS_FreeValue(context, result);
tf_free(source);
}
static JSValue _tf_ssb_add_event_listener(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_ssb_t* ssb = JS_GetOpaque(this_val, _tf_ssb_classId);