Lines Matching refs:v
238 struct variable *v; in variable_lookup() local
240 list_for_each_entry(v, &variable_list, node) { in variable_lookup()
241 if (!strcmp(name, v->name)) in variable_lookup()
242 return v; in variable_lookup()
250 struct variable *v; in variable_expand() local
253 v = variable_lookup(name); in variable_expand()
254 if (!v) in variable_expand()
257 if (argc == 0 && v->exp_count) in variable_expand()
261 if (v->exp_count > 1000) in variable_expand()
264 v->exp_count++; in variable_expand()
266 if (v->flavor == VAR_RECURSIVE) in variable_expand()
267 res = expand_string_with_args(v->value, argc, argv); in variable_expand()
269 res = xstrdup(v->value); in variable_expand()
271 v->exp_count--; in variable_expand()
279 struct variable *v; in variable_add() local
283 v = variable_lookup(name); in variable_add()
284 if (v) { in variable_add()
287 flavor = v->flavor; in variable_add()
290 free(v->value); in variable_add()
297 v = xmalloc(sizeof(*v)); in variable_add()
298 v->name = xstrdup(name); in variable_add()
299 v->exp_count = 0; in variable_add()
300 list_add_tail(&v->node, &variable_list); in variable_add()
303 v->flavor = flavor; in variable_add()
311 v->value = xrealloc(v->value, in variable_add()
312 strlen(v->value) + strlen(new_value) + 2); in variable_add()
313 strcat(v->value, " "); in variable_add()
314 strcat(v->value, new_value); in variable_add()
317 v->value = new_value; in variable_add()
321 static void variable_del(struct variable *v) in variable_del() argument
323 list_del(&v->node); in variable_del()
324 free(v->name); in variable_del()
325 free(v->value); in variable_del()
326 free(v); in variable_del()
331 struct variable *v, *tmp; in variable_all_del() local
333 list_for_each_entry_safe(v, tmp, &variable_list, node) in variable_all_del()
334 variable_del(v); in variable_all_del()