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:
41
src/ssb.js.c
41
src/ssb.js.c
@ -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);
|
||||
|
Reference in New Issue
Block a user