aboutsummaryrefslogtreecommitdiffstats
path: root/src/dirvec.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* directory: replace dirvec with doubly linked listMax Kellermann2012-01-241-111/+0
| | | | | Random access is not needed, and a linked list is easier to manage: we don't need to (re-)allocate the pointer array.
* dirvec: unlock mutex in dirvec_find() in all branchesMax Kellermann2012-01-241-1/+4
|
* dirvec: don't call g_path_get_basename() on parameterMax Kellermann2012-01-241-10/+3
| | | | | This overhead is completely useless, because no caller expects this behaviour.
* dirvec: remove unused functions _clear(), _for_each()Max Kellermann2012-01-211-24/+0
|
* db_lock: new unified lock for songvec and dirvecMax Kellermann2012-01-211-30/+16
|
* copyright year 2011Max Kellermann2011-01-291-1/+1
|
* Update copyright notices.Avuton Olrich2009-12-311-1/+1
|
* include config.h in all sourcesMax Kellermann2009-11-121-0/+1
| | | | | | After we've been hit by Large File Support problems several times in the past week (which only occur on 32 bit platforms, which I don't have), this is yet another attempt to fix the issue.
* all: Update copyright header.Avuton Olrich2009-03-131-0/+19
| | | | | | | | This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
* dirvec, songvec: sort using g_utf8_collate()Max Kellermann2009-01-151-1/+1
| | | | | | Path names in the directory and song structs are always encoded in UTF-8. Don't use strcmp(), it cannot handle UTF-8 characters properly. Use GLib's UTF-8 aware g_utf8_collate() function for that.
* songvec, dirvec: use GLib instead of utils.hMax Kellermann2009-01-031-6/+5
|
* removed os_compat.hMax Kellermann2008-12-291-1/+3
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* dirvec: migrate from pthread to glib threadsThomas Jansen2008-12-281-17/+29
|
* Include <pthread.h> where it is necessary onlyThomas Jansen2008-12-281-0/+1
|
* dirvec: fixed GCC shadow warningMax Kellermann2008-10-261-4/+4
| | | | | On some systems, string.h declares basename(). This emits a shadow warning. Change the variable name.
* update: fix multiple deletes from *vec iteratorsEric Wong2008-10-211-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.
* dirvec: introduce locking for all iteratorsEric Wong2008-10-211-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.
* {dir,song}vec: these structs are constEric Wong2008-10-211-1/+1
| | | | We definitely don't modify them here.
* dirvec: add dirvec_for_each iteratorEric Wong2008-10-211-0/+16
| | | | This will make it easier to introduce locking
* path: replaced mpd_basename() with g_path_get_basename()Max Kellermann2008-10-201-2/+8
| | | | | | GLib's g_path_get_basename() is much more reliable than mpd_basename(). The latter could be tricked into an assertion failure.
* {dir,song}vec: fix off-by-one errors in {dir,song}vec_deleteEric Wong2008-10-141-3/+3
| | | | | | | Found by Valgrind while looking for another bug... Hmm.. I should really just make this code generic since they're duplicated...
* dirvec: dirvec_find() compares basenameMax Kellermann2008-10-131-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.
* dirvec: constant pointers in dirvec_find()Max Kellermann2008-10-091-1/+1
| | | | | dirvec_find() does not modify the object, thus it should get a const pointer.
* directory: eliminate CamelCaseMax Kellermann2008-10-081-1/+1
| | | | CamelCase is ugly, rename the functions.
* don't include os_compat.hMax Kellermann2008-10-081-1/+2
| | | | | When there are standardized headers, use these instead of the bloated os_compat.h.
* directory: converted typedef Directory to struct directoryMax Kellermann2008-10-081-8/+9
| | | | | The struct can be forward-declared by other headers, which relaxes the header dependencies.
* dirvec: moved code to dirvec.cMax Kellermann2008-10-081-0/+69
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.