Minor cleanup to sqlite extension init.

This commit is contained in:
casey langen 2023-07-12 19:13:32 -07:00
parent 304040d09c
commit f1a88e4e71

View File

@ -129,11 +129,7 @@ static void regexpFunc(sqlite3_context* context, int nArg, sqlite3_value** apArg
sqlite3_result_int(context, std::regex_search(matchAgainst, *regex, kMatchFlags) ? 1 : 0);
}
namespace musik { namespace core { namespace db {
namespace SqliteExtensions {
int Register(sqlite3* db) {
static int regex_init(sqlite3* db) {
static const struct Scalar {
const char* zName; /* Function name */
unsigned char nArg; /* Number of arguments */
@ -155,6 +151,15 @@ namespace musik { namespace core { namespace db {
0,
0);
}
return rc;
}
namespace musik { namespace core { namespace db {
namespace SqliteExtensions {
int Register(sqlite3* db) {
int rc = regex_init(db);
if (rc != SQLITE_OK) {
return rc;
}