New option: -db FILE ; Undocumented currently
This commit is contained in:
parent
c31808e8c4
commit
c490a1a0bc
@ -8,7 +8,7 @@
|
|||||||
#include "irccolors.h"
|
#include "irccolors.h"
|
||||||
#include "stmt.h"
|
#include "stmt.h"
|
||||||
|
|
||||||
#define DBFILE "test.sqlite"
|
#define DBFILE "probotic_data.sqlite"
|
||||||
|
|
||||||
#define DBERR(line) do { \
|
#define DBERR(line) do { \
|
||||||
const int e = line; \
|
const int e = line; \
|
||||||
@ -21,12 +21,13 @@
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
static char const * db = DBFILE;
|
||||||
static sqlite3 * connection = NULL;
|
static sqlite3 * connection = NULL;
|
||||||
|
|
||||||
DECL int
|
DECL int
|
||||||
api_init(void)
|
api_init(void)
|
||||||
{
|
{
|
||||||
DBERR(sqlite3_open(DBFILE, &connection));
|
DBERR(sqlite3_open(db, &connection));
|
||||||
// dont you fucking dare to remove this spacing
|
// dont you fucking dare to remove this spacing
|
||||||
DBERR(stmt_prepare(remind_stmt));
|
DBERR(stmt_prepare(remind_stmt));
|
||||||
DBERR(stmt_prepare(set_repo_stmt));
|
DBERR(stmt_prepare(set_repo_stmt));
|
||||||
|
@ -78,7 +78,9 @@ main (int argc,
|
|||||||
{ goto help; }
|
{ goto help; }
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{ goto nop; }
|
{ goto nop; }
|
||||||
if (strcmp(arg, "server") == 0)
|
if (strcmp(arg, "db") == 0)
|
||||||
|
{ db = argv[1]; }
|
||||||
|
else if (strcmp(arg, "server") == 0)
|
||||||
{ FREE(creds.server); creds.server = argv[1]; }
|
{ FREE(creds.server); creds.server = argv[1]; }
|
||||||
else if (strcmp(arg, "port") == 0)
|
else if (strcmp(arg, "port") == 0)
|
||||||
{ creds.port = atoi(argv[1]); }
|
{ creds.port = atoi(argv[1]); }
|
||||||
|
12
src/parse.c
12
src/parse.c
@ -219,18 +219,6 @@ is_admin(char const * user)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL void
|
|
||||||
clean_admin_list()
|
|
||||||
{
|
|
||||||
if (admins == NULL)
|
|
||||||
{ return; }
|
|
||||||
|
|
||||||
for (size_t i = 0; admins[i]; ++i)
|
|
||||||
{ free(admins[i]); }
|
|
||||||
|
|
||||||
FREE(admins);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
creds_free_password(void)
|
creds_free_password(void)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user