rename namespace -> group (it's c++ keyword)

This commit is contained in:
Alexandre Ratchov 2016-05-15 14:45:32 +02:00
parent ebefac2a1e
commit 50e5b13815
8 changed files with 16 additions and 16 deletions

View File

@ -143,7 +143,7 @@ struct amsg_mix_desc {
struct amsg_mix_chan chan0; /* affected channels */
struct amsg_mix_chan chan1; /* dito for AMSG_MIX_{SEL,VEC,LIST} */
char func[AMSG_MIX_NAMEMAX]; /* parameter function name */
char namespace[AMSG_MIX_NAMEMAX];
char group[AMSG_MIX_NAMEMAX];
uint32_t __pad[1];
uint8_t type; /* see siomix_desc structure */
uint8_t __pad1[1];

View File

@ -82,7 +82,7 @@ siomix_aucat_rdata(struct siomix_aucat_hdl *hdl)
c = hdl->buf;
rpos = 0;
while (rpos < hdl->buf_wpos) {
strlcpy(desc.namespace, c->namespace, SIOMIX_NAMEMAX);
strlcpy(desc.group, c->group, SIOMIX_NAMEMAX);
strlcpy(desc.chan0.str, c->chan0.str, SIOMIX_NAMEMAX);
desc.chan0.unit = (int16_t)ntohs(c->chan0.unit);
strlcpy(desc.chan1.str, c->chan1.str, SIOMIX_NAMEMAX);

View File

@ -111,7 +111,7 @@ struct siomix_desc {
#define SIOMIX_VEC 4 /* number, element of vector */
#define SIOMIX_LIST 5 /* switch, element of a list */
unsigned int type; /* one of above */
char namespace[SIOMIX_NAMEMAX]; /* or class name */
char group[SIOMIX_NAMEMAX]; /* or class name */
char func[SIOMIX_NAMEMAX]; /* function name */
struct siomix_chan chan0; /* affected channels */
struct siomix_chan chan1; /* dito for SIOMIX_{VEC,LIST} */

View File

@ -78,7 +78,7 @@ cmpdesc(struct siomix_desc *d1, struct siomix_desc *d2)
{
int res;
res = strcmp(d1->namespace, d2->namespace);
res = strcmp(d1->group, d2->group);
if (res != 0)
return res;
res = strcmp(d1->chan0.str, d2->chan0.str);
@ -395,8 +395,8 @@ print_val(struct info *p, int mono)
void
print_par(struct info *p, int mono, char *comment)
{
if (p->desc.namespace[0] != 0)
printf("%s/", p->desc.namespace);
if (p->desc.group[0] != 0)
printf("%s/", p->desc.group);
print_chan(&p->desc.chan0, mono);
printf(".%s=", p->desc.func);
if (i_flag)

View File

@ -2024,8 +2024,8 @@ ctl_chan_log(struct ctl_chan *c)
void
ctl_log(struct ctl *c)
{
if (c->namespace[0] != 0) {
log_puts(c->namespace);
if (c->group[0] != 0) {
log_puts(c->group);
log_puts("/");
}
ctl_chan_log(&c->chan0);
@ -2051,14 +2051,14 @@ ctl_log(struct ctl *c)
* add a ctl
*/
struct ctl *
dev_addctl(struct dev *d, char *namespace, int type, int addr,
dev_addctl(struct dev *d, char *group, int type, int addr,
char *str0, int unit0, char *func, char *str1, int unit1, int val)
{
struct ctl *c;
c = xmalloc(sizeof(struct ctl));
c->type = type;
strlcpy(c->namespace, namespace, CTL_NAMEMAX);
strlcpy(c->group, group, CTL_NAMEMAX);
strlcpy(c->func, func, CTL_NAMEMAX);
strlcpy(c->chan0.str, str0, CTL_NAMEMAX);
c->chan0.unit = unit0;

View File

@ -114,7 +114,7 @@ struct ctl {
unsigned int addr; /* control address */
#define CTL_NAMEMAX 16 /* max name lenght */
char func[CTL_NAMEMAX]; /* parameter function name */
char namespace[CTL_NAMEMAX]; /* parameter group name */
char group[CTL_NAMEMAX]; /* parameter group name */
struct ctl_chan {
char str[CTL_NAMEMAX]; /* stream name */
int unit;

View File

@ -60,13 +60,13 @@ dev_siomix_ondesc(void *arg, struct siomix_desc *desc, int val)
addr = CTLADDR_END + desc->addr;
dev_rmctl(d, addr);
strlcpy(ns, "dev", CTL_NAMEMAX);
if (sizeof("dev") + 1 + strlen(desc->namespace) >= CTL_NAMEMAX) {
log_puts("control with namespace, skipped\n");
if (sizeof("dev") + 1 + strlen(desc->group) >= CTL_NAMEMAX) {
log_puts("control with group, skipped\n");
return;
}
if (desc->namespace[0] != 0) {
if (desc->group[0] != 0) {
strlcat(ns, "/", CTL_NAMEMAX);
strlcat(ns, desc->namespace, CTL_NAMEMAX);
strlcat(ns, desc->group, CTL_NAMEMAX);
}
dev_addctl(d, ns, desc->type, addr,
desc->chan0.str, desc->chan0.unit, desc->func,

View File

@ -1567,7 +1567,7 @@ sock_buildmsg(struct sock *f)
break;
c->desc_mask &= ~mask;
c->val_mask &= ~mask;
strlcpy(desc->namespace, c->namespace,
strlcpy(desc->group, c->group,
AMSG_MIX_NAMEMAX);
strlcpy(desc->chan0.str, c->chan0.str,
AMSG_MIX_NAMEMAX);