Man page - unibi_format(3)
Packages contains this manual
- unibi_var_from_num(3)
- unibi_var_from_str(3)
- unibi_dummy(3)
- unibi_get_bool(3)
- unibi_get_aliases(3)
- unibi_short_name_num(3)
- unibi_from_term(3)
- unibi_get_ext_str_name(3)
- unibi_from_env(3)
- unibi_get_name(3)
- unibi_num_from_var(3)
- unibi_set_ext_num_name(3)
- unibi_short_name_str(3)
- unibi_from_fp(3)
- unibi_get_ext_num(3)
- unibi_str_from_var(3)
- unibi_run(3)
- unibi_get_ext_str(3)
- unibi_set_ext_bool(3)
- unibi_from_file(3)
- unibi_count_ext_num(3)
- unibi_del_ext_bool(3)
- unibi_count_ext_bool(3)
- unibi_set_num(3)
- unibi_get_ext_bool_name(3)
- unibi_int_from_var(3)
- unibi_get_ext_bool(3)
- unibi_add_ext_bool(3)
- unibi_set_str(3)
- unibi_count_ext_str(3)
- unibi_get_ext_num_name(3)
- unibi_set_name(3)
- unibi_terminfo_dirs(3)
- unibilium.h(3)
- unibi_destroy(3)
- unibi_from_fd(3)
- unibi_add_ext_num(3)
- unibi_name_str(3)
- unibi_set_bool(3)
- unibi_set_ext_bool_name(3)
- unibi_set_aliases(3)
- unibi_dump(3)
- unibi_set_ext_str(3)
- unibi_add_ext_str(3)
- unibi_set_ext_num(3)
- unibi_format(3)
- unibi_name_bool(3)
- unibi_get_num(3)
- unibi_get_str(3)
- unibi_from_mem(3)
- unibi_short_name_bool(3)
- unibi_set_ext_str_name(3)
- unibi_name_num(3)
apt-get install libunibilium-dev
Manual
doc::unibi_format
NAMESYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO
NAME
unibi_format, unibi_run - interpret a terminfo format string
SYNOPSIS
#include
<unibilium.h>
void unibi_format(
unibi_var_t var_dyn[26],
unibi_var_t var_static[26],
const char *fmt,
unibi_var_t param[9],
void (*out)(void *, const char *, size_t),
void *ctx1,
void (*pad)(void *, size_t, int, int),
void *ctx2
);
size_t unibi_run(const char *fmt, unibi_var_t param[9], char
*p, size_t n);
DESCRIPTION
"unibi_format" takes a format string fmt and executes it. All output is done by (possibly repeated) calls to out . In the calls to out the first argument is always ctx1 , the second argument is a pointer to a chunk of data, and the third argument is a count specifying the size of the chunk in bytes.
pad is used when the format string contains "$<...>" padding instructions. In the calls to pad the first argument is always ctx2 , the second argument is the delay in tenths of milliseconds, the third argument is a boolean flag indicating whether "*" (proportional delay) was specified in the format string, and the fourth argument is a boolean flag indicating whether "/" (forced padding) was specified in the format string. Thus a format string of "$<5/>" would translate into "pad(ctx2, 50, 0, 1)". You may pass a null pointer for pad ; in that case padding instructions are silently skipped.
The values of param are used for the format codes %p1 .. %p9; the values of var_dyn and var_static are used for the so-called dynamic/static variables %Pa .. %Pz and %PA .. %PZ, respectively.
"unibi_run" is a wrapper around "unibi_format". It passes two arrays (each initialized to 26 zeroes) as var_dyn and var_static . fmt and param are passed on unchanged. It ignores padding and places all normal output in the buffer pointed to by p . n is the size of the buffer; at most n bytes will be written to p .
RETURN VALUE
"unibi_run" returns the number of bytes that would have been written if the buffer was big enough. Thus the number of valid bytes in p after a call to "unibi_run" is the minimum of n and the return value of "unibi_run".
SEE ALSO
unibi_var_from_num (3), unibi_var_from_str (3), unibilium.h (3)