Add missing statics, and remove the 'tildefriends check' command.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4838 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2024-02-10 16:50:00 +00:00
parent 51a327c52d
commit 6c5a7b0751
17 changed files with 93 additions and 304 deletions

View File

@ -75,7 +75,6 @@ static int _tf_command_import(const char* file, int argc, char* argv[]);
static int _tf_command_export(const char* file, int argc, char* argv[]);
static int _tf_command_run(const char* file, int argc, char* argv[]);
static int _tf_command_sandbox(const char* file, int argc, char* argv[]);
static int _tf_command_check(const char* file, int argc, char* argv[]);
static int _tf_command_usage(const char* file, int argc, char* argv[]);
typedef struct _command_t {
@ -90,7 +89,6 @@ const command_t k_commands[] = {
{ "import", _tf_command_import, "Import apps to SSB." },
{ "export", _tf_command_export, "Export apps from SSB." },
{ "test", _tf_command_test, "Test SSB." },
{ "check", _tf_command_check, "Validate messages in the SSB database." },
};
static int _tf_command_test(const char* file, int argc, char* argv[])
@ -519,57 +517,6 @@ xopt_help:
}
#if !defined(__ANDROID__)
static int _tf_command_check(const char* file, int argc, char* argv[])
{
typedef struct args_t {
bool help;
} args_t;
xoptOption options[] = {
{ "help", 'h', offsetof(args_t, help), NULL, XOPT_TYPE_BOOL, NULL, "Shows this help message." },
XOPT_NULLOPTION,
};
args_t args = { 0 };
const char** extras = NULL;
int extra_count = 0;
const char *err = NULL;
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "check [options]", "options:", NULL, 15);
if (err)
{
fprintf(stderr, "Error: %s\n", err);
return 2;
}
bool result = true;
sqlite3* db = NULL;
sqlite3_open(k_db_path_default, &db);
if (extra_count)
{
for (int i = 0; i < extra_count; i++)
{
result = result && tf_ssb_db_check(db, extras[i]);
}
}
else
{
result = tf_ssb_db_check(db, NULL);
}
sqlite3_close(db);
if (extras)
{
free((void*)extras);
}
return result ? EXIT_SUCCESS : EXIT_FAILURE;
xopt_help:
if (extras)
{
free((void*)extras);
}
return 1;
}
static int _tf_command_usage(const char* file, int argc, char* argv[])
{
tf_printf("Usage: %s command [command-options]\n", file);