panel-plugin/devices.h File Reference

#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_diskdisks_search (GPtrArray *pdisks, char *device)
void disks_refresh (GPtrArray *pdisks)
t_deviceclass disk_classify (char *device, char *mountpoint)


Define Documentation

#define DEBUG   1

#define DEBUG_TRACE   1


Typedef Documentation

typedef struct s_disk t_disk

Disk information.

typedef struct s_mount_info t_mount_info

Mount information. Additional info when a t_disk is mounted.


Enumeration Type Documentation

anonymous enum

An enum. NONE and ERROR as aliases.

Enumerator:
NONE 
ERROR 

enum t_deviceclass

Device class. Used for classification of devices discovered in the system into CDs, removable media etc.

Enumerator:
HARDDISK 
REMOTE 
CD_DVD 
REMOVABLE 
UNKNOWN 


Function Documentation

t_deviceclass disk_classify ( char *  device,
char *  mountpoint 
)

Returns classification for given information

Parameters:
device Device to get class for
mountpoint Mountpoint used as additional information for classfication
Returns:
Device class

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().

Parameters:
include_NFSs whether to include network file systems
Returns:
GPtrArray *pdisks containing elements to be displayed

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.

Returns:
true on success, else false.

gboolean disks_remove_mountpoint ( GPtrArray *  pdisks,
char *  mountp 
)

Removes specfied mount point from array.

Returns:
true on success, else false.

t_disk* disks_search ( GPtrArray *  pdisks,
char *  mount_point 
)

Returns:
a pointer on FIRST struct t_disk containing char * device as device field; if not found return NULL.

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.

Parameters:
size,: Size in bytes
Returns:
Formatted output, e.g. "1.5 GB"


Generated on Sun Feb 18 18:07:09 2007 for Xfce4-Mount-Plugin by  doxygen 1.5.1