Пример #1
0
struct grid_cell *
options_get_style(struct options *oo, const char *name)
{
	struct options_entry	*o;

	if ((o = options_find(oo, name)) == NULL)
		fatalx("missing option %s", name);
	if (o->type != OPTIONS_STYLE)
		fatalx("option %s not a style", name);
	return (&o->style);
}
Пример #2
0
char *
options_get_string(struct options *oo, const char *name)
{
	struct options_entry	*o;

	if ((o = options_find(oo, name)) == NULL)
		fatalx("missing option %s", name);
	if (o->type != OPTIONS_STRING)
		fatalx("option %s not a string", name);
	return (o->str);
}
Пример #3
0
long long
options_get_number(struct options *oo, const char *name)
{
	struct options_entry	*o;

	if ((o = options_find(oo, name)) == NULL)
		fatalx("missing option %s", name);
	if (o->type != OPTIONS_NUMBER)
		fatalx("option %s not a number", name);
	return (o->num);
}
Пример #4
0
void *
options_get_data(struct options *oo, const char *name)
{
	struct options_entry	*o;

	if ((o = options_find(oo, name)) == NULL)
		fatalx("missing option");
	if (o->type != OPTIONS_DATA)
		fatalx("option not data");
	return (o->data);
}