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/column.c
struct libscols_column* scols_copy_column(const struct libscols_column* cl)
{
    struct libscols_column* ret;

    if (!cl)
        return NULL;
    ret = scols_new_column();
    if (!ret)
        return NULL;

    DBG(COL, ul_debugobj(cl, "copy"));

    if (scols_column_set_color(ret, cl->color))
        goto err;
    if (scols_cell_copy_content(&ret->header, &cl->header))
        goto err;

    ret->width = cl->width;
    ret->width_min = cl->width_min;
    ret->width_max = cl->width_max;
    ret->width_avg = cl->width_avg;
    ret->width_hint = cl->width_hint;
    ret->flags = cl->flags;
    ret->is_extreme = cl->is_extreme;

    return ret;
err:
    scols_unref_column(ret);
    return NULL;
}
/**
 * scols_copy_column:
 * @cl: a pointer to a struct libscols_column instance
 *
 * Creates a new column and copies @cl's data over to it.
 *
 * Returns: a pointer to a new struct libscols_column instance.
 */
@cl: a pointer to a struct libscols_column instance

Creates a new column and copies @cl's data over to it.

a pointer to a new struct libscols_column instance.
@cl : a pointer to a struct libscols_column instance Creates a new column and copies @cl ' s data over to it . a pointer to a new struct libscols_column instance .
struct libscols_column* scols_copy_column(const struct libscols_column* cl)
{
    struct libscols_column* ret;
    if (!cl)
        return NULL;
    ret = scols_new_column();
    if (!ret)
        return NULL;
    DBG(COL, ul_debugobj(cl, "copy"));
    if (scols_column_set_color(ret, cl->color))
        goto err;
    if (scols_cell_copy_content(&ret->header, &cl->header))
        goto err;
    ret->width = cl->width;
    ret->width_min = cl->width_min;
    ret->width_max = cl->width_max;
    ret->width_avg = cl->width_avg;
    ret->width_hint = cl->width_hint;
    ret->flags = cl->flags;
    ret->is_extreme = cl->is_extreme;
    return ret;
err:
    scols_unref_column(ret);
    return NULL;
}
struct libscols_column * scols_copy_column ( const struct libscols_column * cl ) { struct libscols_column * ret ; if ( ! cl ) return NULL ; ret = scols_new_column ( ) ; if ( ! ret ) return NULL ; DBG ( COL , ul_debugobj ( cl , " " ) ) ; if ( scols_column_set_color ( ret , cl -> color ) ) goto err ; if ( scols_cell_copy_content ( & ret -> header , & cl -> header ) ) goto err ; ret -> width = cl -> width ; ret -> width_min = cl -> width_min ; ret -> width_max = cl -> width_max ; ret -> width_avg = cl -> width_avg ; ret -> width_hint = cl -> width_hint ; ret -> flags = cl -> flags ; ret -> is_extreme = cl -> is_extreme ; return ret ; err : scols_unref_column ( ret ) ; return NULL ; }
scols_copy_column:
 @cl: a pointer to a struct libscols_column instance
scols_copy_column : @cl : a pointer to a struct libscols_column instance