#include <glib.h>
Include dependency graph for devices.h:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | s_mount_info |
struct | s_disk |
Defines | |
#define | DEBUG 1 |
#define | DEBUG_TRACE 1 |
Typedefs | |
typedef s_mount_info | t_mount_info |
typedef s_disk | t_disk |
Enumerations | |
enum | { NONE = 0, ERROR } |
enum | t_deviceclass { HARDDISK = 0, REMOTE, CD_DVD, REMOVABLE, UNKNOWN } |
Functions | |
char * | get_size_human_readable (float size) |
void | disk_mount (t_disk *pdisk, char *on_mount_cmd, char *mount_command, gboolean eject) |
int | disk_umount (t_disk *pdisk, char *umount_command, gboolean synchronous, gboolean eject) |
GPtrArray * | disks_new (gboolean include_NFSs) |
void | disks_free (GPtrArray **pdisks) |
void | disks_print (GPtrArray *pdisks) |
gboolean | disks_remove_device (GPtrArray *pdisks, char *device) |
gboolean | disks_remove_mountpoint (GPtrArray *pdisks, char *mountpoint) |
t_disk * | disks_search (GPtrArray *pdisks, char *device) |
void | disks_refresh (GPtrArray *pdisks) |
t_deviceclass | disk_classify (char *device, char *mountpoint) |
#define DEBUG 1 |
#define DEBUG_TRACE 1 |
typedef struct s_mount_info t_mount_info |
Mount information. Additional info when a t_disk is mounted.
enum t_deviceclass |
t_deviceclass disk_classify | ( | char * | device, | |
char * | mountpoint | |||
) |
Returns classification for given information
device | Device to get class for | |
mountpoint | Mountpoint used as additional information for classfication |
void disk_mount | ( | t_disk * | pdisk, | |
char * | on_mount_cmd, | |||
char * | mount_command, | |||
gboolean | eject | |||
) |
Return exit status of the mount command
int disk_umount | ( | t_disk * | pdisk, | |
char * | umount_command, | |||
gboolean | synchronous, | |||
gboolean | eject | |||
) |
Return exit status of the umount command.
void disks_free | ( | GPtrArray ** | pdisks | ) |
Free a GPtrArray containing pointer on struct t_disk elements
GPtrArray* disks_new | ( | gboolean | include_NFSs | ) |
Fill a GPtrArray with pointers on struct t_disk containing infos on devices and theoretical mount point. used setfsent() and getfsent(), now uses setmntent() and getmntent() and enmntent().
include_NFSs | whether to include network file systems |
void disks_print | ( | GPtrArray * | pdisks | ) |
Print a GPtrArray containing pointer on struct t_disk elements
void disks_refresh | ( | GPtrArray * | pdisks | ) |
Refreshes t_mount_info infos in a GPtrArray containing struct t_disk * elements.
gboolean disks_remove_device | ( | GPtrArray * | pdisks, | |
char * | device | |||
) |
Removes specfied device from array.
gboolean disks_remove_mountpoint | ( | GPtrArray * | pdisks, | |
char * | mountp | |||
) |
Removes specfied mount point from array.
t_disk* disks_search | ( | GPtrArray * | pdisks, | |
char * | mount_point | |||
) |
char* get_size_human_readable | ( | float | size | ) |
Return a string containing a size expressed in KB, MB or GB and the unit it is expressed in.
size,: | Size in bytes |