From 47c10af317faae9184d5d9e1f1f37c2913a16ef7 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Mon, 30 Jun 2008 17:35:58 -0300 Subject: Make "Resources" information a little more meaningful. If the resource is claimed by a kernel module, use its description. If the resource is reserved by a PCI device, use its name. --- hardinfo2/util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hardinfo2/util.c') diff --git a/hardinfo2/util.c b/hardinfo2/util.c index 153b32b8..2cf37291 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -489,6 +489,19 @@ gchar *module_call_method(gchar * method) g_strdup_printf("{Unknown method: \"%s\"}", method); } +gchar *module_call_method_param(gchar * method, gchar * parameter) +{ + gchar *(*function) (gchar *param); + + if (__module_methods == NULL) { + return NULL; + } + + function = g_hash_table_lookup(__module_methods, method); + return function ? g_strdup(function(parameter)) : + g_strdup_printf("{Unknown method: \"%s\"}", method); +} + static ShellModule *module_load(gchar * filename) { ShellModule *module; -- cgit v1.2.3