[BACK]Return to opt.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/opt.c between version 1.4 and 1.5

version 1.4, 2018/06/26 07:12:35 version 1.5, 2021/01/29 11:21:00
Line 20 
Line 20 
 #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"
  */   */
Line 54 
Line 56 
                 }                  }
         }          }
         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;
Line 67 
Line 70 
         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(".");
Line 110 
Line 113 
 {  {
         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;
         }          }
Line 118 
Line 123 
 }  }
   
 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");

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5