Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

Volume Handler
[MNT daemon]

Handle Volume objects. More...

Functions

PVOLUME new_Volume (const char *udi, const char *base)
 Generate new Volume Object.

int mntd_volume_init (PVOLUME pv)
 Constructor.

void mntd_volume_destroy (PVOLUME pv)
 Destructor.

void mntd_volume_to_string (PVOLUME pv)
 Show Device Info.

int mntd_volume_set_device (PVOLUME pv, const char *device)
 Set device name.

char * mntd_volume_get_device (PVOLUME pv)
 Get device name.

int mntd_volume_set_mntpnt (PVOLUME pv, const char *mntpnt)
 Set device mount point.

char * mntd_volume_get_mntpnt (PVOLUME pv)
 Get device mount point.

int mntd_volume_set_fstype (PVOLUME pv, const char *fstype)
 Set device mount point.

char * mntd_volume_get_fstype (PVOLUME pv)
 Get device filesystem name.

int mntd_volume_mount (PVOLUME pv)
 Mount device.

int mntd_volume_umount (PVOLUME pv)
 Unmount device.

char * mntd_volume_g_build_mntpnt (PVOLUME pv, const char *base)
 Helper: Build mount point path.

int mntd_volume_helper_base_is_in_mntpath (const char *base, const char *mntpnt)
 Check, if base is part of mntpnt.

int mntd_volume_is_in_mntpath (PVOLUME pv)
 Check, if volume is in mount path.

int mntd_volume_send_mounted (PVOLUME pv)
 Send mounted signal to processes listing to dbus.

int mntd_volume_send_unmounted (PVOLUME pv)
 Send unmounted signal to processes listing to dbus.

int mntd_volume_send_signal (PVOLUME pv, int what)
 Send signal to processes listing to dbus.


Detailed Description

Handle Volume objects.


Function Documentation

void mntd_volume_destroy PVOLUME  pv  ) 
 

Destructor.

Parameters:
pv Pointer to Volume Object

Definition at line 173 of file mntd_volume.c.

Referenced by new_Volume().

char * mntd_volume_g_build_mntpnt PVOLUME  pv,
const char *  base
 

Helper: Build mount point path.

Parameters:
pv Pointer to Volume Object
base base path for mntpnt
Returns:
0 if successful, -1 otherwise

Definition at line 634 of file mntd_volume.c.

References MSG_WARNING.

Referenced by mntd_volume_mount().

char * mntd_volume_get_device PVOLUME  pv  ) 
 

Get device name.

String within device name will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
Name of device if already set, or NULL otherwise

Definition at line 303 of file mntd_volume.c.

Referenced by new_Volume().

char * mntd_volume_get_fstype PVOLUME  pv  ) 
 

Get device filesystem name.

String within filesystem name will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
fstype if already set, or NULL otherwise

Definition at line 457 of file mntd_volume.c.

Referenced by new_Volume().

char * mntd_volume_get_mntpnt PVOLUME  pv  ) 
 

Get device mount point.

String within mount point will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
mount point if already set, or NULL otherwise

Definition at line 386 of file mntd_volume.c.

Referenced by new_Volume().

int mntd_volume_helper_base_is_in_mntpath const char *  base,
const char *  mntpnt
 

Check, if base is part of mntpnt.

Parameters:
base mount point base path
mntpnt specific mount point to check
Returns:
true if part, false otherwise

Definition at line 684 of file mntd_volume.c.

Referenced by mntd_volume_is_in_mntpath().

int mntd_volume_init PVOLUME  pv  ) 
 

Constructor.

Parameters:
pv Pointer to Volume Object
Returns:
0 if successful, -1 otherwise

Definition at line 154 of file mntd_volume.c.

Referenced by new_Volume().

int mntd_volume_is_in_mntpath PVOLUME  pv  ) 
 

Check, if volume is in mount path.

Parameters:
pv Pointer to Volume Object
Returns:
true if mounted, false otherwise

Definition at line 742 of file mntd_volume.c.

References mntd_volume_helper_base_is_in_mntpath().

Referenced by new_Volume().

int mntd_volume_mount PVOLUME  pv  ) 
 

Mount device.

Parameters:
pv Pointer to Volume Object
Returns:
0 if successful, -1 otherwise

Definition at line 476 of file mntd_volume.c.

References mntd_dir_is_dir(), mntd_dir_mkdirs(), mntd_dir_remove(), mntd_dir_rmdirs(), mntd_mount_mount(), mntd_volume_g_build_mntpnt(), MSG_ERR, and MSG_INF.

Referenced by new_Volume().

int mntd_volume_send_mounted PVOLUME  pv  ) 
 

Send mounted signal to processes listing to dbus.

Parameters:
pv Pointer to Volume Object
Returns:
true if successful, false otherwise

Definition at line 761 of file mntd_volume.c.

References mntd_dbus_manager_send_signal_volume_mounted(), and MSG_DEBUG.

Referenced by new_Volume().

int mntd_volume_send_signal PVOLUME  pv,
int  what
 

Send signal to processes listing to dbus.

Parameters:
pv Pointer to Volume Object
what Type of signal, that will be send to the listening clients (One of SIGNAL_UNKNOWN | SIGNAL_MOUNTED | SIGNAL_UNMOUNTED)
Returns:
true if successful, false otherwise

Definition at line 810 of file mntd_volume.c.

Referenced by new_Volume().

int mntd_volume_send_unmounted PVOLUME  pv  ) 
 

Send unmounted signal to processes listing to dbus.

Parameters:
pv Pointer to Volume Object
Returns:
true if successful, false otherwise

Definition at line 784 of file mntd_volume.c.

References mntd_dbus_manager_send_signal_volume_unmounted(), and MSG_DEBUG.

Referenced by new_Volume().

int mntd_volume_set_device PVOLUME  pv,
const char *  device
 

Set device name.

Parameters:
pv Pointer to Volume Object
device Name of device
Returns:
0 if successful, -1 otherwise

Definition at line 249 of file mntd_volume.c.

References MSG_DEBUG.

Referenced by new_Volume().

int mntd_volume_set_fstype PVOLUME  pv,
const char *  fstype
 

Set device mount point.

Parameters:
pv Pointer to Volume Object
fstype Set filesystem name
Returns:
0 if successful, -1 otherwise

Definition at line 406 of file mntd_volume.c.

Referenced by new_Volume().

int mntd_volume_set_mntpnt PVOLUME  pv,
const char *  mntpnt
 

Set device mount point.

Parameters:
pv Pointer to Volume Object
mntpnt Mount point
Returns:
0 if successful, -1 otherwise

Definition at line 323 of file mntd_volume.c.

References MSG_DEBUG.

Referenced by new_Volume().

void mntd_volume_to_string PVOLUME  pv  ) 
 

Show Device Info.

Parameters:
pv Pointer to Volume Object

Definition at line 226 of file mntd_volume.c.

References MSG_DEBUG.

Referenced by new_Volume().

int mntd_volume_umount PVOLUME  pv  ) 
 

Unmount device.

Unmount device, if it is mounted by mntd, or if it's mounted in the path mntd is responsible for. So be careful, what you mount manually and don't want to be unmounted by mntd. Default is "/mnt/mntd" path, so your normal devices on "/mnt" will not be touched.

Parameters:
pv Pointer to Volume Object
Returns:
0 if successful, -1 otherwise

Definition at line 563 of file mntd_volume.c.

References mntd_dir_remove(), mntd_mount_umount(), MSG_ERR, and MSG_INF.

Referenced by new_Volume().

PVOLUME new_Volume const char *  udi,
const char *  base
 

Generate new Volume Object.

Parameters:
udi Volume unique identifier got from hal
base Basepath for mount point
Returns:
Pointer to Volume object, NULL if error

Definition at line 80 of file mntd_volume.c.

References mntd_volume_destroy(), mntd_volume_get_device(), mntd_volume_get_fstype(), mntd_volume_get_mntpnt(), mntd_volume_init(), mntd_volume_is_in_mntpath(), mntd_volume_mount(), mntd_volume_send_mounted(), mntd_volume_send_signal(), mntd_volume_send_unmounted(), mntd_volume_set_device(), mntd_volume_set_fstype(), mntd_volume_set_mntpnt(), mntd_volume_to_string(), and mntd_volume_umount().

Referenced by mntd_volume_manager_add_volume().


Generated on Thu May 27 23:27:29 2004 for Mntd by doxygen 1.3.5