mirror of https://github.com/ericonr/sndio.git
Rename node->str to node->name3
This commit is contained in:
parent
f51534ae26
commit
0ac817ab82
|
@ -126,16 +126,16 @@ struct amsg {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* subset of channels of a stream
|
* network representation of sioctl_node structure
|
||||||
*/
|
*/
|
||||||
struct amsg_ctl_node {
|
struct amsg_ctl_node {
|
||||||
char str[AMSG_CTL_NAMEMAX]; /* stream name */
|
char name[AMSG_CTL_NAMEMAX];
|
||||||
int16_t unit; /* stream number */
|
int16_t unit;
|
||||||
uint8_t __pad[2];
|
uint8_t __pad[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* description of a control (index, value) pair
|
* network representation of sioctl_desc structure
|
||||||
*/
|
*/
|
||||||
struct amsg_ctl_desc {
|
struct amsg_ctl_desc {
|
||||||
struct amsg_ctl_node node0; /* affected channels */
|
struct amsg_ctl_node node0; /* affected channels */
|
||||||
|
|
|
@ -83,9 +83,9 @@ sioctl_aucat_rdata(struct sioctl_aucat_hdl *hdl)
|
||||||
rpos = 0;
|
rpos = 0;
|
||||||
while (rpos < hdl->buf_wpos) {
|
while (rpos < hdl->buf_wpos) {
|
||||||
strlcpy(desc.group, c->group, SIOCTL_NAMEMAX);
|
strlcpy(desc.group, c->group, SIOCTL_NAMEMAX);
|
||||||
strlcpy(desc.node0.str, c->node0.str, SIOCTL_NAMEMAX);
|
strlcpy(desc.node0.name, c->node0.name, SIOCTL_NAMEMAX);
|
||||||
desc.node0.unit = (int16_t)ntohs(c->node0.unit);
|
desc.node0.unit = (int16_t)ntohs(c->node0.unit);
|
||||||
strlcpy(desc.node1.str, c->node1.str, SIOCTL_NAMEMAX);
|
strlcpy(desc.node1.name, c->node1.name, SIOCTL_NAMEMAX);
|
||||||
desc.node1.unit = (int16_t)ntohs(c->node1.unit);
|
desc.node1.unit = (int16_t)ntohs(c->node1.unit);
|
||||||
strlcpy(desc.func, c->func, SIOCTL_NAMEMAX);
|
strlcpy(desc.func, c->func, SIOCTL_NAMEMAX);
|
||||||
desc.type = c->type;
|
desc.type = c->type;
|
||||||
|
|
|
@ -116,7 +116,7 @@ Controls are described by the
|
||||||
stucture as follows:
|
stucture as follows:
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
struct sioctl_node {
|
struct sioctl_node {
|
||||||
char str[SIOCTL_NAMEMAX]; /* name, ex "spkr" */
|
char name[SIOCTL_NAMEMAX]; /* ex. "spkr" */
|
||||||
int unit; /* optional number or -1 */
|
int unit; /* optional number or -1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -234,10 +234,10 @@ scanvol(struct sioctl_sun_hdl *hdl, struct wskbd_vol *vol)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
desc.type = SIOCTL_NUM;
|
desc.type = SIOCTL_NUM;
|
||||||
desc.node1.str[0] = 0;
|
desc.node1.name[0] = 0;
|
||||||
desc.node1.unit = -1;
|
desc.node1.unit = -1;
|
||||||
strlcpy(desc.func, "level", SIOCTL_NAMEMAX);
|
strlcpy(desc.func, "level", SIOCTL_NAMEMAX);
|
||||||
strlcpy(desc.node0.str, vol->name, SIOCTL_NAMEMAX);
|
strlcpy(desc.node0.name, vol->name, SIOCTL_NAMEMAX);
|
||||||
for (i = 0; i < vol->nch; i++) {
|
for (i = 0; i < vol->nch; i++) {
|
||||||
desc.node0.unit = i;
|
desc.node0.unit = i;
|
||||||
desc.addr = vol->base_addr + i;
|
desc.addr = vol->base_addr + i;
|
||||||
|
@ -254,10 +254,10 @@ scanvol(struct sioctl_sun_hdl *hdl, struct wskbd_vol *vol)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
desc.type = SIOCTL_SW;
|
desc.type = SIOCTL_SW;
|
||||||
desc.node1.str[0] = 0;
|
desc.node1.name[0] = 0;
|
||||||
desc.node1.unit = -1;
|
desc.node1.unit = -1;
|
||||||
strlcpy(desc.func, "mute", SIOCTL_NAMEMAX);
|
strlcpy(desc.func, "mute", SIOCTL_NAMEMAX);
|
||||||
strlcpy(desc.node0.str, vol->name, SIOCTL_NAMEMAX);
|
strlcpy(desc.node0.name, vol->name, SIOCTL_NAMEMAX);
|
||||||
val = ctrl.un.ord ? 1 : 0;
|
val = ctrl.un.ord ? 1 : 0;
|
||||||
vol->mute_val = val;
|
vol->mute_val = val;
|
||||||
for (i = 0; i < vol->nch; i++) {
|
for (i = 0; i < vol->nch; i++) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ struct sio_cap {
|
||||||
* controlled component of the device
|
* controlled component of the device
|
||||||
*/
|
*/
|
||||||
struct sioctl_node {
|
struct sioctl_node {
|
||||||
char str[SIOCTL_NAMEMAX]; /* name, ex "spkr" */
|
char name[SIOCTL_NAMEMAX]; /* ex. "spkr" */
|
||||||
int unit; /* optional number or -1 */
|
int unit; /* optional number or -1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ cmpdesc(struct sioctl_desc *d1, struct sioctl_desc *d2)
|
||||||
res = strcmp(d1->group, d2->group);
|
res = strcmp(d1->group, d2->group);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
res = strcmp(d1->node0.str, d2->node0.str);
|
res = strcmp(d1->node0.name, d2->node0.name);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
res = d1->type - d2->type;
|
res = d1->type - d2->type;
|
||||||
|
@ -94,7 +94,7 @@ cmpdesc(struct sioctl_desc *d1, struct sioctl_desc *d2)
|
||||||
d1->type == SIOCTL_LIST) {
|
d1->type == SIOCTL_LIST) {
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
res = strcmp(d1->node1.str, d2->node1.str);
|
res = strcmp(d1->node1.name, d2->node1.name);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
res = d1->node1.unit - d2->node1.unit;
|
res = d1->node1.unit - d2->node1.unit;
|
||||||
|
@ -120,7 +120,7 @@ struct info *
|
||||||
vecent(struct info *i, char *vstr, int vunit)
|
vecent(struct info *i, char *vstr, int vunit)
|
||||||
{
|
{
|
||||||
while (i != NULL) {
|
while (i != NULL) {
|
||||||
if ((strcmp(i->desc.node1.str, vstr) == 0) &&
|
if ((strcmp(i->desc.node1.name, vstr) == 0) &&
|
||||||
(vunit < 0 || i->desc.node1.unit == vunit))
|
(vunit < 0 || i->desc.node1.unit == vunit))
|
||||||
break;
|
break;
|
||||||
i = i->next;
|
i = i->next;
|
||||||
|
@ -138,10 +138,10 @@ nextfunc(struct info *i)
|
||||||
|
|
||||||
group = i->desc.group;
|
group = i->desc.group;
|
||||||
func = i->desc.func;
|
func = i->desc.func;
|
||||||
str = i->desc.node0.str;
|
str = i->desc.node0.name;
|
||||||
for (i = i->next; i != NULL; i = i->next) {
|
for (i = i->next; i != NULL; i = i->next) {
|
||||||
if (strcmp(i->desc.group, group) != 0 ||
|
if (strcmp(i->desc.group, group) != 0 ||
|
||||||
strcmp(i->desc.node0.str, str) != 0 ||
|
strcmp(i->desc.node0.name, str) != 0 ||
|
||||||
strcmp(i->desc.func, func) != 0)
|
strcmp(i->desc.func, func) != 0)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -159,11 +159,11 @@ nextpar(struct info *i)
|
||||||
|
|
||||||
group = i->desc.group;
|
group = i->desc.group;
|
||||||
func = i->desc.func;
|
func = i->desc.func;
|
||||||
str = i->desc.node0.str;
|
str = i->desc.node0.name;
|
||||||
unit = i->desc.node0.unit;
|
unit = i->desc.node0.unit;
|
||||||
for (i = i->next; i != NULL; i = i->next) {
|
for (i = i->next; i != NULL; i = i->next) {
|
||||||
if (strcmp(i->desc.group, group) != 0 ||
|
if (strcmp(i->desc.group, group) != 0 ||
|
||||||
strcmp(i->desc.node0.str, str) != 0 ||
|
strcmp(i->desc.node0.name, str) != 0 ||
|
||||||
strcmp(i->desc.func, func) != 0)
|
strcmp(i->desc.func, func) != 0)
|
||||||
break;
|
break;
|
||||||
/* XXX: need to check for -1 ? */
|
/* XXX: need to check for -1 ? */
|
||||||
|
@ -183,16 +183,16 @@ firstent(struct info *g, char *vstr)
|
||||||
struct info *i;
|
struct info *i;
|
||||||
|
|
||||||
group = g->desc.group;
|
group = g->desc.group;
|
||||||
astr = g->desc.node0.str;
|
astr = g->desc.node0.name;
|
||||||
func = g->desc.func;
|
func = g->desc.func;
|
||||||
for (i = g; i != NULL; i = i->next) {
|
for (i = g; i != NULL; i = i->next) {
|
||||||
if (strcmp(i->desc.group, group) != 0 ||
|
if (strcmp(i->desc.group, group) != 0 ||
|
||||||
strcmp(i->desc.node0.str, astr) != 0 ||
|
strcmp(i->desc.node0.name, astr) != 0 ||
|
||||||
strcmp(i->desc.func, func) != 0)
|
strcmp(i->desc.func, func) != 0)
|
||||||
break;
|
break;
|
||||||
if (!isdiag(i))
|
if (!isdiag(i))
|
||||||
continue;
|
continue;
|
||||||
if (strcmp(i->desc.node1.str, vstr) == 0)
|
if (strcmp(i->desc.node1.name, vstr) == 0)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -211,11 +211,11 @@ nextent(struct info *i, int mono)
|
||||||
|
|
||||||
group = i->desc.group;
|
group = i->desc.group;
|
||||||
func = i->desc.func;
|
func = i->desc.func;
|
||||||
str = i->desc.node0.str;
|
str = i->desc.node0.name;
|
||||||
unit = i->desc.node0.unit;
|
unit = i->desc.node0.unit;
|
||||||
for (i = i->next; i != NULL; i = i->next) {
|
for (i = i->next; i != NULL; i = i->next) {
|
||||||
if (strcmp(i->desc.group, group) != 0 ||
|
if (strcmp(i->desc.group, group) != 0 ||
|
||||||
strcmp(i->desc.node0.str, str) != 0 ||
|
strcmp(i->desc.node0.name, str) != 0 ||
|
||||||
strcmp(i->desc.func, func) != 0)
|
strcmp(i->desc.func, func) != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (mono)
|
if (mono)
|
||||||
|
@ -232,7 +232,7 @@ nextent(struct info *i, int mono)
|
||||||
int
|
int
|
||||||
matchpar(struct info *i, char *astr, int aunit)
|
matchpar(struct info *i, char *astr, int aunit)
|
||||||
{
|
{
|
||||||
if (strcmp(i->desc.node0.str, astr) != 0)
|
if (strcmp(i->desc.node0.name, astr) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (aunit < 0)
|
if (aunit < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -250,7 +250,7 @@ matchpar(struct info *i, char *astr, int aunit)
|
||||||
int
|
int
|
||||||
matchent(struct info *i, char *vstr, int vunit)
|
matchent(struct info *i, char *vstr, int vunit)
|
||||||
{
|
{
|
||||||
if (strcmp(i->desc.node1.str, vstr) != 0)
|
if (strcmp(i->desc.node1.name, vstr) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (vunit < 0)
|
if (vunit < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -289,7 +289,7 @@ ismono(struct info *g)
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
e1 = vecent(p1,
|
e1 = vecent(p1,
|
||||||
e2->desc.node1.str,
|
e2->desc.node1.name,
|
||||||
p1->desc.node0.unit);
|
p1->desc.node0.unit);
|
||||||
if (e1 == NULL)
|
if (e1 == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
@ -309,7 +309,7 @@ ismono(struct info *g)
|
||||||
void
|
void
|
||||||
print_node(struct sioctl_node *c, int mono)
|
print_node(struct sioctl_node *c, int mono)
|
||||||
{
|
{
|
||||||
printf("%s", c->str);
|
printf("%s", c->name);
|
||||||
if (!mono && c->unit >= 0)
|
if (!mono && c->unit >= 0)
|
||||||
printf("[%d]", c->unit);
|
printf("[%d]", c->unit);
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ print_desc(struct info *p, int mono)
|
||||||
if (mono) {
|
if (mono) {
|
||||||
if (!isdiag(e))
|
if (!isdiag(e))
|
||||||
continue;
|
continue;
|
||||||
if (e != firstent(p, e->desc.node1.str))
|
if (e != firstent(p, e->desc.node1.name))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (more)
|
if (more)
|
||||||
|
@ -368,7 +368,7 @@ print_val(struct info *p, int mono)
|
||||||
if (mono) {
|
if (mono) {
|
||||||
if (!isdiag(e))
|
if (!isdiag(e))
|
||||||
continue;
|
continue;
|
||||||
if (e != firstent(p, e->desc.node1.str))
|
if (e != firstent(p, e->desc.node1.name))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (more)
|
if (more)
|
||||||
|
@ -588,7 +588,7 @@ cmd(char *line)
|
||||||
}
|
}
|
||||||
if (strcmp(g->desc.group, group) == 0 &&
|
if (strcmp(g->desc.group, group) == 0 &&
|
||||||
strcmp(g->desc.func, func) == 0 &&
|
strcmp(g->desc.func, func) == 0 &&
|
||||||
strcmp(g->desc.node0.str, astr) == 0)
|
strcmp(g->desc.node0.name, astr) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g->mode = MODE_PRINT;
|
g->mode = MODE_PRINT;
|
||||||
|
|
10
sndiod/dev.c
10
sndiod/dev.c
|
@ -2224,7 +2224,7 @@ ctlslot_del(struct ctlslot *s)
|
||||||
void
|
void
|
||||||
ctl_node_log(struct ctl_node *c)
|
ctl_node_log(struct ctl_node *c)
|
||||||
{
|
{
|
||||||
log_puts(c->str);
|
log_puts(c->name);
|
||||||
if (c->unit >= 0)
|
if (c->unit >= 0)
|
||||||
log_putu(c->unit);
|
log_putu(c->unit);
|
||||||
}
|
}
|
||||||
|
@ -2269,10 +2269,10 @@ dev_addctl(struct dev *d, char *gstr, int type, int addr,
|
||||||
c->type = type;
|
c->type = type;
|
||||||
strlcpy(c->func, func, CTL_NAMEMAX);
|
strlcpy(c->func, func, CTL_NAMEMAX);
|
||||||
strlcpy(c->group, gstr, CTL_NAMEMAX);
|
strlcpy(c->group, gstr, CTL_NAMEMAX);
|
||||||
strlcpy(c->node0.str, str0, CTL_NAMEMAX);
|
strlcpy(c->node0.name, str0, CTL_NAMEMAX);
|
||||||
c->node0.unit = unit0;
|
c->node0.unit = unit0;
|
||||||
if (c->type == CTL_VEC || c->type == CTL_LIST) {
|
if (c->type == CTL_VEC || c->type == CTL_LIST) {
|
||||||
strlcpy(c->node1.str, str1, CTL_NAMEMAX);
|
strlcpy(c->node1.name, str1, CTL_NAMEMAX);
|
||||||
c->node1.unit = unit1;
|
c->node1.unit = unit1;
|
||||||
} else
|
} else
|
||||||
memset(&c->node1, 0, sizeof(struct ctl_node));
|
memset(&c->node1, 0, sizeof(struct ctl_node));
|
||||||
|
@ -2419,9 +2419,9 @@ dev_label(struct dev *d, int i)
|
||||||
c = c->next;
|
c = c->next;
|
||||||
}
|
}
|
||||||
slot_ctlname(&d->slot[i], name, CTL_NAMEMAX);
|
slot_ctlname(&d->slot[i], name, CTL_NAMEMAX);
|
||||||
if (strcmp(c->node0.str, name) == 0)
|
if (strcmp(c->node0.name, name) == 0)
|
||||||
return;
|
return;
|
||||||
strlcpy(c->node0.str, name, CTL_NAMEMAX);
|
strlcpy(c->node0.name, name, CTL_NAMEMAX);
|
||||||
c->desc_mask = ~0;
|
c->desc_mask = ~0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ struct ctl {
|
||||||
char func[CTL_NAMEMAX]; /* parameter function name */
|
char func[CTL_NAMEMAX]; /* parameter function name */
|
||||||
char group[CTL_NAMEMAX]; /* group aka namespace */
|
char group[CTL_NAMEMAX]; /* group aka namespace */
|
||||||
struct ctl_node {
|
struct ctl_node {
|
||||||
char str[CTL_NAMEMAX]; /* stream name */
|
char name[CTL_NAMEMAX]; /* stream name */
|
||||||
int unit;
|
int unit;
|
||||||
} node0, node1; /* affected channels */
|
} node0, node1; /* affected channels */
|
||||||
#define CTL_DEVMASK (1 << 31)
|
#define CTL_DEVMASK (1 << 31)
|
||||||
|
|
|
@ -80,8 +80,8 @@ dev_sioctl_ondesc(void *arg, struct sioctl_desc *desc, int val)
|
||||||
group = desc->group;
|
group = desc->group;
|
||||||
|
|
||||||
dev_addctl(d, group, desc->type, addr,
|
dev_addctl(d, group, desc->type, addr,
|
||||||
desc->node0.str, desc->node0.unit, desc->func,
|
desc->node0.name, desc->node0.unit, desc->func,
|
||||||
desc->node1.str, desc->node1.unit, val);
|
desc->node1.name, desc->node1.unit, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1534,10 +1534,10 @@ sock_buildmsg(struct sock *f)
|
||||||
c->val_mask &= ~mask;
|
c->val_mask &= ~mask;
|
||||||
strlcpy(desc->group, c->group,
|
strlcpy(desc->group, c->group,
|
||||||
AMSG_CTL_NAMEMAX);
|
AMSG_CTL_NAMEMAX);
|
||||||
strlcpy(desc->node0.str, c->node0.str,
|
strlcpy(desc->node0.name, c->node0.name,
|
||||||
AMSG_CTL_NAMEMAX);
|
AMSG_CTL_NAMEMAX);
|
||||||
desc->node0.unit = ntohs(c->node0.unit);
|
desc->node0.unit = ntohs(c->node0.unit);
|
||||||
strlcpy(desc->node1.str, c->node1.str,
|
strlcpy(desc->node1.name, c->node1.name,
|
||||||
AMSG_CTL_NAMEMAX);
|
AMSG_CTL_NAMEMAX);
|
||||||
desc->node1.unit = ntohs(c->node1.unit);
|
desc->node1.unit = ntohs(c->node1.unit);
|
||||||
desc->type = c->type;
|
desc->type = c->type;
|
||||||
|
|
|
@ -66,7 +66,7 @@ dev_ondesc(void *unused, struct sioctl_desc *desc, int val)
|
||||||
if (output_found)
|
if (output_found)
|
||||||
return;
|
return;
|
||||||
if (desc->group[0] == 0 &&
|
if (desc->group[0] == 0 &&
|
||||||
strcmp(desc->node0.str, "output") == 0 &&
|
strcmp(desc->node0.name, "output") == 0 &&
|
||||||
strcmp(desc->func, "level") == 0) {
|
strcmp(desc->func, "level") == 0) {
|
||||||
output_found = 1;
|
output_found = 1;
|
||||||
output_addr = desc->addr;
|
output_addr = desc->addr;
|
||||||
|
|
Loading…
Reference in New Issue