diff --git a/base/application.h b/base/application.h index 07eee7941..1e0a98906 100644 --- a/base/application.h +++ b/base/application.h @@ -1,5 +1,5 @@ -#ifndef I2_APPLICATION_H -#define I2_APPLICATION_H +#ifndef APPLICATION_H +#define APPLICATION_H #include @@ -42,7 +42,7 @@ public: }; template -int i2_main(int argc, char **argv) +int application_main(int argc, char **argv) { int result; @@ -64,9 +64,9 @@ int i2_main(int argc, char **argv) #define SET_START_CLASS(klass) \ int main(int argc, char **argv) { \ - return i2_main(argc, argv); \ + return application_main(argc, argv); \ } } -#endif /* I2_APPLICATION_H */ +#endif /* APPLICATION_H */ diff --git a/base/component.h b/base/component.h index d7d3c93b2..2fd12cbdc 100644 --- a/base/component.h +++ b/base/component.h @@ -1,5 +1,5 @@ -#ifndef I2_COMPONENT_H -#define I2_COMPONENT_H +#ifndef COMPONENT_H +#define COMPONENT_H namespace icinga { @@ -33,4 +33,4 @@ public: } -#endif /* I2_COMPONENT_H */ +#endif /* COMPONENT_H */ diff --git a/base/condvar.h b/base/condvar.h index 6ce196e4d..b34689be1 100644 --- a/base/condvar.h +++ b/base/condvar.h @@ -1,5 +1,5 @@ -#ifndef I2_CONDVAR_H -#define I2_CONDVAR_H +#ifndef CONDVAR_H +#define CONDVAR_H namespace icinga { @@ -30,4 +30,4 @@ public: } -#endif /* I2_CONDVAR_H */ \ No newline at end of file +#endif /* CONDVAR_H */ diff --git a/base/confighive.h b/base/confighive.h index bd0c3523e..8425bf31f 100644 --- a/base/confighive.h +++ b/base/confighive.h @@ -1,5 +1,5 @@ -#ifndef I2_CONFIGHIVE_H -#define I2_CONFIGHIVE_H +#ifndef CONFIGHIVE_H +#define CONFIGHIVE_H #include @@ -39,4 +39,4 @@ public: } -#endif /* I2_CONFIGHIVE_H */ +#endif /* CONFIGHIVE_H */ diff --git a/base/configobject.h b/base/configobject.h index 2ee0f5a99..150cafb34 100644 --- a/base/configobject.h +++ b/base/configobject.h @@ -1,5 +1,5 @@ -#ifndef I2_CONFIGOBJECT_H -#define I2_CONFIGOBJECT_H +#ifndef CONFIGOBJECT_H +#define CONFIGOBJECT_H #include @@ -46,4 +46,4 @@ public: } -#endif /* I2_CONFIGOBJECT_H */ +#endif /* CONFIGOBJECT_H */ diff --git a/base/delegate.h b/base/delegate.h index 232291abb..8a6f455ce 100644 --- a/base/delegate.h +++ b/base/delegate.h @@ -1,5 +1,5 @@ -#ifndef I2_DELEGATE_H -#define I2_DELEGATE_H +#ifndef DELEGATE_H +#define DELEGATE_H #include @@ -42,4 +42,4 @@ function bind_weak(int (TObject::*function)(TArgs), shared_ptr #include @@ -53,4 +53,4 @@ #include "application.h" #include "component.h" -#endif /* I2_BASE_H */ \ No newline at end of file +#endif /* I2BASE_H */ diff --git a/base/memory.h b/base/memory.h index 6e7cc90bb..e23530cc0 100644 --- a/base/memory.h +++ b/base/memory.h @@ -1,5 +1,5 @@ -#ifndef I2_MEMORY_H -#define I2_MEMORY_H +#ifndef MEMORY_H +#define MEMORY_H namespace icinga { @@ -21,4 +21,4 @@ public: } -#endif /* I2_MEMORY_H */ \ No newline at end of file +#endif /* MEMORY_H */ diff --git a/base/mutex.h b/base/mutex.h index 6d0edd10f..2d8d317b4 100644 --- a/base/mutex.h +++ b/base/mutex.h @@ -1,5 +1,5 @@ -#ifndef I2_MUTEX_H -#define I2_MUTEX_H +#ifndef MUTEX_H +#define MUTEX_H namespace icinga { @@ -30,4 +30,4 @@ public: } -#endif /* I2_MUTEX_H */ +#endif /* MUTEX_H */ diff --git a/base/object.h b/base/object.h index 1c5ad0e2e..f62e60815 100644 --- a/base/object.h +++ b/base/object.h @@ -1,5 +1,5 @@ -#ifndef I2_OBJECT_H -#define I2_OBJECT_H +#ifndef OBJECT_H +#define OBJECT_H namespace icinga { @@ -60,4 +60,4 @@ Object::RefType factory(void) } -#endif /* I2_OBJECT_H */ +#endif /* OBJECT_H */ diff --git a/base/socket.h b/base/socket.h index 375092282..d1e867189 100644 --- a/base/socket.h +++ b/base/socket.h @@ -1,5 +1,5 @@ -#ifndef I2_SOCKET_H -#define I2_SOCKET_H +#ifndef SOCKET_H +#define SOCKET_H namespace icinga { @@ -43,4 +43,4 @@ public: } -#endif /* I2_SOCKET_H */ +#endif /* SOCKET_H */ diff --git a/base/tcpclient.h b/base/tcpclient.h index 8751ba822..46b24084e 100644 --- a/base/tcpclient.h +++ b/base/tcpclient.h @@ -1,5 +1,5 @@ -#ifndef I2_TCPCLIENT_H -#define I2_TCPCLIENT_H +#ifndef TCPCLIENT_H +#define TCPCLIENT_H namespace icinga { @@ -34,4 +34,4 @@ public: } -#endif /* I2_TCPCLIENT_H */ +#endif /* TCPCLIENT_H */ diff --git a/base/tcpserver.h b/base/tcpserver.h index e97ad8d84..a666b1eb1 100644 --- a/base/tcpserver.h +++ b/base/tcpserver.h @@ -1,5 +1,5 @@ -#ifndef I2_TCPSERVER_H -#define I2_TCPSERVER_H +#ifndef TCPSERVER_H +#define TCPSERVER_H namespace icinga { @@ -39,4 +39,4 @@ public: } -#endif /* I2_TCPSERVER_H */ +#endif /* TCPSERVER_H */ diff --git a/base/tcpsocket.h b/base/tcpsocket.h index 3538cfab7..89d67be5b 100644 --- a/base/tcpsocket.h +++ b/base/tcpsocket.h @@ -1,5 +1,5 @@ -#ifndef I2_TCPSOCKET_H -#define I2_TCPSOCKET_H +#ifndef TCPSOCKET_H +#define TCPSOCKET_H namespace icinga { @@ -18,4 +18,4 @@ public: } -#endif /* I2_TCPSOCKET_H */ \ No newline at end of file +#endif /* TCPSOCKET_H */ diff --git a/base/thread.h b/base/thread.h index 8306942da..a5b364fbd 100644 --- a/base/thread.h +++ b/base/thread.h @@ -1,5 +1,5 @@ -#ifndef I2_THREAD_H -#define I2_THREAD_H +#ifndef THREAD_H +#define THREAD_H namespace icinga { @@ -24,4 +24,4 @@ public: } -#endif /* I2_THREAD_H */ +#endif /* THREAD_H */ diff --git a/base/timer.h b/base/timer.h index 8f766af72..1730068a0 100644 --- a/base/timer.h +++ b/base/timer.h @@ -1,5 +1,5 @@ -#ifndef I2_TIMER_H -#define I2_TIMER_H +#ifndef TIMER_H +#define TIMER_H #include @@ -54,4 +54,4 @@ public: } -#endif /* I2_TIMER_H */ +#endif /* TIMER_H */ diff --git a/base/unix.h b/base/unix.h index 54d4abe97..a2bda9804 100644 --- a/base/unix.h +++ b/base/unix.h @@ -1,5 +1,5 @@ -#ifndef I2_UNIX_H -#define I2_UNIX_H +#ifndef UNIX_H +#define UNIX_H #include #include @@ -62,4 +62,4 @@ inline void *GetProcAddress(HMODULE module, const char *function) return lt_dlsym(module, function); } -#endif /* I2_UNIX_H */ \ No newline at end of file +#endif /* UNIX_H */ diff --git a/base/win32.h b/base/win32.h index a75c521a6..44b9fc86f 100644 --- a/base/win32.h +++ b/base/win32.h @@ -1,5 +1,5 @@ -#ifndef I2_WIN32_H -#define I2_WIN32_H +#ifndef WIN32_H +#define WIN32_H #define NOGDI #include @@ -10,4 +10,4 @@ typedef int socklen_t; #define I2_EXPORT __declspec(dllexport) #define I2_IMPORT __declspec(dllimport) -#endif /* I2_WIN32_H */ \ No newline at end of file +#endif /* WIN32_H */ diff --git a/configfilecomponent/configfilecomponent.cpp b/configfilecomponent/configfilecomponent.cpp index 34438e6fd..b50eda4d9 100644 --- a/configfilecomponent/configfilecomponent.cpp +++ b/configfilecomponent/configfilecomponent.cpp @@ -17,8 +17,8 @@ void ConfigFileComponent::Start(void) FIFO::RefType fifo = new_object(); string filename; - if (!GetConfig()->GetProperty("filename", &filename)) - throw exception(/*"Missing filename property"*/); + if (!GetConfig()->GetProperty("configFilename", &filename)) + throw exception(/*"Missing configFilename property"*/); fp.open(filename.c_str(), ifstream::in); if (fp.fail()) diff --git a/configfilecomponent/configfilecomponent.h b/configfilecomponent/configfilecomponent.h index 0039d8fda..58ddf4338 100644 --- a/configfilecomponent/configfilecomponent.h +++ b/configfilecomponent/configfilecomponent.h @@ -1,5 +1,5 @@ -#ifndef I2_CONFIGFILECOMPONENT_H -#define I2_CONFIGFILECOMPONENT_H +#ifndef CONFIGFILECOMPONENT_H +#define CONFIGFILECOMPONENT_H namespace icinga { @@ -17,4 +17,4 @@ public: } -#endif /* I2_CONFIGFILECOMPONENT_H */ \ No newline at end of file +#endif /* CONFIGFILECOMPONENT_H */ diff --git a/configfilecomponent/i2-configfilecomponent.h b/configfilecomponent/i2-configfilecomponent.h index 64de42294..c476c1835 100644 --- a/configfilecomponent/i2-configfilecomponent.h +++ b/configfilecomponent/i2-configfilecomponent.h @@ -1,8 +1,8 @@ -#ifndef I2_I2CONFIGFILECOMPONENT_H -#define I2_I2CONFIGFILECOMPONENT_H +#ifndef I2CONFIGFILECOMPONENT_H +#define I2CONFIGFILECOMPONENT_H #include #include "configfilecomponent.h" -#endif /* I2_I2CONFIGFILECOMPONENT_H */ +#endif /* I2CONFIGFILECOMPONENT_H */ diff --git a/configrpccomponent/configrpccomponent.h b/configrpccomponent/configrpccomponent.h index ee0905eb3..c84fe5619 100644 --- a/configrpccomponent/configrpccomponent.h +++ b/configrpccomponent/configrpccomponent.h @@ -1,5 +1,5 @@ -#ifndef I2_CONFIGRPCCOMPONENT_H -#define I2_CONFIGRPCCOMPONENT_H +#ifndef CONFIGRPCCOMPONENT_H +#define CONFIGRPCCOMPONENT_H namespace icinga { @@ -29,4 +29,4 @@ public: } -#endif /* I2_CONFIGRPCCOMPONENT_H */ +#endif /* CONFIGRPCCOMPONENT_H */ diff --git a/configrpccomponent/i2-configrpccomponent.h b/configrpccomponent/i2-configrpccomponent.h index 514ea3152..dd3d9c983 100644 --- a/configrpccomponent/i2-configrpccomponent.h +++ b/configrpccomponent/i2-configrpccomponent.h @@ -1,5 +1,5 @@ -#ifndef I2_I2CONFIGCOMPONENT_H -#define I2_I2CONFIGCOMPONENT_H +#ifndef I2CONFIGCOMPONENT_H +#define I2CONFIGCOMPONENT_H #include #include @@ -7,4 +7,4 @@ #include "configrpccomponent.h" -#endif /* I2_I2CONFIGCOMPONENT_H */ +#endif /* I2CONFIGCOMPONENT_H */ diff --git a/icinga/i2-icinga.h b/icinga/i2-icinga.h index ca653f31a..fd61e6fca 100644 --- a/icinga/i2-icinga.h +++ b/icinga/i2-icinga.h @@ -1,9 +1,9 @@ -#ifndef I2_ICINGA_H -#define I2_ICINGA_H +#ifndef I2ICINGA_H +#define I2ICINGA_H #include #include #include "icingaapplication.h" -#endif /* I2_ICINGA_H */ +#endif /* I2ICINGA_H */ diff --git a/icinga/icingaapplication.cpp b/icinga/icingaapplication.cpp index f9a9ffac2..948953382 100644 --- a/icinga/icingaapplication.cpp +++ b/icinga/icingaapplication.cpp @@ -31,8 +31,7 @@ int IcingaApplication::Main(const vector& args) ConfigObject::RefType fileComponentConfig = new_object(); fileComponentConfig->SetName("configfilecomponent"); fileComponentConfig->SetType("component"); - fileComponentConfig->SetProperty("path", "libconfigfilecomponent.la"); - fileComponentConfig->SetProperty("filename", "icinga.conf"); + fileComponentConfig->SetProperty("configFilename", "icinga.conf"); GetConfigHive()->AddObject(fileComponentConfig); RunEventLoop(); @@ -50,8 +49,15 @@ int IcingaApplication::ConfigObjectCreatedHandler(ConfigHiveEventArgs::RefType e if (ea->Object->GetType() == "component") { string path; - if (!ea->Object->GetProperty("path", &path)) - throw exception(/*"Missing path property"*/); + if (!ea->Object->GetProperty("path", &path)) { +#ifdef _WIN32 + path = ea->Object->GetName() + ".dll"; +#else /* _WIN32 */ + path = "lib" + ea->Object->GetName() + ".la"; +#endif /* _WIN32 */ + + // TODO: try to figure out where the component is located */ + } LoadComponent(path, ea->Object); } diff --git a/icinga/icingaapplication.h b/icinga/icingaapplication.h index 209e6b655..f7f92d0a4 100644 --- a/icinga/icingaapplication.h +++ b/icinga/icingaapplication.h @@ -1,5 +1,5 @@ -#ifndef I2_ICINGAAPPLICATION_H -#define I2_ICINGAAPPLICATION_H +#ifndef ICINGAAPPLICATION_H +#define ICINGAAPPLICATION_H namespace icinga { @@ -25,4 +25,4 @@ public: } -#endif /* I2_ICINGAAPPLICATION_H */ +#endif /* ICINGAAPPLICATION_H */ diff --git a/jsonrpc/connectionmanager.h b/jsonrpc/connectionmanager.h index f92b802b8..934244492 100644 --- a/jsonrpc/connectionmanager.h +++ b/jsonrpc/connectionmanager.h @@ -1,5 +1,5 @@ -#ifndef I2_CONNECTIONMANAGER_H -#define I2_CONNECTIONMANAGER_H +#ifndef CONNECTIONMANAGER_H +#define CONNECTIONMANAGER_H namespace icinga { @@ -34,4 +34,4 @@ public: } -#endif /* I2_CONNECTIONMANAGER_H */ +#endif /* CONNECTIONMANAGER_H */ diff --git a/jsonrpc/i2-jsonrpc.h b/jsonrpc/i2-jsonrpc.h index a25d58ce0..dfbec61c2 100644 --- a/jsonrpc/i2-jsonrpc.h +++ b/jsonrpc/i2-jsonrpc.h @@ -1,5 +1,5 @@ -#ifndef I2_JSONRPC_H -#define I2_JSONRPC_H +#ifndef I2JSONRPC_H +#define I2JSONRPC_H #include #include @@ -11,4 +11,4 @@ #include "jsonrpcserver.h" #include "connectionmanager.h" -#endif /* I2_JSONRPC_H */ +#endif /* I2JSONRPC_H */ diff --git a/jsonrpc/jsonrpcclient.h b/jsonrpc/jsonrpcclient.h index 58e6e3edc..6d66898a8 100644 --- a/jsonrpc/jsonrpcclient.h +++ b/jsonrpc/jsonrpcclient.h @@ -1,5 +1,5 @@ -#ifndef I2_JSONRPCCLIENT_H -#define I2_JSONRPCCLIENT_H +#ifndef JSONRPCCLIENT_H +#define JSONRPCCLIENT_H namespace icinga { @@ -30,4 +30,4 @@ public: } -#endif /* I2_JSONRPCCLIENT_H */ +#endif /* JSONRPCCLIENT_H */ diff --git a/jsonrpc/jsonrpcmessage.h b/jsonrpc/jsonrpcmessage.h index 1f63d553c..b6c34566b 100644 --- a/jsonrpc/jsonrpcmessage.h +++ b/jsonrpc/jsonrpcmessage.h @@ -1,5 +1,5 @@ -#ifndef I2_JSONRPCMESSAGE_H -#define I2_JSONRPCMESSAGE_H +#ifndef JSONRPCMESSAGE_H +#define JSONRPCMESSAGE_H namespace icinga { @@ -53,4 +53,4 @@ public: } -#endif /* I2_JSONRPCMESSAGE_H */ +#endif /* JSONRPCMESSAGE_H */ diff --git a/jsonrpc/jsonrpcserver.h b/jsonrpc/jsonrpcserver.h index 70c70c4a7..4dde75311 100644 --- a/jsonrpc/jsonrpcserver.h +++ b/jsonrpc/jsonrpcserver.h @@ -1,5 +1,5 @@ -#ifndef I2_JSONRPCSERVER_H -#define I2_JSONRPCSERVER_H +#ifndef JSONRPCSERVER_H +#define JSONRPCSERVER_H namespace icinga { @@ -15,4 +15,4 @@ public: } -#endif /* I2_JSONRPCSERVER_H */ \ No newline at end of file +#endif /* JSONRPCSERVER_H */ diff --git a/jsonrpc/netstring.h b/jsonrpc/netstring.h index f44e3f61d..4c2152a44 100644 --- a/jsonrpc/netstring.h +++ b/jsonrpc/netstring.h @@ -1,5 +1,5 @@ -#ifndef I2_NETSTRING_H -#define I2_NETSTRING_H +#ifndef NETSTRING_H +#define NETSTRING_H namespace icinga { @@ -20,4 +20,4 @@ public: } -#endif /* I2_NETSTRING_H */ +#endif /* NETSTRING_H */