/ gwdevicemanager.h / Functions / Description

Functions



gw_device_manager_device_load_to_vfs_stats

Loads the virtual file system stats.
gint gw_device_manager_device_load_to_vfs_stats ( struct vfs_stats *p, gchar *dir);
This function loads the virtual file system. Initialize all informations as name, path, total size, free space, label, ...

Parameters
p the virtual file system to load
dir the file system path

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured..


gw_device_manager_disk_try_mount_from_vfs_stats

Tries to mount the disk.
gboolean gw_device_manager_disk_try_mount_from_vfs_stats ( struct vfs_stats *p);
This function tries to mount the disk of the virtual file system stats.
Use the /bin/mount and /bin/umount programs to mount disk

Parameters
p the virtual file system stats to try to mount disk

Result: TRUE if can be mounted or FALSE if can be not mounted.
Returns FALSE when an error occured..


gw_device_manager_search_disk_in_tab_file_to_vfs_stats

Searches and sets informations from the device table
gboolean gw_device_manager_search_disk_in_tab_file_to_vfs_stats ( struct vfs_stats *p, const gchar *tab_file, const gchar *dir);
This function searches and sets informations from the device table.


Parameters
p the virtual file system stats to search and set informations
tab_file the device table file name
dir the file system path

Result: TRUE if the disk found and loaded or FALSE if hasn't been found.
Returns FALSE when an error occured..


gw_device_manager_disk_mount_from_vfs_stats

Mounts the disk.
gboolean gw_device_manager_disk_mount_from_vfs_stats ( struct vfs_stats *p);
This function mounts the disk of the virtual file system stats.
Use the /bin/mount programs to mount disk

Parameters
p the virtual file system stats to try to mount disk

Result: TRUE if can mount or FALSE if cannot mount.
Returns FALSE when an error occured..


gw_device_manager_disk_umount_from_vfs_stats

Umounts the disk.
gboolean gw_device_manager_disk_umount_from_vfs_stats ( struct vfs_stats *p);
This function umounts the disk of the virtual file system stats.
Use the /bin/umount programs to umount disk

Parameters
p the virtual file system stats to try to umount disk

Result: TRUE if can umount or FALSE if cannot umount.
Returns FALSE when an error occured..


gw_pipe_get_data

Gets data in the pipe.
gint gw_pipe_get_data ( gint entry, gchar * line);
This function gets the data in the pipe.


Parameters
entry the pipe to get data
line the string to extract data from pipe

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured..


gw_device_manager_disk_get_device_name

Gets the device name of a mount point.
gint gw_device_manager_disk_get_device_name ( const gchar *mount_point, gchar **device_name);
This function gets the device name of a mount point.
Warning : it's an ugly function. Runs only for floppy drive (1 and 2) and for first primary disk (partition 1 and 2). It was developped in the cas eof the experimental port on Cygwin.

Parameters
mount_point the mount point path
device_name a pointer to get device name (Note that device_name must be free with g_free).

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured..


gw_device_manager_disk_is_mounted_from_vfs_stats

Gets if is mounted.
gboolean gw_device_manager_disk_is_mounted_from_vfs_stats ( struct vfs_stats *p);
This function tries and gets if the virtual file system stats is mounted.


Parameters
p the virtual file system stats to get if is mounted

Result: TRUE if is mounted or FALSE if is not mounted.
Returns FALSE when an error occured..


gw_device_manager_disk_can_mounted_from_vfs_stats

Gets if can be mounted.
gboolean gw_device_manager_disk_can_mounted_from_vfs_stats ( struct vfs_stats *p);
This function gets if the virtual file system stats can be mounted.


Parameters
p the virtual file system stats to get if can be mounted

Result: TRUE if can be mounted or FALSE if can be not mounted.
Returns FALSE when an error occured..


gw_device_disk_in_drive

Gets if there is a disk in the drive.
gboolean gw_device_disk_in_drive ( const gchar *drive_path);
This function gets if there is a disk in the drive.
Use mount as drive_path under Linux-like system.
Use the drive letter ("A:", "D:", ...) under win32 system.


Parameters
drive_path the drive path

Result: TRUE if there is a disk or FALSE if there is no disk.
Returns FALSE when an error occured..