Lines Matching defs:oo
111 options_parent_table_entry(struct options *oo, const char *s)
115 if (oo->parent == NULL)
117 o = options_get(oo->parent, s);
173 struct options *oo;
175 oo = xcalloc(1, sizeof *oo);
176 RB_INIT(&oo->tree);
177 oo->parent = parent;
178 return (oo);
182 options_free(struct options *oo)
186 RB_FOREACH_SAFE(o, options_tree, &oo->tree, tmp)
188 free(oo);
192 options_get_parent(struct options *oo)
194 return (oo->parent);
198 options_set_parent(struct options *oo, struct options *parent)
200 oo->parent = parent;
204 options_first(struct options *oo)
206 return (RB_MIN(options_tree, &oo->tree));
212 return (RB_NEXT(options_tree, &oo->tree, o));
216 options_get_only(struct options *oo, const char *name)
220 found = RB_FIND(options_tree, &oo->tree, &o);
223 return (RB_FIND(options_tree, &oo->tree, &o));
229 options_get(struct options *oo, const char *name)
233 o = options_get_only(oo, name);
235 oo = oo->parent;
236 if (oo == NULL)
238 o = options_get_only(oo, name);
244 options_empty(struct options *oo, const struct options_table_entry *oe)
248 o = options_add(oo, oe->name);
258 options_default(struct options *oo, const struct options_table_entry *oe)
265 o = options_empty(oo, oe);
332 options_add(struct options *oo, const char *name)
336 o = options_get_only(oo, name);
341 o->owner = oo;
344 RB_INSERT(options_tree, &oo->tree, o);
351 struct options *oo = o->owner;
357 RB_REMOVE(options_tree, &oo->tree, o);
649 options_parse_get(struct options *oo, const char *s, int *idx, int only)
658 o = options_get_only(oo, name);
660 o = options_get(oo, name);
708 options_match_get(struct options *oo, const char *s, int *idx, int only,
719 o = options_get_only(oo, name);
721 o = options_get(oo, name);
727 options_get_string(struct options *oo, const char *name)
731 o = options_get(oo, name);
740 options_get_number(struct options *oo, const char *name)
744 o = options_get(oo, name);
753 options_get_command(struct options *oo, const char *name)
757 o = options_get(oo, name);
766 options_set_string(struct options *oo, const char *name, int append,
778 o = options_get_only(oo, name);
790 o = options_add(oo, name);
792 o = options_default(oo, options_parent_table_entry(oo, name));
806 options_set_number(struct options *oo, const char *name, long long value)
813 o = options_get_only(oo, name);
815 o = options_default(oo, options_parent_table_entry(oo, name));
827 options_set_command(struct options *oo, const char *name,
835 o = options_get_only(oo, name);
837 o = options_default(oo, options_parent_table_entry(oo, name));
852 const char *name, struct cmd_find_state *fs, struct options **oo,
863 return (options_scope_from_flags(args, window, fs, oo, cause));
875 *oo = global_options;
880 *oo = global_s_options;
887 *oo = s->options;
898 *oo = wp->options;
906 *oo = global_w_options;
913 *oo = wl->window->options;
923 struct cmd_find_state *fs, struct options **oo, char **cause)
931 *oo = global_options;
943 *oo = wp->options;
947 *oo = global_w_options;
957 *oo = wl->window->options;
961 *oo = global_s_options;
971 *oo = s->options;
977 options_string_to_style(struct options *oo, const char *name,
984 o = options_get(oo, name);
1036 options_from_string_flag(struct options *oo, const char *name,
1042 flag = !options_get_number(oo, name);
1055 options_set_number(oo, name, flag);
1080 struct options *oo, const char *name, const char *value, char **cause)
1085 choice = options_get_number(oo, name);
1093 options_set_number(oo, name, choice);
1098 options_from_string(struct options *oo, const struct options_table_entry *oe,
1126 old = xstrdup(options_get_string(oo, name));
1127 options_set_string(oo, name, append, "%s", value);
1129 new = options_get_string(oo, name);
1131 options_set_string(oo, name, 0, "%s", old);
1143 options_set_number(oo, name, number);
1151 options_set_number(oo, name, key);
1158 options_set_number(oo, name, number);
1161 return (options_from_string_flag(oo, name, value, cause));
1163 return (options_from_string_choice(oe, oo, name, value, cause));
1171 options_set_command(oo, name, pr->cmdlist);
1264 struct options *oo = o->owner;
1268 (oo == global_options ||
1269 oo == global_s_options ||
1270 oo == global_w_options))
1271 options_default(oo, o->tableentry);