probe.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 2004, 2005, 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>
#include <stdint.h>
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
#include "hfs.h"
#include "probe.h"
int
{
_("Parted can't use HFS file systems on disks "
"with a sector size not equal to %d bytes."),
(int)PED_SECTOR_SIZE_DEFAULT );
return 0;
}
return 1;
}
/* Probe an HFS volume, detecting it even if
it is in fact a wrapper to an HFS+ volume */
/* Used by hfsplus_probe and hfs_probe */
{
/* is 5 an intelligent value ? */
return NULL;
return NULL;
break;
return geom_ret;
}
return NULL;
}
{
if (!hfsc_can_use_geom (geom))
return NULL;
/* HFS+ is embedded in an HFS volume ? */
!= PED_CPU_TO_BE16 (HFSP_SIGNATURE))) {
return NULL;
} else
return geom_ret;
} else {
/* This is a standalone HFS+ volume ? */
return NULL;
/* Correct range is indeed [ blocks*sz-2;(blocs+1)*sz-2 ( */
/* But previous versions of my implementation used to */
/* assume range is [(blocks-1)*sz-1;(blocks*sz) ( */
/* (blocks-1)*sz-1 has to be scanned last, because */
/* it can belong to a regular file */
- 2;
/ PED_SECTOR_SIZE_DEFAULT ) + 2;
search + 2)))
return NULL;
search + 2)
break;
return geom_ret;
}
- 1;
search + 2)
return NULL;
} else
return geom_ret;
}
}
{
if (!hfsc_can_use_geom (geom))
return NULL;
return geom_base;
else {
return NULL;
}
}
{
if (!hfsc_can_use_geom (geom))
return NULL;
return NULL;
/* unlike the hfs+ code, which should be kept compatible
with my old previous implementations, we only care here
about legal alternate VH positions, like TN1150 describes them */
- 2;
search + 2)))
return NULL;
search + 2)
break;
return geom_ret;
}
return NULL;
}