Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- src/util.c | 27 --------------------------- src/util.h | 28 ---------------------------- 2 files changed, 55 deletions(-) diff --git a/src/util.c b/src/util.c index a9d130e..4efa3ec 100644 --- a/src/util.c +++ b/src/util.c @@ -214,33 +214,6 @@ virtDBusUtilVirDomainListFree(virDomainPtr *domains) g_free(domains); } -const gchar * -virtDBusUtilEnumToString(const gchar *const *types, - guint ntypes, - gint type) -{ - if (type < 0 || (guint)type >= ntypes) - return NULL; - - return types[type]; -} - -gint -virtDBusUtilEnumFromString(const gchar *const *types, - guint ntypes, - const gchar *type) -{ - guint i; - if (!type) - return -1; - - for (i = 0; i < ntypes; i++) - if (g_str_equal(types[i], type)) - return i; - - return -1; -} - virNetworkPtr virtDBusUtilVirNetworkFromBusPath(virConnectPtr connection, const gchar *path, diff --git a/src/util.h b/src/util.h index 4a2138a..3309803 100644 --- a/src/util.h +++ b/src/util.h @@ -57,34 +57,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainPtr, virtDBusUtilVirDomainListFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecordListFree); -gint -virtDBusUtilEnumFromString(const gchar *const *types, - guint ntypes, - const gchar *type) G_GNUC_PURE; - -const gchar * -virtDBusUtilEnumToString(const gchar *const *types, - guint ntypes, - gint type) G_GNUC_PURE; - -#define VIRT_DBUS_ENUM_IMPL(name, lastVal, ...) \ - static const gchar *const name ##TypeList[] = { __VA_ARGS__ }; \ - G_STATIC_ASSERT(G_N_ELEMENTS(name ##TypeList) == lastVal); \ - const gchar *name ##TypeToString(gint type) { \ - return virtDBusUtilEnumToString(name ##TypeList, \ - G_N_ELEMENTS(name ##TypeList), \ - type); \ - } \ - gint name ##TypeFromString(const gchar *type) { \ - return virtDBusUtilEnumFromString(name ##TypeList, \ - G_N_ELEMENTS(name ##TypeList), \ - type); \ - } - -#define VIRT_DBUS_ENUM_DECL(name) \ - const gchar *name ##TypeToString(gint type) G_GNUC_PURE; \ - gint name ##TypeFromString(const gchar *type) G_GNUC_PURE; - virNetworkPtr virtDBusUtilVirNetworkFromBusPath(virConnectPtr connection, const gchar *path, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list