Merge branch 'gh/254' of https://github.com/ignatenkobrain/util-linux
This commit is contained in:
commit
1bb767f54c
1
AUTHORS
1
AUTHORS
|
@ -246,6 +246,7 @@ CONTRIBUTORS:
|
|||
Huschaam Hussain <Huschaam.Hussain@hp.com>
|
||||
Ian Wienand <iwienand@redhat.com>
|
||||
Igor Bazhitov <igor.bazhitov@gmail.com>
|
||||
Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
ihno <ihno@suse.de>
|
||||
Ilias Mamedov <arknir@yandex.ru>
|
||||
Imre Kaloz <kaloz@openwrt.org>
|
||||
|
|
|
@ -157,6 +157,13 @@ int scols_column_set_flags(struct libscols_column *cl, int flags)
|
|||
if (!cl)
|
||||
return -EINVAL;
|
||||
|
||||
if (cl->table) {
|
||||
if (!(cl->flags & SCOLS_FL_TREE) && (flags & SCOLS_FL_TREE))
|
||||
cl->table->ntreecols++;
|
||||
else if ((cl->flags & SCOLS_FL_TREE) && !(flags & SCOLS_FL_TREE))
|
||||
cl->table->ntreecols--;
|
||||
}
|
||||
|
||||
cl->flags = flags;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -89,6 +89,8 @@ struct libscols_column {
|
|||
|
||||
struct libscols_cell header;
|
||||
struct list_head cl_columns;
|
||||
|
||||
struct libscols_table *table;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -141,6 +141,7 @@ int scols_table_add_column(struct libscols_table *tb, struct libscols_column *cl
|
|||
DBG(TAB, ul_debugobj(tb, "add column %p", cl));
|
||||
list_add_tail(&cl->cl_columns, &tb->tb_columns);
|
||||
cl->seqnum = tb->ncols++;
|
||||
cl->table = tb;
|
||||
scols_ref_column(cl);
|
||||
|
||||
/* TODO:
|
||||
|
@ -173,6 +174,7 @@ int scols_table_remove_column(struct libscols_table *tb,
|
|||
DBG(TAB, ul_debugobj(tb, "remove column %p", cl));
|
||||
list_del_init(&cl->cl_columns);
|
||||
tb->ncols--;
|
||||
cl->table = NULL;
|
||||
scols_unref_column(cl);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue