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/libsmartcols/src/table.c
int scols_sort_table_by_tree(struct libscols_table* tb)
{
    struct libscols_line* ln;
    struct libscols_iter itr;

    if (!tb)
        return -EINVAL;

    DBG(TAB, ul_debugobj(tb, "sorting table by tree"));

    scols_reset_iter(&itr, SCOLS_ITER_FORWARD);
    while (scols_table_next_line(tb, &itr, &ln) == 0)
    {
        if (ln->parent)
            continue;

        move_line_and_children(ln, NULL);
    }

    return 0;
}
/**
 * scols_sort_table_by_tree:
 * @tb: table
 *
 * Reorders lines in the table by parent->child relation. Note that order of
 * the lines in the table is independent on the tree hierarchy.
 *
 * Since: 2.30
 *
 * Returns: 0, a negative value in case of an error.
 */
@tb: table

Reorders lines in the table by parent->child relation. Note that order of
the lines in the table is independent on the tree hierarchy.



0, a negative value in case of an error.
@tb : table Reorders lines in the table by parent - > child relation . Note that order of the lines in the table is independent on the tree hierarchy . 0 a negative value in case of an error .
int scols_sort_table_by_tree(struct libscols_table* tb)
{
    struct libscols_line* ln;
    struct libscols_iter itr;
    if (!tb)
        return -EINVAL;
    DBG(TAB, ul_debugobj(tb, "sorting table by tree"));
    scols_reset_iter(&itr, SCOLS_ITER_FORWARD);
    while (scols_table_next_line(tb, &itr, &ln) == 0)
    {
        if (ln->parent)
            continue;
        move_line_and_children(ln, NULL);
    }
    return 0;
}
int scols_sort_table_by_tree ( struct libscols_table * tb ) { struct libscols_line * ln ; struct libscols_iter itr ; if ( ! tb ) return - EINVAL ; DBG ( TAB , ul_debugobj ( tb , " " ) ) ; scols_reset_iter ( & itr , SCOLS_ITER_FORWARD ) ; while ( scols_table_next_line ( tb , & itr , & ln ) == 0 ) { if ( ln -> parent ) continue ; move_line_and_children ( ln , NULL ) ; } return 0 ; }
scols_sort_table_by_tree:
 @tb: table
scols_sort_table_by_tree : @tb : table