Lines Matching defs:attr

218 static const char *cardinfo_get(struct space *space, const char *attr)
220 if (strncasecmp(attr, "CARD", 4) == 0) {
225 if (strncasecmp(attr, "ID", 2) == 0)
227 if (strncasecmp(attr, "DRIVER", 6) == 0)
229 if (strncasecmp(attr, "NAME", 4) == 0)
231 if (strncasecmp(attr, "LONGNAME", 8) == 0)
233 if (strncasecmp(attr, "MIXERNAME", 9) == 0)
235 if (strncasecmp(attr, "COMPONENTS", 10) == 0)
237 Perror(space, "unknown cardinfo{} attribute '%s'", attr);
527 static const char *elemid_get(struct space *space, const char *attr)
533 if (strncasecmp(attr, "numid", 5) == 0) {
537 if (strncasecmp(attr, "iface", 5) == 0 ||
538 strncasecmp(attr, "interface", 9) == 0)
540 if (strncasecmp(attr, "device", 6) == 0) {
544 if (strncasecmp(attr, "subdev", 6) == 0) {
548 if (strncasecmp(attr, "name", 4) == 0)
550 if (strncasecmp(attr, "index", 5) == 0) {
554 if (strncasecmp(attr, "type", 4) == 0) {
559 if (strncasecmp(attr, "attr", 4) == 0) {
585 if (strncasecmp(attr, "owner", 5) == 0) {
591 if (strncasecmp(attr, "count", 5) == 0) {
597 if (strncasecmp(attr, "min", 3) == 0) {
609 if (strncasecmp(attr, "max", 3) == 0) {
621 if (strncasecmp(attr, "step", 3) == 0) {
633 if (strncasecmp(attr, "items", 5) == 0) {
645 if (strncasecmp(attr, "value", 5) == 0) {
650 if (strncasecmp(attr, "dBmin", 5) == 0) {
661 if (strncasecmp(attr, "dBmax", 5) == 0) {
670 if (strncasecmp(attr, "enums", 5) == 0) {
691 if (strncasecmp(attr, "do_search", 9) == 0) {
695 char *pos = strchr(attr, ' ');
722 if (strncasecmp(attr, "do_count", 8) == 0) {
741 Perror(space, "unknown ctl{} attribute '%s'", attr);
748 static int elemid_set(struct space *space, const char *attr, const char *value)
755 if (strncasecmp(attr, "numid", 5) == 0) {
759 if (strncasecmp(attr, "iface", 5) == 0 ||
760 strncasecmp(attr, "interface", 9) == 0 ||
761 strncasecmp(attr, "reset", 5) == 0 ||
762 strncasecmp(attr, "search", 6) == 0) {
763 if (strlen(value) == 0 && strncasecmp(attr, "search", 6) == 0) {
769 if (strncasecmp(attr, "reset", 5) == 0)
771 if (strncasecmp(attr, "search", 5) == 0) {
791 if (strncasecmp(attr, "device", 6) == 0) {
795 if (strncasecmp(attr, "subdev", 6) == 0) {
799 if (strncasecmp(attr, "name", 4) == 0) {
804 if (strncasecmp(attr, "index", 5) == 0) {
808 if (strncasecmp(attr, "values", 6) == 0 ||
809 strncasecmp(attr, "value", 5) == 0) {
815 err = set_ctl_value(space, value, strncasecmp(attr, "values", 6) == 0);
829 Perror(space, "unknown CTL{} attribute '%s'", attr);
941 /* extract possible KEY{attr} */
945 char *attr;
947 attr = strchr(str, '{');
948 if (attr != NULL) {
949 attr++;
950 pos = strchr(attr, '}');
956 strlcpy(res, attr, ressize);
965 /* extract possible {attr} and move str behind it */
969 char *attr = NULL;
978 attr = *str+1;
980 dbg("attribute='%s', str='%s'", attr, *str);
982 return attr;
1008 char *head, *tail, *pos, *cpos, *attr, *rest;
1031 { .name = "attr", .fmt = 's', .type = SUBST_ATTR },
1089 attr = get_format_attribute(space, &tail);
1095 if (attr == NULL)
1098 const char *value = cardinfo_get(space, attr);
1102 dbg("substitute cardinfo{%s} '%s'", attr, value);
1106 if (attr == NULL)
1109 const char *value = elemid_get(space, attr);
1113 dbg("substitute ctl{%s} '%s'", attr, value);
1121 if (attr != NULL)
1122 i = strtoul(attr, &rest, 10);
1151 if (attr == NULL)
1152 Perror(space, "missing file parameter for attr");
1160 value = sysfs_attr_get_value(pair->value, attr);
1183 if (attr == NULL) {
1187 pos = getenv(attr);
1189 dbg("env '%s' not available", attr);
1192 dbg("substitute env '%s=%s'", attr, pos);
1196 if (attr == NULL) {
1200 pair = value_find(space, attr);
1291 char *key, *value, *attr, *temp;
1324 attr = get_key_attribute(space, key + 3, string, sizeof(string));
1325 if (attr == NULL) {
1332 dbg("ctl assign: '%s' '%s'", value, attr);
1333 err = elemid_set(space, attr, result);
1344 if (strncmp(attr, "write", 5) == 0) {
1347 dbg("ctl write: '%s' '%s'", value, attr);
1354 temp = (char *)elemid_get(space, attr);
1355 dbg("ctl match: '%s' '%s' '%s'", attr, value, temp);
1415 attr = get_key_attribute(space, key + 8, string, sizeof(string));
1416 if (attr == NULL) {
1421 dbg("cardinfo: '%s' '%s'", value, attr);
1422 temp = (char *)cardinfo_get(space, attr);
1432 attr = get_key_attribute(space, key + 4, string, sizeof(string));
1433 if (attr == NULL) {
1441 dbg("sysfs_attr: '%s' '%s'", pair->value, attr);
1442 temp = sysfs_attr_get_value(pair->value, attr);
1452 attr = get_key_attribute(space, key + 3, string, sizeof(string));
1453 if (attr == NULL) {
1458 temp = getenv(attr);
1459 dbg("env: '%s' '%s'", attr, temp);
1466 dbg("env set: '%s' '%s'", attr, result);
1467 if (setenv(attr, result, op == KEY_OP_ASSIGN_FINAL))
1627 attr = get_key_attribute(space, key + 6, string, sizeof(string));
1628 if (attr == NULL) {
1635 err = value_set(space, attr, result);
1636 dbg("CONFIG{%s}='%s'", attr, result);
1639 pair = value_find(space, attr);