Lines Matching defs:list

94 static int list_count(struct list_head *list)
99 list_for_each(pos, list) {
105 static int alloc_str_list(struct list_head *list, int mult, char **result[])
110 cnt = list_count(list) * mult;
148 * \brief Free a string list
149 * \param list The string list to free
153 int snd_use_case_free_list(const char *list[], int items)
156 if (list == NULL)
159 free((void *)list[i]);
160 free(list);
711 device = list_entry(pos, struct use_case_device, list);
751 s = list_entry(pos, struct sequence_element, list);
1065 * \brief Universal find - string in a list
1066 * \param list List of structures
1067 * \param offset Offset of list structure
1072 static void *find0(struct list_head *list,
1080 list_for_each(pos, list) {
1089 #define find(list, type, member, value, match) \
1090 find0(list, (unsigned long)(&((type *)0)->member), \
1094 * \brief Universal string list
1095 * \param list List of structures
1096 * \param result Result list
1097 * \param offset Offset of list structure
1101 static int get_list0(struct list_head *list,
1111 cnt = alloc_str_list(list, 1, &res);
1117 list_for_each(pos, list) {
1135 #define get_list(list, result, type, member, s1) \
1136 get_list0(list, result, \
1141 * \brief Universal string list - pair of strings
1142 * \param list List of structures
1143 * \param result Result list
1144 * \param offset Offset of list structure
1149 static int get_list20(struct list_head *list,
1160 cnt = alloc_str_list(list, 2, &res);
1166 list_for_each(pos, list) {
1193 #define get_list2(list, result, type, member, s1, s2) \
1194 get_list20(list, result, \
1209 struct use_case_verb, list, name,
1233 list_for_each(pos, &dev_list->list) {
1234 device = list_entry(pos, struct dev_list_node, list);
1272 device = list_entry(pos, struct use_case_device, list);
1300 modifier = list_entry(pos, struct use_case_modifier, list);
1657 * \brief Get list of verbs in pair verbname+comment
1658 * \param list Returned list
1659 * \return Number of list entries if success, otherwise a negative error code
1661 static int get_verb_list(snd_use_case_mgr_t *uc_mgr, const char **list[])
1663 return get_list2(&uc_mgr->verb_list, list,
1664 struct use_case_verb, list,
1669 * \brief Get list of devices in pair devicename+comment
1670 * \param list Returned list
1672 * \return Number of list entries if success, otherwise a negative error code
1674 static int get_device_list(snd_use_case_mgr_t *uc_mgr, const char **list[],
1686 return get_list2(&verb->device_list, list,
1687 struct use_case_device, list,
1692 * \brief Get list of modifiers in pair devicename+comment
1693 * \param list Returned list
1695 * \return Number of list entries if success, otherwise a negative error code
1697 static int get_modifier_list(snd_use_case_mgr_t *uc_mgr, const char **list[],
1708 return get_list2(&verb->modifier_list, list,
1709 struct use_case_modifier, list,
1714 * \brief Get list of supported/conflicting devices
1715 * \param list Returned list
1717 * \param type Type of device list entries to return
1718 * \return Number of list entries if success, otherwise a negative error code
1721 const char **list[], char *name,
1746 *list = NULL;
1749 return get_list(&modifier->dev_list.list, list,
1750 struct dev_list_node, list,
1757 *list = NULL;
1760 return get_list(&device->dev_list.list, list,
1761 struct dev_list_node, list,
1769 * \brief Get list of supported devices
1770 * \param list Returned list
1772 * \return Number of list entries if success, otherwise a negative error code
1775 const char **list[], char *name)
1777 return get_supcon_device_list(uc_mgr, list, name, DEVLIST_SUPPORTED);
1781 * \brief Get list of conflicting devices
1782 * \param list Returned list
1784 * \return Number of list entries if success, otherwise a negative error code
1787 const char **list[], char *name)
1789 return get_supcon_device_list(uc_mgr, list, name, DEVLIST_CONFLICTING);
1794 struct list_head list;
1800 * \brief Convert myvalue list string list
1801 * \param list myvalue list
1802 * \param res string list
1803 * \retval Number of list entries if success, otherwise a negativer error code
1805 static int myvalue_to_str_list(struct list_head *list, char ***res)
1812 cnt = alloc_str_list(list, 1, res);
1816 list_for_each(pos, list) {
1817 value = list_entry(pos, struct myvalue, list);
1829 * \brief Free myvalue list
1830 * \param list myvalue list
1832 static void myvalue_list_free(struct list_head *list)
1837 list_for_each_safe(pos, npos, list) {
1838 value = list_entry(pos, struct myvalue, list);
1839 list_del(&value->list);
1845 * \brief Merge one value to the myvalue list
1846 * \param list The list with values
1850 static int merge_value(struct list_head *list, const char *text)
1855 list_for_each(pos, list) {
1856 value = list_entry(pos, struct myvalue, list);
1864 list_add_tail(&value->list, list);
1870 * \param list Returned list
1871 * \param source Source list with ucm_value structures
1874 static int add_identifiers(struct list_head *list,
1882 v = list_entry(pos, struct ucm_value, list);
1883 err = merge_value(list, v->name);
1892 * \param list Returned list
1894 * \param source Source list with ucm_value structures
1896 static int add_values(struct list_head *list,
1905 v = list_entry(pos, struct ucm_value, list);
1907 err = merge_value(list, v->data);
1926 * \brief Get list of available identifiers
1927 * \param list Returned list
1929 * \return Number of list entries if success, otherwise a negative error code
1932 const char **list[], char *name)
1980 *list = (const char **)res;
1982 *list = NULL;
1987 qsort(*list, err, sizeof(char *), identifier_cmp);
1992 * \brief Get list of values
1993 * \param list Returned list
1995 * \return Number of list entries if success, otherwise a negative error code
1999 const char **list[],
2024 dev = list_entry(pos, struct use_case_device, list);
2030 mod = list_entry(pos, struct use_case_modifier, list);
2037 *list = (const char **)res;
2039 *list = NULL;
2046 * \brief Get list of enabled devices
2047 * \param list Returned list
2049 * \return Number of list entries if success, otherwise a negative error code
2052 const char **list[])
2056 return get_list(&uc_mgr->active_devices, list,
2062 * \brief Get list of enabled modifiers
2063 * \param list Returned list
2065 * \return Number of list entries if success, otherwise a negative error code
2068 const char **list[])
2072 return get_list(&uc_mgr->active_modifiers, list,
2079 const char **list[])
2085 return uc_mgr_scan_master_configs(list);
2088 err = get_verb_list(uc_mgr, list);
2090 err = get_enabled_device_list(uc_mgr, list);
2092 err = get_enabled_modifier_list(uc_mgr, list);
2105 err = get_device_list(uc_mgr, list, str);
2107 err = get_modifier_list(uc_mgr, list, str);
2109 err = get_identifiers_list(uc_mgr, list, str);
2111 err = get_supported_device_list(uc_mgr, list, str);
2113 err = get_conflicting_device_list(uc_mgr, list, str);
2117 err = get_value_list(uc_mgr, identifier, list, str);
2137 val = list_entry(pos, struct ucm_value, list);
2500 trans = list_entry(pos, struct transition_sequence, list);
2612 trans = list_entry(pos, struct transition_sequence, list);
2665 trans = list_entry(pos, struct transition_sequence, list);