Hello community,
here is the log from the commit of package liblazy
checked in at Fri Nov 17 19:03:52 CET 2006.
--------
--- liblazy/liblazy.changes 2006-10-26 19:33:48.000000000 +0200
+++ /mounts/work_src_done/STABLE/liblazy/liblazy.changes 2006-11-17 16:57:24.000000000 +0100
@@ -1,0 +2,5 @@
+Fri Nov 17 16:57:03 CET 2006 - hmacht@suse.de
+
+- add more error handling (novell bug 220912)
+
+-------------------------------------------------------------------
Old:
----
liblazy-0.1.tar.bz2
New:
----
liblazy-0.1.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ liblazy.spec ++++++
--- /var/tmp/diff_new_pack.2oRtAx/_old 2006-11-17 19:03:36.000000000 +0100
+++ /var/tmp/diff_new_pack.2oRtAx/_new 2006-11-17 19:03:36.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package liblazy (Version 0.1)
+# spec file for package liblazy (Version 0.1.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,8 +13,8 @@
Name: liblazy
BuildRequires: dbus-1-devel pkgconfig
Summary: Liblazy - D-Bus methods provided for convenience
-Version: 0.1
-Release: 13
+Version: 0.1.1
+Release: 1
License: GNU Library General Public License v. 2.0 and 2.1 (LGPL)
Group: Development/Libraries/C and C++
Source: %{name}-%{version}.tar.bz2
@@ -57,6 +57,8 @@
%_libdir/pkgconfig/*.pc
%changelog -n liblazy
+* Fri Nov 17 2006 - hmacht@suse.de
+- add more error handling (novell bug 220912)
* Thu Oct 26 2006 - hmacht@suse.de
- fix function to query privilege by uid
- add function to query privilege of the _current_ user
++++++ liblazy-0.1.tar.bz2 -> liblazy-0.1.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/README new/liblazy-0.1.1/README
--- old/liblazy-0.1/README 2006-10-22 17:24:59.000000000 +0200
+++ new/liblazy-0.1.1/README 2006-11-12 02:10:14.000000000 +0100
@@ -4,4 +4,92 @@
Liblazy is a simple and easy to use library that provides convenient
functions for sending messages over the D-Bus daemon, querying information
from HAL or asking PolicyKit for a privilege. Its features may grow as
-needed, though
+needed, though.
+
+
+Rationale
+=========
+
+Once in a while, I stumble across an application which has no proper D-Bus
+support and gathers some information through reading /proc or sysfs, or
+any other circumstantial way, although software like HAL or PolicyKit
+already have this information. Or they just want to send a simple message
+to another application, sometimes even without caring about the reply.
+These applications often only have to do very simple tasks.
+
+So to adopt these applications, you always have to duplicate lots of code
+over and over again.
+
+Just some examples...
+
+To to send a message over D-Bus one has to do:
+ 1. Get a D-Bus connection
+ 2. Check for errors
+ 3. Send a message over the bus
+ 4. Check for errors
+ 5. Get the reply
+ 6. Check for errors
+
+To get a simple property from HAL, one has to do (with libhal in
+this example):
+ 1. Get a D-Bus connection
+ 2. Check for errors
+ 3. Get a LibHalContext
+ 4. C.f.e.
+ 5. Register the connection with the context
+ 6. C.f.e.
+ 7. Fetch the property with libhal
+ 8. C.f.e
+
+When you have to check if your application possess a specific privilege
+according to PolicyKit:
+ Either do a mixture of the above things to ask directly via D-Bus or
+ link against libpolkit and do a complicated call of
+ libpolkit_is_uid_allowed_for_privilege(7 arguments follow). This call
+ gives you a lot of information you might not care about at all.</li>
+
+So in every application, you have to implement functions like:</p>
+ - dbus_send_message(service, path, interface, method);
+ - dbus_send_message_with_reply(service, path, interface, method, &reply);
+ - hal_get_property_int(udi, property)
+ - ...
+
+There are a lot of applications which just don't want to care too much
+about D-Bus or HAL at all. I'm mostly talking about small applications, of
+course, even about those without a mainloop. They just want to make use of
+hardware databases and abstractions and a new way of inter process
+communication we have with D-Bus these days.
+
+So what I've done is combining these very simple functions into one small
+library called liblazy. A small application may just want to do the
+following to send a message over the bus and get its reply, maybe even
+with ignoring any errors:
+
+ DBusMessage *reply;
+ liblazy_dbus_system_send_method_call("org.freedesktop.NetworkworkManager",
+ "/org/freedesktop/NetworkManager",
+ "org.freedesktop.NetworkManager",
+ "sleep",
+ &reply,
+ DBUS_TYPE_INVALID);
+
+ int *arg_from_reply;
+ liblazy_dbus_message_get_arg(reply, DBUS_TYPE_INT32, &arg_from_reply, 0);
+
+That's it. The application developer just has to link against libdbus and
+liblazy, without caring about any other stuff.
+
+Liblazy also contains very simple functions to get a property from HAL or
+ask for a privilege from PolicyKit. But it doesn't contain complex
+functionality. It may grow as needed, though. But...
+
+It is definitely not intended for replacing any of the dbus bindings,
+libhal or libpolkit. Complex applications can and will still have their
+own implementations and will link agains libhal or libpolkit or
+whatever. They are free to use liblazy, of course. But it is definitely of
+benefit for small applications which only need a subset of functionality
+and like to profit from new software like D-Bus, HAL, etc. but without
+having to care a lot. It should serve as a set of functions for developers
+provided for convenience. Also a lot more command line applications could
+make use of HAL, etc. in an easy way IMO. Additionally, it may serve as a
+code example for developers to get familiar with D-Bus.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/configure new/liblazy-0.1.1/configure
--- old/liblazy-0.1/configure 2006-10-26 19:29:29.000000000 +0200
+++ new/liblazy-0.1.1/configure 2006-11-15 21:59:29.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for liblazy 0.1.
+# Generated by GNU Autoconf 2.60 for liblazy 0.1.1.
#
# Report bugs to .
#
@@ -713,8 +713,8 @@
# Identity of this package.
PACKAGE_NAME='liblazy'
PACKAGE_TARNAME='liblazy'
-PACKAGE_VERSION='0.1'
-PACKAGE_STRING='liblazy 0.1'
+PACKAGE_VERSION='0.1.1'
+PACKAGE_STRING='liblazy 0.1.1'
PACKAGE_BUGREPORT='hmacht@suse.de'
ac_unique_file="liblazy/liblazy_hal.c"
@@ -1380,7 +1380,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures liblazy 0.1 to adapt to many kinds of systems.
+\`configure' configures liblazy 0.1.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1450,7 +1450,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of liblazy 0.1:";;
+ short | recursive ) echo "Configuration of liblazy 0.1.1:";;
esac
cat <<\_ACEOF
@@ -1554,7 +1554,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-liblazy configure 0.1
+liblazy configure 0.1.1
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1568,7 +1568,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by liblazy $as_me 0.1, which was
+It was created by liblazy $as_me 0.1.1, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -2238,7 +2238,7 @@
# Define the identity of the package.
PACKAGE='liblazy'
- VERSION='0.1'
+ VERSION='0.1.1'
cat >>confdefs.h <<_ACEOF
@@ -20656,7 +20656,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by liblazy $as_me 0.1, which was
+This file was extended by liblazy $as_me 0.1.1, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20703,7 +20703,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-liblazy config.status 0.1
+liblazy config.status 0.1.1
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/configure.in new/liblazy-0.1.1/configure.in
--- old/liblazy-0.1/configure.in 2006-10-26 19:29:21.000000000 +0200
+++ new/liblazy-0.1.1/configure.in 2006-11-15 21:59:16.000000000 +0100
@@ -3,7 +3,7 @@
AC_PREREQ(2.59)
-AC_INIT(liblazy, 0.1, hmacht@suse.de)
+AC_INIT(liblazy, 0.1.1, hmacht@suse.de)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([liblazy/liblazy_hal.c])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/liblazy/liblazy.h new/liblazy-0.1.1/liblazy/liblazy.h
--- old/liblazy-0.1/liblazy/liblazy.h 2006-10-26 19:27:48.000000000 +0200
+++ new/liblazy-0.1.1/liblazy/liblazy.h 2006-11-15 21:47:57.000000000 +0100
@@ -37,6 +37,7 @@
* @{ */
#define LIBLAZY_ERROR_GENERAL -1
+#define LIBLAZY_ERROR_INVALID_ARGUMENT -2
#define LIBLAZY_ERROR_HAL_NOT_READY -10
#define LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY -11
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/liblazy/liblazy_dbus.c new/liblazy-0.1.1/liblazy/liblazy_dbus.c
--- old/liblazy-0.1/liblazy/liblazy_dbus.c 2006-10-22 17:24:59.000000000 +0200
+++ new/liblazy-0.1.1/liblazy/liblazy_dbus.c 2006-11-17 16:40:31.000000000 +0100
@@ -42,6 +42,9 @@
DBusMessage *message = NULL;
int ret = 0;
+ if (path == NULL || method == NULL)
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
dbus_error_init(&dbus_error);
dbus_connection = dbus_bus_get(bus_type, &dbus_error);
@@ -127,6 +130,9 @@
DBusConnection *dbus_connection;
int ret = 0;
+ if (path == NULL || interface == NULL || name == NULL)
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
dbus_error_init(&dbus_error);
dbus_connection = dbus_bus_get(bus_type, &dbus_error);
@@ -184,9 +190,12 @@
int current_type;
DBusMessageIter iter;
int x = 0;
- int ret = -1;
+ int ret = LIBLAZY_ERROR_GENERAL;
int _no = 0;
+ if (message == NULL)
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
for (dbus_message_iter_init(message, &iter);
(current_type = dbus_message_iter_get_arg_type(&iter)) != DBUS_TYPE_INVALID;
x++, dbus_message_iter_next(&iter)) {
@@ -241,9 +250,12 @@
int current_type;
DBusMessageIter iter;
int x = 0;
- int ret = -1;
+ int ret = LIBLAZY_ERROR_GENERAL;
int _no = 0;
+ if (message == NULL)
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
for (dbus_message_iter_init(message, &iter);
(current_type = dbus_message_iter_get_arg_type(&iter)) != DBUS_TYPE_INVALID;
x++, dbus_message_iter_next(&iter)) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/liblazy/liblazy_hal.c new/liblazy-0.1.1/liblazy/liblazy_hal.c
--- old/liblazy-0.1/liblazy/liblazy_hal.c 2006-10-22 17:24:59.000000000 +0200
+++ new/liblazy-0.1.1/liblazy/liblazy_hal.c 2006-11-17 16:45:24.000000000 +0100
@@ -41,6 +41,9 @@
int exists = 0;
DBusMessage *reply;
+ if (udi == NULL || property == NULL)
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
error = liblazy_dbus_system_send_method_call(DBUS_HAL_SERVICE,
udi,
DBUS_HAL_DEVICE_INTERFACE,
@@ -57,7 +60,8 @@
error = liblazy_dbus_message_get_basic_arg(reply, DBUS_TYPE_BOOLEAN,
&exists, 0);
- dbus_message_unref(reply);
+ if (reply != NULL)
+ dbus_message_unref(reply);
if (exists == 1)
return 1;
return error;
@@ -69,6 +73,9 @@
int error = 0;
DBusMessage *reply;
+ if (udi == NULL || property == NULL )
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
error = liblazy_dbus_system_send_method_call(DBUS_HAL_SERVICE,
udi,
DBUS_HAL_DEVICE_INTERFACE,
@@ -78,9 +85,14 @@
&property,
DBUS_TYPE_INVALID);
+ if (error) {
+ ERROR("Error sending '%s' to HAL", method);
+ return error;
+ }
error = liblazy_dbus_message_get_basic_arg(reply, type, value, 0);
- dbus_message_unref(reply);
+ if (reply != NULL)
+ dbus_message_unref(reply);
if (error)
ERROR("Error fetching property '%s'", property);
return error;
@@ -111,32 +123,45 @@
}
error = liblazy_dbus_message_get_strlist_arg(reply, strlist, 0);
- dbus_message_unref(reply);
+ if (reply != NULL)
+ dbus_message_unref(reply);
return error;
}
int liblazy_hal_get_property_string(char *udi, char *property, char **value)
{
char *str;
- int error;
+ int ret;
- if (liblazy_hal_property_exists(udi, property) != 1) {
- *value = NULL;
- return LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
+ ret = liblazy_hal_property_exists(udi, property);
+ if (ret != 1) {
+ if (ret == 0)
+ ret = LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
+ goto Error;
}
- error = liblazy_hal_get_property(udi, property, "GetPropertyString",
- DBUS_TYPE_STRING, &str);
-
+ ret = liblazy_hal_get_property(udi, property, "GetPropertyString",
+ DBUS_TYPE_STRING, &str);
+ if (ret)
+ goto Error;
+
*value = strdup(str);
- return error;
+ return ret;
+Error:
+ *value = NULL;
+ return ret;
}
int liblazy_hal_get_property_int(char *udi, char *property, int *value)
{
- if (!liblazy_hal_property_exists(udi, property)) {
+ int ret;
+
+ ret = liblazy_hal_property_exists(udi, property);
+ if (ret != 1) {
+ if (ret == 0)
+ ret = LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
*value = -1;
- return LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
+ return ret;
}
return liblazy_hal_get_property(udi, property, "GetPropertyInteger",
@@ -145,9 +170,14 @@
int liblazy_hal_get_property_bool(char *udi, char *property, int *value)
{
- if (!liblazy_hal_property_exists(udi, property)) {
+ int ret;
+
+ ret = liblazy_hal_property_exists(udi, property);
+ if (ret != 1) {
+ if (ret == 0)
+ ret = LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
*value = -1;
- return LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
+ return ret;
}
return liblazy_hal_get_property(udi, property, "GetPropertyBoolean",
@@ -159,10 +189,14 @@
int error = 0;
DBusMessage *reply;
+ if (udi == NULL || property == NULL )
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
error = liblazy_hal_property_exists(udi, property);
- if (!error) {
- strlist[0] = NULL;
- return error;
+ if (error != 1) {
+ if (error == 0)
+ error = LIBLAZY_ERROR_HAL_NO_SUCH_PROPERTY;
+ goto Error;
}
error = liblazy_dbus_system_send_method_call(DBUS_HAL_SERVICE,
@@ -176,12 +210,18 @@
if (error) {
ERROR("Error while getting strlist property %s from HAL", property);
- return error;
+ goto Error;
}
error = liblazy_dbus_message_get_strlist_arg(reply, strlist, 0);
- dbus_message_unref(reply);
-
+ if (reply != NULL)
+ dbus_message_unref(reply);
+ if (error)
+ goto Error;
+ return error;
+
+Error:
+ strlist[0] = NULL;
return error;
}
@@ -191,6 +231,9 @@
int error = -1;
char **caps = NULL;
+ if (udi == NULL || capability == NULL )
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
error = liblazy_hal_get_property_strlist(udi, "info.capabilities", &caps);
if (caps != NULL && !error) {
for (i = 0; caps[i] != NULL; i++) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/liblazy/liblazy_polkit.c new/liblazy-0.1.1/liblazy/liblazy_polkit.c
--- old/liblazy-0.1/liblazy/liblazy_polkit.c 2006-10-26 19:28:14.000000000 +0200
+++ new/liblazy-0.1.1/liblazy/liblazy_polkit.c 2006-11-17 14:45:33.000000000 +0100
@@ -47,6 +47,9 @@
int is_allowed;
int error = 0;
+ if (user == NULL || privilege == NULL )
+ return LIBLAZY_ERROR_INVALID_ARGUMENT;
+
dbus_error_init(&dbus_error);
dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
@@ -79,7 +82,8 @@
error = liblazy_dbus_message_get_basic_arg(reply, DBUS_TYPE_BOOLEAN,
&is_allowed, 0);
- dbus_message_unref(reply);
+ if (reply != NULL)
+ dbus_message_unref(reply);
if (error)
return error;
return is_allowed;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/liblazy-0.1/tools/test.c new/liblazy-0.1.1/tools/test.c
--- old/liblazy-0.1/tools/test.c 2006-10-22 17:34:47.000000000 +0200
+++ new/liblazy-0.1.1/tools/test.c 2006-11-17 16:39:36.000000000 +0100
@@ -1,9 +1,126 @@
#include "liblazy.h"
#include
+#include
+
+#define DBUS_NM_SERVICE "org.freedesktop.NetworkManager"
+#define DBUS_NM_INTERFACE "org.freedesktop.NetworkManager"
+#define DBUS_NM_PATH "/org/freedesktop/NetworkManager"
+#define DBUS_HAL_MANAGER_INTERFACE "org.freedesktop.Hal.Manager"
+#define DBUS_HAL_DEVICE_INTERFACE "org.freedesktop.Hal.Device"
+#define DBUS_HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer"
+#define DBUS_HAL_INTERFACE "org.freedesktop.Hal"
+#define DBUS_HAL_CPUFREQ_INTERFACE "org.freedesktop.Hal.Device.CPUFreq"
+#define DBUS_SYSTEM_PM_INTERFACE "org.freedesktop.Policy.Power"
int main(int argc, char *argv[])
{
- /* add some testing code here */
+ char *governor = "ondemand";
+ char *rpstring = NULL;
+ int intval = -1;
+
+ int ret = 0;
+ DBusMessage *reply = NULL;
+
+ printf("Try to set the ondemand governor\n");
+ ret = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ DBUS_HAL_UDI_COMPUTER,
+ DBUS_HAL_CPUFREQ_INTERFACE,
+ "SetCPUFreqGovernor",
+ &reply,
+ DBUS_TYPE_STRING,
+ &governor,
+ DBUS_TYPE_INVALID);
+ printf("return value: %d\n", ret);
+ if (!ret)
+ dbus_message_unref(reply);
+
+ printf("------------------\n");
+ printf("Try to get the current governor\n");
+ ret = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ DBUS_HAL_UDI_COMPUTER,
+ DBUS_HAL_CPUFREQ_INTERFACE,
+ "GetCPUFreqGovernor",
+ &reply,
+ DBUS_TYPE_INVALID);
+
+ ret = liblazy_dbus_message_get_basic_arg(reply, DBUS_TYPE_STRING, &rpstring, 0);
+ printf("returned string: %s\n", rpstring);
+ printf("return value: %d\n", ret);
+ if (!ret)
+ dbus_message_unref(reply);
+
+ printf("--------------------\n");
+ ret = liblazy_hal_get_property_string("/org/freedesktop/Hal/devices/computer",
+ "system.kernel.name",
+ &rpstring);
+ printf("return value: %d\n", ret);
+ printf("returned string: %s\n", rpstring);
+
+ printf("string: %s\n", rpstring);
+ liblazy_free_string(rpstring);
+
+ printf("--------------------\n");
+ printf("Try to get a string property from HAL\n");
+ ret = liblazy_hal_get_property_string("/org/freedesktop/Hal/devices/computer",
+ "system.kernel.name",
+ &rpstring);
+ printf("return value: %d\n", ret);
+ printf("returned string: %s\n", rpstring);
+ liblazy_free_string(rpstring);
+
+ printf("--------------------\n");
+ printf("Try to get a boolean value from HAL\n");
+ ret = liblazy_hal_get_property_bool("/org/freedesktop/Hal/devices/computer",
+ "power_management.can_hibernate",
+ &intval);
+ printf("return value: %d\n", ret);
+ printf("returned int: %d\n", intval);
+
+ printf("--------------------\n");
+ printf("Try to get a integer value from HAL\n");
+ ret = liblazy_hal_get_property_int("/org/freedesktop/Hal/devices/acpi_BAT0",
+ "battery.charge_level.current",
+ &intval);
+ printf("return value: %d\n", ret);
+ printf("returned int: %d\n", intval);
+
+
+ printf("--------------------\n");
+ ret = liblazy_hal_get_property_string("/org/freedesktop/Hal/devices/computer",
+ "system.kernel.name",
+ &rpstring);
+ printf("return value: %d\n", ret);
+ printf("returned string: %s\n", rpstring);
+
+ printf("string: %s\n", rpstring);
+ liblazy_free_string(rpstring);
+
+ printf("--------------------\n");
+ printf("Try to get a string property from HAL\n");
+ ret = liblazy_hal_get_property_string("/org/freedesktop/Hal/devices/computer",
+ "system.kernel.name",
+ &rpstring);
+ printf("return value: %d\n", ret);
+ printf("returned string: %s\n", rpstring);
+ liblazy_free_string(rpstring);
+
+ printf("--------------------\n");
+ printf("Try to get a boolean value from HAL\n");
+ ret = liblazy_hal_get_property_bool("/org/freedesktop/Hal/devices/computer",
+ "power_management.can_hibernate",
+ &intval);
+ printf("return value: %d\n", ret);
+ printf("returned int: %d\n", intval);
+
+ printf("--------------------\n");
+ printf("Trying to send signal over system bus\n");
+ ret = liblazy_dbus_system_send_signal("/macht/holger/super",
+ "org.holger.super",
+ "heyho",
+ DBUS_TYPE_INVALID);
+ printf("return value: %d\n", ret);
+
+
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org