~youscribe/parted/3.1

« back to all changes in this revision

Viewing changes to include/parted/filesys.h

  • Committer: Guilhem Lettron
  • Date: 2012-10-22 14:37:59 UTC
  • Revision ID: guilhem+ubuntu@lettron.fr-20121022143759-m403kecgz13sknvp
3.1 from tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    libparted - a library for manipulating disk partitions
 
3
    Copyright (C) 1999-2001, 2006-2007, 2009-2012 Free Software Foundation,
 
4
    Inc.
 
5
 
 
6
    This program is free software; you can redistribute it and/or modify
 
7
    it under the terms of the GNU General Public License as published by
 
8
    the Free Software Foundation; either version 3 of the License, or
 
9
    (at your option) any later version.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
    GNU General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU General Public License
 
17
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
/**
 
21
 * \addtogroup PedFileSystem
 
22
 * @{
 
23
 */
 
24
 
 
25
/** \file filesys.h */
 
26
 
 
27
#ifndef PED_FILESYS_H_INCLUDED
 
28
#define PED_FILESYS_H_INCLUDED
 
29
 
 
30
typedef struct _PedFileSystem           PedFileSystem;
 
31
typedef struct _PedFileSystemType       PedFileSystemType;
 
32
typedef struct _PedFileSystemAlias      PedFileSystemAlias;
 
33
typedef const struct _PedFileSystemOps  PedFileSystemOps;
 
34
 
 
35
#include <parted/geom.h>
 
36
#include <parted/constraint.h>
 
37
#include <parted/timer.h>
 
38
 
 
39
struct _PedFileSystemOps {
 
40
        PedGeometry* (*probe) (PedGeometry* geom);
 
41
};
 
42
 
 
43
/**
 
44
 * Structure describing type of file system
 
45
 */
 
46
struct _PedFileSystemType {
 
47
        PedFileSystemType*      next;
 
48
        const char* const       name;           /**< name of the file system type */
 
49
        const int*              block_sizes;
 
50
        PedFileSystemOps* const ops;
 
51
};
 
52
 
 
53
/**
 
54
 * Structure describing a file system alias. This is separate from
 
55
 * PedFileSystemType because probing only looks through the list of types,
 
56
 * and does not probe aliases separately.
 
57
 */
 
58
struct _PedFileSystemAlias {
 
59
        PedFileSystemAlias*     next;
 
60
        PedFileSystemType*      fs_type;
 
61
        const char*             alias;
 
62
        int                     deprecated;
 
63
};
 
64
 
 
65
 
 
66
/**
 
67
 * Structure describing file system
 
68
 */
 
69
struct _PedFileSystem {
 
70
        PedFileSystemType*      type;           /**< the file system type */
 
71
        PedGeometry*            geom;           /**< where the file system actually is */
 
72
        int                     checked;        /**< 1 if the file system has been checked.
 
73
                                                      0 otherwise. */
 
74
 
 
75
        void*                   type_specific;
 
76
 
 
77
};
 
78
 
 
79
extern void ped_file_system_type_register (PedFileSystemType* type);
 
80
extern void ped_file_system_type_unregister (PedFileSystemType* type);
 
81
 
 
82
extern void ped_file_system_alias_register (PedFileSystemType* type,
 
83
                                            const char* alias, int deprecated);
 
84
extern void ped_file_system_alias_unregister (PedFileSystemType* type,
 
85
                                              const char* alias);
 
86
 
 
87
extern PedFileSystemType* ped_file_system_type_get (const char* name);
 
88
extern PedFileSystemType*
 
89
ped_file_system_type_get_next (const PedFileSystemType* fs_type)
 
90
 
 
91
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 
92
  __attribute ((__pure__))
 
93
#endif
 
94
;
 
95
 
 
96
extern PedFileSystemAlias*
 
97
ped_file_system_alias_get_next (const PedFileSystemAlias* fs_alias)
 
98
 
 
99
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 
100
  __attribute ((__pure__))
 
101
#endif
 
102
;
 
103
 
 
104
extern PedFileSystemType* ped_file_system_probe (PedGeometry* geom);
 
105
extern PedGeometry* ped_file_system_probe_specific (
 
106
                        const PedFileSystemType* fs_type,
 
107
                        PedGeometry* geom);
 
108
 
 
109
PedFileSystem *ped_file_system_open (PedGeometry *geom);
 
110
int ped_file_system_close (PedFileSystem *fs);
 
111
int ped_file_system_resize (PedFileSystem *fs, PedGeometry *geom,
 
112
                            PedTimer *timer);
 
113
PedConstraint *ped_file_system_get_resize_constraint (const PedFileSystem *fs);
 
114
 
 
115
#endif /* PED_FILESYS_H_INCLUDED */
 
116
 
 
117
/** @} */