aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_save.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* song: removed CamelCaseMax Kellermann2008-10-081-5/+5
| | | | CamelCase is ugly... rename all functions.
* song: replaced all song constructorsMax Kellermann2008-10-081-2/+2
| | | | | | 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.
* song: converted typedef Song to struct songMax Kellermann2008-10-081-5/+8
| | | | Again, a data type which can be forward-declared.
* directory: converted typedef Directory to struct directoryMax Kellermann2008-10-081-1/+1
| | | | | The struct can be forward-declared by other headers, which relaxes the header dependencies.
* song: use songvec_for_each() in songvec_print() / songvec_save()Max Kellermann2008-10-071-12/+11
| | | | | songvec_for_each() has locking, use it instead of manually iterating over the songvec items.
* song: stop storing song_typeEric Wong2008-10-061-1/+1
| | | | | | | 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).
* song: use flex arrays to store song->urlEric Wong2008-10-061-7/+3
| | | | | | Reduce the number of allocations we make, so there's less pressure on the allocator and less overhead to keep track of the allocations in.
* song: get rid of newNullSong()Eric Wong2008-10-061-1/+1
| | | | | It didn't save us any lines of code nor did it do anything useful since we would overwrite everything anyways.
* songvec: remove songvec_pruneEric Wong2008-09-231-3/+0
| | | | | | Any pruned files will be noticed during update and pruned from the live database, so this inefficient function can go away and never come back.
* Don't try to prune unless we're updatingEric Wong2008-09-231-1/+2
| | | | | | Pruning is very expensive and we won't need it in the future anyways. This brings startup back to previous speeds (before songvec changes).
* Replace SongList with struct songvecEric Wong2008-09-231-54/+31
| | | | | | | Our linked-list implementation is wasteful and the SongList isn't modified enough to benefit from being a linked list. So use a more compact array of song pointers which saves ~200K on a library with ~9K songs (on x86-32).
* tag: added buffered versions of the tag_print.c codeMax Kellermann2008-09-071-3/+20
| | | | | | | | | | | Currently, when the tag cache is being serialized to hard disk, the stdio buffer is flushed before every song, because tag_print.c performs unbuffered writes on the raw file descriptor. Unfortunately, the fdprintf() API allows buffered I/O only for a client connection by looking up the client pointer owning the file descriptor - for stdio, this is not possible. To re-enable proper stdio buffering, we have to duplicate the tag_print.c code without fprintf() instead of our custom fdprintf() hack. Add this duplicated code to tag_save.c.
* song: moved code to song_print.c, song_save.cMax Kellermann2008-09-071-0/+160
Move everything which dumps song information (via tag_print.c) to a separate source file. song_print.c gets code which writes song data to the client; song_save.c is responsible for serializing songs from the tag cache.