| libsmartcols Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
struct libscols_column; const char * scols_column_get_color (struct libscols_column *cl); int scols_column_get_flags (struct libscols_column *cl); struct libscols_cell * scols_column_get_header (struct libscols_column *cl); double scols_column_get_whint (struct libscols_column *cl); int scols_column_is_noextremes (struct libscols_column *cl); int scols_column_is_right (struct libscols_column *cl); int scols_column_is_strict_width (struct libscols_column *cl); int scols_column_is_tree (struct libscols_column *cl); int scols_column_is_trunc (struct libscols_column *cl); int scols_column_set_cmpfunc (struct libscols_column *cl,int (*cmp) (struct libscols_cell *a, struct libscols_cell *b, void *),void *data); int scols_column_set_color (struct libscols_column *cl,const char *color); int scols_column_set_flags (struct libscols_column *cl,int flags); int scols_column_set_whint (struct libscols_column *cl,double whint); struct libscols_column * scols_copy_column (const struct libscols_column *cl); struct libscols_column * scols_new_column (void); void scols_ref_column (struct libscols_column *cl); void scols_unref_column (struct libscols_column *cl);
struct libscols_column;
A column - defines the number of columns and column names
const char * scols_column_get_color (struct libscols_column *cl);
|
a pointer to a struct libscols_column instance |
Returns : |
The current color setting of the column cl. |
int scols_column_get_flags (struct libscols_column *cl);
|
a pointer to a struct libscols_column instance |
Returns : |
The flag mask of cl, a negative value in case of an error. |
struct libscols_cell * scols_column_get_header (struct libscols_column *cl);
|
a pointer to a struct libscols_column instance |
Returns : |
A pointer to a struct libscols_cell instance, representing the
header info of column cl or NULL in case of an error. |
double scols_column_get_whint (struct libscols_column *cl);
|
a pointer to a struct libscols_column instance |
Returns : |
The width hint of column cl, a negative value in case of an error. |
int scols_column_is_noextremes (struct libscols_column *cl);
Gets the value of cl's flag no_extremes.
|
a pointer to a struct libscols_column instance |
Returns : |
no_extremes flag value, negative value in case of an error. |
int scols_column_is_right (struct libscols_column *cl);
Gets the value of cl's flag right.
|
a pointer to a struct libscols_column instance |
Returns : |
right flag value, negative value in case of an error. |
int scols_column_is_strict_width (struct libscols_column *cl);
Gets the value of cl's flag strict_width.
|
a pointer to a struct libscols_column instance |
Returns : |
strict_width flag value, negative value in case of an error. |
int scols_column_is_tree (struct libscols_column *cl);
Gets the value of cl's flag tree.
|
a pointer to a struct libscols_column instance |
Returns : |
tree flag value, negative value in case of an error. |
int scols_column_is_trunc (struct libscols_column *cl);
Gets the value of cl's flag trunc.
|
a pointer to a struct libscols_column instance |
Returns : |
trunc flag value, negative value in case of an error. |
int scols_column_set_cmpfunc (struct libscols_column *cl,int (*cmp) (struct libscols_cell *a, struct libscols_cell *b, void *),void *data);
|
column |
|
pointer to compare function |
|
private data for cmp function |
Returns : |
0, a negative value in case of an error. |
int scols_column_set_color (struct libscols_column *cl,const char *color);
The default color for data cells and column header.
If you want to set header specific color then use scols_column_get_header()
and scols_cell_set_color().
If you want to set data cell specific color the use scols_line_get_cell() +
scols_cell_set_color().
|
a pointer to a struct libscols_column instance |
|
color name or ESC sequence |
Returns : |
0, a negative value in case of an error. |
int scols_column_set_flags (struct libscols_column *cl,int flags);
Sets the flags of cl to flags.
|
a pointer to a struct libscols_column instance |
|
a flag mask |
Returns : |
0, a negative value in case of an error. |
int scols_column_set_whint (struct libscols_column *cl,double whint);
Sets the width hint of column cl to whint.
|
a pointer to a struct libscols_column instance |
|
a width hint |
Returns : |
0, a negative value in case of an error. |
struct libscols_column * scols_copy_column (const struct libscols_column *cl);
Creates a new column and copies cl's data over to it.
|
a pointer to a struct libscols_column instance |
Returns : |
a pointer to a new struct libscols_column instance. |
struct libscols_column * scols_new_column (void);
Allocates space for a new column.
Returns : |
a pointer to a new struct libscols_cell instance, NULL in case of an ENOMEM error. |
void scols_ref_column (struct libscols_column *cl);
Increases the refcount of cl.
|
a pointer to a struct libscols_column instance |