Home | History | Annotate | Download | only in alsactl

Lines Matching refs:attr

220 static const char *cardinfo_get(struct space *space, const char *attr)
222 if (strncasecmp(attr, "CARD", 4) == 0) {
227 if (strncasecmp(attr, "ID", 2) == 0)
229 if (strncasecmp(attr, "DRIVER", 6) == 0)
231 if (strncasecmp(attr, "NAME", 4) == 0)
233 if (strncasecmp(attr, "LONGNAME", 8) == 0)
235 if (strncasecmp(attr, "MIXERNAME", 9) == 0)
237 if (strncasecmp(attr, "COMPONENTS", 10) == 0)
239 Perror(space, "unknown cardinfo{} attribute '%s'", attr);
489 static const char *elemid_get(struct space *space, const char *attr)
495 if (strncasecmp(attr, "numid", 5) == 0) {
499 if (strncasecmp(attr, "iface", 5) == 0 ||
500 strncasecmp(attr, "interface", 9) == 0)
502 if (strncasecmp(attr, "device", 6) == 0) {
506 if (strncasecmp(attr, "subdev", 6) == 0) {
510 if (strncasecmp(attr, "name", 4) == 0)
512 if (strncasecmp(attr, "index", 5) == 0) {
516 if (strncasecmp(attr, "type", 4) == 0) {
521 if (strncasecmp(attr, "attr", 4) == 0) {
547 if (strncasecmp(attr, "owner", 5) == 0) {
553 if (strncasecmp(attr, "count", 5) == 0) {
559 if (strncasecmp(attr, "min", 3) == 0) {
571 if (strncasecmp(attr, "max", 3) == 0) {
583 if (strncasecmp(attr, "step", 3) == 0) {
595 if (strncasecmp(attr, "items", 5) == 0) {
607 if (strncasecmp(attr, "value", 5) == 0) {
612 if (strncasecmp(attr, "dBmin", 5) == 0) {
623 if (strncasecmp(attr, "dBmax", 5) == 0) {
632 if (strncasecmp(attr, "enums", 5) == 0) {
653 Perror(space, "unknown ctl{} attribute '%s'", attr);
660 static int elemid_set(struct space *space, const char *attr, const char *value)
667 if (strncasecmp(attr, "numid", 5) == 0) {
671 if (strncasecmp(attr, "iface", 5) == 0 ||
672 strncasecmp(attr, "interface", 9) == 0 ||
673 strncasecmp(attr, "reset", 5) == 0 ||
674 strncasecmp(attr, "search", 6) == 0) {
675 if (strlen(value) == 0 && strncasecmp(attr, "search", 6) == 0) {
681 if (strncasecmp(attr, "reset", 5) == 0)
683 if (strncasecmp(attr, "search", 5) == 0) {
703 if (strncasecmp(attr, "device", 6) == 0) {
707 if (strncasecmp(attr, "subdev", 6) == 0) {
711 if (strncasecmp(attr, "name", 4) == 0) {
716 if (strncasecmp(attr, "index", 5) == 0) {
720 if (strncasecmp(attr, "values", 6) == 0 ||
721 strncasecmp(attr, "value", 5) == 0) {
727 err = set_ctl_value(space, value, strncasecmp(attr, "values", 6) == 0);
741 Perror(space, "unknown CTL{} attribute '%s'", attr);
853 /* extract possible KEY{attr} */
857 char *attr;
859 attr = strchr(str, '{');
860 if (attr != NULL) {
861 attr++;
862 pos = strchr(attr, '}');
868 strlcpy(res, attr, ressize);
877 /* extract possible {attr} and move str behind it */
881 char *attr = NULL;
890 attr = *str+1;
892 dbg("attribute='%s', str='%s'", attr, *str);
894 return attr;
920 char *head, *tail, *pos, *cpos, *attr, *rest;
942 { .name = "attr", .fmt = 's', .type = SUBST_ATTR },
999 attr = get_format_attribute(space, &tail);
1005 if (attr == NULL)
1008 const char *value = cardinfo_get(space, attr);
1012 dbg("substitute cardinfo{%s} '%s'", attr, value);
1016 if (attr == NULL)
1019 const char *value = elemid_get(space, attr);
1023 dbg("substitute ctl{%s} '%s'", attr, value);
1031 if (attr != NULL)
1032 i = strtoul(attr, &rest, 10);
1061 if (attr == NULL)
1062 Perror(space, "missing file parameter for attr");
1070 value = sysfs_attr_get_value(pair->value, attr);
1093 if (attr == NULL) {
1097 pos = getenv(attr);
1099 dbg("env '%s' not available", attr);
1102 dbg("substitute env '%s=%s'", attr, pos);
1268 char *key, *value, *attr, *temp;
1301 attr = get_key_attribute(space, key + 3, string, sizeof(string));
1302 if (attr == NULL) {
1309 dbg("ctl assign: '%s' '%s'", value, attr);
1310 err = elemid_set(space, attr, result);
1322 dbg("ctl match: '%s' '%s'", value, attr);
1323 temp = (char *)elemid_get(space, attr);
1382 attr = get_key_attribute(space, key + 8, string, sizeof(string));
1383 if (attr == NULL) {
1388 dbg("cardinfo: '%s' '%s'", value, attr);
1389 temp = (char *)cardinfo_get(space, attr);
1398 if (strncasecmp(key, "ATTR{", 5) == 0) {
1399 attr = get_key_attribute(space, key + 4, string, sizeof(string));
1400 if (attr == NULL) {
1401 Perror(space, "error parsing ATTR attribute");
1408 dbg("sysfs_attr: '%s' '%s'", pair->value, attr);
1409 temp = sysfs_attr_get_value(pair->value, attr);
1413 Perror(space, "invalid ATTR{} operation");
1419 attr = get_key_attribute(space, key + 3, string, sizeof(string));
1420 if (attr == NULL) {
1425 temp = getenv(attr);
1426 dbg("env: '%s' '%s'", attr, temp);
1433 dbg("env set: '%s' '%s'", attr, result);
1434 if (setenv(attr, result, op == KEY_OP_ASSIGN_FINAL))
1578 attr = get_key_attribute(space, key + 6, string, sizeof(string));
1579 if (attr == NULL) {
1586 err = value_set(space, attr, result);
1587 dbg("CONFIG{%s}='%s'", attr, result);
1590 pair = value_find(space, attr);