- 08 Oct, 2008 24 commits
-
-
Max Kellermann authored
Also convert directory_get_path() to an inline function, which returns a constant string.
-
Max Kellermann authored
CamelCase is ugly, rename the functions.
-
Max Kellermann authored
Yet another CamelCase removal patch.
-
Max Kellermann authored
The same can be achieved with directory_print(db_get_directory()).
-
Max Kellermann authored
Taming the directory.c monster, part II: move the database management stuff to database. directory.c should only contain code which works on directory objects.
-
Max Kellermann authored
The function isRootDirectory() is tiny and can be converted to an inline function. Don't allow name==NULL.
-
Max Kellermann authored
The runtime check suggests that the author has somehow thought song_get_url(NULL) might be valid. It should not be. Replace it with an assertion.
-
Max Kellermann authored
Eliminate duplicated code.
-
Max Kellermann authored
Instead of returning 0 or -1, return true on success and false on failure. This seems more natural, and when the C library was designed, there was no "bool" data type.
-
Max Kellermann authored
This function was never used on remote songs. Replace the runtime check with an assertion.
-
Max Kellermann authored
CamelCase is ugly... rename all functions.
-
Max Kellermann authored
Provide separate constructors for creating a remote song, a local song, and one for loading data from a song file. This way, we can add more assertions.
-
Max Kellermann authored
Check the old status before assigning. This saves a temporary variable.
-
Max Kellermann authored
"bool" should be used in C99 programs for boolean values.
-
Max Kellermann authored
When there are standardized headers, use these instead of the bloated os_compat.h.
-
Max Kellermann authored
Include only headers which are really used.
-
Max Kellermann authored
Typedefs shouldn't be used, use the bare struct names instead.
-
Max Kellermann authored
Again, a data type which can be forward-declared.
-
Max Kellermann authored
The struct can be forward-declared by other headers, which relaxes the header dependencies.
-
Max Kellermann authored
exploreDirectory() duplicates some code in updateDirectory(). Merge both functions, and use directory_is_empty() to determine whether update or explore mode should be used.
-
Max Kellermann authored
directory_is_empty() is a tiny inline function which determine if a directory has any child objects (sub directories or songs).
-
Max Kellermann authored
The source directory.c mixes several libraries: directory object management, database management and database update, resulting in a 1000+ line monster. Move the whole database update code to update.c.
-
Max Kellermann authored
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.
-
Max Kellermann authored
pthread_cond_wait() may wake up spuriously. To prevent superfluous state checks, loop until the "pending" flag becomes true. Removed the dangerous assertion.
-
- 07 Oct, 2008 11 commits
-
-
Max Kellermann authored
Somehow I must have missed this in commit 22e40b61.
-
Eric Wong authored
oops :x
-
Eric Wong authored
This makes the update code thread-safe and doesn't penalize the playlist code by complicating it with complicated and error-prone locks (and the associated overhead, not everybody has a thread-implementation as good as NPTL). The update task blocks during the delete; but the update task is a slow task anyways so we can block w/o people caring too much. This was also our only freeSong call site, so remove that function. Note that deleting entire directories is not fully thread-safe, yet; as their traversals are not yet locked.
-
Eric Wong authored
Get rid of songvec_write so we can enforce proper locking
-
Max Kellermann authored
songvec_for_each() has locking, use it instead of manually iterating over the songvec items.
-
Max Kellermann authored
Pass const songvec pointers to songvec_find() and songvec_for_each().
-
Eric Wong authored
Being consistent with most UNIX functions...
-
Eric Wong authored
Only one lock is used for all songvec traversals since they're rarely changed. Also, minimize lock time and release it before calling iterator functions since they may block (updateSongInfo => stat/open/seek/read). This lock only protects songvecs (and all of them) during traversals; not the individual song structures themselves.
-
Eric Wong authored
This is so we can more consistently deal with locking needed for thread-safety in iterator functions.
-
Eric Wong authored
This make argument order more consistent for iterators. Additionally, these now return ssize_t results for error checking.
-
Eric Wong authored
song objects cannot exist without a path or URL
-
- 06 Oct, 2008 5 commits
-
-
Eric Wong authored
* Add missing headers in Makefile.am * remove mp4ff.dsp (Win32 crap) * Add scripts, m4, bs, autogen.sh to allow for hotfixes by the SCM-challenged. (downloading the source via git is NOT a lightweight operation for everybody).
-
Eric Wong authored
This is needed for people that don't use any of the following: JACK, ALSA, libmikmod, Shout.
-
Eric Wong authored
These patterns have been sitting in my private .git/info/exclude files since 2005 because we used to use SVN.
-
Eric Wong authored
We already know if a song is a URL or not based on whether it has parentDir defined or not. Hopefully one day in the future we can drop HTTP support from MPD entirely when an HTTP filesystem comes along and we can access streams via open(2).
-
Max Kellermann authored
The "packed" attribute may have negative side effects on performance. Remove the "packed" attribute, and increase the size of "song.url" to a multiple of the machine word size.
-