<xi:include href="xml/partition.xml"/>
<xi:include href="xml/table.xml"/>
<xi:include href="xml/parttype.xml"/>
+ <xi:include href="xml/item.xml"/>
+ <xi:include href="xml/field.xml"/>
</part>
<part>
<title>Label specific functions</title>
/**
* fdisk_gpt_set_npartitions:
* @cxt: context
- * @new: new size
+ * @entries: new size
*
* Elarge GPT entries array if possible. The function check if an existing
* partition does not overlap the entries array area. If yes, then it report
* warning and returns -EINVAL.
*
* Returns: 0 on success, < 0 on error.
- * Since: v2.29
+ * Since: 2.29
*/
-int fdisk_gpt_set_npartitions(struct fdisk_context *cxt, uint32_t new)
+int fdisk_gpt_set_npartitions(struct fdisk_context *cxt, uint32_t entries)
{
struct fdisk_gpt_label *gpt;
size_t old_size, new_size;
gpt = self_label(cxt);
old = le32_to_cpu(gpt->pheader->npartition_entries);
- if (old == new)
+ if (old == entries)
return 0; /* do nothing, say nothing */
/* calculate the size (bytes) of the entries array */
- new_size = new * le32_to_cpu(gpt->pheader->sizeof_partition_entry);
+ new_size = entries * le32_to_cpu(gpt->pheader->sizeof_partition_entry);
old_size = old * le32_to_cpu(gpt->pheader->sizeof_partition_entry);
/* calculate new range of usable LBAs */
/* if expanding the table, first check that everything fits,
* then allocate more memory and zero. */
- if (new > old) {
+ if (entries > old) {
rc = gpt_check_table_overlap(cxt, first_usable, last_usable);
if (rc)
return rc;
}
/* everything's ok, apply the new size */
- gpt->pheader->npartition_entries = cpu_to_le32(new);
- gpt->bheader->npartition_entries = cpu_to_le32(new);
+ gpt->pheader->npartition_entries = cpu_to_le32(entries);
+ gpt->bheader->npartition_entries = cpu_to_le32(entries);
/* usable LBA addresses will have changed */
fdisk_set_first_lba(cxt, first_usable);
gpt_recompute_crc(gpt->pheader, gpt->ents);
gpt_recompute_crc(gpt->bheader, gpt->ents);
- fdisk_info(cxt, _("Partition table length changed from %"PRIu32" to %"PRIu64"."), old, new);
+ fdisk_info(cxt, _("Partition table length changed from %"PRIu32" to %"PRIu64"."), old, entries);
fdisk_label_set_changed(cxt->label, 1);
return 0;
#include "fdiskP.h"
/**
- * SECTION: labelitem
+ * SECTION: item
* @title: Labelitem
* @short_description: disk label items
*
* fdisk_new_labelitem
*
* Returns: new instance.
- * Since: v2.29
+ * Since: 2.29
*/
struct fdisk_labelitem *fdisk_new_labelitem(void)
{
* @li: label item
*
* Increments reference counter.
- * Since: v2.29
+ * Since: 2.29
*/
void fdisk_ref_labelitem(struct fdisk_labelitem *li)
{
* Zeroize data stored in the @li (does not modify anything in disk label).
*
* Returns: 0 on success, or <0 in case of error
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_reset_labelitem(struct fdisk_labelitem *li)
{
* Decrements reference counter, on zero the @li is automatically
* deallocated.
*
- * Since: v2.29
+ * Since: 2.29
*/
void fdisk_unref_labelitem(struct fdisk_labelitem *li)
{
* @li: label item
*
* Returns: item name or NULL.
- * Since: v2.29
+ * Since: 2.29
*/
const char *fdisk_labelitem_get_name(struct fdisk_labelitem *li)
{
* @li: label item
*
* Returns: item Id or <0 in case of error.
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_labelitem_get_id(struct fdisk_labelitem *li)
{
* @data: returns data
*
* Returns: 0 on success, <0 on error
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_labelitem_get_data_u64(struct fdisk_labelitem *li, uint64_t *data)
{
* @data: returns data
*
* Returns: 0 on success, <0 on error.
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_labelitem_get_data_string(struct fdisk_labelitem *li, const char **data)
{
* @li: label item
*
* Returns: 0 or 1
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_labelitem_is_string(struct fdisk_labelitem *li)
{
* @li: label item
*
* Returns: 0 or 1
- * Since: v2.29
+ * Since: 2.29
*/
int fdisk_labelitem_is_number(struct fdisk_labelitem *li)
{
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
+ <index role="2.28">
+ <title>Index of new symbols in 2.28</title>
+ <xi:include href="xml/api-index-2.28.xml"><xi:fallback /></xi:include>
+ </index>
</book>
MNT_ERR_NOFSTAB
MNT_ERR_NOFSTYPE
MNT_ERR_NOSOURCE
+MNT_ERR_LOOPOVERLAP
</SECTION>
<SECTION>
/**
* mnt_fs_set_priority:
* @fs: /proc/swaps entry
+ * @prio: priority
*
* Returns: 0 or -1 in case of error
*/
extern int mnt_fs_get_tag(struct libmnt_fs *fs, const char **name,
const char **value);
extern const char *mnt_fs_get_target(struct libmnt_fs *fs);
-extern int mnt_fs_set_target(struct libmnt_fs *fs, const char *target);
+extern int mnt_fs_set_target(struct libmnt_fs *fs, const char *tgt);
extern const char *mnt_fs_get_fstype(struct libmnt_fs *fs);
extern int mnt_fs_set_fstype(struct libmnt_fs *fs, const char *fstype);
extern int mnt_fs_get_passno(struct libmnt_fs *fs);
extern int mnt_fs_set_passno(struct libmnt_fs *fs, int passno);
extern const char *mnt_fs_get_root(struct libmnt_fs *fs);
-extern int mnt_fs_set_root(struct libmnt_fs *fs, const char *root);
+extern int mnt_fs_set_root(struct libmnt_fs *fs, const char *path);
extern const char *mnt_fs_get_bindsrc(struct libmnt_fs *fs);
extern int mnt_fs_set_bindsrc(struct libmnt_fs *fs, const char *src);
extern int mnt_fs_get_id(struct libmnt_fs *fs);
scols_column_get_color
scols_column_get_flags
scols_column_get_header
-scols_column_get_safechars;
-scols_column_get_table;
+scols_column_get_safechars
+scols_column_get_table
scols_column_get_whint
-scols_column_is_customwrap;
+scols_column_is_customwrap
scols_column_is_hidden
scols_column_is_noextremes
scols_column_is_right
scols_column_set_cmpfunc
scols_column_set_color
scols_column_set_flags
-scols_column_set_safechars;
+scols_column_set_safechars
scols_column_set_whint
-scols_column_set_wrapfunc;
+scols_column_set_wrapfunc
scols_copy_column
scols_new_column
scols_ref_column
scols_unref_column
-scols_wrapnl_chunksize;
-scols_wrapnl_nextchunk;
+scols_wrapnl_chunksize
+scols_wrapnl_nextchunk
</SECTION>
<SECTION>
* scols_wrapnl_nextchunk:
* @cl: a pointer to a struct libscols_column instance
* @data: string
- * @userdata: any data or NULL
+ * @userdata: callback private data
*
* This is build-in function for scols_column_set_wrapfunc(). This function
* terminates the current chunk by \0 and returns pointer to the begin of
* scols_wrapnl_chunksize:
* @cl: a pointer to a struct libscols_column instance
* @data: string
+ * @userdata: callback private data
*
* Analyzes @data and returns size of the largest chunk. The chunks are based
* on \n. For example for data "AAA\nBBB\nCCCC" the largest chunk size is 4.
* @cl: a pointer to a struct libscols_column instance
* @wrap_chunksize: function to return size of the largest chink of data
* @wrap_nextchunk: function to return next zero terminated data
+ * @userdata: optional stuff for callbacks
*
* Extends SCOLS_FL_WRAP and allows to set custom wrap function. The default
* is to wrap by column size, but you can create functions to wrap for example
char * (*wrap_nextchunk)(const struct libscols_column *,
char *,
void *),
- void *data)
+ void *userdata)
{
if (!cl)
return -EINVAL;
cl->wrap_nextchunk = wrap_nextchunk;
cl->wrap_chunksize = wrap_chunksize;
- cl->wrapfunc_data = data;
+ cl->wrapfunc_data = userdata;
return 0;
}
const char *, void *),
char * (*wrap_nextchunk)(const struct libscols_column *,
char *, void *),
- void *data);
+ void *userdata);
extern char *scols_wrapnl_nextchunk(const struct libscols_column *cl, char *data, void *userdata);
extern size_t scols_wrapnl_chunksize(const struct libscols_column *cl, const char *data, void *userdata);