X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_sqlite3.cpp;h=932d427d2451a8f9768438b575ddaaa74aa9773c;hb=56b4dc61e49e4218544f51ac9a25ab3ece60a782;hp=e81e990252c7e9b115f1865c6b3fe038306e1bec;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index e81e99025..932d427d2 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -1,10 +1,16 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2007-2009 Dennis Friis - * Copyright (C) 2007, 2009 Craig Edwards - * Copyright (C) 2008 Pippijn van Steenhoven + * Copyright (C) 2019 linuxdaemon + * Copyright (C) 2015 Daniel Vassdal + * Copyright (C) 2013-2014, 2016-2019 Sadie Powell + * Copyright (C) 2013-2014, 2016 Attila Molnar + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2012, 2016 Adam + * Copyright (C) 2012 ChrisTX + * Copyright (C) 2010 Daniel De Graaf + * Copyright (C) 2007, 2009 Craig Edwards + * Copyright (C) 2007 Dennis Friis * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -22,6 +28,7 @@ /// $CompilerFlags: find_compiler_flags("sqlite3") /// $LinkerFlags: find_linker_flags("sqlite3" "-lsqlite3") +/// $PackageInfo: require_system("arch") pkgconf sqlite /// $PackageInfo: require_system("centos") pkgconfig sqlite-devel /// $PackageInfo: require_system("darwin") pkg-config sqlite3 /// $PackageInfo: require_system("debian") libsqlite3-dev pkg-config @@ -30,6 +37,10 @@ #include "inspircd.h" #include "modules/sql.h" +#ifdef __GNUC__ +# pragma GCC diagnostic push +#endif + // Fix warnings about the use of `long long` on C++03. #if defined __clang__ # pragma clang diagnostic ignored "-Wc++11-long-long" @@ -39,6 +50,10 @@ #include +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + #ifdef _WIN32 # pragma comment(lib, "sqlite3.lib") #endif @@ -103,7 +118,9 @@ class SQLConn : public SQL::Provider reference config; public: - SQLConn(Module* Parent, ConfigTag* tag) : SQL::Provider(Parent, "SQL/" + tag->getString("id")), config(tag) + SQLConn(Module* Parent, ConfigTag* tag) + : SQL::Provider(Parent, tag->getString("id")) + , config(tag) { std::string host = tag->getString("hostname"); if (sqlite3_open_v2(host.c_str(), &conn, SQLITE_OPEN_READWRITE, 0) != SQLITE_OK) @@ -174,6 +191,7 @@ class SQLConn : public SQL::Provider void Submit(SQL::Query* query, const std::string& q) CXX11_OVERRIDE { + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Executing SQLite3 query: " + q); Query(query, q); delete query; } @@ -264,7 +282,7 @@ class ModuleSQLite3 : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides SQLite3 support", VF_VENDOR); + return Version("Provides the ability for SQL modules to query a SQLite 3 database.", VF_VENDOR); } };