version 1.4, 2018/06/26 07:12:35 |
version 1.5, 2021/01/29 11:21:00 |
|
|
#include "opt.h" |
#include "opt.h" |
#include "utils.h" |
#include "utils.h" |
|
|
|
struct opt *opt_list; |
|
|
/* |
/* |
* create a new audio sub-device "configuration" |
* create a new audio sub-device "configuration" |
*/ |
*/ |
|
|
} |
} |
} |
} |
o = xmalloc(sizeof(struct opt)); |
o = xmalloc(sizeof(struct opt)); |
|
o->dev = d; |
if (mode & MODE_PLAY) { |
if (mode & MODE_PLAY) { |
o->pmin = pmin; |
o->pmin = pmin; |
o->pmax = pmax; |
o->pmax = pmax; |
|
|
o->dup = dup; |
o->dup = dup; |
o->mode = mode; |
o->mode = mode; |
memcpy(o->name, name, len + 1); |
memcpy(o->name, name, len + 1); |
o->next = d->opt_list; |
o->next = opt_list; |
d->opt_list = o; |
opt_list = o; |
if (log_level >= 2) { |
if (log_level >= 2) { |
dev_log(d); |
dev_log(d); |
log_puts("."); |
log_puts("."); |
|
|
{ |
{ |
struct opt *o; |
struct opt *o; |
|
|
for (o = d->opt_list; o != NULL; o = o->next) { |
for (o = opt_list; o != NULL; o = o->next) { |
|
if (d != NULL && o->dev != d) |
|
continue; |
if (strcmp(name, o->name) == 0) |
if (strcmp(name, o->name) == 0) |
return o; |
return o; |
} |
} |
|
|
} |
} |
|
|
void |
void |
opt_del(struct dev *d, struct opt *o) |
opt_del(struct opt *o) |
{ |
{ |
struct opt **po; |
struct opt **po; |
|
|
for (po = &d->opt_list; *po != o; po = &(*po)->next) { |
for (po = &opt_list; *po != o; po = &(*po)->next) { |
#ifdef DEBUG |
#ifdef DEBUG |
if (*po == NULL) { |
if (*po == NULL) { |
log_puts("opt_del: not on list\n"); |
log_puts("opt_del: not on list\n"); |