filesys.h

Go to the documentation of this file.
00001 /*
00002     libparted - a library for manipulating disk partitions
00003     Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00018 */
00019 
00027 #ifndef PED_FILESYS_H_INCLUDED
00028 #define PED_FILESYS_H_INCLUDED
00029 
00030 typedef struct _PedFileSystem           PedFileSystem;
00031 typedef struct _PedFileSystemType       PedFileSystemType;
00032 typedef const struct _PedFileSystemOps  PedFileSystemOps;
00033 
00034 #include <parted/geom.h>
00035 #include <parted/disk.h>
00036 #include <parted/exception.h>
00037 #include <parted/constraint.h>
00038 #include <parted/timer.h>
00039 #include <stdio.h>
00040 
00041 struct _PedFileSystemOps {
00042         PedGeometry* (*probe) (PedGeometry* geom);
00043         int (*clobber) (PedGeometry* geom);
00044 
00045         PedFileSystem* (*open) (PedGeometry* geom);
00046         PedFileSystem* (*create) (PedGeometry* geom, PedTimer* timer);
00047         int (*close) (PedFileSystem* fs);
00048         int (*check) (PedFileSystem* fs, PedTimer* timer);
00049         PedFileSystem* (*copy) (const PedFileSystem* fs, PedGeometry* geom,
00050                                 PedTimer* timer);
00051         int (*resize) (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer);
00052 
00053         PedConstraint* (*get_create_constraint) (const PedDevice* dev);
00054         PedConstraint* (*get_resize_constraint) (const PedFileSystem* fs);
00055         PedConstraint* (*get_copy_constraint) (const PedFileSystem* fs,
00056                                                const PedDevice* dev);
00057 };
00058 
00062 struct _PedFileSystemType {
00063         PedFileSystemType*      next;
00064         const char* const       name;           
00065         const int*              block_sizes;
00066         PedFileSystemOps* const ops;
00067 };
00068 
00069 
00073 struct _PedFileSystem {
00074         PedFileSystemType*      type;           
00075         PedGeometry*            geom;           
00076         int                     checked;        
00079         void*                   type_specific;
00080 
00081 };
00082 
00083 extern void ped_file_system_type_register (PedFileSystemType* type);
00084 extern void ped_file_system_type_unregister (PedFileSystemType* type);
00085 
00086 extern PedFileSystemType* ped_file_system_type_get (const char* name);
00087 extern PedFileSystemType*
00088 ped_file_system_type_get_next (const PedFileSystemType* fs_type);
00089 
00090 extern PedFileSystemType* ped_file_system_probe (PedGeometry* geom);
00091 extern PedGeometry* ped_file_system_probe_specific (
00092                         const PedFileSystemType* fs_type,
00093                         PedGeometry* geom);
00094 extern int ped_file_system_clobber (PedGeometry* geom);
00095 
00096 extern PedFileSystem* ped_file_system_open (PedGeometry* geom);
00097 extern PedFileSystem* ped_file_system_create (PedGeometry* geom,
00098                                               const PedFileSystemType* type,
00099                                               PedTimer* timer);
00100 extern int ped_file_system_close (PedFileSystem* fs);
00101 extern int ped_file_system_check (PedFileSystem* fs, PedTimer* timer);
00102 extern PedFileSystem* ped_file_system_copy (PedFileSystem* fs,
00103                                             PedGeometry* geom,
00104                                             PedTimer* timer);
00105 extern int ped_file_system_resize (PedFileSystem* fs, PedGeometry* geom,
00106                                    PedTimer* timer);
00107 
00108 extern PedConstraint* ped_file_system_get_create_constraint (
00109                 const PedFileSystemType* fs_type, const PedDevice* dev);
00110 extern PedConstraint* ped_file_system_get_resize_constraint (
00111                 const PedFileSystem* fs);
00112 extern PedConstraint* ped_file_system_get_copy_constraint (
00113                 const PedFileSystem* fs, const PedDevice* dev);
00114 
00115 #endif /* PED_FILESYS_H_INCLUDED */
00116 

Generated on Fri May 4 05:15:31 2007 for libparted by  doxygen 1.5.2