add: case AHIDB_DriverBaseName: tp->ti_Data = ((ULONG) &node->ahidbn_Tags[tagitems]) + datalength + namelength + driverlength; strcpy((UBYTE *)tp->ti_Data, (UBYTE *)tag->ti_Data); break;
context: AddAudioMode( struct TagItem* DBtags,              struct AHIBase* AHIBase ){  struct AHI_AudioDatabase *audiodb;  struct AHI_AudioMode *node;  ULONG nodesize = sizeof(struct AHI_AudioMode), tagitems = 0;  ULONG datalength = 0, namelength = 0, driverlength = 0;  struct TagItem *tstate = DBtags, *tp, *tag;  ULONG rc = FALSE;  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)  {    Debug_AddAudioMode(DBtags);  }// Remove old mode if present in database  AHI_RemoveAudioMode( GetTagData(AHIDB_AudioID, AHI_INVALID_ID, DBtags));// Now add the new mode  audiodb = LockDatabaseWrite();  if(audiodb != NULL)  {// Find total size    while( (tag = NextTagItem(&tstate)) != NULL )    {      if(tag->ti_Data) switch(tag->ti_Tag)      {        case AHIDB_Data:          datalength    = ((ULONG *)tag->ti_Data)[0];          nodesize     += datalength;          break;        case AHIDB_Name:          namelength    = strlen((UBYTE *)tag->ti_Data)+1;          nodesize     += namelength;          break;        case AHIDB_Driver:          driverlength  = strlen((UBYTE *)tag->ti_Data)+1;          nodesize     += driverlength;          break;      }      nodesize += sizeof(struct TagItem);      tagitems++;    }    nodesize += sizeof(struct TagItem);  // The last TAG_END    tagitems++;    node = AllocVec(nodesize, MEMF_PUBLIC|MEMF_CLEAR);    if(node != NULL)    {      tp      = node->ahidbn_Tags;      tstate  = DBtags;      while( (tag = NextTagItem(&tstate)) != NULL)      {        if(tag->ti_Data) switch(tag->ti_Tag)        {          case AHIDB_Data:            tp->ti_Data = ((ULONG) &node->ahidbn_Tags[tagitems]);            CopyMem((APTR)tag->ti_Data, (APTR)tp->ti_Data, datalength);            break;          case AHIDB_Name:            tp->ti_Data = ((ULONG) &node->ahidbn_Tags[tagitems]) + datalength;            strcpy((UBYTE *)tp->ti_Data, (UBYTE *)tag->ti_Data);            break;          case AHIDB_Driver:            tp->ti_Data= ((ULONG) &node->ahidbn_Tags[tagitems]) + datalength + namelength;            strcpy((UBYTE *)tp->ti_Data, (UBYTE *)tag->ti_Data);            break;          default:            tp->ti_Data = tag->ti_Data;            break;        }        tp->ti_Tag = tag->ti_Tag;        tp++;      }      tp->ti_Tag = TAG_DONE;      AddHead((struct List *) &audiodb->ahidb_AudioModes, (struct Node *) node);      rc = TRUE;    }unlock:    UnlockDatabase(audiodb);  }  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH)  {    KPrintF("=>%ld\n",rc);  }  return rc;}