Data Structures | |
struct | vbi_export |
struct | vbi_export_class |
Defines | |
#define | VBI_OPTION_BOUNDS_INITIALIZER_(type_, def_, min_, max_, step_) { type_ = def_ }, { type_ = min_ }, { type_ = max_ }, { type_ = step_ } |
#define | VBI_OPTION_BOOL_INITIALIZER(key_, label_, def_, tip_) |
#define | VBI_OPTION_INT_RANGE_INITIALIZER(key_, label_, def_, min_, max_, step_, tip_) |
#define | VBI_OPTION_INT_MENU_INITIALIZER(key_, label_, def_,menu_, entries_, tip_) |
#define | VBI_OPTION_REAL_RANGE_INITIALIZER(key_, label_, def_, min_, max_, step_, tip_) |
#define | VBI_OPTION_REAL_MENU_INITIALIZER(key_, label_, def_,menu_, entries_, tip_) |
#define | VBI_OPTION_STRING_INITIALIZER(key_, label_, def_, tip_) |
#define | VBI_OPTION_STRING_MENU_INITIALIZER(key_, label_, def_,menu_, entries_, tip_) |
#define | VBI_OPTION_MENU_INITIALIZER(key_, label_, def_, menu_,entries_, tip_) |
#define | VBI_AUTOREG_EXPORT_MODULE(name) |
Functions | |
void | vbi_register_export_module (vbi_export_class *) |
void | vbi_export_write_error (vbi_export *) |
void | vbi_export_unknown_option (vbi_export *, const char *keyword) |
void | vbi_export_invalid_option (vbi_export *, const char *keyword,...) |
char * | vbi_export_strdup (vbi_export *, char **d, const char *s) |
void | vbi_export_error_printf (vbi_export *, const char *templ,...) |
int | vbi_ucs2be (void) |
Export modules include
"export.h"
to get these definitions. See example module exp-templ.c.
#define VBI_OPTION_BOOL_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_BOOL, key_, label_, VBI_OPTION_BOUNDS_INITIALIZER_( \ .num, def_, 0, 1, 1), { .num = NULL }, tip_ }
vbi_option_info myinfo = VBI_OPTION_BOOL_INITIALIZER ("mute", N_("Switch sound on/off"), FALSE, N_("I am a tooltip"));
N_() marks the string for i18n, see info gettext for details.
#define VBI_OPTION_INT_RANGE_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
min_, | |||||
max_, | |||||
step_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_INT, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.num, def_, min_, max_, step_), \ { .num = NULL }, tip_ }
vbi_option_info myinfo = VBI_OPTION_INT_RANGE_INITIALIZER ("sampling", N_("Sampling rate"), 44100, 8000, 48000, 100, NULL);
Here we have no tooltip (NULL
).
#define VBI_OPTION_INT_MENU_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
menu_, | |||||
entries_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_INT, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.num, def_, 0, (entries_) - 1, 1), \ { .num = menu_ }, tip_ }
int mymenu[] = { 29, 30, 31 }; vbi_option_info myinfo = VBI_OPTION_INT_MENU_INITIALIZER ("days", NULL, 1, mymenu, 3, NULL);
No label and tooltip (NULL
), i. e. this option is not to be listed in the user interface. Default is entry 1 ("30") of 3 entries.
#define VBI_OPTION_REAL_RANGE_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
min_, | |||||
max_, | |||||
step_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_REAL, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.dbl, def_, min_, max_, step_), \ { .dbl = NULL }, tip_ }
#define VBI_OPTION_REAL_MENU_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
menu_, | |||||
entries_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_REAL, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.num, def_, 0, (entries_) - 1, 1), \ { .dbl = menu_ }, tip_ }
#define VBI_OPTION_STRING_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_STRING, key_, label_, VBI_OPTION_BOUNDS_INITIALIZER_( \ .str, def_, NULL, NULL, NULL), { .str = NULL }, tip_ }
vbi_option_info myinfo = VBI_OPTION_STRING_INITIALIZER ("comment", N_("Comment"), "bububaba", "Please enter a string");
#define VBI_OPTION_STRING_MENU_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
menu_, | |||||
entries_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_STRING, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.str, def_, 0, (entries_) - 1, 1), \ { .str = menu_ }, tip_ }
char *mymenu[] = { "txt", "html" }; vbi_option_info myinfo = VBI_OPTION_STRING_MENU_INITIALIZER ("extension", "Ext", 0, mymenu, 2, N_("Select an extension"));
Remember this is like VBI_OPTION_STRING_INITIALIZER() in the sense that the vbi client can pass any string as option value, not just those proposed in the menu. In contrast a plain menu option as with VBI_OPTION_MENU_INITIALIZER() expects menu indices as input.
#define VBI_OPTION_MENU_INITIALIZER | ( | key_, | |||
label_, | |||||
def_, | |||||
menu_, | |||||
entries_, | |||||
tip_ | ) |
Value:
{ VBI_OPTION_MENU, key_, label_, \ VBI_OPTION_BOUNDS_INITIALIZER_(.num, def_, 0, (entries_) - 1, 1), \ { .str = (char **)(menu_) }, tip_ }
char *mymenu[] = { N_("Monday"), N_("Tuesday") }; vbi_option_info myinfo = VBI_OPTION_MENU_INITIALIZER ("weekday", "Weekday", 0, mymenu, 2, N_("Select a weekday"));
#define VBI_AUTOREG_EXPORT_MODULE | ( | name | ) |
Doesn't work, sigh.
void vbi_register_export_module | ( | vbi_export_class * | new_module | ) |
new_module | Static pointer to initialized vbi_export_class structure. |
void vbi_export_write_error | ( | vbi_export * | export | ) |
export | Pointer to a initialized vbi_export object. |
void vbi_export_unknown_option | ( | vbi_export * | export, | |
const char * | keyword | |||
) |
export | Pointer to a initialized vbi_export object. | |
keyword | Name of the unknown option. |
void vbi_export_invalid_option | ( | vbi_export * | export, | |
const char * | keyword, | |||
... | ||||
) |
export | Pointer to a initialized vbi_export object. | |
keyword | Name of the unknown option. | |
... | Invalid value, type depending on the option. |
char* vbi_export_strdup | ( | vbi_export * | export, | |
char ** | d, | |||
const char * | s | |||
) |
export | Pointer to a initialized vbi_export object. | |
d | If non-zero, store pointer to allocated string here. When *d is non-zero, free(*d) the old string first. | |
s | String to be duplicated. |
Same as the libc strdup(), except for d argument and setting the export error string on failure.
NULL
on failure, pointer to malloc()ed string otherwise. void vbi_export_error_printf | ( | vbi_export * | export, | |
const char * | templ, | |||
... | ||||
) |
export | Pointer to a initialized vbi_export object. | |
templ | See printf(). | |
... | See printf(). |
int vbi_ucs2be | ( | void | ) |
Helper function for export modules, since iconv seems undecided what it really wants (not every iconv supports UCS-2LE/BE).