hal/libhal libhal.c,1.49,1.50 libhal.h,1.27,1.28

David Zeuthen david at freedesktop.org
Fri Jul 8 16:02:31 PDT 2005


Update of /cvs/hal/hal/libhal
In directory gabe:/tmp/cvs-serv25462/libhal

Modified Files:
	libhal.c libhal.h 
Log Message:
2005-07-08  David Zeuthen  <davidz at redhat.com>

        Make it possible to create and remove HAL devices without kernel and
        sysfs support. Some legacy devices or userspace driven devices may be
        useful in HAL too, but need to be maintained by an application instead
        of the kernel itself. Patch from Steffen Winterfeldt <snwint at suse.de>.

        * tools/hal-device.c: New file

        * tools/Makefile.am: Add build rules for hal-device

        * libhal/libhal.[ch]: Remove the _agent prefix from the agent_manager
        functions

        * hald/hald_dbus.h: Add prototypes for new functions

        * hald/hald_dbus.c (manager_new_device)
        (manager_remove_done, manager_remove)
        (manager_commit_done)
        (manager_commit_preprobing_done)
        (manager_commit_to_gdl): New functions
        (hald_dbus_filter_handle_methods): Add handlers for new D-BUS methods



Index: libhal.c
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- libhal.c	11 May 2005 17:20:55 -0000	1.49
+++ libhal.c	8 Jul 2005 23:02:29 -0000	1.50
@@ -1964,7 +1964,7 @@
 
 
 /** Create a new device object which will be hidden from applications
- *  until the CommitToGdl(), ie. libhal_agent_commit_to_gdl(), method is called.
+ *  until the CommitToGdl(), ie. libhal_device_commit_to_gdl(), method is called.
  *
  *  Note that the program invoking this method needs to run with super user
  *  privileges.
@@ -1977,7 +1977,7 @@
  *                              by the caller.
  */
 char *
-libhal_agent_new_device (LibHalContext *ctx, DBusError *error)
+libhal_new_device (LibHalContext *ctx, DBusError *error)
 {
 	DBusMessage *message;
 	DBusMessage *reply;
@@ -1987,7 +1987,7 @@
 
 	message = dbus_message_new_method_call ("org.freedesktop.Hal",
 						"/org/freedesktop/Hal/Manager",
-						"org.freedesktop.Hal.AgentManager",
+						"org.freedesktop.Hal.Manager",
 						"NewDevice");
 	if (message == NULL) {
 		fprintf (stderr,
@@ -2037,7 +2037,7 @@
 
 
 /** When a hidden device has been built using the NewDevice method, ie.
- *  libhal_agent_new_device(), and the org.freedesktop.Hal.Device interface
+ *  libhal_new_device(), and the org.freedesktop.Hal.Device interface
  *  this function will commit it to the global device list. 
  *
  *  This means that the device object will be visible to applications and
@@ -2049,7 +2049,7 @@
  *
  *  @param  ctx                 The context for the connection to hald
  *  @param  temp_udi            The temporary unique device id as returned by
- *                              libhal_agent_new_device()
+ *                              libhal_new_device()
  *  @param  udi                 The new unique device id.
  *  @param  error               Pointer to an initialized dbus error object for
  *                              returning errors or #NULL
@@ -2057,8 +2057,8 @@
  *                              in use.
  */
 dbus_bool_t
-libhal_agent_commit_to_gdl (LibHalContext *ctx, 
-			    const char *temp_udi, const char *udi, DBusError *error)
+libhal_device_commit_to_gdl (LibHalContext *ctx, 
+			     const char *temp_udi, const char *udi, DBusError *error)
 {
 	DBusMessage *message;
 	DBusMessage *reply;
@@ -2066,7 +2066,7 @@
 
 	message = dbus_message_new_method_call ("org.freedesktop.Hal",
 						"/org/freedesktop/Hal/Manager",
-						"org.freedesktop.Hal.AgentManager",
+						"org.freedesktop.Hal.Manager",
 						"CommitToGdl");
 	if (message == NULL) {
 		fprintf (stderr,
@@ -2111,7 +2111,7 @@
  *  @return                     TRUE if the device was removed, FALSE otherwise
  */
 dbus_bool_t
-libhal_agent_remove_device (LibHalContext *ctx, const char *udi, DBusError *error)
+libhal_remove_device (LibHalContext *ctx, const char *udi, DBusError *error)
 {
 	DBusMessage *message;
 	DBusMessage *reply;
@@ -2119,7 +2119,7 @@
 
 	message = dbus_message_new_method_call ("org.freedesktop.Hal",
 						"/org/freedesktop/Hal/Manager",
-						"org.freedesktop.Hal.AgentManager",
+						"org.freedesktop.Hal.Manager",
 						"Remove");
 	if (message == NULL) {
 		fprintf (stderr,
@@ -2289,8 +2289,8 @@
  *  @return                     TRUE if the properties were merged, FALSE otherwise
  */
 dbus_bool_t
-libhal_agent_merge_properties (LibHalContext *ctx, 
-			       const char *target_udi, const char *source_udi, DBusError *error)
+libhal_merge_properties (LibHalContext *ctx, 
+			 const char *target_udi, const char *source_udi, DBusError *error)
 {
 	DBusMessage *message;
 	DBusMessage *reply;
@@ -2298,7 +2298,7 @@
 
 	message = dbus_message_new_method_call ("org.freedesktop.Hal",
 						"/org/freedesktop/Hal/Manager",
-						"org.freedesktop.Hal.AgentManager",
+						"org.freedesktop.Hal.Manager",
 						"MergeProperties");
 	if (message == NULL) {
 		fprintf (stderr,
@@ -2351,7 +2351,7 @@
  *                              have the same value.
  */
 dbus_bool_t
-libhal_agent_device_matches (LibHalContext *ctx, 
+libhal_device_matches (LibHalContext *ctx, 
 			     const char *udi1, const char *udi2,
 			     const char *property_namespace, DBusError *error)
 {
@@ -2363,7 +2363,7 @@
 
 	message = dbus_message_new_method_call ("org.freedesktop.Hal",
 						"/org/freedesktop/Hal/Manager",
-						"org.freedesktop.Hal.AgentManager",
+						"org.freedesktop.Hal.Manager",
 						"DeviceMatches");
 	if (message == NULL) {
 		fprintf (stderr,

Index: libhal.h
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- libhal.h	11 May 2005 17:20:55 -0000	1.27
+++ libhal.h	8 Jul 2005 23:02:29 -0000	1.28
@@ -390,35 +390,35 @@
 void libhal_free_string (char *str);
 
 /* Create a new device object which will be hidden from applications
- * until the CommitToGdl(), ie. libhal_agent_commit_to_gdl(), method is called.
+ * until the CommitToGdl(), ie. libhal_device_commit_to_gdl(), method is called.
  */
-char *libhal_agent_new_device (LibHalContext *ctx, DBusError *error);
+char *libhal_new_device (LibHalContext *ctx, DBusError *error);
 
 /* When a hidden device has been built using the NewDevice method, ie.
- * libhal_agent_new_device(), and the org.freedesktop.Hal.Device interface
+ * libhal_new_device(), and the org.freedesktop.Hal.Device interface
  * this function will commit it to the global device list. 
  */
-dbus_bool_t libhal_agent_commit_to_gdl (LibHalContext *ctx,
-					const char *temp_udi,
-					const char *udi,
-					DBusError *error);
+dbus_bool_t libhal_device_commit_to_gdl (LibHalContext *ctx,
+					 const char *temp_udi,
+					 const char *udi,
+					 DBusError *error);
 
 /* This method can be invoked when a device is removed. The HAL daemon
  * will shut down the device. Note that the device may still be in the device
  * list if the Persistent property is set to true. 
  */
-dbus_bool_t libhal_agent_remove_device (LibHalContext *ctx, 
+dbus_bool_t libhal_remove_device (LibHalContext *ctx, 
 					const char *udi,
 					DBusError *error);
 
 /* Merge properties from one device to another. */
-dbus_bool_t libhal_agent_merge_properties (LibHalContext *ctx,
+dbus_bool_t libhal_merge_properties (LibHalContext *ctx,
 					   const char *target_udi,
 					   const char *source_udi,
 					   DBusError *error);
 
 /* Check a set of properties for two devices matches. */
-dbus_bool_t libhal_agent_device_matches (LibHalContext *ctx,
+dbus_bool_t libhal_device_matches (LibHalContext *ctx,
 					 const char *udi1,
 					 const char *udi2,
 					 const char *property_namespace,




More information about the hal-commit mailing list