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

libmnt.h

00001 /***************************************************************************
00002  * CVSID: $Id: libmnt.h,v 1.20 2004/12/19 00:13:08 stefanb Exp $
00003  *
00004  * libmnt.h : main() for MNT daemon
00005  *
00006  * Copyright (C) 2004 Stefan Bambach, <sbambach@gmx.net>
00007  *
00008  * Licensed under the GNU Lesser General Public License 2.1
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  **************************************************************************/
00025  
00026 #ifndef __LIBMNT_H__
00027 #define __LIBMNT_H__
00028 
00029 
00039 #include <dbus/dbus.h>
00040 
00041 #if defined(__cplusplus)
00042 extern "C" {
00043 #endif
00044 
00045 
00047 #define DBUS_SERVICE_MNT "biz.bambach.Mnt"
00048 
00050 #define DBUS_PATH_MNT_MANAGER "/biz/bambach/Mnt/Manager"
00051 
00053 #define DBUS_PATH_MNT_BLOCK "/biz/bambach/Mnt/Block"
00054 
00056 #define DBUS_PATH_MNT_DISC "/biz/bambach/Mnt/Disc"
00057 
00059 #define DBUS_PATH_MNT_TTY "/biz/bambach/Mnt/Tty"
00060 
00062 #define DBUS_INTERFACE_MNT_MANAGER "biz.bambach.Mnt.Manager"
00063 
00065 #define DBUS_INTERFACE_MNT_BLOCK "biz.bambach.Mnt.Block"
00066 
00068 #define DBUS_INTERFACE_MNT_DISC "biz.bambach.Mnt.Disc"
00069 
00071 #define DBUS_INTERFACE_MNT_TTY "biz.bambach.Mnt.Tty"
00072 
00074 #define DBUS_ERROR_NO_SUCH_DEVICE "biz.bambach.Mnt.NoSuchDevice"
00075 
00077 #define DBUS_ERROR_SYNTAX "biz.bambach.Mnt.SyntaxError"
00078 
00080 #define DBUS_ERROR_NO_MNTPNT "biz.bambach.Mnt.NoMntPnt"
00081 
00082     
00088 typedef void (*LibMntMainLoop)(DBusConnection* dbus_connection, void *user_data);
00089 
00090 
00097 typedef void (*LibMntVolumeMounted)(const char* udi, const char* mntpnt, void *user_data);
00098     
00099 
00106 typedef void (*LibMntVolumeUnmounted)(const char* udi, const char* mntpnt, void *user_data);
00107 
00108 
00113 typedef void (*LibMntDbusDisconnect)(void *user_data);
00114 
00115 
00120 typedef struct LIBMNTFUNCS_
00121 {
00123     LibMntMainLoop               main_loop;
00124 
00126     LibMntVolumeMounted          volume_mounted;
00127 
00129     LibMntVolumeUnmounted        volume_unmounted;
00130 
00132     LibMntDbusDisconnect         dbus_disconnect;
00133     
00134 } LIBMNTFUNCS, *PLIBMNTFUNCS;
00135 
00136 
00145 int mnt_init(PLIBMNTFUNCS functions, void *user_data);
00146 
00147 
00151 void mnt_quit(void);
00152 
00153 
00161 char **mnt_get_all_volumes(int *num_volumes);
00162 
00163 
00170 char *mnt_get_mntpnt(char *udi);
00171 
00172 
00178 int mnt_remount_rd(char *udi);
00179 
00180 
00186 int mnt_remount_rw(char *udi);
00187 
00188 
00195 DBusConnection *_mnt_get_connection(void);
00196 
00197 
00198 #if defined(__cplusplus)
00199 }
00200 #endif
00201 
00204 #endif /* __LIBMNT_H__ */

Generated on Wed Mar 30 13:43:26 2005 for Mntd by  doxygen 1.3.9.1