From 9d076c3c03f87f8411ee304606cf48e7e5dd974e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 17 Mar 2013 20:19:29 +0100 Subject: [PATCH] Refactor #includes (Part 3). --- components/checker/Makefile.am | 3 +- components/checker/checkercomponent.cpp | 3 +- components/checker/checkercomponent.h | 2 + components/checker/i2-checker.h | 34 ----- components/compat/Makefile.am | 3 +- components/compat/compatcomponent.cpp | 31 +++-- components/compat/compatcomponent.h | 8 +- components/compat/i2-compat.h | 40 ------ components/delegation/delegationcomponent.cpp | 3 +- components/delegation/delegationcomponent.h | 4 + components/delegation/i2-delegation.h | 34 ----- components/demo/Makefile.am | 3 +- components/demo/democomponent.cpp | 3 +- components/demo/democomponent.h | 3 + components/demo/i2-demo.h | 35 ----- components/livestatus/Makefile.am | 3 +- components/livestatus/andfilter.cpp | 2 +- components/livestatus/andfilter.h | 4 + components/livestatus/attributefilter.cpp | 3 +- components/livestatus/attributefilter.h | 4 + components/livestatus/column.cpp | 2 +- components/livestatus/column.h | 5 + components/livestatus/combinerfilter.cpp | 2 +- components/livestatus/combinerfilter.h | 4 + components/livestatus/commentstable.cpp | 3 +- components/livestatus/commentstable.h | 4 + components/livestatus/component.cpp | 4 +- components/livestatus/component.h | 6 + components/livestatus/connection.cpp | 3 +- components/livestatus/connection.h | 4 + components/livestatus/contactgroupstable.cpp | 3 +- components/livestatus/contactgroupstable.h | 4 + components/livestatus/contactstable.cpp | 3 +- components/livestatus/contactstable.h | 4 + components/livestatus/downtimestable.cpp | 3 +- components/livestatus/downtimestable.h | 4 + components/livestatus/filter.cpp | 3 +- components/livestatus/filter.h | 2 + components/livestatus/hoststable.cpp | 3 +- components/livestatus/hoststable.h | 4 + components/livestatus/i2-livestatus.h | 54 -------- components/livestatus/negatefilter.cpp | 2 +- components/livestatus/negatefilter.h | 4 + components/livestatus/orfilter.cpp | 2 +- components/livestatus/orfilter.h | 4 + components/livestatus/query.cpp | 10 +- components/livestatus/query.h | 9 +- components/livestatus/servicestable.cpp | 4 +- components/livestatus/servicestable.h | 4 + components/livestatus/statustable.cpp | 2 +- components/livestatus/statustable.h | 4 + components/livestatus/table.cpp | 13 +- components/livestatus/table.h | 3 + components/notification/i2-notification.h | 35 ----- .../notification/notificationcomponent.cpp | 3 +- .../notification/notificationcomponent.h | 3 + components/replication/i2-replication.h | 35 ----- .../replication/replicationcomponent.cpp | 5 +- components/replication/replicationcomponent.h | 9 +- icinga-app/icinga.cpp | 4 +- lib/config/config_lexer.cc | 129 +++++++++--------- lib/config/config_lexer.ll | 7 +- lib/config/config_parser.cc | 115 +++++++++------- lib/config/config_parser.yy | 11 +- lib/config/configcompiler.cpp | 4 +- lib/config/configcompiler.h | 3 + lib/config/configcompilercontext.cpp | 3 +- lib/config/configcompilercontext.h | 8 +- lib/config/configitem.cpp | 3 +- lib/config/configitem.h | 2 + lib/config/configitembuilder.cpp | 3 +- lib/config/configitembuilder.h | 6 + lib/config/configtype.cpp | 3 +- lib/config/configtype.h | 4 + lib/config/expression.cpp | 3 +- lib/config/expression.h | 3 + lib/config/expressionlist.cpp | 2 +- lib/config/expressionlist.h | 3 + lib/config/i2-config.h | 13 +- lib/config/typerule.cpp | 5 +- lib/config/typerule.h | 4 + lib/config/typerulelist.cpp | 3 +- lib/config/typerulelist.h | 1 + lib/icinga/api.cpp | 3 +- lib/icinga/api.h | 3 + lib/icinga/checkresultmessage.cpp | 2 +- lib/icinga/checkresultmessage.h | 3 + lib/icinga/cib.cpp | 2 +- lib/icinga/cib.h | 1 + lib/icinga/externalcommandprocessor.cpp | 10 +- lib/icinga/externalcommandprocessor.h | 6 + lib/icinga/host.cpp | 6 +- lib/icinga/host.h | 5 + lib/icinga/hostgroup.cpp | 2 +- lib/icinga/hostgroup.h | 5 + lib/icinga/i2-icinga.h | 33 ----- lib/icinga/icingaapplication.cpp | 3 +- lib/icinga/icingaapplication.h | 1 + lib/icinga/macroprocessor.cpp | 4 +- lib/icinga/macroprocessor.h | 4 + lib/icinga/notification.cpp | 4 +- lib/icinga/notification.h | 5 + lib/icinga/notificationrequestmessage.cpp | 2 +- lib/icinga/notificationrequestmessage.h | 4 + lib/icinga/nullchecktask.cpp | 4 +- lib/icinga/nullchecktask.h | 1 + lib/icinga/perfdatawriter.cpp | 6 +- lib/icinga/perfdatawriter.h | 2 + lib/icinga/pluginchecktask.cpp | 4 +- lib/icinga/pluginchecktask.h | 2 + lib/icinga/pluginnotificationtask.cpp | 6 +- lib/icinga/pluginnotificationtask.h | 1 + lib/icinga/service-check.cpp | 5 +- lib/icinga/service-comment.cpp | 1 - lib/icinga/service-downtime.cpp | 1 - lib/icinga/service-notification.cpp | 5 +- lib/icinga/service.cpp | 5 +- lib/icinga/service.h | 7 +- lib/icinga/servicegroup.h | 3 + lib/icinga/timeperiod.cpp | 28 +++- lib/icinga/timeperiod.h | 4 + lib/icinga/user.cpp | 3 +- lib/icinga/user.h | 4 + lib/icinga/usergroup.cpp | 2 +- lib/icinga/usergroup.h | 2 + lib/python/i2-python.h | 5 - lib/remoting/Makefile.am | 4 +- lib/remoting/endpoint.cpp | 4 +- lib/remoting/endpoint.h | 4 + lib/remoting/endpointmanager.cpp | 2 +- lib/remoting/endpointmanager.h | 2 + lib/remoting/i2-remoting.h | 8 -- lib/remoting/jsonrpcconnection.cpp | 2 +- lib/remoting/jsonrpcconnection.h | 2 + lib/remoting/messagepart.cpp | 2 +- lib/remoting/messagepart.h | 3 + lib/remoting/requestmessage.cpp | 2 +- lib/remoting/requestmessage.h | 3 + lib/remoting/responsemessage.cpp | 2 +- lib/remoting/responsemessage.h | 3 + 140 files changed, 550 insertions(+), 544 deletions(-) delete mode 100644 components/checker/i2-checker.h delete mode 100644 components/compat/i2-compat.h delete mode 100644 components/delegation/i2-delegation.h delete mode 100644 components/demo/i2-demo.h delete mode 100644 components/livestatus/i2-livestatus.h delete mode 100644 components/notification/i2-notification.h delete mode 100644 components/replication/i2-replication.h diff --git a/components/checker/Makefile.am b/components/checker/Makefile.am index d7897b28c..e8e15cbcb 100644 --- a/components/checker/Makefile.am +++ b/components/checker/Makefile.am @@ -12,8 +12,7 @@ EXTRA_DIST = \ libchecker_la_SOURCES = \ checkercomponent.cpp \ checkercomponent.h \ - checker-type.cpp \ - i2-checker.h + checker-type.cpp libchecker_la_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index 136e63cd0..9140ae7f5 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-checker.h" +#include "checker/checkercomponent.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/components/checker/checkercomponent.h b/components/checker/checkercomponent.h index d3139b91e..253e8fa16 100644 --- a/components/checker/checkercomponent.h +++ b/components/checker/checkercomponent.h @@ -20,6 +20,8 @@ #ifndef CHECKERCOMPONENT_H #define CHECKERCOMPONENT_H +#include "icinga/service.h" +#include "remoting/endpoint.h" #include "base/dynamicobject.h" #include #include diff --git a/components/checker/i2-checker.h b/components/checker/i2-checker.h deleted file mode 100644 index 733bcacfb..000000000 --- a/components/checker/i2-checker.h +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2CHECKER_H -#define I2CHECKER_H - -/** - * @defgroup checker Checker component - * - * The Checker component executes service checks. - */ - -#include "base/i2-base.h" -#include "icinga/i2-icinga.h" - -#include "checker/checkercomponent.h" - -#endif /* I2CHECKER_H */ diff --git a/components/compat/Makefile.am b/components/compat/Makefile.am index 5c5851f8a..712938ff4 100644 --- a/components/compat/Makefile.am +++ b/components/compat/Makefile.am @@ -12,8 +12,7 @@ EXTRA_DIST = \ libcompat_la_SOURCES = \ compatcomponent.cpp \ compatcomponent.h \ - compat-type.cpp \ - i2-compat.h + compat-type.cpp libcompat_la_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index d77dd7c74..0ca564c04 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -17,14 +17,21 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-compat.h" +#include "compat/compatcomponent.h" +#include "icinga/externalcommandprocessor.h" +#include "icinga/icingaapplication.h" +#include "icinga/cib.h" +#include "icinga/hostgroup.h" +#include "icinga/servicegroup.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" #include "base/exception.h" +#include "base/application.h" #include #include #include +#include using namespace icinga; @@ -193,7 +200,7 @@ void CompatComponent::CommandPipeThread(const String& commandPath) } #endif /* _WIN32 */ -void CompatComponent::DumpComments(ostream& fp, const Service::Ptr& owner, CompatObjectType type) +void CompatComponent::DumpComments(std::ostream& fp, const Service::Ptr& owner, CompatObjectType type) { Service::Ptr service; Host::Ptr host; @@ -230,7 +237,7 @@ void CompatComponent::DumpComments(ostream& fp, const Service::Ptr& owner, Compa } } -void CompatComponent::DumpDowntimes(ostream& fp, const Service::Ptr& owner, CompatObjectType type) +void CompatComponent::DumpDowntimes(std::ostream& fp, const Service::Ptr& owner, CompatObjectType type) { Host::Ptr host = owner->GetHost(); @@ -278,7 +285,7 @@ void CompatComponent::DumpDowntimes(ostream& fp, const Service::Ptr& owner, Comp } } -void CompatComponent::DumpHostStatus(ostream& fp, const Host::Ptr& host) +void CompatComponent::DumpHostStatus(std::ostream& fp, const Host::Ptr& host) { fp << "hoststatus {" << "\n" << "\t" << "host_name=" << host->GetName() << "\n"; @@ -298,7 +305,7 @@ void CompatComponent::DumpHostStatus(ostream& fp, const Host::Ptr& host) } } -void CompatComponent::DumpHostObject(ostream& fp, const Host::Ptr& host) +void CompatComponent::DumpHostObject(std::ostream& fp, const Host::Ptr& host) { fp << "define host {" << "\n" << "\t" << "host_name" << "\t" << host->GetName() << "\n" @@ -338,7 +345,7 @@ void CompatComponent::DumpHostObject(ostream& fp, const Host::Ptr& host) << "\n"; } -void CompatComponent::DumpServiceStatusAttrs(ostream& fp, const Service::Ptr& service, CompatObjectType type) +void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Ptr& service, CompatObjectType type) { ASSERT(service->OwnsLock()); @@ -401,7 +408,7 @@ void CompatComponent::DumpServiceStatusAttrs(ostream& fp, const Service::Ptr& se << "\t" << "last_notification=" << service->GetLastNotification() << "\n"; } -void CompatComponent::DumpServiceStatus(ostream& fp, const Service::Ptr& service) +void CompatComponent::DumpServiceStatus(std::ostream& fp, const Service::Ptr& service) { Host::Ptr host = service->GetHost(); @@ -424,7 +431,7 @@ void CompatComponent::DumpServiceStatus(ostream& fp, const Service::Ptr& service DumpComments(fp, service, CompatTypeService); } -void CompatComponent::DumpServiceObject(ostream& fp, const Service::Ptr& service) +void CompatComponent::DumpServiceObject(std::ostream& fp, const Service::Ptr& service) { Host::Ptr host = service->GetHost(); @@ -486,8 +493,8 @@ void CompatComponent::StatusTimerHandler(void) String statuspathtmp = statuspath + ".tmp"; /* XXX make this a global definition */ String objectspathtmp = objectspath + ".tmp"; - ofstream statusfp; - statusfp.open(statuspathtmp.CStr(), ofstream::out | ofstream::trunc); + std::ofstream statusfp; + statusfp.open(statuspathtmp.CStr(), std::ofstream::out | std::ofstream::trunc); statusfp << std::fixed; @@ -521,8 +528,8 @@ void CompatComponent::StatusTimerHandler(void) << "\t" << "}" << "\n" << "\n"; - ofstream objectfp; - objectfp.open(objectspathtmp.CStr(), ofstream::out | ofstream::trunc); + std::ofstream objectfp; + objectfp.open(objectspathtmp.CStr(), std::ofstream::out | std::ofstream::trunc); objectfp << std::fixed; diff --git a/components/compat/compatcomponent.h b/components/compat/compatcomponent.h index ed37e196e..224edd52b 100644 --- a/components/compat/compatcomponent.h +++ b/components/compat/compatcomponent.h @@ -20,7 +20,11 @@ #ifndef COMPATCOMPONENT_H #define COMPATCOMPONENT_H +#include "icinga/host.h" +#include "icinga/service.h" +#include "base/dynamicobject.h" #include "base/objectlock.h" +#include namespace icinga { @@ -68,7 +72,7 @@ private: void DumpServiceStatusAttrs(std::ostream& fp, const Service::Ptr& service, CompatObjectType type); template - void DumpNameList(ostream& fp, const T& list) + void DumpNameList(std::ostream& fp, const T& list) { typename T::const_iterator it; bool first = true; @@ -84,7 +88,7 @@ private: } template - void DumpStringList(ostream& fp, const T& list) + void DumpStringList(std::ostream& fp, const T& list) { typename T::const_iterator it; bool first = true; diff --git a/components/compat/i2-compat.h b/components/compat/i2-compat.h deleted file mode 100644 index d50747e02..000000000 --- a/components/compat/i2-compat.h +++ /dev/null @@ -1,40 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2COMPAT_H -#define I2COMPAT_H - -/** - * @defgroup compat Compat component - * - * The compat component implements compatibility functionality for Icinga 1.x. - */ - -#include "base/i2-base.h" -#include "remoting/i2-remoting.h" -#include "icinga/i2-icinga.h" - -#include - -using std::ofstream; -using std::endl; - -#include "compatcomponent.h" - -#endif /* I2COMPAT_H */ diff --git a/components/delegation/delegationcomponent.cpp b/components/delegation/delegationcomponent.cpp index 0475a2b7b..b706907f1 100644 --- a/components/delegation/delegationcomponent.cpp +++ b/components/delegation/delegationcomponent.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-delegation.h" +#include "delegation/delegationcomponent.h" +#include "remoting/endpointmanager.h" #include "base/objectlock.h" #include "base/logger_fwd.h" #include diff --git a/components/delegation/delegationcomponent.h b/components/delegation/delegationcomponent.h index 538bcb625..51465888c 100644 --- a/components/delegation/delegationcomponent.h +++ b/components/delegation/delegationcomponent.h @@ -20,6 +20,10 @@ #ifndef DELEGATIONCOMPONENT_H #define DELEGATIONCOMPONENT_H +#include "icinga/service.h" +#include "remoting/endpoint.h" +#include "base/dynamicobject.h" + namespace icinga { diff --git a/components/delegation/i2-delegation.h b/components/delegation/i2-delegation.h deleted file mode 100644 index 62502fa94..000000000 --- a/components/delegation/i2-delegation.h +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2DELEGATION_H -#define I2DELEGATION_H - -/** - * @defgroup delegation Delegation component - * - * The Delegation component delegates service checks to the checker component. - */ - -#include "base/i2-base.h" -#include "icinga/i2-icinga.h" - -#include "delegation/delegationcomponent.h" - -#endif /* I2DELEGATION_H */ diff --git a/components/demo/Makefile.am b/components/demo/Makefile.am index 58dd52055..a7a541d52 100644 --- a/components/demo/Makefile.am +++ b/components/demo/Makefile.am @@ -12,8 +12,7 @@ EXTRA_DIST = \ libdemo_la_SOURCES = \ democomponent.cpp \ democomponent.h \ - demo-type.cpp \ - i2-demo.h + demo-type.cpp libdemo_la_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ diff --git a/components/demo/democomponent.cpp b/components/demo/democomponent.cpp index 2c89455c0..d5f8ce485 100644 --- a/components/demo/democomponent.cpp +++ b/components/demo/democomponent.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-demo.h" +#include "demo/democomponent.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/logger_fwd.h" #include diff --git a/components/demo/democomponent.h b/components/demo/democomponent.h index c832ba9bd..930215cdc 100644 --- a/components/demo/democomponent.h +++ b/components/demo/democomponent.h @@ -20,6 +20,9 @@ #ifndef DEMOCOMPONENT_H #define DEMOCOMPONENT_H +#include "remoting/endpoint.h" +#include "base/dynamicobject.h" + namespace icinga { diff --git a/components/demo/i2-demo.h b/components/demo/i2-demo.h deleted file mode 100644 index b5a94187d..000000000 --- a/components/demo/i2-demo.h +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2DEMO_H -#define I2DEMO_H - -/** - * @defgroup demo Demo component - * - * The demo component periodically sends demo messages. - */ - -#include "base/i2-base.h" -#include "remoting/i2-remoting.h" -#include "icinga/i2-icinga.h" - -#include "demo/democomponent.h" - -#endif /* I2DEMO_H */ diff --git a/components/livestatus/Makefile.am b/components/livestatus/Makefile.am index 80d64aae4..286aa1d64 100644 --- a/components/livestatus/Makefile.am +++ b/components/livestatus/Makefile.am @@ -46,8 +46,7 @@ liblivestatus_la_SOURCES = \ statustable.cpp \ statustable.h \ table.cpp \ - table.h \ - i2-livestatus.h + table.h liblivestatus_la_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ diff --git a/components/livestatus/andfilter.cpp b/components/livestatus/andfilter.cpp index e68a958eb..73ab38927 100644 --- a/components/livestatus/andfilter.cpp +++ b/components/livestatus/andfilter.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/andfilter.h" #include using namespace icinga; diff --git a/components/livestatus/andfilter.h b/components/livestatus/andfilter.h index 748ef85f1..520606058 100644 --- a/components/livestatus/andfilter.h +++ b/components/livestatus/andfilter.h @@ -20,6 +20,10 @@ #ifndef ANDFILTER_H #define ANDFILTER_H +#include "livestatus/combinerfilter.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/attributefilter.cpp b/components/livestatus/attributefilter.cpp index 0b306597a..c02dc93d8 100644 --- a/components/livestatus/attributefilter.cpp +++ b/components/livestatus/attributefilter.cpp @@ -17,8 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/attributefilter.h" #include "base/convert.h" +#include "base/array.h" #include using namespace icinga; diff --git a/components/livestatus/attributefilter.h b/components/livestatus/attributefilter.h index eb508dc92..0e3f3b71f 100644 --- a/components/livestatus/attributefilter.h +++ b/components/livestatus/attributefilter.h @@ -20,6 +20,10 @@ #ifndef ATTRIBUTEFILTER_H #define ATTRIBUTEFILTER_H +#include "livestatus/filter.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/column.cpp b/components/livestatus/column.cpp index 2de70cead..2ab9e7fce 100644 --- a/components/livestatus/column.cpp +++ b/components/livestatus/column.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/column.h" using namespace icinga; using namespace livestatus; diff --git a/components/livestatus/column.h b/components/livestatus/column.h index 94718a4fe..e259a6234 100644 --- a/components/livestatus/column.h +++ b/components/livestatus/column.h @@ -20,6 +20,11 @@ #ifndef COLUMN_H #define COLUMN_H +#include "base/value.h" +#include + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/combinerfilter.cpp b/components/livestatus/combinerfilter.cpp index 3f8072ae5..a12d44770 100644 --- a/components/livestatus/combinerfilter.cpp +++ b/components/livestatus/combinerfilter.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/combinerfilter.h" using namespace icinga; using namespace livestatus; diff --git a/components/livestatus/combinerfilter.h b/components/livestatus/combinerfilter.h index 8cb55a1a5..70538172d 100644 --- a/components/livestatus/combinerfilter.h +++ b/components/livestatus/combinerfilter.h @@ -20,6 +20,10 @@ #ifndef COMBINERFILTER_H #define COMBINERFILTER_H +#include "livestatus/filter.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/commentstable.cpp b/components/livestatus/commentstable.cpp index 1d01601e6..777d7f75b 100644 --- a/components/livestatus/commentstable.cpp +++ b/components/livestatus/commentstable.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/commentstable.h" +#include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include diff --git a/components/livestatus/commentstable.h b/components/livestatus/commentstable.h index aaa58dad2..56197e56d 100644 --- a/components/livestatus/commentstable.h +++ b/components/livestatus/commentstable.h @@ -20,6 +20,10 @@ #ifndef COMMENTSTABLE_H #define COMMENTSTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/component.cpp b/components/livestatus/component.cpp index 5d19edaed..c00dc50a1 100644 --- a/components/livestatus/component.cpp +++ b/components/livestatus/component.cpp @@ -17,9 +17,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/component.h" #include "base/dynamictype.h" #include "base/logger_fwd.h" +#include "base/tcpsocket.h" +#include "base/application.h" #include using namespace icinga; diff --git a/components/livestatus/component.h b/components/livestatus/component.h index dbb868b69..9ec3381dd 100644 --- a/components/livestatus/component.h +++ b/components/livestatus/component.h @@ -20,6 +20,12 @@ #ifndef LIVESTATUSCOMPONENT_H #define LIVESTATUSCOMPONENT_H +#include "livestatus/connection.h" +#include "base/dynamicobject.h" +#include "base/socket.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/connection.cpp b/components/livestatus/connection.cpp index 224337ffc..e22c22111 100644 --- a/components/livestatus/connection.cpp +++ b/components/livestatus/connection.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/connection.h" +#include "livestatus/query.h" #include using namespace icinga; diff --git a/components/livestatus/connection.h b/components/livestatus/connection.h index e37887f17..49d36ec02 100644 --- a/components/livestatus/connection.h +++ b/components/livestatus/connection.h @@ -20,6 +20,10 @@ #ifndef LIVESTATUSCONNECTION_H #define LIVESTATUSCONNECTION_H +#include "base/connection.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/contactgroupstable.cpp b/components/livestatus/contactgroupstable.cpp index 834986c3c..309bba856 100644 --- a/components/livestatus/contactgroupstable.cpp +++ b/components/livestatus/contactgroupstable.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/contactgroupstable.h" +#include "icinga/usergroup.h" #include "base/dynamictype.h" #include diff --git a/components/livestatus/contactgroupstable.h b/components/livestatus/contactgroupstable.h index 1d6cd9ce6..6710ffab2 100644 --- a/components/livestatus/contactgroupstable.h +++ b/components/livestatus/contactgroupstable.h @@ -20,6 +20,10 @@ #ifndef CONTACTGROUPSTABLE_H #define CONTACTGROUPSTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/contactstable.cpp b/components/livestatus/contactstable.cpp index f01d31345..a46cae893 100644 --- a/components/livestatus/contactstable.cpp +++ b/components/livestatus/contactstable.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/contactstable.h" +#include "icinga/user.h" #include "base/dynamictype.h" #include diff --git a/components/livestatus/contactstable.h b/components/livestatus/contactstable.h index 1a22f91bb..744f7f178 100644 --- a/components/livestatus/contactstable.h +++ b/components/livestatus/contactstable.h @@ -20,6 +20,10 @@ #ifndef CONTACTSTABLE_H #define CONTACTSTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/downtimestable.cpp b/components/livestatus/downtimestable.cpp index 684cc51c6..0db77a6df 100644 --- a/components/livestatus/downtimestable.cpp +++ b/components/livestatus/downtimestable.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/downtimestable.h" +#include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include diff --git a/components/livestatus/downtimestable.h b/components/livestatus/downtimestable.h index 23e788565..ee38f9bf1 100644 --- a/components/livestatus/downtimestable.h +++ b/components/livestatus/downtimestable.h @@ -20,6 +20,10 @@ #ifndef DOWNTIMESTABLE_H #define DOWNTIMESTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/filter.cpp b/components/livestatus/filter.cpp index bbf262f97..bfae683e0 100644 --- a/components/livestatus/filter.cpp +++ b/components/livestatus/filter.cpp @@ -17,9 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/filter.h" -using namespace icinga; using namespace livestatus; Filter::Filter(void) diff --git a/components/livestatus/filter.h b/components/livestatus/filter.h index d60612075..68dfef619 100644 --- a/components/livestatus/filter.h +++ b/components/livestatus/filter.h @@ -20,6 +20,8 @@ #ifndef FILTER_H #define FILTER_H +#include "livestatus/table.h" + namespace livestatus { diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index e6fcd3c99..5e1786e3a 100644 --- a/components/livestatus/hoststable.cpp +++ b/components/livestatus/hoststable.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/hoststable.h" +#include "icinga/host.h" #include "base/dynamictype.h" #include diff --git a/components/livestatus/hoststable.h b/components/livestatus/hoststable.h index e16524a2a..e299c63d5 100644 --- a/components/livestatus/hoststable.h +++ b/components/livestatus/hoststable.h @@ -20,6 +20,10 @@ #ifndef HOSTSTABLE_H #define HOSTSTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/i2-livestatus.h b/components/livestatus/i2-livestatus.h deleted file mode 100644 index 8d0994fb3..000000000 --- a/components/livestatus/i2-livestatus.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2LIVESTATUS_H -#define I2LIVESTATUS_H - -/** - * @defgroup livestatus Livestatus component - * - * The livestatus component implements livestatus queries. - */ - -#include "base/i2-base.h" -#include "remoting/i2-remoting.h" -#include "icinga/i2-icinga.h" - -using namespace icinga; - -#include "livestatus/connection.h" -#include "livestatus/column.h" -#include "livestatus/table.h" -#include "livestatus/filter.h" -#include "livestatus/combinerfilter.h" -#include "livestatus/orfilter.h" -#include "livestatus/andfilter.h" -#include "livestatus/negatefilter.h" -#include "livestatus/attributefilter.h" -#include "livestatus/query.h" -#include "livestatus/statustable.h" -#include "livestatus/contactgroupstable.h" -#include "livestatus/contactstable.h" -#include "livestatus/hoststable.h" -#include "livestatus/servicestable.h" -#include "livestatus/commentstable.h" -#include "livestatus/downtimestable.h" -#include "livestatus/component.h" - -#endif /* I2LIVESTATUS_H */ diff --git a/components/livestatus/negatefilter.cpp b/components/livestatus/negatefilter.cpp index ee02a4d09..b6dedcff0 100644 --- a/components/livestatus/negatefilter.cpp +++ b/components/livestatus/negatefilter.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/negatefilter.h" using namespace icinga; using namespace livestatus; diff --git a/components/livestatus/negatefilter.h b/components/livestatus/negatefilter.h index f321789a9..18759345c 100644 --- a/components/livestatus/negatefilter.h +++ b/components/livestatus/negatefilter.h @@ -20,6 +20,10 @@ #ifndef NEGATEFILTER_H #define NEGATEFILTER_H +#include "livestatus/filter.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/orfilter.cpp b/components/livestatus/orfilter.cpp index f142a77b3..601665562 100644 --- a/components/livestatus/orfilter.cpp +++ b/components/livestatus/orfilter.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/orfilter.h" #include using namespace icinga; diff --git a/components/livestatus/orfilter.h b/components/livestatus/orfilter.h index 95ff502f5..2d323f1b3 100644 --- a/components/livestatus/orfilter.h +++ b/components/livestatus/orfilter.h @@ -20,6 +20,10 @@ #ifndef ORFILTER_H #define ORFILTER_H +#include "livestatus/combinerfilter.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/query.cpp b/components/livestatus/query.cpp index 302a7541e..1dc785eb7 100644 --- a/components/livestatus/query.cpp +++ b/components/livestatus/query.cpp @@ -17,7 +17,13 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/query.h" +#include "livestatus/attributefilter.h" +#include "livestatus/negatefilter.h" +#include "livestatus/orfilter.h" +#include "livestatus/andfilter.h" +#include "icinga/externalcommandprocessor.h" +#include "base/utility.h" #include "base/convert.h" #include "base/objectlock.h" #include "base/logger_fwd.h" @@ -160,7 +166,7 @@ Query::Query(const std::vector& lines) m_Stats.swap(stats); } -void Query::PrintResultSet(ostream& fp, const std::vector& columns, const Array::Ptr& rs) +void Query::PrintResultSet(std::ostream& fp, const std::vector& columns, const Array::Ptr& rs) { if (m_OutputFormat == "csv" && m_Columns.size() == 0 && m_ColumnHeaders) { bool first = true; diff --git a/components/livestatus/query.h b/components/livestatus/query.h index cab0dbb3a..5b2a832cf 100644 --- a/components/livestatus/query.h +++ b/components/livestatus/query.h @@ -20,6 +20,13 @@ #ifndef QUERY_H #define QUERY_H +#include "livestatus/filter.h" +#include "base/object.h" +#include "base/array.h" +#include "base/stream.h" + +using namespace icinga; + namespace livestatus { @@ -61,7 +68,7 @@ private: int m_ErrorCode; String m_ErrorMessage; - void PrintResultSet(ostream& fp, const std::vector& columns, const Array::Ptr& rs); + void PrintResultSet(std::ostream& fp, const std::vector& columns, const Array::Ptr& rs); void ExecuteGetHelper(const Stream::Ptr& stream); void ExecuteCommandHelper(const Stream::Ptr& stream); diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp index f589ffe20..b9e330d7e 100644 --- a/components/livestatus/servicestable.cpp +++ b/components/livestatus/servicestable.cpp @@ -17,7 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/servicestable.h" +#include "livestatus/hoststable.h" +#include "icinga/service.h" #include "base/dynamictype.h" #include diff --git a/components/livestatus/servicestable.h b/components/livestatus/servicestable.h index cf7abce09..33a80248e 100644 --- a/components/livestatus/servicestable.h +++ b/components/livestatus/servicestable.h @@ -20,6 +20,10 @@ #ifndef SERVICESTABLE_H #define SERVICESTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/statustable.cpp b/components/livestatus/statustable.cpp index d0f93c5dc..c36e1153d 100644 --- a/components/livestatus/statustable.cpp +++ b/components/livestatus/statustable.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/statustable.h" #include using namespace icinga; diff --git a/components/livestatus/statustable.h b/components/livestatus/statustable.h index 4320fedbf..5a891e7e3 100644 --- a/components/livestatus/statustable.h +++ b/components/livestatus/statustable.h @@ -20,6 +20,10 @@ #ifndef STATUSTABLE_H #define STATUSTABLE_H +#include "livestatus/table.h" + +using namespace icinga; + namespace livestatus { diff --git a/components/livestatus/table.cpp b/components/livestatus/table.cpp index aecc9c698..e22d80aa7 100644 --- a/components/livestatus/table.cpp +++ b/components/livestatus/table.cpp @@ -17,10 +17,21 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-livestatus.h" +#include "livestatus/table.h" +#include "livestatus/statustable.h" +#include "livestatus/contactgroupstable.h" +#include "livestatus/contactstable.h" +#include "livestatus/hoststable.h" +#include "livestatus/servicestable.h" +#include "livestatus/commentstable.h" +#include "livestatus/downtimestable.h" +#include "livestatus/filter.h" +#include "base/array.h" +#include "base/dictionary.h" #include #include #include +#include using namespace icinga; using namespace livestatus; diff --git a/components/livestatus/table.h b/components/livestatus/table.h index 91f4dd0fd..9c8db2288 100644 --- a/components/livestatus/table.h +++ b/components/livestatus/table.h @@ -20,6 +20,9 @@ #ifndef TABLE_H #define TABLE_H +#include "livestatus/column.h" +#include "base/object.h" + namespace livestatus { diff --git a/components/notification/i2-notification.h b/components/notification/i2-notification.h deleted file mode 100644 index 6b649bafe..000000000 --- a/components/notification/i2-notification.h +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2NOTIFICATION_H -#define I2NOTIFICATION_H - -/** - * @defgroup notification Notification component - * - * The notification component is in charge of sending downtime notifications. - */ - -#include "base/i2-base.h" -#include "remoting/i2-remoting.h" -#include "icinga/i2-icinga.h" - -#include "notification/notificationcomponent.h" - -#endif /* I2NOTIFICATION_H */ diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp index ba358e99f..ac0c79772 100644 --- a/components/notification/notificationcomponent.cpp +++ b/components/notification/notificationcomponent.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-notification.h" +#include "notification/notificationcomponent.h" +#include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include diff --git a/components/notification/notificationcomponent.h b/components/notification/notificationcomponent.h index 0703ad3f8..57754b842 100644 --- a/components/notification/notificationcomponent.h +++ b/components/notification/notificationcomponent.h @@ -20,6 +20,9 @@ #ifndef NOTIFICATIONCOMPONENT_H #define NOTIFICATIONCOMPONENT_H +#include "remoting/endpoint.h" +#include "base/dynamicobject.h" + namespace icinga { diff --git a/components/replication/i2-replication.h b/components/replication/i2-replication.h deleted file mode 100644 index c1946c9f0..000000000 --- a/components/replication/i2-replication.h +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef I2REPLICATION_H -#define I2REPLICATION_H - -/** - * @defgroup replication Replication component - * - * Replicates Icinga 2 objects to remote instances. - */ - -#include "base/i2-base.h" -#include "remoting/i2-remoting.h" -#include "icinga/i2-icinga.h" - -#include "replication/replicationcomponent.h" - -#endif /* I2REPLICATION_H */ diff --git a/components/replication/replicationcomponent.cpp b/components/replication/replicationcomponent.cpp index a08077582..899cd5cf5 100644 --- a/components/replication/replicationcomponent.cpp +++ b/components/replication/replicationcomponent.cpp @@ -17,7 +17,10 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-replication.h" +#include "replication/replicationcomponent.h" +#include "icinga/service.h" +#include "icinga/checkresultmessage.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/components/replication/replicationcomponent.h b/components/replication/replicationcomponent.h index 3eea4be7f..d097e181c 100644 --- a/components/replication/replicationcomponent.h +++ b/components/replication/replicationcomponent.h @@ -17,8 +17,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#ifndef CIBSYNCCOMPONENT_H -#define CIBSYNCCOMPONENT_H +#ifndef REPLICATIONCOMPONENT_H +#define REPLICATIONCOMPONENT_H + +#include "base/dynamicobject.h" +#include "remoting/endpoint.h" namespace icinga { @@ -57,4 +60,4 @@ private: } -#endif /* CIBSYNCCOMPONENT_H */ +#endif /* REPLICATIONCOMPONENT_H */ diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index af35c0d76..60c6ff5f0 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -17,8 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "base/i2-base.h" -#include "config/i2-config.h" +#include "config/configcompilercontext.h" +#include "config/configcompiler.h" #include "base/application.h" #include "base/logger_fwd.h" #include diff --git a/lib/config/config_lexer.cc b/lib/config/config_lexer.cc index d6e67899e..4a1023fd2 100644 --- a/lib/config/config_lexer.cc +++ b/lib/config/config_lexer.cc @@ -625,8 +625,11 @@ static yyconst flex_int32_t yy_rule_can_match_eol[57] = * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" -#include "config_parser.h" +#include "config/configcompiler.h" +#include "config/expression.h" +#include "config/typerule.h" +#include "config/configcompilercontext.h" +#include "config/config_parser.h" #include using namespace icinga; @@ -690,7 +693,7 @@ static void lb_append_char(lex_buf *lb, char new_char) -#line 694 "config_lexer.cc" +#line 697 "config_lexer.cc" #define INITIAL 0 #define C_COMMENT 1 @@ -938,11 +941,11 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 92 "config_lexer.ll" +#line 95 "config_lexer.ll" lex_buf string_buf; -#line 946 "config_lexer.cc" +#line 949 "config_lexer.cc" yylval = yylval_param; @@ -1039,12 +1042,12 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 95 "config_lexer.ll" +#line 98 "config_lexer.ll" { lb_init(&string_buf); BEGIN(STRING); } YY_BREAK case 2: YY_RULE_SETUP -#line 97 "config_lexer.ll" +#line 100 "config_lexer.ll" { BEGIN(INITIAL); @@ -1058,7 +1061,7 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 107 "config_lexer.ll" +#line 110 "config_lexer.ll" { std::ostringstream msgbuf; msgbuf << "Unterminated string found: " << *yylloc; @@ -1068,7 +1071,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 114 "config_lexer.ll" +#line 117 "config_lexer.ll" { /* octal escape sequence */ int result; @@ -1087,7 +1090,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 130 "config_lexer.ll" +#line 133 "config_lexer.ll" { /* generate error - bad escape sequence; something * like '\48' or '\0777777' @@ -1099,38 +1102,38 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 139 "config_lexer.ll" +#line 142 "config_lexer.ll" { lb_append_char(&string_buf, '\n'); } YY_BREAK case 7: YY_RULE_SETUP -#line 140 "config_lexer.ll" +#line 143 "config_lexer.ll" { lb_append_char(&string_buf, '\t'); } YY_BREAK case 8: YY_RULE_SETUP -#line 141 "config_lexer.ll" +#line 144 "config_lexer.ll" { lb_append_char(&string_buf, '\r'); } YY_BREAK case 9: YY_RULE_SETUP -#line 142 "config_lexer.ll" +#line 145 "config_lexer.ll" { lb_append_char(&string_buf, '\b'); } YY_BREAK case 10: YY_RULE_SETUP -#line 143 "config_lexer.ll" +#line 146 "config_lexer.ll" { lb_append_char(&string_buf, '\f'); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 144 "config_lexer.ll" +#line 147 "config_lexer.ll" { lb_append_char(&string_buf, yytext[1]); } YY_BREAK case 12: YY_RULE_SETUP -#line 146 "config_lexer.ll" +#line 149 "config_lexer.ll" { char *yptr = yytext; @@ -1140,12 +1143,12 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 153 "config_lexer.ll" +#line 156 "config_lexer.ll" { lb_init(&string_buf); BEGIN(HEREDOC); } YY_BREAK case 14: YY_RULE_SETUP -#line 155 "config_lexer.ll" +#line 158 "config_lexer.ll" { BEGIN(INITIAL); @@ -1159,224 +1162,224 @@ YY_RULE_SETUP case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 165 "config_lexer.ll" +#line 168 "config_lexer.ll" { lb_append_char(&string_buf, yytext[0]); } YY_BREAK case 16: YY_RULE_SETUP -#line 168 "config_lexer.ll" +#line 171 "config_lexer.ll" BEGIN(C_COMMENT); YY_BREAK case 17: YY_RULE_SETUP -#line 172 "config_lexer.ll" +#line 175 "config_lexer.ll" BEGIN(INITIAL); YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP -#line 173 "config_lexer.ll" +#line 176 "config_lexer.ll" /* ignore comment */ YY_BREAK case 19: YY_RULE_SETUP -#line 174 "config_lexer.ll" +#line 177 "config_lexer.ll" /* ignore star */ YY_BREAK case 20: YY_RULE_SETUP -#line 177 "config_lexer.ll" +#line 180 "config_lexer.ll" /* ignore C++-style comments */ YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP -#line 178 "config_lexer.ll" +#line 181 "config_lexer.ll" /* ignore whitespace */ YY_BREAK case 22: YY_RULE_SETUP -#line 181 "config_lexer.ll" +#line 184 "config_lexer.ll" return T_TYPE; YY_BREAK case 23: YY_RULE_SETUP -#line 182 "config_lexer.ll" +#line 185 "config_lexer.ll" { yylval->type = TypeDictionary; return T_TYPE_DICTIONARY; } YY_BREAK case 24: YY_RULE_SETUP -#line 183 "config_lexer.ll" +#line 186 "config_lexer.ll" { yylval->type = TypeArray; return T_TYPE_ARRAY; } YY_BREAK case 25: YY_RULE_SETUP -#line 184 "config_lexer.ll" +#line 187 "config_lexer.ll" { yylval->type = TypeNumber; return T_TYPE_NUMBER; } YY_BREAK case 26: YY_RULE_SETUP -#line 185 "config_lexer.ll" +#line 188 "config_lexer.ll" { yylval->type = TypeString; return T_TYPE_STRING; } YY_BREAK case 27: YY_RULE_SETUP -#line 186 "config_lexer.ll" +#line 189 "config_lexer.ll" { yylval->type = TypeScalar; return T_TYPE_SCALAR; } YY_BREAK case 28: YY_RULE_SETUP -#line 187 "config_lexer.ll" +#line 190 "config_lexer.ll" { yylval->type = TypeAny; return T_TYPE_ANY; } YY_BREAK case 29: YY_RULE_SETUP -#line 188 "config_lexer.ll" +#line 191 "config_lexer.ll" { return T_VALIDATOR; } YY_BREAK case 30: YY_RULE_SETUP -#line 189 "config_lexer.ll" +#line 192 "config_lexer.ll" { return T_REQUIRE; } YY_BREAK case 31: YY_RULE_SETUP -#line 190 "config_lexer.ll" +#line 193 "config_lexer.ll" { return T_ATTRIBUTE; } YY_BREAK case 32: YY_RULE_SETUP -#line 191 "config_lexer.ll" +#line 194 "config_lexer.ll" return T_ABSTRACT; YY_BREAK case 33: YY_RULE_SETUP -#line 192 "config_lexer.ll" +#line 195 "config_lexer.ll" return T_LOCAL; YY_BREAK case 34: YY_RULE_SETUP -#line 193 "config_lexer.ll" +#line 196 "config_lexer.ll" return T_OBJECT; YY_BREAK case 35: YY_RULE_SETUP -#line 194 "config_lexer.ll" +#line 197 "config_lexer.ll" return T_TEMPLATE; YY_BREAK case 36: YY_RULE_SETUP -#line 195 "config_lexer.ll" +#line 198 "config_lexer.ll" return T_INCLUDE; YY_BREAK case 37: YY_RULE_SETUP -#line 196 "config_lexer.ll" +#line 199 "config_lexer.ll" return T_LIBRARY; YY_BREAK case 38: YY_RULE_SETUP -#line 197 "config_lexer.ll" +#line 200 "config_lexer.ll" return T_INHERITS; YY_BREAK case 39: YY_RULE_SETUP -#line 198 "config_lexer.ll" +#line 201 "config_lexer.ll" return T_NULL; YY_BREAK case 40: YY_RULE_SETUP -#line 199 "config_lexer.ll" +#line 202 "config_lexer.ll" return T_PARTIAL; YY_BREAK case 41: YY_RULE_SETUP -#line 200 "config_lexer.ll" +#line 203 "config_lexer.ll" { yylval->num = 1; return T_NUMBER; } YY_BREAK case 42: YY_RULE_SETUP -#line 201 "config_lexer.ll" +#line 204 "config_lexer.ll" { yylval->num = 0; return T_NUMBER; } YY_BREAK case 43: YY_RULE_SETUP -#line 202 "config_lexer.ll" +#line 205 "config_lexer.ll" { yylval->text = strdup(yytext); return T_IDENTIFIER; } YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP -#line 203 "config_lexer.ll" +#line 206 "config_lexer.ll" { yytext[yyleng-1] = '\0'; yylval->text = strdup(yytext + 1); return T_STRING_ANGLE; } YY_BREAK case 45: YY_RULE_SETUP -#line 204 "config_lexer.ll" +#line 207 "config_lexer.ll" { yylval->num = strtod(yytext, NULL) / 1000; return T_NUMBER; } YY_BREAK case 46: YY_RULE_SETUP -#line 205 "config_lexer.ll" +#line 208 "config_lexer.ll" { yylval->num = strtod(yytext, NULL) * 60 * 60; return T_NUMBER; } YY_BREAK case 47: YY_RULE_SETUP -#line 206 "config_lexer.ll" +#line 209 "config_lexer.ll" { yylval->num = strtod(yytext, NULL) * 60; return T_NUMBER; } YY_BREAK case 48: YY_RULE_SETUP -#line 207 "config_lexer.ll" +#line 210 "config_lexer.ll" { yylval->num = strtod(yytext, NULL); return T_NUMBER; } YY_BREAK case 49: YY_RULE_SETUP -#line 208 "config_lexer.ll" +#line 211 "config_lexer.ll" { yylval->num = strtod(yytext, NULL); return T_NUMBER; } YY_BREAK case 50: YY_RULE_SETUP -#line 209 "config_lexer.ll" +#line 212 "config_lexer.ll" { yylval->op = OperatorSet; return T_EQUAL; } YY_BREAK case 51: YY_RULE_SETUP -#line 210 "config_lexer.ll" +#line 213 "config_lexer.ll" { yylval->op = OperatorPlus; return T_PLUS_EQUAL; } YY_BREAK case 52: YY_RULE_SETUP -#line 211 "config_lexer.ll" +#line 214 "config_lexer.ll" { yylval->op = OperatorMinus; return T_MINUS_EQUAL; } YY_BREAK case 53: YY_RULE_SETUP -#line 212 "config_lexer.ll" +#line 215 "config_lexer.ll" { yylval->op = OperatorMultiply; return T_MULTIPLY_EQUAL; } YY_BREAK case 54: YY_RULE_SETUP -#line 213 "config_lexer.ll" +#line 216 "config_lexer.ll" { yylval->op = OperatorDivide; return T_DIVIDE_EQUAL; } YY_BREAK case 55: YY_RULE_SETUP -#line 216 "config_lexer.ll" +#line 219 "config_lexer.ll" return yytext[0]; YY_BREAK case 56: YY_RULE_SETUP -#line 218 "config_lexer.ll" +#line 221 "config_lexer.ll" ECHO; YY_BREAK -#line 1380 "config_lexer.cc" +#line 1383 "config_lexer.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(C_COMMENT): case YY_STATE_EOF(STRING): @@ -2567,7 +2570,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 218 "config_lexer.ll" +#line 221 "config_lexer.ll" diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index fec02f982..6a785e026 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -18,8 +18,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" -#include "config_parser.h" +#include "config/configcompiler.h" +#include "config/expression.h" +#include "config/typerule.h" +#include "config/configcompilercontext.h" +#include "config/config_parser.h" #include using namespace icinga; diff --git a/lib/config/config_parser.cc b/lib/config/config_parser.cc index f763ee6f5..59503423a 100644 --- a/lib/config/config_parser.cc +++ b/lib/config/config_parser.cc @@ -117,18 +117,27 @@ extern int yydebug; ******************************************************************************/ #include "i2-config.h" +#include "config/expression.h" +#include "config/expressionlist.h" +#include "config/configitembuilder.h" +#include "config/configcompiler.h" +#include "config/configcompilercontext.h" +#include "config/typerule.h" +#include "config/typerulelist.h" +#include "base/value.h" +#include "base/array.h" #include #include #include using namespace icinga; -#define YYLTYPE DebugInfo +#define YYLTYPE icinga::DebugInfo /* Line 387 of yacc.c */ -#line 132 "config_parser.cc" +#line 141 "config_parser.cc" /* Tokens. */ #ifndef YYTOKENTYPE @@ -202,7 +211,7 @@ using namespace icinga; typedef union YYSTYPE { /* Line 387 of yacc.c */ -#line 41 "config_parser.yy" +#line 50 "config_parser.yy" char *text; double num; @@ -212,7 +221,7 @@ typedef union YYSTYPE /* Line 387 of yacc.c */ -#line 216 "config_parser.cc" +#line 225 "config_parser.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -251,7 +260,7 @@ int yyparse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 88 "config_parser.yy" +#line 97 "config_parser.yy" int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner); @@ -289,7 +298,7 @@ void ConfigCompiler::Compile(void) /* Line 390 of yacc.c */ -#line 293 "config_parser.cc" +#line 302 "config_parser.cc" #ifdef short # undef short @@ -606,14 +615,14 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 126, 126, 127, 130, 130, 130, 130, 133, 138, - 144, 150, 151, 159, 158, 188, 191, 198, 197, 209, - 210, 212, 213, 214, 217, 222, 227, 234, 243, 244, - 251, 252, 253, 254, 255, 256, 263, 268, 263, 293, - 294, 299, 300, 303, 307, 313, 314, 317, 324, 325, - 329, 328, 340, 341, 343, 344, 345, 348, 356, 372, - 373, 374, 375, 376, 383, 382, 394, 395, 397, 398, - 402, 408, 413, 417, 421, 427, 428 + 0, 135, 135, 136, 139, 139, 139, 139, 142, 147, + 153, 159, 160, 168, 167, 197, 200, 207, 206, 218, + 219, 221, 222, 223, 226, 231, 236, 243, 252, 253, + 260, 261, 262, 263, 264, 265, 272, 277, 272, 302, + 303, 308, 309, 312, 316, 322, 323, 326, 333, 334, + 338, 337, 349, 350, 352, 353, 354, 357, 365, 381, + 382, 383, 384, 385, 392, 391, 403, 404, 406, 407, + 411, 417, 422, 426, 430, 436, 437 }; #endif @@ -1709,7 +1718,7 @@ yyreduce: { case 8: /* Line 1792 of yacc.c */ -#line 134 "config_parser.yy" +#line 143 "config_parser.yy" { context->HandleInclude((yyvsp[(2) - (2)].text), false, yylloc); free((yyvsp[(2) - (2)].text)); @@ -1718,7 +1727,7 @@ yyreduce: case 9: /* Line 1792 of yacc.c */ -#line 139 "config_parser.yy" +#line 148 "config_parser.yy" { context->HandleInclude((yyvsp[(2) - (2)].text), true, yylloc); free((yyvsp[(2) - (2)].text)); @@ -1727,7 +1736,7 @@ yyreduce: case 10: /* Line 1792 of yacc.c */ -#line 145 "config_parser.yy" +#line 154 "config_parser.yy" { context->HandleLibrary((yyvsp[(2) - (2)].text)); free((yyvsp[(2) - (2)].text)); @@ -1736,7 +1745,7 @@ yyreduce: case 12: /* Line 1792 of yacc.c */ -#line 152 "config_parser.yy" +#line 161 "config_parser.yy" { (yyval.text) = (yyvsp[(1) - (1)].text); free((yyvsp[(1) - (1)].text)); @@ -1745,7 +1754,7 @@ yyreduce: case 13: /* Line 1792 of yacc.c */ -#line 159 "config_parser.yy" +#line 168 "config_parser.yy" { String name = String((yyvsp[(3) - (3)].text)); free((yyvsp[(3) - (3)].text)); @@ -1764,7 +1773,7 @@ yyreduce: case 14: /* Line 1792 of yacc.c */ -#line 174 "config_parser.yy" +#line 183 "config_parser.yy" { TypeRuleList::Ptr ruleList = *(yyvsp[(6) - (6)].variant); m_Type->GetRuleList()->AddRules(ruleList); @@ -1780,7 +1789,7 @@ yyreduce: case 15: /* Line 1792 of yacc.c */ -#line 188 "config_parser.yy" +#line 197 "config_parser.yy" { (yyval.num) = 0; } @@ -1788,7 +1797,7 @@ yyreduce: case 16: /* Line 1792 of yacc.c */ -#line 192 "config_parser.yy" +#line 201 "config_parser.yy" { (yyval.num) = 1; } @@ -1796,7 +1805,7 @@ yyreduce: case 17: /* Line 1792 of yacc.c */ -#line 198 "config_parser.yy" +#line 207 "config_parser.yy" { m_RuleLists.push(boost::make_shared()); } @@ -1804,7 +1813,7 @@ yyreduce: case 18: /* Line 1792 of yacc.c */ -#line 203 "config_parser.yy" +#line 212 "config_parser.yy" { (yyval.variant) = new Value(m_RuleLists.top()); m_RuleLists.pop(); @@ -1813,7 +1822,7 @@ yyreduce: case 24: /* Line 1792 of yacc.c */ -#line 218 "config_parser.yy" +#line 227 "config_parser.yy" { m_RuleLists.top()->AddRequire((yyvsp[(2) - (2)].text)); free((yyvsp[(2) - (2)].text)); @@ -1822,7 +1831,7 @@ yyreduce: case 25: /* Line 1792 of yacc.c */ -#line 223 "config_parser.yy" +#line 232 "config_parser.yy" { m_RuleLists.top()->SetValidator((yyvsp[(2) - (2)].text)); free((yyvsp[(2) - (2)].text)); @@ -1831,7 +1840,7 @@ yyreduce: case 26: /* Line 1792 of yacc.c */ -#line 228 "config_parser.yy" +#line 237 "config_parser.yy" { TypeRule rule((yyvsp[(2) - (3)].type), (yyvsp[(3) - (3)].text), TypeRuleList::Ptr(), yylloc); free((yyvsp[(3) - (3)].text)); @@ -1842,7 +1851,7 @@ yyreduce: case 27: /* Line 1792 of yacc.c */ -#line 235 "config_parser.yy" +#line 244 "config_parser.yy" { TypeRule rule((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].text), *(yyvsp[(4) - (4)].variant), yylloc); free((yyvsp[(3) - (4)].text)); @@ -1853,7 +1862,7 @@ yyreduce: case 29: /* Line 1792 of yacc.c */ -#line 245 "config_parser.yy" +#line 254 "config_parser.yy" { m_Type->SetParent((yyvsp[(2) - (2)].text)); free((yyvsp[(2) - (2)].text)); @@ -1862,7 +1871,7 @@ yyreduce: case 35: /* Line 1792 of yacc.c */ -#line 257 "config_parser.yy" +#line 266 "config_parser.yy" { (yyval.type) = (yyvsp[(1) - (1)].type); } @@ -1870,7 +1879,7 @@ yyreduce: case 36: /* Line 1792 of yacc.c */ -#line 263 "config_parser.yy" +#line 272 "config_parser.yy" { m_Abstract = false; m_Local = false; @@ -1879,7 +1888,7 @@ yyreduce: case 37: /* Line 1792 of yacc.c */ -#line 268 "config_parser.yy" +#line 277 "config_parser.yy" { m_Item = boost::make_shared(yylloc); @@ -1895,7 +1904,7 @@ yyreduce: case 38: /* Line 1792 of yacc.c */ -#line 280 "config_parser.yy" +#line 289 "config_parser.yy" { ExpressionList::Ptr exprl = *(yyvsp[(7) - (7)].variant); delete (yyvsp[(7) - (7)].variant); @@ -1911,7 +1920,7 @@ yyreduce: case 40: /* Line 1792 of yacc.c */ -#line 295 "config_parser.yy" +#line 304 "config_parser.yy" { m_Abstract = true; } @@ -1919,7 +1928,7 @@ yyreduce: case 43: /* Line 1792 of yacc.c */ -#line 304 "config_parser.yy" +#line 313 "config_parser.yy" { m_Abstract = true; } @@ -1927,7 +1936,7 @@ yyreduce: case 44: /* Line 1792 of yacc.c */ -#line 308 "config_parser.yy" +#line 317 "config_parser.yy" { m_Local = true; } @@ -1935,7 +1944,7 @@ yyreduce: case 47: /* Line 1792 of yacc.c */ -#line 318 "config_parser.yy" +#line 327 "config_parser.yy" { m_Item->AddParent((yyvsp[(1) - (1)].text)); free((yyvsp[(1) - (1)].text)); @@ -1944,7 +1953,7 @@ yyreduce: case 50: /* Line 1792 of yacc.c */ -#line 329 "config_parser.yy" +#line 338 "config_parser.yy" { m_ExpressionLists.push(boost::make_shared()); } @@ -1952,7 +1961,7 @@ yyreduce: case 51: /* Line 1792 of yacc.c */ -#line 334 "config_parser.yy" +#line 343 "config_parser.yy" { (yyval.variant) = new Value(m_ExpressionLists.top()); m_ExpressionLists.pop(); @@ -1961,7 +1970,7 @@ yyreduce: case 57: /* Line 1792 of yacc.c */ -#line 349 "config_parser.yy" +#line 358 "config_parser.yy" { Expression expr((yyvsp[(1) - (3)].text), (yyvsp[(2) - (3)].op), *(yyvsp[(3) - (3)].variant), yylloc); free((yyvsp[(1) - (3)].text)); @@ -1973,7 +1982,7 @@ yyreduce: case 58: /* Line 1792 of yacc.c */ -#line 357 "config_parser.yy" +#line 366 "config_parser.yy" { Expression subexpr((yyvsp[(3) - (6)].text), (yyvsp[(5) - (6)].op), *(yyvsp[(6) - (6)].variant), yylloc); free((yyvsp[(3) - (6)].text)); @@ -1991,7 +2000,7 @@ yyreduce: case 63: /* Line 1792 of yacc.c */ -#line 377 "config_parser.yy" +#line 386 "config_parser.yy" { (yyval.op) = (yyvsp[(1) - (1)].op); } @@ -1999,7 +2008,7 @@ yyreduce: case 64: /* Line 1792 of yacc.c */ -#line 383 "config_parser.yy" +#line 392 "config_parser.yy" { m_Arrays.push(boost::make_shared()); } @@ -2007,7 +2016,7 @@ yyreduce: case 65: /* Line 1792 of yacc.c */ -#line 388 "config_parser.yy" +#line 397 "config_parser.yy" { (yyval.variant) = new Value(m_Arrays.top()); m_Arrays.pop(); @@ -2016,7 +2025,7 @@ yyreduce: case 69: /* Line 1792 of yacc.c */ -#line 399 "config_parser.yy" +#line 408 "config_parser.yy" { m_Arrays.top()->Add(*(yyvsp[(1) - (1)].variant)); } @@ -2024,7 +2033,7 @@ yyreduce: case 70: /* Line 1792 of yacc.c */ -#line 403 "config_parser.yy" +#line 412 "config_parser.yy" { m_Arrays.top()->Add(*(yyvsp[(3) - (3)].variant)); } @@ -2032,7 +2041,7 @@ yyreduce: case 71: /* Line 1792 of yacc.c */ -#line 409 "config_parser.yy" +#line 418 "config_parser.yy" { (yyval.variant) = new Value((yyvsp[(1) - (1)].text)); free((yyvsp[(1) - (1)].text)); @@ -2041,7 +2050,7 @@ yyreduce: case 72: /* Line 1792 of yacc.c */ -#line 414 "config_parser.yy" +#line 423 "config_parser.yy" { (yyval.variant) = new Value((yyvsp[(1) - (1)].num)); } @@ -2049,7 +2058,7 @@ yyreduce: case 73: /* Line 1792 of yacc.c */ -#line 418 "config_parser.yy" +#line 427 "config_parser.yy" { (yyval.variant) = new Value(); } @@ -2057,7 +2066,7 @@ yyreduce: case 74: /* Line 1792 of yacc.c */ -#line 422 "config_parser.yy" +#line 431 "config_parser.yy" { (yyval.variant) = (yyvsp[(1) - (1)].variant); } @@ -2065,7 +2074,7 @@ yyreduce: case 76: /* Line 1792 of yacc.c */ -#line 429 "config_parser.yy" +#line 438 "config_parser.yy" { (yyval.variant) = (yyvsp[(1) - (1)].variant); } @@ -2073,7 +2082,7 @@ yyreduce: /* Line 1792 of yacc.c */ -#line 2077 "config_parser.cc" +#line 2086 "config_parser.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2312,5 +2321,5 @@ yyreturn: /* Line 2055 of yacc.c */ -#line 433 "config_parser.yy" +#line 442 "config_parser.yy" diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 7be4649ca..5b4c27941 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -19,13 +19,22 @@ ******************************************************************************/ #include "i2-config.h" +#include "config/expression.h" +#include "config/expressionlist.h" +#include "config/configitembuilder.h" +#include "config/configcompiler.h" +#include "config/configcompilercontext.h" +#include "config/typerule.h" +#include "config/typerulelist.h" +#include "base/value.h" +#include "base/array.h" #include #include #include using namespace icinga; -#define YYLTYPE DebugInfo +#define YYLTYPE icinga::DebugInfo } diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 5432406a5..330f51491 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -17,8 +17,10 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/configcompiler.h" +#include "config/configitem.h" #include "base/logger_fwd.h" +#include "base/utility.h" #include #include #include diff --git a/lib/config/configcompiler.h b/lib/config/configcompiler.h index 6420c1c53..1918dd78e 100644 --- a/lib/config/configcompiler.h +++ b/lib/config/configcompiler.h @@ -20,8 +20,11 @@ #ifndef CONFIGCOMPILER_H #define CONFIGCOMPILER_H +#include "config/i2-config.h" +#include "config/debuginfo.h" #include "base/registry.h" #include +#include namespace icinga { diff --git a/lib/config/configcompilercontext.cpp b/lib/config/configcompilercontext.cpp index 82e4a1ac4..eda8674f4 100644 --- a/lib/config/configcompilercontext.cpp +++ b/lib/config/configcompilercontext.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/configcompilercontext.h" +#include "base/utility.h" #include "base/logger_fwd.h" #include diff --git a/lib/config/configcompilercontext.h b/lib/config/configcompilercontext.h index ef5358f6b..bfd4b79bc 100644 --- a/lib/config/configcompilercontext.h +++ b/lib/config/configcompilercontext.h @@ -20,6 +20,10 @@ #ifndef CONFIGCOMPILERCONTEXT_H #define CONFIGCOMPILERCONTEXT_H +#include "config/i2-config.h" +#include "config/configitem.h" +#include "config/configtype.h" + namespace icinga { @@ -76,8 +80,8 @@ private: int m_Flags; - std::vector > m_Items; - std::map, shared_ptr > m_ItemsMap; + std::vector m_Items; + std::map, ConfigItem::Ptr> m_ItemsMap; std::map > m_Types; diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 48c53c16d..f9cd4fcbb 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/configitem.h" +#include "config/configcompilercontext.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/config/configitem.h b/lib/config/configitem.h index ff0c6a9d2..a7b46852a 100644 --- a/lib/config/configitem.h +++ b/lib/config/configitem.h @@ -20,6 +20,8 @@ #ifndef CONFIGITEM_H #define CONFIGITEM_H +#include "config/i2-config.h" +#include "config/expressionlist.h" #include "base/dynamicobject.h" namespace icinga diff --git a/lib/config/configitembuilder.cpp b/lib/config/configitembuilder.cpp index c34cbd5d8..0023c4d98 100644 --- a/lib/config/configitembuilder.cpp +++ b/lib/config/configitembuilder.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/configitembuilder.h" +#include "config/configcompilercontext.h" #include "base/dynamictype.h" #include #include diff --git a/lib/config/configitembuilder.h b/lib/config/configitembuilder.h index 26f57601d..6b38ce618 100644 --- a/lib/config/configitembuilder.h +++ b/lib/config/configitembuilder.h @@ -20,6 +20,12 @@ #ifndef CONFIGITEMBUILDER_H #define CONFIGITEMBUILDER_H +#include "config/debuginfo.h" +#include "config/expression.h" +#include "config/expressionlist.h" +#include "config/configitem.h" +#include "base/object.h" + namespace icinga { diff --git a/lib/config/configtype.cpp b/lib/config/configtype.cpp index dae44df33..8f196667e 100644 --- a/lib/config/configtype.cpp +++ b/lib/config/configtype.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/configtype.h" +#include "config/configcompilercontext.h" #include "base/objectlock.h" #include "base/convert.h" #include diff --git a/lib/config/configtype.h b/lib/config/configtype.h index 5ce363a71..6ce37536e 100644 --- a/lib/config/configtype.h +++ b/lib/config/configtype.h @@ -20,6 +20,10 @@ #ifndef CONFIGTYPE_H #define CONFIGTYPE_H +#include "config/i2-config.h" +#include "config/typerule.h" +#include "config/typerulelist.h" +#include "config/configitem.h" #include "base/array.h" namespace icinga diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 9425c3ea6..e5d7af74e 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/expression.h" +#include "config/expressionlist.h" #include "base/objectlock.h" #include #include diff --git a/lib/config/expression.h b/lib/config/expression.h index 1c660c0ed..c785290de 100644 --- a/lib/config/expression.h +++ b/lib/config/expression.h @@ -20,7 +20,10 @@ #ifndef EXPRESSION_H #define EXPRESSION_H +#include "config/i2-config.h" +#include "config/debuginfo.h" #include "base/dictionary.h" +#include namespace icinga { diff --git a/lib/config/expressionlist.cpp b/lib/config/expressionlist.cpp index b1a97930e..a359f4755 100644 --- a/lib/config/expressionlist.cpp +++ b/lib/config/expressionlist.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/expressionlist.h" #include using namespace icinga; diff --git a/lib/config/expressionlist.h b/lib/config/expressionlist.h index 8ab611743..73173a273 100644 --- a/lib/config/expressionlist.h +++ b/lib/config/expressionlist.h @@ -20,7 +20,10 @@ #ifndef EXPRESSIONLIST_H #define EXPRESSIONLIST_H +#include "config/i2-config.h" +#include "config/expression.h" #include "base/dictionary.h" +#include namespace icinga { diff --git a/lib/config/i2-config.h b/lib/config/i2-config.h index 260adb94a..3cc4988b6 100644 --- a/lib/config/i2-config.h +++ b/lib/config/i2-config.h @@ -28,7 +28,7 @@ * at runtime. */ -//#include "base/i2-base.h" +#include "base/i2-base.h" #ifdef I2_CONFIG_BUILD # define I2_CONFIG_API I2_EXPORT @@ -36,15 +36,4 @@ # define I2_CONFIG_API I2_IMPORT #endif /* I2_CONFIG_BUILD */ -/*#include "debuginfo.h" -#include "typerulelist.h" -#include "typerule.h" -#include "expression.h" -#include "expressionlist.h" -#include "configitem.h" -#include "configtype.h" -#include "configitembuilder.h" -#include "configcompiler.h" -#include "configcompilercontext.h"*/ - #endif /* I2CONFIG_H */ diff --git a/lib/config/typerule.cpp b/lib/config/typerule.cpp index 68cda5f63..f878a1767 100644 --- a/lib/config/typerule.cpp +++ b/lib/config/typerule.cpp @@ -17,8 +17,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/typerule.h" #include "base/convert.h" +#include "base/utility.h" +#include "base/dictionary.h" +#include "base/array.h" using namespace icinga; diff --git a/lib/config/typerule.h b/lib/config/typerule.h index 6f593f8cf..c73243020 100644 --- a/lib/config/typerule.h +++ b/lib/config/typerule.h @@ -20,6 +20,10 @@ #ifndef TYPERULE_H #define TYPERULE_H +#include "config/i2-config.h" +#include "config/typerulelist.h" +#include "config/debuginfo.h" + namespace icinga { diff --git a/lib/config/typerulelist.cpp b/lib/config/typerulelist.cpp index 7f27f4496..504377f5d 100644 --- a/lib/config/typerulelist.cpp +++ b/lib/config/typerulelist.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-config.h" +#include "config/typerulelist.h" +#include "config/typerule.h" #include using namespace icinga; diff --git a/lib/config/typerulelist.h b/lib/config/typerulelist.h index 078fff4c2..b75c23b9c 100644 --- a/lib/config/typerulelist.h +++ b/lib/config/typerulelist.h @@ -20,6 +20,7 @@ #ifndef TYPERULELIST_H #define TYPERULELIST_H +#include "config/i2-config.h" #include "base/value.h" namespace icinga diff --git a/lib/icinga/api.cpp b/lib/icinga/api.cpp index 29cea119a..7a51e7b8e 100644 --- a/lib/icinga/api.cpp +++ b/lib/icinga/api.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/api.h" +#include "base/scriptfunction.h" #include "base/logger_fwd.h" using namespace icinga; diff --git a/lib/icinga/api.h b/lib/icinga/api.h index 3b222eda2..9e97aedd9 100644 --- a/lib/icinga/api.h +++ b/lib/icinga/api.h @@ -20,6 +20,9 @@ #ifndef API_H #define API_H +#include "icinga/i2-icinga.h" +#include "base/scripttask.h" + namespace icinga { diff --git a/lib/icinga/checkresultmessage.cpp b/lib/icinga/checkresultmessage.cpp index 2ecaf9c35..f63105d0f 100644 --- a/lib/icinga/checkresultmessage.cpp +++ b/lib/icinga/checkresultmessage.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/checkresultmessage.h" using namespace icinga; diff --git a/lib/icinga/checkresultmessage.h b/lib/icinga/checkresultmessage.h index c3d53fd27..314f3a6f5 100644 --- a/lib/icinga/checkresultmessage.h +++ b/lib/icinga/checkresultmessage.h @@ -20,6 +20,9 @@ #ifndef CHECKRESULTMESSAGE_H #define CHECKRESULTMESSAGE_H +#include "icinga/i2-icinga.h" +#include "remoting/messagepart.h" + namespace icinga { diff --git a/lib/icinga/cib.cpp b/lib/icinga/cib.cpp index 1f91d8d60..a12666045 100644 --- a/lib/icinga/cib.cpp +++ b/lib/icinga/cib.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/cib.h" using namespace icinga; diff --git a/lib/icinga/cib.h b/lib/icinga/cib.h index 232fb72ea..dff294268 100644 --- a/lib/icinga/cib.h +++ b/lib/icinga/cib.h @@ -20,6 +20,7 @@ #ifndef CIB_H #define CIB_H +#include "icinga/i2-icinga.h" #include "base/ringbuffer.h" namespace icinga diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp index b0430517b..68701317f 100644 --- a/lib/icinga/externalcommandprocessor.cpp +++ b/lib/icinga/externalcommandprocessor.cpp @@ -17,10 +17,18 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/externalcommandprocessor.h" +#include "icinga/host.h" +#include "icinga/service.h" +#include "icinga/user.h" +#include "icinga/hostgroup.h" +#include "icinga/servicegroup.h" +#include "icinga/pluginchecktask.h" #include "base/convert.h" #include "base/logger_fwd.h" #include "base/objectlock.h" +#include "base/application.h" +#include #include #include #include diff --git a/lib/icinga/externalcommandprocessor.h b/lib/icinga/externalcommandprocessor.h index 4c5c4b580..8f5682700 100644 --- a/lib/icinga/externalcommandprocessor.h +++ b/lib/icinga/externalcommandprocessor.h @@ -20,6 +20,12 @@ #ifndef EXTERNALCOMMANDPROCESSOR_H #define EXTERNALCOMMANDPROCESSOR_H +#include "icinga/i2-icinga.h" +#include "base/qstring.h" +#include +#include +#include + namespace icinga { diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 7d4be7238..20948d57b 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -17,10 +17,14 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/host.h" +#include "icinga/service.h" +#include "icinga/hostgroup.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" +#include "config/configitembuilder.h" +#include "config/configcompilercontext.h" #include #include #include diff --git a/lib/icinga/host.h b/lib/icinga/host.h index e91d665b3..d6184fda2 100644 --- a/lib/icinga/host.h +++ b/lib/icinga/host.h @@ -20,6 +20,11 @@ #ifndef HOST_H #define HOST_H +#include "icinga/i2-icinga.h" +#include "base/array.h" +#include "base/dynamicobject.h" +#include "base/dictionary.h" + namespace icinga { diff --git a/lib/icinga/hostgroup.cpp b/lib/icinga/hostgroup.cpp index 2dccfe20a..b10309406 100644 --- a/lib/icinga/hostgroup.cpp +++ b/lib/icinga/hostgroup.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/hostgroup.h" #include "base/dynamictype.h" #include "base/logger_fwd.h" #include "base/objectlock.h" diff --git a/lib/icinga/hostgroup.h b/lib/icinga/hostgroup.h index 5ec1681cf..a390665ea 100644 --- a/lib/icinga/hostgroup.h +++ b/lib/icinga/hostgroup.h @@ -20,6 +20,11 @@ #ifndef HOSTGROUP_H #define HOSTGROUP_H +#include "icinga/i2-icinga.h" +#include "icinga/host.h" +#include "base/dynamicobject.h" +#include + namespace icinga { diff --git a/lib/icinga/i2-icinga.h b/lib/icinga/i2-icinga.h index 1b9d734ff..44743bda0 100644 --- a/lib/icinga/i2-icinga.h +++ b/lib/icinga/i2-icinga.h @@ -28,8 +28,6 @@ */ #include "base/i2-base.h" -#include "config/i2-config.h" -#include "remoting/i2-remoting.h" #ifdef I2_ICINGA_BUILD # define I2_ICINGA_API I2_EXPORT @@ -37,35 +35,4 @@ # define I2_ICINGA_API I2_IMPORT #endif /* I2_ICINGA_BUILD */ -#include "externalcommandprocessor.h" - -#include "icingaapplication.h" - -#include "timeperiod.h" - -#include "user.h" -#include "usergroup.h" - -#include "notification.h" -#include "notificationrequestmessage.h" - -#include "host.h" -#include "hostgroup.h" -#include "service.h" -#include "servicegroup.h" - -#include "macroprocessor.h" -#include "pluginchecktask.h" -#include "nullchecktask.h" - -#include "pluginnotificationtask.h" - -#include "checkresultmessage.h" - -#include "cib.h" - -#include "api.h" - -#include "perfdatawriter.h" - #endif /* I2ICINGA_H */ diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp index 9ab690a76..0eab4b4cd 100644 --- a/lib/icinga/icingaapplication.cpp +++ b/lib/icinga/icingaapplication.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/icingaapplication.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/logger_fwd.h" #include "base/objectlock.h" diff --git a/lib/icinga/icingaapplication.h b/lib/icinga/icingaapplication.h index cb25260d6..9d5ba5fea 100644 --- a/lib/icinga/icingaapplication.h +++ b/lib/icinga/icingaapplication.h @@ -20,6 +20,7 @@ #ifndef ICINGAAPPLICATION_H #define ICINGAAPPLICATION_H +#include "icinga/i2-icinga.h" #include "base/application.h" namespace icinga diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index 5b5a28bd9..434580366 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -17,7 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/macroprocessor.h" +#include "base/utility.h" +#include "base/array.h" #include "base/objectlock.h" #include #include diff --git a/lib/icinga/macroprocessor.h b/lib/icinga/macroprocessor.h index bad3136c6..acbd278fc 100644 --- a/lib/icinga/macroprocessor.h +++ b/lib/icinga/macroprocessor.h @@ -20,6 +20,10 @@ #ifndef MACROPROCESSOR_H #define MACROPROCESSOR_H +#include "icinga/i2-icinga.h" +#include "base/dictionary.h" +#include + namespace icinga { diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index 816d8ede6..7cc1b1f0c 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -17,7 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/notification.h" +#include "icinga/macroprocessor.h" +#include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/icinga/notification.h b/lib/icinga/notification.h index 8eb616ade..151092f5d 100644 --- a/lib/icinga/notification.h +++ b/lib/icinga/notification.h @@ -20,6 +20,11 @@ #ifndef NOTIFICATION_H #define NOTIFICATION_H +#include "icinga/i2-icinga.h" +#include "icinga/user.h" +#include "icinga/usergroup.h" +#include "base/array.h" + namespace icinga { diff --git a/lib/icinga/notificationrequestmessage.cpp b/lib/icinga/notificationrequestmessage.cpp index a8361efc7..931ef58f4 100644 --- a/lib/icinga/notificationrequestmessage.cpp +++ b/lib/icinga/notificationrequestmessage.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/notificationrequestmessage.h" using namespace icinga; diff --git a/lib/icinga/notificationrequestmessage.h b/lib/icinga/notificationrequestmessage.h index f355abd6a..88cd87f81 100644 --- a/lib/icinga/notificationrequestmessage.h +++ b/lib/icinga/notificationrequestmessage.h @@ -20,6 +20,10 @@ #ifndef NOTIFICATIONREQUESTMESSAGE_H #define NOTIFICATIONREQUESTMESSAGE_H +#include "icinga/i2-icinga.h" +#include "icinga/notification.h" +#include "remoting/messagepart.h" + namespace icinga { diff --git a/lib/icinga/nullchecktask.cpp b/lib/icinga/nullchecktask.cpp index eddf62abc..2f5d9687a 100644 --- a/lib/icinga/nullchecktask.cpp +++ b/lib/icinga/nullchecktask.cpp @@ -17,7 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/nullchecktask.h" +#include "icinga/service.h" +#include "base/dictionary.h" #include using namespace icinga; diff --git a/lib/icinga/nullchecktask.h b/lib/icinga/nullchecktask.h index e748e92d6..342604a3b 100644 --- a/lib/icinga/nullchecktask.h +++ b/lib/icinga/nullchecktask.h @@ -20,6 +20,7 @@ #ifndef NULLCHECKTASK_H #define NULLCHECKTASK_H +#include "icinga/i2-icinga.h" #include "base/scripttask.h" namespace icinga diff --git a/lib/icinga/perfdatawriter.cpp b/lib/icinga/perfdatawriter.cpp index 571f11f6f..3e866b4f3 100644 --- a/lib/icinga/perfdatawriter.cpp +++ b/lib/icinga/perfdatawriter.cpp @@ -17,11 +17,15 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/perfdatawriter.h" +#include "icinga/checkresultmessage.h" +#include "icinga/service.h" +#include "icinga/macroprocessor.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" #include "base/convert.h" +#include "base/application.h" #include using namespace icinga; diff --git a/lib/icinga/perfdatawriter.h b/lib/icinga/perfdatawriter.h index af37c2275..b7cf49c6d 100644 --- a/lib/icinga/perfdatawriter.h +++ b/lib/icinga/perfdatawriter.h @@ -20,6 +20,8 @@ #ifndef PERFDATAWRITER_H #define PERFDATAWRITER_H +#include "icinga/i2-icinga.h" +#include "remoting/endpoint.h" #include "base/dynamicobject.h" #include diff --git a/lib/icinga/pluginchecktask.cpp b/lib/icinga/pluginchecktask.cpp index 5c17dbe59..6b25fe8c0 100644 --- a/lib/icinga/pluginchecktask.cpp +++ b/lib/icinga/pluginchecktask.cpp @@ -17,7 +17,9 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/pluginchecktask.h" +#include "icinga/macroprocessor.h" +#include "base/dynamictype.h" #include #include #include diff --git a/lib/icinga/pluginchecktask.h b/lib/icinga/pluginchecktask.h index 71cdcf621..ee995020a 100644 --- a/lib/icinga/pluginchecktask.h +++ b/lib/icinga/pluginchecktask.h @@ -20,6 +20,8 @@ #ifndef PLUGINCHECKTASK_H #define PLUGINCHECKTASK_H +#include "icinga/i2-icinga.h" +#include "icinga/service.h" #include "base/scripttask.h" #include "base/process.h" diff --git a/lib/icinga/pluginnotificationtask.cpp b/lib/icinga/pluginnotificationtask.cpp index 975d86136..4a565c681 100644 --- a/lib/icinga/pluginnotificationtask.cpp +++ b/lib/icinga/pluginnotificationtask.cpp @@ -17,7 +17,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/pluginnotificationtask.h" +#include "icinga/notification.h" +#include "icinga/service.h" +#include "icinga/macroprocessor.h" +#include "base/scriptfunction.h" #include "base/logger_fwd.h" #include diff --git a/lib/icinga/pluginnotificationtask.h b/lib/icinga/pluginnotificationtask.h index c9a55f299..9aba9a968 100644 --- a/lib/icinga/pluginnotificationtask.h +++ b/lib/icinga/pluginnotificationtask.h @@ -20,6 +20,7 @@ #ifndef PLUGINNOTIFICATIONTASK_H #define PLUGINNOTIFICATIONTASK_H +#include "icinga/i2-icinga.h" #include "base/scripttask.h" #include "base/process.h" diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 330655cf6..f0c918f5c 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -17,8 +17,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" #include "icinga/service.h" +#include "icinga/icingaapplication.h" +#include "icinga/checkresultmessage.h" +#include "icinga/cib.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/icinga/service-comment.cpp b/lib/icinga/service-comment.cpp index e2e777eaf..148858ccc 100644 --- a/lib/icinga/service-comment.cpp +++ b/lib/icinga/service-comment.cpp @@ -17,7 +17,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" #include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" diff --git a/lib/icinga/service-downtime.cpp b/lib/icinga/service-downtime.cpp index fdba26dae..9738f4a2b 100644 --- a/lib/icinga/service-downtime.cpp +++ b/lib/icinga/service-downtime.cpp @@ -17,7 +17,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" #include "icinga/service.h" #include "base/dynamictype.h" #include "base/objectlock.h" diff --git a/lib/icinga/service-notification.cpp b/lib/icinga/service-notification.cpp index bad86a97b..84882fff7 100644 --- a/lib/icinga/service-notification.cpp +++ b/lib/icinga/service-notification.cpp @@ -17,10 +17,13 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" #include "icinga/service.h" +#include "icinga/notificationrequestmessage.h" +#include "remoting/endpointmanager.h" +#include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" +#include "config/configitembuilder.h" #include #include #include diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 28ef74b52..24166b0b9 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -17,10 +17,13 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" #include "icinga/service.h" +#include "icinga/servicegroup.h" +#include "icinga/icingaapplication.h" +#include "icinga/macroprocessor.h" #include "base/dynamictype.h" #include "base/objectlock.h" +#include "config/configitembuilder.h" #include #include diff --git a/lib/icinga/service.h b/lib/icinga/service.h index e41717f2f..40bbf7fab 100644 --- a/lib/icinga/service.h +++ b/lib/icinga/service.h @@ -20,7 +20,12 @@ #ifndef SERVICE_H #define SERVICE_H -#include "base/dynamictype.h" +#include "icinga/i2-icinga.h" +#include "icinga/host.h" +#include "icinga/timeperiod.h" +#include "icinga/notification.h" +#include "base/dynamicobject.h" +#include "base/array.h" #include namespace icinga diff --git a/lib/icinga/servicegroup.h b/lib/icinga/servicegroup.h index 5801c1d9b..07ce4961c 100644 --- a/lib/icinga/servicegroup.h +++ b/lib/icinga/servicegroup.h @@ -20,7 +20,10 @@ #ifndef SERVICEGROUP_H #define SERVICEGROUP_H +#include "icinga/i2-icinga.h" +#include "icinga/service.h" #include "base/dynamictype.h" +#include namespace icinga { diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 80e5f1385..31b7bf99b 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -17,11 +17,12 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/timeperiod.h" #include "base/dynamictype.h" #include "base/scriptfunction.h" #include "base/objectlock.h" #include "base/logger_fwd.h" +#include "config/configitem.h" #include #include @@ -69,11 +70,15 @@ void TimePeriod::AddSegment(double begin, double end) { ASSERT(OwnsLock()); - if (m_ValidBegin.IsEmpty() || begin < m_ValidBegin) + if (m_ValidBegin.IsEmpty() || begin < m_ValidBegin) { m_ValidBegin = begin; + Touch("valid_begin"); + } - if (m_ValidEnd.IsEmpty() || end > m_ValidEnd) + if (m_ValidEnd.IsEmpty() || end > m_ValidEnd) { m_ValidEnd = end; + Touch("valid_end"); + } Array::Ptr segments = m_Segments; @@ -119,11 +124,15 @@ void TimePeriod::RemoveSegment(double begin, double end) { ASSERT(OwnsLock()); - if (m_ValidBegin.IsEmpty() || begin < m_ValidBegin) + if (m_ValidBegin.IsEmpty() || begin < m_ValidBegin) { m_ValidBegin = begin; + Touch("valid_begin"); + } - if (m_ValidEnd.IsEmpty() || end > m_ValidEnd) + if (m_ValidEnd.IsEmpty() || end > m_ValidEnd) { m_ValidEnd = end; + Touch("valid_end"); + } Array::Ptr segments = m_Segments; @@ -168,6 +177,7 @@ void TimePeriod::PurgeSegments(double end) return; m_ValidBegin = end; + Touch("valid_begin"); Array::Ptr segments = m_Segments; @@ -276,13 +286,17 @@ void TimePeriod::UpdateTimerHandler(void) if (!ConfigItem::GetObject("TimePeriod", tp->GetName())) continue; + double valid_end; + { ObjectLock olock(tp); tp->PurgeSegments(now - 3600); + + valid_end = tp->m_ValidEnd; } - if (tp->m_ValidEnd < now + 3 * 3600) - tp->UpdateRegion(tp->m_ValidEnd, tp->m_ValidEnd + 24 * 3600); + if (valid_end < now + 3 * 3600) + tp->UpdateRegion(valid_end, now + 24 * 3600); } } diff --git a/lib/icinga/timeperiod.h b/lib/icinga/timeperiod.h index 98a07d93b..bc89bb2b4 100644 --- a/lib/icinga/timeperiod.h +++ b/lib/icinga/timeperiod.h @@ -20,6 +20,10 @@ #ifndef TIMEPERIOD_H #define TIMEPERIOD_H +#include "icinga/i2-icinga.h" +#include "base/dynamicobject.h" +#include "base/array.h" + namespace icinga { diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index b90ed9d00..41a843b76 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/user.h" +#include "icinga/usergroup.h" #include "base/dynamictype.h" #include diff --git a/lib/icinga/user.h b/lib/icinga/user.h index 56d10de95..dd0e849b6 100644 --- a/lib/icinga/user.h +++ b/lib/icinga/user.h @@ -20,6 +20,10 @@ #ifndef USER_H #define USER_H +#include "icinga/i2-icinga.h" +#include "base/dynamicobject.h" +#include "base/array.h" + namespace icinga { diff --git a/lib/icinga/usergroup.cpp b/lib/icinga/usergroup.cpp index 396206585..9d1a417b0 100644 --- a/lib/icinga/usergroup.cpp +++ b/lib/icinga/usergroup.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-icinga.h" +#include "icinga/usergroup.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/icinga/usergroup.h b/lib/icinga/usergroup.h index 3ac92bb81..4d6365b3f 100644 --- a/lib/icinga/usergroup.h +++ b/lib/icinga/usergroup.h @@ -20,6 +20,8 @@ #ifndef USERGROUP_H #define USERGROUP_H +#include "icinga/i2-icinga.h" +#include "icinga/user.h" #include "base/dynamicobject.h" namespace icinga diff --git a/lib/python/i2-python.h b/lib/python/i2-python.h index 8b6a68799..271b4726d 100644 --- a/lib/python/i2-python.h +++ b/lib/python/i2-python.h @@ -29,8 +29,6 @@ #include #include -#include -#include #ifdef I2_PYTHON_BUILD # define I2_PYTHON_API I2_EXPORT @@ -38,7 +36,4 @@ # define I2_PYTHON_API I2_IMPORT #endif /* I2_PYTHON_BUILD */ -#include "pythonlanguage.h" -#include "pythoninterpreter.h" - #endif /* I2PYTHON_H */ diff --git a/lib/remoting/Makefile.am b/lib/remoting/Makefile.am index 674d6280c..3c4093a04 100644 --- a/lib/remoting/Makefile.am +++ b/lib/remoting/Makefile.am @@ -7,12 +7,14 @@ pkglib_LTLIBRARIES = \ .conf.cpp: $(top_builddir)/tools/mkembedconfig.c $(top_builddir)/tools/mkembedconfig $< $@ +EXTRA_DIST = \ + i2-remoting.cpp + libremoting_la_SOURCES = \ endpoint.cpp \ endpoint.h \ endpointmanager.cpp \ endpointmanager.h \ - i2-remoting.cpp \ i2-remoting.h \ jsonrpcconnection.cpp \ jsonrpcconnection.h \ diff --git a/lib/remoting/endpoint.cpp b/lib/remoting/endpoint.cpp index e7bf05615..c4470bd19 100644 --- a/lib/remoting/endpoint.cpp +++ b/lib/remoting/endpoint.cpp @@ -17,11 +17,13 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/endpoint.h" +#include "remoting/endpointmanager.h" #include "base/application.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" +#include "config/configitembuilder.h" #include using namespace icinga; diff --git a/lib/remoting/endpoint.h b/lib/remoting/endpoint.h index e60c8f5dc..5a09732ad 100644 --- a/lib/remoting/endpoint.h +++ b/lib/remoting/endpoint.h @@ -20,6 +20,10 @@ #ifndef ENDPOINT_H #define ENDPOINT_H +#include "remoting/i2-remoting.h" +#include "remoting/requestmessage.h" +#include "remoting/responsemessage.h" +#include "remoting/jsonrpcconnection.h" #include "base/dynamicobject.h" #include diff --git a/lib/remoting/endpointmanager.cpp b/lib/remoting/endpointmanager.cpp index a0e2b27dc..6694b4e3d 100644 --- a/lib/remoting/endpointmanager.cpp +++ b/lib/remoting/endpointmanager.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/endpointmanager.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/remoting/endpointmanager.h b/lib/remoting/endpointmanager.h index e180a983b..9f0cc3e29 100644 --- a/lib/remoting/endpointmanager.h +++ b/lib/remoting/endpointmanager.h @@ -20,6 +20,8 @@ #ifndef ENDPOINTMANAGER_H #define ENDPOINTMANAGER_H +#include "remoting/i2-remoting.h" +#include "remoting/endpoint.h" #include "base/tcpsocket.h" #include "base/tlsstream.h" #include diff --git a/lib/remoting/i2-remoting.h b/lib/remoting/i2-remoting.h index 47c4ade2a..e44cafcd9 100644 --- a/lib/remoting/i2-remoting.h +++ b/lib/remoting/i2-remoting.h @@ -28,7 +28,6 @@ */ #include "base/i2-base.h" -#include "config/i2-config.h" #ifdef I2_REMOTING_BUILD # define I2_REMOTING_API I2_EXPORT @@ -36,11 +35,4 @@ # define I2_REMOTING_API I2_IMPORT #endif /* I2_REMOTING_BUILD */ -#include "messagepart.h" -#include "requestmessage.h" -#include "responsemessage.h" -#include "jsonrpcconnection.h" -#include "endpoint.h" -#include "endpointmanager.h" - #endif /* I2REMOTING_H */ diff --git a/lib/remoting/jsonrpcconnection.cpp b/lib/remoting/jsonrpcconnection.cpp index b7ac5d727..a6225288e 100644 --- a/lib/remoting/jsonrpcconnection.cpp +++ b/lib/remoting/jsonrpcconnection.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/jsonrpcconnection.h" #include "base/netstring.h" #include "base/objectlock.h" #include "base/logger_fwd.h" diff --git a/lib/remoting/jsonrpcconnection.h b/lib/remoting/jsonrpcconnection.h index daeec311d..3aaaa247e 100644 --- a/lib/remoting/jsonrpcconnection.h +++ b/lib/remoting/jsonrpcconnection.h @@ -20,6 +20,8 @@ #ifndef JSONRPCCONNECTION_H #define JSONRPCCONNECTION_H +#include "remoting/i2-remoting.h" +#include "remoting/messagepart.h" #include "base/connection.h" #include diff --git a/lib/remoting/messagepart.cpp b/lib/remoting/messagepart.cpp index 4da41ebc4..69a1f5fc3 100644 --- a/lib/remoting/messagepart.cpp +++ b/lib/remoting/messagepart.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/messagepart.h" #include using namespace icinga; diff --git a/lib/remoting/messagepart.h b/lib/remoting/messagepart.h index 385cc9b2a..1c02fd258 100644 --- a/lib/remoting/messagepart.h +++ b/lib/remoting/messagepart.h @@ -20,6 +20,9 @@ #ifndef MESSAGEPART_H #define MESSAGEPART_H +#include "remoting/i2-remoting.h" +#include "base/dictionary.h" + struct cJSON; namespace icinga diff --git a/lib/remoting/requestmessage.cpp b/lib/remoting/requestmessage.cpp index c18b8596c..a530317ba 100644 --- a/lib/remoting/requestmessage.cpp +++ b/lib/remoting/requestmessage.cpp @@ -17,6 +17,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/requestmessage.h" using namespace icinga; diff --git a/lib/remoting/requestmessage.h b/lib/remoting/requestmessage.h index 506885628..eb75752cb 100644 --- a/lib/remoting/requestmessage.h +++ b/lib/remoting/requestmessage.h @@ -20,6 +20,9 @@ #ifndef REQUESTMESSAGE_H #define REQUESTMESSAGE_H +#include "remoting/i2-remoting.h" +#include "remoting/messagepart.h" + namespace icinga { diff --git a/lib/remoting/responsemessage.cpp b/lib/remoting/responsemessage.cpp index c18b8596c..5461015e9 100644 --- a/lib/remoting/responsemessage.cpp +++ b/lib/remoting/responsemessage.cpp @@ -17,6 +17,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "i2-remoting.h" +#include "remoting/responsemessage.h" using namespace icinga; diff --git a/lib/remoting/responsemessage.h b/lib/remoting/responsemessage.h index d46ef18a2..a3cd9b9e6 100644 --- a/lib/remoting/responsemessage.h +++ b/lib/remoting/responsemessage.h @@ -20,6 +20,9 @@ #ifndef RESPONSEMESSAGE_H #define RESPONSEMESSAGE_H +#include "remoting/i2-remoting.h" +#include "remoting/messagepart.h" + namespace icinga {