aboutsummaryrefslogtreecommitdiffstats
path: root/src/dirvec.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-10-26dirvec: fixed GCC shadow warningMax Kellermann1-4/+4
On some systems, string.h declares basename(). This emits a shadow warning. Change the variable name.
2008-10-21update: fix multiple deletes from *vec iteratorsEric Wong1-1/+5
{song,dir}vec_for_each each failed to gracefully handle deleted files when iterating through. While we were thread-safe, we were not safe within the calling thread. If a callback we passed caused sv->nr to shring, our index would still increment; causing files to stay in the database. A way to test this is to remove 10 or so contiguous songs from a >10 song directory.
2008-10-21dirvec: introduce locking for all iteratorsEric Wong1-6/+25
Like the songvec nr_lock, only one lock is used for all traversals since they're rarely changed. This only projects traversals, but not the individual structures themselves.
2008-10-21{dir,song}vec: these structs are constEric Wong1-1/+1
We definitely don't modify them here.
2008-10-21dirvec: add dirvec_for_each iteratorEric Wong1-0/+16
This will make it easier to introduce locking
2008-10-20path: replaced mpd_basename() with g_path_get_basename()Max Kellermann1-2/+8
GLib's g_path_get_basename() is much more reliable than mpd_basename(). The latter could be tricked into an assertion failure.
2008-10-14{dir,song}vec: fix off-by-one errors in {dir,song}vec_deleteEric Wong1-3/+3
Found by Valgrind while looking for another bug... Hmm.. I should really just make this code generic since they're duplicated...
2008-10-13dirvec: dirvec_find() compares basenameMax Kellermann1-1/+4
It is invalid to pass a path with the wrong dirname to dirvec_find(). To be able to find a subdirectory only by its basename, compare only the basename of both paths.
2008-10-09dirvec: constant pointers in dirvec_find()Max Kellermann1-1/+1
dirvec_find() does not modify the object, thus it should get a const pointer.
2008-10-08directory: eliminate CamelCaseMax Kellermann1-1/+1
CamelCase is ugly, rename the functions.
2008-10-08don't include os_compat.hMax Kellermann1-1/+2
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-10-08directory: converted typedef Directory to struct directoryMax Kellermann1-8/+9
The struct can be forward-declared by other headers, which relaxes the header dependencies.
2008-10-08dirvec: moved code to dirvec.cMax Kellermann1-10/+6
Having all functions as static (non-inline) functions generates GCC warnings, and duplicates binary code across several object files. Most of dirvec's methods are too complex for becoming inline functions. Move them all to dirvec.c and publish the prototypes in dirvec.h.
2008-09-29directory: replace DirectoryList with dirvecEric Wong1-0/+73
Small memory reduction compared to songvec since most users have much fewer dirs than songs, but still nice to have.