Track tags need to add themselves to the filter index and update the
library track count once added to the database.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The Track tag needs to do some cleanup when removed from a database, so
we need to use this op when removing items.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
For allocating new database items from a given key. Tracks do not need
this function since we have special handling for creation and insertion.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function is similar to Linux's list_for_each_safe(), and lets you
iterate over a database even if the current item is removed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also take the chance to modify this function slightly. Now, if a
matching item could not be found a new item will be allocated.
I added the new function db_get() if callers just want to get an item
without allocating.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This variable should only be set by the Database when a DatabaseItem is
first created. This means I should hide _index from the rest of the
world to prevent accidental modifications. I also add an accessor
function for other code that needs to read _index.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I transfer everything from my DESIGN file into doxygen, and then remove
the section from DESIGN.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I plan to introduce a new lib/ that sits between the gui and the backend
files (similar to how glibc sits between the kernel and userspace).
This gets the rename out of the way before I change my mind again.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>