openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/disk-utils/cfdisk.c
static int partition_from_scols(struct fdisk_table* tb,
                                struct libscols_line* ln)
{
    struct fdisk_partition* pa = scols_line_get_userdata(ln);

    fdisk_table_add_partition(tb, pa);
    fdisk_unref_partition(pa);

    if (scols_line_has_children(ln))
    {
        struct libscols_line* chln;
        struct libscols_iter* itr = scols_new_iter(SCOLS_ITER_FORWARD);

        if (!itr)
            return -EINVAL;
        while (scols_line_next_child(ln, itr, &chln) == 0)
            partition_from_scols(tb, chln);
        scols_free_iter(itr);
    }
    return 0;
}
/* Reads partition in tree-like order from scols
 */
Reads partition in tree-like order from scols
Reads partition in tree - like order from scols
static int partition_from_scols(struct fdisk_table* tb,
                                struct libscols_line* ln)
{
    struct fdisk_partition* pa = scols_line_get_userdata(ln);
    fdisk_table_add_partition(tb, pa);
    fdisk_unref_partition(pa);
    if (scols_line_has_children(ln))
    {
        struct libscols_line* chln;
        struct libscols_iter* itr = scols_new_iter(SCOLS_ITER_FORWARD);
        if (!itr)
            return -EINVAL;
        while (scols_line_next_child(ln, itr, &chln) == 0)
            partition_from_scols(tb, chln);
        scols_free_iter(itr);
    }
    return 0;
}
static int partition_from_scols ( struct fdisk_table * tb , struct libscols_line * ln ) { struct fdisk_partition * pa = scols_line_get_userdata ( ln ) ; fdisk_table_add_partition ( tb , pa ) ; fdisk_unref_partition ( pa ) ; if ( scols_line_has_children ( ln ) ) { struct libscols_line * chln ; struct libscols_iter * itr = scols_new_iter ( SCOLS_ITER_FORWARD ) ; if ( ! itr ) return - EINVAL ; while ( scols_line_next_child ( ln , itr , & chln ) == 0 ) partition_from_scols ( tb , chln ) ; scols_free_iter ( itr ) ; } return 0 ; }
Reads partition in tree-like order from scols
Reads partition in tree - like order from scols