/* (un)mount */
EAPI int e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
EAPI int e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
+ EAPI int e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
#ifdef __cplusplus
}
* @param mount_point the path to mount to, or null for default
* @param fstype the fstype of the device (e.g. volume.fstype property)
* @param options a list of additional options (not sure... fstype dependant?)
+ * @param cb_func an optional callback to call when the mount is done
+ * @param data custom data pointer for the callback function
*/
EAPI int
e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
/* void Unmount(array{string} options) */
/**
- * @brief Mount a Volume
+ * @brief Unmount a Volume
*
* @param conn the E_DBus_Connection
* @param udi the udi of the device object
* @param options a list of additional options (not sure... fstype dependant?)
+ * @param cb_func an optional callback to call when the unmount is done
+ * @param data cuatom data pointer for the callback function
*/
EAPI int
e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
dbus_message_unref(msg);
return ret;
}
+
+/**
+ * @brief Eject a Volume
+ *
+ * @param conn the E_DBus_Connection
+ * @param udi the udi of the device object
+ * @param options a list of additional options (not sure... fstype dependant?)
+ * @param cb_func an optional callback to call when the eject is done
+ * @param data cuatom data pointer for the callback function
+ */
+EAPI int
+e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
+{
+ DBusMessage *msg;
+ DBusMessageIter iter, subiter;
+ int ret;
+
+ msg = e_hal_device_volume_call_new(udi, "Eject");
+
+ dbus_message_iter_init_append(msg, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &subiter);
+ if (options)
+ {
+ const char *opt;
+ ecore_list_first_goto(options);
+ while ((opt = ecore_list_next(options)))
+ {
+ dbus_message_iter_append_basic(&subiter, DBUS_TYPE_STRING, &opt);
+ }
+ }
+ dbus_message_iter_close_container(&iter, &subiter) ;
+
+ ret = e_dbus_method_call_send(conn, msg, NULL, cb_func, NULL, -1, data) ? 1 : 0;
+ dbus_message_unref(msg);
+ return ret;
+}