| Top |
| int | scols_cell_copy_content () |
| int | scols_cell_get_alignment () |
| const char * | scols_cell_get_color () |
| const char * | scols_cell_get_data () |
| size_t | scols_cell_get_datasiz () |
| int | scols_cell_get_flags () |
| void * | scols_cell_get_userdata () |
| int | scols_cell_refer_data () |
| int | scols_cell_refer_memory () |
| 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 (data, usewrdata, colors) 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 data
to ce
. The pointer is deallocated by
scols_reset_cell() or scols_unref_line() by free(). 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().
ce |
a pointer to a struct libscols_cell instance |
|
data |
string (used for |
int scols_cell_refer_memory (struct libscols_cell *ce,char *data,size_t datasiz);
Same like scols_cell_refer_data, but data
does not have to be zero terminated.
The pointer is deallocated by scols_reset_cell() or scols_unref_line() by free().
The column (for the cell) has to define wrap function which converts the data to zero terminated string, otherwise library will work with the data as with string!
Since: 2.40
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 data
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 strcoll(). The function is designed for
scols_column_set_cmpfunc() and scols_sort_table().