forked from cory/tildefriends
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:
31
src/main.c
31
src/main.c
@ -1,3 +1,4 @@
|
||||
#include "log.h"
|
||||
#include "mem.h"
|
||||
#include "ssb.h"
|
||||
#include "ssb.db.h"
|
||||
@ -215,13 +216,13 @@ static int _tf_command_import(const char* file, int argc, char* argv[])
|
||||
{
|
||||
for (int i = 0; i < extra_count; i++)
|
||||
{
|
||||
printf("Importing %s...\n", extras[i]);
|
||||
tf_printf("Importing %s...\n", extras[i]);
|
||||
tf_ssb_import(ssb, args.user, extras[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Importing %s...\n", "apps");
|
||||
tf_printf("Importing %s...\n", "apps");
|
||||
tf_ssb_import(ssb, args.user, "apps");
|
||||
}
|
||||
tf_ssb_destroy(ssb);
|
||||
@ -275,7 +276,7 @@ static int _tf_command_export(const char* file, int argc, char* argv[])
|
||||
{
|
||||
for (int i = 0; i < extra_count; i++)
|
||||
{
|
||||
printf("Exporting %s...\n", extras[i]);
|
||||
tf_printf("Exporting %s...\n", extras[i]);
|
||||
tf_ssb_export(ssb, extras[i]);
|
||||
}
|
||||
}
|
||||
@ -295,7 +296,7 @@ static int _tf_command_export(const char* file, int argc, char* argv[])
|
||||
{
|
||||
char buffer[256];
|
||||
snprintf(buffer, sizeof(buffer), "/~%s/%s", args.user, k_export[i]);
|
||||
printf("Exporting %s...\n", buffer);
|
||||
tf_printf("Exporting %s...\n", buffer);
|
||||
tf_ssb_export(ssb, buffer);
|
||||
}
|
||||
}
|
||||
@ -651,11 +652,11 @@ xopt_help:
|
||||
|
||||
static int _tf_command_usage(const char* file, int argc, char* argv[])
|
||||
{
|
||||
printf("Usage: %s command [command-options]\n", file);
|
||||
printf("commands:\n");
|
||||
tf_printf("Usage: %s command [command-options]\n", file);
|
||||
tf_printf("commands:\n");
|
||||
for (int i = 0; i < (int)_countof(k_commands); i++)
|
||||
{
|
||||
printf(" %s - %s\n", k_commands[i].name, k_commands[i].description);
|
||||
tf_printf(" %s - %s\n", k_commands[i].name, k_commands[i].description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -669,7 +670,7 @@ static void _do_leak_checks(int sig)
|
||||
|
||||
static void _backtrace_error(void* data, const char* message, int errnum)
|
||||
{
|
||||
printf("libbacktrace error %d: %s\n", errnum, message);
|
||||
tf_printf("libbacktrace error %d: %s\n", errnum, message);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
@ -732,3 +733,17 @@ done:
|
||||
tf_mem_shutdown();
|
||||
return result;
|
||||
}
|
||||
|
||||
static void _tf_android_thread(void* user_data)
|
||||
{
|
||||
char* args[] = { "tildefriends" };
|
||||
main(_countof(args), args);
|
||||
}
|
||||
|
||||
void tf_android()
|
||||
{
|
||||
uv_thread_t thread_id = 0;
|
||||
tf_printf("TEST: Starting a thread.\n");
|
||||
uv_thread_create(&thread_id, _tf_android_thread, NULL);
|
||||
tf_printf("TEST: Post-thread start.\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user