HAL Support Functions

HAL Support Functions — Miscellaneous Utility Functions for HAL integration

Synopsis

#include <exo-hal/exo-hal.h>

gboolean            exo_hal_init                        (void);
gboolean            exo_hal_udi_validate                (const gchar *udi,
                                                         gssize len,
                                                         gchar **end);
gchar *             exo_hal_drive_compute_display_name  (struct LibHalContext_s *context,
                                                         struct LibHalDrive_s *drive);
GList *             exo_hal_drive_compute_icon_list     (struct LibHalContext_s *context,
                                                         struct LibHalDrive_s *drive);
gchar *             exo_hal_volume_compute_display_name (struct LibHalContext_s *context,
                                                         struct LibHalVolume_s *volume,
                                                         struct LibHalDrive_s *drive);
GList *             exo_hal_volume_compute_icon_list    (struct LibHalContext_s *context,
                                                         struct LibHalVolume_s *volume,
                                                         struct LibHalDrive_s *drive);

Description

This is an additional library that ships with the exo package and offers support functions for HAL integration, that are used by exo-mount and Thunar to figure out display names and icons to visually present HAL devices to the user. The library may also be used by other components to offer smooth integration between various parts of the desktop, making sure that the same names and icons are used for devices everywhere.

Since HAL is currently an optional dependency for Xfce, you should first check whether HAL support is really available by calling the exo_hal_init() function, which returns TRUE if HAL support is available and the other functions will be able to do their work, or FALSE if the functions will return hardcoded default values instead. The exo_hal_init() also takes care of setting up the internationalization support, so make sure you call it first.

The HAL support module is not part of the main exo library, so you if you want to use any of these functions you will need to explicitly link to the exo-hal library. This is done with the pkg-config utility, using exo-hal-0.3 as the package name.

Details

exo_hal_init ()

gboolean            exo_hal_init                        (void);

Initializes the HAL support module, which includes setting up the internationalization support. Returns TRUE if support for HAL was enabled at compile time, FALSE otherwise.

Make sure you call this function first prior to calling any of the functions below.

Returns :

TRUE if HAL support is available, FALSE otherwise.

Since 0.3.1.13


exo_hal_udi_validate ()

gboolean            exo_hal_udi_validate                (const gchar *udi,
                                                         gssize len,
                                                         gchar **end);

Checks that the given range of the udi is a valid HAL device UDI (i.e. a valid D-BUS object path name in the D-BUS protocol). Part of the validation ensures that the udi contains only ASCII.

If end is non-NULL, then then end of the valid range will be stored there (i.e. the start of the first invalid character if some bytes were invalid, or unt