return grpstates[state];
}
+/*
static void grpset_debug(struct libscols_table *tb, struct libscols_line *ln)
{
size_t i;
DBG(LINE, ul_debug("grpset[%zu]: free", i));
}
}
+*/
+
static int group_state_for_line(struct libscols_group *gr, struct libscols_line *ln)
{
if (gr->state == SCOLS_GSTATE_NONE &&
if (!tb->grpset_size)
prepend = 0;
+ /*
DBG(TAB, ul_debugobj(tb, "orig grpset:"));
grpset_debug(tb, NULL);
+ */
if (prepend) {
for (i = tb->grpset_size - 1; ; i--) {
tb->grpset_size += wanted;
done:
+ /*
DBG(TAB, ul_debugobj(tb, "new grpset:"));
grpset_debug(tb, NULL);
+ */
return first;
}
}
grpset_apply_group_state(xx, state, gr);
- ON_DBG(LINE, grpset_debug(tb, ln));
+ /*ON_DBG(LINE, grpset_debug(tb, ln));*/
return 0;
}
{
int rc, children = 0, gr_children = 0;
- DBG(LINE, ul_debugobj(ln, "printing line"));
+ DBG(LINE, ul_debugobj(ln, "---printing tree line->"));
/* print the line */
fput_line_open(tb);
if (children) {
struct list_head *p;
+ DBG(LINE, ul_debugobj(ln, " printing children"));
+
list_for_each(p, &ln->ln_branch) {
struct libscols_line *chld =
list_entry(p, struct libscols_line, ln_children);
if (gr_children) {
struct list_head *p;
+ DBG(LINE, ul_debugobj(ln, " printing group children"));
+
list_for_each(p, &ln->group->gr_children) {
struct libscols_line *chld =
list_entry(p, struct libscols_line, ln_children);
if ((!children && !gr_children) || scols_table_is_json(tb))
fput_line_close(tb, last, last_in_table);
done:
+ DBG(LINE, ul_debugobj(ln, "<- print tree line [rc=%d]", rc));
return rc;
}