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); }
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); }
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); }
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); }