Replace all printfs with tf_printf, which redirects to android logging. Change into the files directory so that sqlite can do its thing. Getting closer.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4203 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
11
src/ssb.js.c
11
src/ssb.js.c
@ -1,6 +1,7 @@
|
||||
#include "ssb.js.h"
|
||||
|
||||
#include "database.js.h"
|
||||
#include "log.h"
|
||||
#include "mem.h"
|
||||
#include "ssb.db.h"
|
||||
#include "ssb.h"
|
||||
@ -699,7 +700,7 @@ static JSValue _tf_ssb_connect(JSContext* context, JSValueConst this_val, int ar
|
||||
if (JS_IsString(args))
|
||||
{
|
||||
const char* address_str = JS_ToCString(context, args);
|
||||
printf("Connecting to %s\n", address_str);
|
||||
tf_printf("Connecting to %s\n", address_str);
|
||||
tf_ssb_connect_str(ssb, address_str);
|
||||
JS_FreeCString(context, address_str);
|
||||
}
|
||||
@ -714,14 +715,14 @@ static JSValue _tf_ssb_connect(JSContext* context, JSValueConst this_val, int ar
|
||||
const char* pubkey_str = JS_ToCString(context, pubkey);
|
||||
if (pubkey_str)
|
||||
{
|
||||
printf("Connecting to %s:%d\n", address_str, port_int);
|
||||
tf_printf("Connecting to %s:%d\n", address_str, port_int);
|
||||
uint8_t pubkey_bin[k_id_bin_len];
|
||||
tf_ssb_id_str_to_bin(pubkey_bin, pubkey_str);
|
||||
tf_ssb_connect(ssb, address_str, port_int, pubkey_bin);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Not connecting to null.\n");
|
||||
tf_printf("Not connecting to null.\n");
|
||||
}
|
||||
JS_FreeCString(context, pubkey_str);
|
||||
JS_FreeCString(context, address_str);
|
||||
@ -858,7 +859,7 @@ void tf_ssb_run_file(JSContext* context, const char* file_name)
|
||||
FILE* file = fopen(file_name, "rb");
|
||||
if (!file)
|
||||
{
|
||||
printf("Unable to open %s: %s.", file_name, strerror(errno));
|
||||
tf_printf("Unable to open %s: %s.", file_name, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -874,7 +875,7 @@ void tf_ssb_run_file(JSContext* context, const char* file_name)
|
||||
JSValue result = JS_Eval(context, source, file_size, file_name, 0);
|
||||
if (tf_util_report_error(context, result))
|
||||
{
|
||||
printf("Error running %s.\n", file_name);
|
||||
tf_printf("Error running %s.\n", file_name);
|
||||
}
|
||||
|
||||
JSRuntime* runtime = JS_GetRuntime(context);
|
||||
|
Reference in New Issue
Block a user