Top |
int | scols_cell_copy_content () |
int | scols_cell_get_alignment () |
const char * | scols_cell_get_color () |
const char * | scols_cell_get_data () |
int | scols_cell_get_flags () |
void * | scols_cell_get_userdata () |
int | scols_cell_refer_data () |
int | scols_cell_set_color () |
int | scols_cell_set_data () |
int | scols_cell_set_flags () |
int | scols_cell_set_userdata () |
int | scols_cmpstr_cells () |
int | scols_reset_cell () |
An API to access and modify per-cell data and information. Note that cell is always part of the line. If you destroy (un-reference) a line than it destroys all line cells too.
int scols_cell_copy_content (struct libscols_cell *dest
,const struct libscols_cell *src
);
Copy the contents of src
into dest
.
int
scols_cell_get_alignment (const struct libscols_cell *ce
);
Since: 2.30
int scols_cell_refer_data (struct libscols_cell *ce
,char *data
);
Adds a reference to str
to ce
. The pointer is deallocated by
scols_reset_cell()
or scols_unref_line()
. This function is mostly designed
for situations when the data for the cell are already composed in allocated
memory (e.g. asprintf()
) to avoid extra unnecessary strdup()
.
int scols_cell_set_color (struct libscols_cell *ce
,const char *color
);
Set the color of ce
to color
.
int scols_cell_set_data (struct libscols_cell *ce
,const char *data
);
Stores a copy of the str
in ce
, the old data are deallocated by free()
.
int scols_cell_set_flags (struct libscols_cell *ce
,int flags
);
Note that cells in the table are always aligned by column flags. The cell flags are used for table title only (now).
int scols_cmpstr_cells (struct libscols_cell *a
,struct libscols_cell *b
,void *data
);
Compares cells data by strcmp()
. The function is designed for
scols_column_set_cmpfunc()
and scols_sort_table()
.