Lines Matching full:if

47  * in m, with m, a pointer to the item, and extra being passed to callback. If
66 if (ret) in menu_items_iter()
74 * Print a menu_item. If the consumer provided an item_data_print function
82 if (!m->item_data_print) { in menu_item_print()
100 if (item->key) in menu_item_destroy()
114 * title, if any, and then each item in the menu.
118 if (m->title) { in menu_display()
128 * Check if an item's key matches a provided string, pointed to by extra. If
132 * This is called via menu_items_iter, so it returns a pointer to the item if
140 if (!item_key || !item->key) { in menu_item_key_match()
141 if (item_key == item->key) in menu_item_key_match()
147 if (strcmp(item->key, item_key) == 0) in menu_item_key_match()
154 * Find the first item with a key matching item_key, if any exists.
163 * Set *choice to point to the default item's data, if any default item was
164 * set, and returns 1. If no default item was set, returns -ENOENT.
168 if (m->default_item) { in menu_default_choice()
183 * Returns 1 if the user made a choice, or -EINTR if they bail via ^c.
196 if (!m->item_choice) { in menu_interactive_choice()
201 if (readret >= 0) { in menu_interactive_choice()
203 if (!choice_item) in menu_interactive_choice()
205 } else if (readret == -1) { in menu_interactive_choice()
214 if (key) in menu_interactive_choice()
218 if (!choice_item) in menu_interactive_choice()
236 * Returns 1 if successful, -EINVAL if m is NULL, or -ENOENT if no item with a
243 if (!m) in menu_default_set()
248 if (!item) in menu_default_set()
258 * if the menu is set to not prompt or the timeout expires. This is safe to
264 * menu item. If no item is selected or there is an error, no value will be
267 * Returns 1 if successful, -EINVAL if m or choice is NULL, -ENOENT if no
269 * expires, or -EINTR if the user exits the menu via ^c.
273 if (!m || !choice) in menu_get_choice()
276 if (!m->prompt) in menu_get_choice()
284 * data of an item if it already exists, but doesn't change the order of the
295 * will be returned from menu_get_choice if the menu item is selected.
297 * Returns 1 if successful, -EINVAL if m is NULL, or -ENOMEM if there is
304 if (!m) in menu_item_add()
309 if (item) { in menu_item_add()
315 if (!item) in menu_item_add()
320 if (!item->key) { in menu_item_add()
335 * title - If not NULL, points to a string that will be displayed before the
339 * timeout - A delay in seconds to wait for user input. If 0, timeout is
342 * prompt - If 0, don't ask for user input unless there is an interrupted
343 * timeout. If 1, the user will be prompted for input regardless of the value
346 * item_data_print - If not NULL, will be called for each item when the menu
348 * If NULL, each item's key will be printed instead. Since an item's key is
352 * item_choice - If not NULL, will be called when asking the user to choose an
353 * item. Returns a key string corresponding to the chosen item or NULL if
358 * Returns a pointer to the menu if successful, or NULL if there is
370 if (!m) in menu_create()
380 if (title) { in menu_create()
382 if (!m->title) { in menu_create()
400 * Returns 1 if successful, or -EINVAL if m is NULL.
404 if (!m) in menu_destroy()
409 if (m->title) in menu_destroy()