loop.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999, 2000, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
#define LOOP_SIGNATURE "GNU Parted Loopback 0"
static PedDiskType loop_disk_type;
static int
{
char buf [512];
int result;
return 0;
if (!disk)
goto error;
goto error_destroy_disk;
result = 1;
} else {
if (!geom)
goto error_destroy_disk;
}
return result;
return 0;
}
#ifndef DISCOVER_ONLY
static int
{
char buf [512];
PedSector i = 0;
while (loop_probe (dev)) {
return 0;
}
return 1;
}
#endif /* !DISCOVER_ONLY */
static PedDisk*
{
return NULL;
}
static PedDisk*
{
}
static void
{
}
static int
{
char buf [512];
goto error;
return 1;
if (!geom)
goto error;
if (!fs_type)
goto error_free_geom;
if (!part)
goto error;
goto error;
return 1;
return 0;
}
#ifndef DISCOVER_ONLY
static int
{
char buf [512];
return 0;
return 1;
}
}
#endif /* !DISCOVER_ONLY */
static PedPartition*
const PedFileSystemType* fs_type,
{
if (!part)
return NULL;
return part;
}
static PedPartition*
{
return result;
}
static void
{
}
static int
{
return 1;
}
static int
{
return 0;
}
static int
{
return 0;
}
static int
{
if (!new_geom) {
_("Unable to satisfy all constraints on the "
"partition."));
return 0;
}
return 1;
}
static int
{
return 0;
}
static int
{
return 1;
}
static int
{
return 1;
}
static int
{
return 1;
}
static PedDiskOps loop_disk_ops = {
.probe = loop_probe,
#ifndef DISCOVER_ONLY
.clobber = loop_clobber,
#else
#endif
.alloc = loop_alloc,
#ifndef DISCOVER_ONLY
.write = loop_write,
#else
#endif
};
static PedDiskType loop_disk_type = {
.name = "loop",
.ops = &loop_disk_ops,
.features = 0
};
void
{
}
void
{
}