diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-19 14:54:53 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-19 14:54:53 +0100 |
commit | 9829fdd1e6aa72c1703d27160fbed432eccf33e4 (patch) | |
tree | 827808f590d11d6d4a655390e2ababa143abe677 | |
parent | 71d3637ffe75f9dd910d418e9b9d5242ec9ac423 (diff) | |
download | abrt-9829fdd1e6aa72c1703d27160fbed432eccf33e4.tar.gz abrt-9829fdd1e6aa72c1703d27160fbed432eccf33e4.tar.xz abrt-9829fdd1e6aa72c1703d27160fbed432eccf33e4.zip |
Removed unneeded files.
-rw-r--r-- | lib/DBus/DBusClient.cpp | 51 | ||||
-rw-r--r-- | lib/DBus/DBusClient.h | 38 | ||||
-rw-r--r-- | lib/DBus/DBusClientProxy.h | 85 | ||||
-rw-r--r-- | lib/DBus/DBusCommon.h | 28 | ||||
-rw-r--r-- | lib/DBus/DBusManager.cpp | 66 | ||||
-rw-r--r-- | lib/DBus/DBusManager.h | 53 | ||||
-rw-r--r-- | lib/DBus/DBusServer.cpp | 47 | ||||
-rw-r--r-- | lib/DBus/DBusServer.h | 34 | ||||
-rw-r--r-- | lib/DBus/DBusServerProxy.h | 114 | ||||
-rw-r--r-- | lib/DBus/DbusClient.h | 15 | ||||
-rw-r--r-- | lib/DBus/Makefile.am | 20 | ||||
-rw-r--r-- | lib/DBus/marshal.c | 51 | ||||
-rw-r--r-- | lib/DBus/marshal.h | 15 | ||||
-rw-r--r-- | lib/DBus/marshal.list | 1 | ||||
-rw-r--r-- | lib/DBus/test.cpp | 86 | ||||
-rw-r--r-- | lib/DBus/test_client.cpp | 61 | ||||
-rw-r--r-- | lib/DBus/test_server.cpp | 45 |
17 files changed, 0 insertions, 810 deletions
diff --git a/lib/DBus/DBusClient.cpp b/lib/DBus/DBusClient.cpp deleted file mode 100644 index cb9c3a0e..00000000 --- a/lib/DBus/DBusClient.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "DBusClient.h" -#include <iostream> - -CDBusClient::CDBusClient(DBus::Connection &connection, const char *path, const char *name) -: DBus::ObjectProxy(connection, path, name) -{ - m_pCrashHandler = NULL; - std::cerr << "Client created" << std::endl; -} - -CDBusClient::~CDBusClient() -{ - //clean -} - -void CDBusClient::Crash(std::string &value) -{ - if(m_pCrashHandler) - { - m_pCrashHandler(value.c_str()); - } - else - { - std::cout << "This is default handler, you should register your own with ConnectCrashHandler" << std::endl; - std::cout.flush(); - } -} - -void CDBusClient::ConnectCrashHandler(void (*pCrashHandler)(const char *progname)) -{ - m_pCrashHandler = pCrashHandler; -} diff --git a/lib/DBus/DBusClient.h b/lib/DBus/DBusClient.h deleted file mode 100644 index 5460141c..00000000 --- a/lib/DBus/DBusClient.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <dbus-c++/dbus.h> -#include "DBusClientProxy.h" - -class CDBusClient -: public CDBusClient_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -private: - /* the real signal handler called to handle the signal */ - void (*m_pCrashHandler)(const char *progname); -public: - - CDBusClient(DBus::Connection &connection, const char *path, const char *name); - ~CDBusClient(); - void ConnectCrashHandler(void (*pCrashHandler)(const char *progname)); - void Crash(std::string &value); -}; - diff --git a/lib/DBus/DBusClientProxy.h b/lib/DBus/DBusClientProxy.h deleted file mode 100644 index f0b8a001..00000000 --- a/lib/DBus/DBusClientProxy.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <dbus-c++/dbus.h> -#include <dbus-c++/glib-integration.h> -#include "DBusCommon.h" - -class CDBusClient_proxy - : public DBus::InterfaceProxy -{ -public: - - CDBusClient_proxy() - : DBus::InterfaceProxy(CC_DBUS_IFACE) - { - //# define connect_signal(interface, signal, callback) - connect_signal(CDBusClient_proxy, Crash, _Crash_stub); - } - -public: - - /* properties exported by this interface */ -public: - - /* methods exported by this interface, - * this functions will invoke the corresponding methods on the remote objects - */ - /* - - < - <m_sUUID;m_sUID;m_sCount;m_sExecutable;m_sPackage> - <m_sUUID;m_sUID;m_sCount;m_sExecutable;m_sPackage> - <m_sUUID;m_sUID;m_sCount;m_sExecutable;m_sPackage> - ... - > - */ - dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID) - { - DBus::CallMessage call; - - DBus::MessageIter wi = call.writer(); - - wi << pUID; - call.member("GetCrashInfos"); - DBus::Message ret = invoke_method(call); - DBus::MessageIter ri = ret.reader(); - - dbus_vector_crash_infos_t argout; - ri >> argout; - return argout; - } -public: - - /* signal handlers for this interface - */ - virtual void Crash(std::string& value) = 0; - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual signal handler) - */ - void _Crash_stub(const ::DBus::SignalMessage &sig) - { - DBus::MessageIter ri = sig.reader(); - - std::string value; ri >> value; - Crash(value); - } -}; diff --git a/lib/DBus/DBusCommon.h b/lib/DBus/DBusCommon.h deleted file mode 100644 index 8b36d82d..00000000 --- a/lib/DBus/DBusCommon.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* we need this to know the data structures */ -#include "MiddleWare.h" - -#define CC_DBUS_NAME "com.redhat.CrashCatcher" -#define CC_DBUS_PATH "/com/redhat/CrashCatcher" -#define CC_DBUS_IFACE "com.redhat.CrashCatcher" - -//typedef std::vector<crash_info_t> vector_crash_infos_t; -typedef std::vector< std::vector<std::string> > dbus_vector_crash_infos_t; diff --git a/lib/DBus/DBusManager.cpp b/lib/DBus/DBusManager.cpp deleted file mode 100644 index 456c1786..00000000 --- a/lib/DBus/DBusManager.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "DBusManager.h" -#include <iostream> -#include "marshal.h" - -CDBusManager::CDBusManager() -{ - DBus::default_dispatcher = new DBus::Glib::BusDispatcher(); - m_pConn = new DBus::Connection(DBus::Connection::SessionBus()); - -} - -CDBusManager::~CDBusManager() -{ - //delete DBus::default_dispatcher - // delete m_pConn -} - -/* register name com.redhat.CrashCatcher on dbus */ -void CDBusManager::RegisterService() -{ - /* this can lead to race condition - rewrite with better check */ - if(m_pConn->has_name(CC_DBUS_NAME)) - { - /* shouldn't happen, but ... */ - throw std::string("Name already taken: ") + CC_DBUS_NAME; - } - /* register our name */ - m_pConn->request_name(CC_DBUS_NAME,DBUS_NAME_FLAG_DO_NOT_QUEUE); -#ifdef DEBUG - std::cout << "Service running" << std::endl; -#endif -} - -bool CDBusManager::SendMessage(const std::string& pMessage, const std::string& pMessParam) -{ - const char *progname = pMessParam.c_str(); - DBus::SignalMessage mess(CC_DBUS_PATH, CC_DBUS_NAME, pMessage.c_str()); - /* append some info to the signal */ - mess.append(DBUS_TYPE_STRING,&progname,DBUS_TYPE_INVALID); - /* send the message */ - m_pConn->send(mess); - /* flush - to make sure it's not stuck in queue */ - // probably not needed - //m_pConn->flush(); - std::cerr << "Message sent!" << std::endl; - return TRUE; -} diff --git a/lib/DBus/DBusManager.h b/lib/DBus/DBusManager.h deleted file mode 100644 index 34181698..00000000 --- a/lib/DBus/DBusManager.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef DBUS_H_ -#define DBUS_H_ - -#include <string> -#include <dbus/dbus.h> -//#include <glibmm.h> -#include <dbus-c++/glib-integration.h> -#include <dbus-c++/dbus.h> - -#define CC_DBUS_NAME "com.redhat.CrashCatcher" -#define CC_DBUS_PATH "/com/redhat/CrashCatcher" -#define CC_DBUS_IFACE "com.redhat.CrashCatcher" -#define DBUS_BUS DBUS_BUS_SYSTEM -#define CC_DBUS_PATH_NOTIFIER "/com/redhat/CrashCatcher/Crash" - - - -class CDBusManager -{ - private: - DBus::Glib::BusDispatcher *m_pDispatcher; - DBus::Connection *m_pConn; - public: - CDBusManager(); - ~CDBusManager(); - void RegisterService(); - bool SendMessage(const std::string& pMessage, const std::string& pMessParam); - /** TODO - //tries to reconnect after daemon failure - void Reconnect(); - */ -}; - -#endif /*DBUS_H_*/ diff --git a/lib/DBus/DBusServer.cpp b/lib/DBus/DBusServer.cpp deleted file mode 100644 index 2f92c966..00000000 --- a/lib/DBus/DBusServer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "DBusServer.h" - -CDBusServer::CDBusServer(DBus::Connection &connection, const std::string& pServerPath) -: DBus::ObjectAdaptor(connection, pServerPath) -{ -} - -dbus_vector_crash_infos_t CDBusServer::GetCrashInfos(const std::string &pUID) -{ - dbus_vector_crash_infos_t info; - //CMiddleWare mw; - //mw.GetCrashInfos(); - std::vector<std::string> v; - v.push_back("vector1_prvek1"); - v.push_back("vector1_prvek_1"); - info.push_back(v); - v.clear(); - v.push_back("vector2_prvek1"); - v.push_back("vector2_prvek_1"); - v.push_back(pUID); - info.push_back(v); - return info; -} - -CDBusServer::~CDBusServer() -{ - //clean -} diff --git a/lib/DBus/DBusServer.h b/lib/DBus/DBusServer.h deleted file mode 100644 index 17f93939..00000000 --- a/lib/DBus/DBusServer.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <dbus-c++/dbus.h> -#include "DBusServerProxy.h" - -class CDBusServer -: public CDBusServer_adaptor, - public DBus::IntrospectableAdaptor, - public DBus::ObjectAdaptor -{ -public: - CDBusServer(DBus::Connection& connection, const std::string& pServerPath); - ~CDBusServer(); - int32_t Sum(const std::vector<int32_t> & ints); - dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID); -}; - diff --git a/lib/DBus/DBusServerProxy.h b/lib/DBus/DBusServerProxy.h deleted file mode 100644 index a32bbc3d..00000000 --- a/lib/DBus/DBusServerProxy.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <dbus-c++/dbus.h> -#include <dbus-c++/glib-integration.h> -#include "DBusCommon.h" - -class CDBusServer_adaptor -: public DBus::InterfaceAdaptor -{ -public: - - CDBusServer_adaptor() - : DBus::InterfaceAdaptor(CC_DBUS_IFACE) - { - register_method(CDBusServer_adaptor, GetCrashInfos, _GetCrashInfos_stub); - } - - DBus::IntrospectedInterface *const introspect() const - { - static DBus::IntrospectedArgument GetCrashInfos_args[] = - { - { "uid", "i", true}, - { "info", "aas", false }, - { 0, 0, 0 } - }; - static DBus::IntrospectedArgument Crash_args[] = - { - { "value", "v", false }, - { 0, 0, 0 } - }; - static DBus::IntrospectedMethod CDBusServer_adaptor_methods[] = - { - { "GetDumps", GetCrashInfos_args }, - { 0, 0 } - }; - static DBus::IntrospectedMethod CDBusServer_adaptor_signals[] = - { - { "Echoed", Crash_args }, - { 0, 0 } - }; - static DBus::IntrospectedProperty CDBusServer_adaptor_properties[] = - { - { 0, 0, 0, 0 } - }; - static DBus::IntrospectedInterface CDBusServer_adaptor_interface = - { - "com.redhat.CrashCatcher", - CDBusServer_adaptor_methods, - CDBusServer_adaptor_signals, - CDBusServer_adaptor_properties - }; - return &CDBusServer_adaptor_interface; - } - -public: - - /* properties exposed by this interface, use - * property() and property(value) to get and set a particular property - */ - -public: - - /* methods exported by this interface, - * you will have to implement them in your ObjectAdaptor - */ - virtual dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID) = 0; - -public: - - /* signal emitters for this interface - */ - void Crash(const std::string& arg1) - { - ::DBus::SignalMessage sig("Crash"); - ::DBus::MessageIter wi = sig.writer(); - wi << arg1; - emit_signal(sig); - } - - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual interface method) - */ - DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call) - { - DBus::MessageIter ri = call.reader(); - - std::string argin1; ri >> argin1; - dbus_vector_crash_infos_t argout1 = GetCrashInfos(argin1); - DBus::ReturnMessage reply(call); - DBus::MessageIter wi = reply.writer(); - wi << argout1; - return reply; - } -}; - diff --git a/lib/DBus/DbusClient.h b/lib/DBus/DbusClient.h deleted file mode 100644 index e278c50d..00000000 --- a/lib/DBus/DbusClient.h +++ /dev/null @@ -1,15 +0,0 @@ -#include <dbus-c++/dbus.h> -#include "DBusClientProxy.h" - -class CDBusClient -: public org::freedesktop::DBus::CDBusClient_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - - CDBusClient(DBus::Connection &connection, const char *path, const char *name); - ~CDBusClient(); - void Crash(const DBus::Variant &value); -}; - diff --git a/lib/DBus/Makefile.am b/lib/DBus/Makefile.am deleted file mode 100644 index 1f709e77..00000000 --- a/lib/DBus/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -lib_LTLIBRARIES = libDBus.la -libDBus_la_SOURCES = DBusManager.cpp DBusManager.h DBusClient.h DBusClient.cpp \ - DBusClientProxy.h DBusServer.cpp DBusServer.h DBusServerProxy.h -libDBus_la_LDFLAGS = -version-info 0:1:0 -libDBus_la_LIBADD = $(DBUS_GLIB_LIBS) $(GLIBMM_LIBS) $(DBUSCPP_LIBS) -libDBus_la_CPPFLAGS = $(DBUS_GLIB_CFLAGS) $(GLIBMM_CFLAGS) $(DBUSCPP_CFLAGS) \ - -I../../lib/MiddleWare - -#BUILT_SOURCES = crashcatcher-glue.h - -#crashcatcher-glue.h: crashcatcher.xml -# $(LIBTOOL) --mode=execute dbus-binding-tool --prefix=Crash --mode=glib-server --output=crashcatcher-glue.h $(srcdir)/crashcatcher.xml - -check_PROGRAMS = test_server test_client -test_server_SOURCES = test_server.cpp -test_server_LDADD = libDBus.la $(DL_LIBS) -test_server_CPPFLAGS = $(DBUS_GLIB_CFLAGS) $(DBUSCPP_CFLAGS) -g -I../../lib/MiddleWare -test_client_SOURCES = test_client.cpp -test_client_LDADD = libDBus.la $(DL_LIBS) -test_client_CPPFLAGS = $(DBUS_GLIB_CFLAGS) $(DBUSCPP_CFLAGS) -g -I../../lib/MiddleWare diff --git a/lib/DBus/marshal.c b/lib/DBus/marshal.c deleted file mode 100644 index 247bf1bb..00000000 --- a/lib/DBus/marshal.c +++ /dev/null @@ -1,51 +0,0 @@ - -#include <glib-object.h> - - -#ifdef G_ENABLE_DEBUG -#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -#define g_marshal_value_peek_char(v) g_value_get_char (v) -#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) -#define g_marshal_value_peek_int(v) g_value_get_int (v) -#define g_marshal_value_peek_uint(v) g_value_get_uint (v) -#define g_marshal_value_peek_long(v) g_value_get_long (v) -#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) -#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) -#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) -#define g_marshal_value_peek_enum(v) g_value_get_enum (v) -#define g_marshal_value_peek_flags(v) g_value_get_flags (v) -#define g_marshal_value_peek_float(v) g_value_get_float (v) -#define g_marshal_value_peek_double(v) g_value_get_double (v) -#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) -#define g_marshal_value_peek_param(v) g_value_get_param (v) -#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) -#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) -#define g_marshal_value_peek_object(v) g_value_get_object (v) -#else /* !G_ENABLE_DEBUG */ -/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. - * Do not access GValues directly in your code. Instead, use the - * g_value_get_*() functions - */ -#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int -#define g_marshal_value_peek_char(v) (v)->data[0].v_int -#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint -#define g_marshal_value_peek_int(v) (v)->data[0].v_int -#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint -#define g_marshal_value_peek_long(v) (v)->data[0].v_long -#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 -#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 -#define g_marshal_value_peek_enum(v) (v)->data[0].v_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_float(v) (v)->data[0].v_float -#define g_marshal_value_peek_double(v) (v)->data[0].v_double -#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* VOID:STRING (marshal.list:1) */ - diff --git a/lib/DBus/marshal.h b/lib/DBus/marshal.h deleted file mode 100644 index 60608245..00000000 --- a/lib/DBus/marshal.h +++ /dev/null @@ -1,15 +0,0 @@ - -#ifndef __marshal_MARSHAL_H__ -#define __marshal_MARSHAL_H__ - -#include <glib-object.h> - -G_BEGIN_DECLS - -/* VOID:STRING (marshal.list:1) */ -#define marshal_VOID__STRING g_cclosure_marshal_VOID__STRING - -G_END_DECLS - -#endif /* __marshal_MARSHAL_H__ */ - diff --git a/lib/DBus/marshal.list b/lib/DBus/marshal.list deleted file mode 100644 index 30ba5d8d..00000000 --- a/lib/DBus/marshal.list +++ /dev/null @@ -1 +0,0 @@ -VOID:STRING diff --git a/lib/DBus/test.cpp b/lib/DBus/test.cpp deleted file mode 100644 index ad414b6a..00000000 --- a/lib/DBus/test.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "DBusManager.h" -#include <cstring> -#include <iostream> -#include <climits> -#include <stdlib.h> -#include <unistd.h> - -int main(int argc, char** argv){ - GMainLoop *mainloop; - mainloop = g_main_loop_new(NULL, FALSE); - CDBusManager dm; - try - { - dm.RegisterService(); - } - catch(std::string err) - { - std::cerr << err << std::endl; - return -1; - } - while(1) - { - dm.SendMessage("Crash","Svete"); - sleep(1); - } - g_main_loop_run(mainloop); - /* - //no sanity check, it's just a testing program! - if (argc < 2){ - std::cout << "Usage: " << argv[0] << " {s|c}" << std::endl; - return 0; - } - //service - if (strcmp(argv[1], "s") == 0){ - std::cout << "Service: " << std::endl; - CDBusManager dm; - try - { - dm.RegisterService(); - } - catch(std::string err) - { - std::cerr << err << std::endl; - return -1; - } - dm.LoopSend(); - - g_main_loop_run(mainloop); - } - //client - else if (strcmp(argv[1], "c") == 0){ - CDBusManager dm; - try - { - dm.ConnectToService(); - } - catch(std::string error) - { - std::cerr << error << std::endl; - return -1; - } - dm.RegisterToMessage("Crash",G_CALLBACK(print_cb),NULL,NULL); - g_main_loop_run(mainloop); - } - */ - return 0; -} diff --git a/lib/DBus/test_client.cpp b/lib/DBus/test_client.cpp deleted file mode 100644 index ccdae45c..00000000 --- a/lib/DBus/test_client.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "DBusClient.h" -#include <iostream> -#include <signal.h> - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - - CDBusClient client(conn, CC_DBUS_PATH, CC_DBUS_NAME); - /* - typedef std::vector< std::vector<std::string> > type_t; - type_t vec = client.GetCrashInfos("client"); - for (type_t::iterator it = vec.begin(); it!=vec.end(); ++it) { - for (std::vector<std::string>::iterator itt = it->begin(); itt!=it->end(); ++itt) { - std::cout << *itt << std::endl; - } - } - */ - dbus_vector_crash_infos_t v = client.GetCrashInfos("client"); - for (dbus_vector_crash_infos_t::iterator it = v.begin(); it!=v.end(); ++it) { - for (dbus_vector_crash_infos_t::value_type::iterator itt = it->begin(); itt!=it->end(); ++itt) { - std::cout << *itt << std::endl; - } - } - dispatcher.enter(); - - std::cout << "terminating" << std::endl; - - return 0; -} diff --git a/lib/DBus/test_server.cpp b/lib/DBus/test_server.cpp deleted file mode 100644 index ba4d47a2..00000000 --- a/lib/DBus/test_server.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "DBusServer.h" -#include <iostream> -#include <signal.h> - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - - CDBusServer server(conn, CC_DBUS_PATH); - conn.request_name(CC_DBUS_NAME); - dispatcher.enter(); - - return 0; -} |