~ubuntu-branches/ubuntu/utopic/parted/utopic-proposed

« back to all changes in this revision

Viewing changes to libparted/libparted.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-07-21 10:23:16 UTC
  • mfrom: (7.2.32 sid)
  • Revision ID: package-import@ubuntu.com-20140721102316-jsyv3yzmbo8vlde5
Tags: 3.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    libparted - a library for manipulating disk partitions
3
 
    Copyright (C) 1999-2001, 2007-2010 Free Software Foundation, Inc.
 
3
    Copyright (C) 1999-2001, 2007-2012 Free Software Foundation, Inc.
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
98
98
        ped_disk_aix_init ();
99
99
}
100
100
 
101
 
#ifdef ENABLE_FS
102
101
extern void ped_file_system_amiga_init (void);
103
102
extern void ped_file_system_xfs_init (void);
104
103
extern void ped_file_system_ufs_init (void);
109
108
extern void ped_file_system_hfs_init (void);
110
109
extern void ped_file_system_fat_init (void);
111
110
extern void ped_file_system_ext2_init (void);
 
111
extern void ped_file_system_nilfs2_init (void);
112
112
extern void ped_file_system_btrfs_init (void);
113
113
extern void ped_file_system_zfs_init (void);
114
114
 
125
125
        ped_file_system_hfs_init ();
126
126
        ped_file_system_fat_init ();
127
127
        ped_file_system_ext2_init ();
 
128
        ped_file_system_nilfs2_init ();
128
129
        ped_file_system_btrfs_init ();
129
130
        ped_file_system_zfs_init ();
130
131
}
131
 
#endif /* ENABLE_FS */
132
132
 
133
133
extern void ped_disk_aix_done ();
134
134
extern void ped_disk_bsd_done ();
172
172
#endif
173
173
 
174
174
        init_disk_types ();
175
 
 
176
 
#ifdef ENABLE_FS
177
175
        init_file_system_types ();
178
 
#endif
179
176
        ped_set_architecture ();
180
177
#ifdef DEBUG
181
178
        memset (dodgy_memory_active, 0, sizeof (dodgy_memory_active));
182
179
#endif
183
180
}
184
181
 
185
 
#ifdef ENABLE_FS
 
182
extern void ped_file_system_nilfs2_done (void);
186
183
extern void ped_file_system_ext2_done (void);
187
184
extern void ped_file_system_fat_done (void);
188
185
extern void ped_file_system_hfs_done (void);
199
196
static void
200
197
done_file_system_types ()
201
198
{
 
199
        ped_file_system_nilfs2_done ();
202
200
        ped_file_system_ext2_done ();
203
201
        ped_file_system_fat_done ();
204
202
        ped_file_system_hfs_done ();
212
210
        ped_file_system_zfs_done ();
213
211
        ped_file_system_amiga_done ();
214
212
}
215
 
#endif /* ENABLE_FS */
216
213
 
217
214
static void _done() __attribute__ ((destructor));
218
215
 
220
217
_done()
221
218
{
222
219
        ped_device_free_all ();
223
 
 
224
220
        done_disk_types ();
225
 
 
226
 
#ifdef ENABLE_FS
227
221
        done_file_system_types ();
228
 
#endif
229
222
}
230
223
 
231
224
const char*
249
242
        return mem;
250
243
}
251
244
 
252
 
int
253
 
ped_realloc (void** old, size_t size)
254
 
{
255
 
        void*           mem;
256
 
 
257
 
        mem = (void*) realloc (*old, size);
258
 
        if (!mem) {
259
 
                ped_exception_throw (PED_EXCEPTION_FATAL, PED_EXCEPTION_CANCEL,
260
 
                                     _("Out of memory."));
261
 
                return 0;
262
 
        }
263
 
        *old = mem;
264
 
        return 1;
265
 
}
266
 
 
267
245
 
268
246
void* ped_calloc (size_t size)
269
247
{