libfdisk: add docs for DOS functions

This commit is contained in:
Karel Zak 2014-11-26 11:00:43 +01:00
parent a4e6a45e54
commit b7d101a20d
3 changed files with 31 additions and 11 deletions

View File

@ -19,6 +19,14 @@
#define MAXIMUM_PARTS 60
#define ACTIVE_FLAG 0x80
/**
* SECTION: dos
* @title: MBR (DOS) functions
* @short_description: MBR disk label specific functions
*
*/
#define IS_EXTENDED(i) \
((i) == MBR_DOS_EXTENDED_PARTITION \
|| (i) == MBR_W95_EXTENDED_PARTITION \
@ -2289,10 +2297,16 @@ struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt)
return lb;
}
/*
* Public label specific functions
/**
* fdisk_dos_enable_compatible:
* @lb: DOS label (see fdisk_get_label())
* @enable: 0 or 1
*
* Enables deprecated DOS compatible mode, in this mode library checks for
* cylinders boundary, cases about CHS addressing and another obscure things.
*
* Returns: 0 on success, <0 on error.
*/
int fdisk_dos_enable_compatible(struct fdisk_label *lb, int enable)
{
struct fdisk_dos_label *dos = (struct fdisk_dos_label *) lb;
@ -2306,6 +2320,12 @@ int fdisk_dos_enable_compatible(struct fdisk_label *lb, int enable)
return 0;
}
/**
* fdisk_dos_is_compatible:
* @lb: DOS label
*
* Returns: 0 if DOS compatibility disabled, 1 if enabled
*/
int fdisk_dos_is_compatible(struct fdisk_label *lb)
{
return ((struct fdisk_dos_label *) lb)->compatible;

View File

@ -431,4 +431,9 @@ int fdisk_info_new_partition(
int num, sector_t start, sector_t stop,
struct fdisk_parttype *t);
/* dos.c */
extern struct dos_partition *fdisk_dos_get_partition(
struct fdisk_context *cxt,
size_t i);
#endif /* _LIBFDISK_PRIVATE_H */

View File

@ -359,6 +359,9 @@ extern int fdisk_iter_get_direction(struct fdisk_iter *itr);
/* dos.c */
#define DOS_FLAG_ACTIVE 1
extern int fdisk_dos_move_begin(struct fdisk_context *cxt, size_t i);
extern int fdisk_dos_enable_compatible(struct fdisk_label *lb, int enable);
extern int fdisk_dos_is_compatible(struct fdisk_label *lb);
@ -412,14 +415,6 @@ enum {
extern int fdisk_gpt_is_hybrid(struct fdisk_context *cxt);
/* dos.c */
extern struct dos_partition *fdisk_dos_get_partition(
struct fdisk_context *cxt,
size_t i);
extern int fdisk_dos_move_begin(struct fdisk_context *cxt, size_t i);
#define DOS_FLAG_ACTIVE 1
/* script.c */
struct fdisk_script *fdisk_new_script(struct fdisk_context *cxt);