Create a util.js.{h,c} from some common things.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3681 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-11-03 22:15:46 +00:00
parent 03a2367532
commit fde7fb4270
9 changed files with 129 additions and 155 deletions

View File

@ -1,6 +1,7 @@
#include "file.js.h"
#include "task.h"
#include "util.js.h"
#include <malloc.h>
#include <stdbool.h>
@ -177,7 +178,7 @@ static JSValue _file_write_file(JSContext* context, JSValueConst this_val, int a
const char* file_name = JS_ToCString(context, argv[0]);
size_t size;
uint8_t* buffer = tf_try_get_array_buffer(context, &size, argv[1]);
uint8_t* buffer = tf_util_try_get_array_buffer(context, &size, argv[1]);
bool is_array_buffer = false;
if (buffer)
{