assert(l);
line = scols_table_new_line(table, NULL);
- if (!line) {
- warn(_("failed to add line to output"));
- return;
- }
+ if (!line)
+ err(EXIT_FAILURE, _("failed to initialize output line"));
for (i = 0; i < ncolumns; i++) {
char *str = NULL;
}
if (str)
- scols_line_set_data(line, i, str);
+ scols_line_refer_data(line, i, str);
}
}
struct libscols_table *table;
table = scols_new_table(NULL);
- if (!table) {
- warn(_("failed to initialize output table"));
- return -1;
- }
+ if (!table)
+ err(EXIT_FAILURE, _("failed to initialize output table"));
+
scols_table_set_raw(table, raw);
scols_table_set_no_headings(table, no_headings);
for (i = 0; i < ncolumns; i++) {
struct colinfo *col = get_column_info(i);
- if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
- warnx(_("failed to initialize output column"));
- goto done;
- }
+ if (!scols_table_new_column(table, col->name, col->whint, col->flags))
+ err(EXIT_FAILURE, _("failed to initialize output column"));
}
}
scols_print_table(table);
-done:
scols_unref_table(table);
return 0;
}