libsmartcols: add scols_column_add_width()
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
9abc823240
commit
82053f5e3d
|
@ -24,6 +24,7 @@ scols_column_get_header
|
||||||
scols_column_get_safechars
|
scols_column_get_safechars
|
||||||
scols_column_get_table
|
scols_column_get_table
|
||||||
scols_column_get_whint
|
scols_column_get_whint
|
||||||
|
scols_column_get_width
|
||||||
scols_column_is_customwrap
|
scols_column_is_customwrap
|
||||||
scols_column_is_hidden
|
scols_column_is_hidden
|
||||||
scols_column_is_noextremes
|
scols_column_is_noextremes
|
||||||
|
|
|
@ -396,6 +396,25 @@ const char *scols_column_get_safechars(const struct libscols_column *cl)
|
||||||
return cl->safechars;
|
return cl->safechars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* scols_column_get_width:
|
||||||
|
* @cl: a pointer to a struct libscols_column instance
|
||||||
|
*
|
||||||
|
* Important note: the column width is unknown until library starts printing
|
||||||
|
* (width is calculated before printing). The function is usable for example in
|
||||||
|
* nextchunk() callback specified by scols_column_set_wrapfunc().
|
||||||
|
*
|
||||||
|
* See also scols_column_get_whint(), it returns wanted size (!= final size).
|
||||||
|
*
|
||||||
|
* Returns: column width
|
||||||
|
*
|
||||||
|
* Since: 2.29
|
||||||
|
*/
|
||||||
|
size_t scols_column_get_width(const struct libscols_column *cl)
|
||||||
|
{
|
||||||
|
return cl->width;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scols_column_is_hidden:
|
* scols_column_is_hidden:
|
||||||
* @cl: a pointer to a struct libscols_column instance
|
* @cl: a pointer to a struct libscols_column instance
|
||||||
|
|
|
@ -147,6 +147,8 @@ extern int scols_column_is_noextremes(const struct libscols_column *cl);
|
||||||
extern int scols_column_is_wrap(const struct libscols_column *cl);
|
extern int scols_column_is_wrap(const struct libscols_column *cl);
|
||||||
extern int scols_column_is_customwrap(const struct libscols_column *cl);
|
extern int scols_column_is_customwrap(const struct libscols_column *cl);
|
||||||
|
|
||||||
|
extern size_t scols_column_get_width(const struct libscols_column *cl);
|
||||||
|
|
||||||
extern int scols_column_set_safechars(struct libscols_column *cl, const char *safe);
|
extern int scols_column_set_safechars(struct libscols_column *cl, const char *safe);
|
||||||
extern const char *scols_column_get_safechars(const struct libscols_column *cl);
|
extern const char *scols_column_get_safechars(const struct libscols_column *cl);
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,7 @@ SMARTCOLS_2.29 {
|
||||||
global:
|
global:
|
||||||
scols_column_get_safechars;
|
scols_column_get_safechars;
|
||||||
scols_column_get_table;
|
scols_column_get_table;
|
||||||
|
scols_column_get_width;
|
||||||
scols_column_is_customwrap;
|
scols_column_is_customwrap;
|
||||||
scols_column_set_safechars;
|
scols_column_set_safechars;
|
||||||
scols_column_set_wrapfunc;
|
scols_column_set_wrapfunc;
|
||||||
|
|
Loading…
Reference in New Issue