aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Several fixes uncovered with -pedanticEric Wong2006-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | playerData.c: proper error checking directory.c: properly check myFgets() for errors (it returns NULL on error) inputPlugins/mp3_plugin.c get rid of commas at the end of enums interface.c: we weren't using long long, so strtoll isn't needed get rid of void-pointer arithmetic sllist.c: get rid of void-pointer arithmetic compress.c: get rid of C++ comments, some compilers don't accept them Note that I personally like void pointer arithmetic, but some ancient compilers don't support them :( git-svn-id: https://svn.musicpd.org/mpd/trunk@4510 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* remove deprecated myfprintf wrapperEric Wong2006-07-301-7/+7
| | | | | | | This shaves another 5-6k because we've removed the paranoid fflush() calls after every fprintf. Now we only fflush() when we need to git-svn-id: https://svn.musicpd.org/mpd/trunk@4493 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* commandError() cleanups, fixup gcc checksEric Wong2006-07-301-6/+4
| | | | | | | stripped binary size reduced by 9k on my machine from making commandError a function. We'll print out error messages slightly slower before, but the smaller binary is more than worth it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface/connection malloc reductions from mpd-keEric Wong2006-07-301-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* If we're going to create the db file, make sure the parent path is a directoryJ. Alexander Treuman2006-07-231-1/+16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4437 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Make checkDirectoryDB check that the db file is a regular fileJ. Alexander Treuman2006-07-231-3/+16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4436 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Tidying up code in checkDirectoryDBJ. Alexander Treuman2006-07-231-19/+17
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4434 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-201-591/+648
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* remove the glib library dependencyEric Wong2006-07-161-1/+0
| | | | | | | | | We never used many features from it, so there's no point in keeping it and forcing people to install a non-standard library. It may be standard on many GNU/Linux distributions, but there are many other UNIXes out there. This makes life much easier for people cross-compiling (like me :) git-svn-id: https://svn.musicpd.org/mpd/trunk@4361 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] Remove unused functionAvuton Olrich2006-07-141-1/+0
| | | | | | | | Remove unused functions from the header, static where possible Cleanup whitespace->tabs git-svn-id: https://svn.musicpd.org/mpd/trunk@4341 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] Remove unused functions from the headerAvuton Olrich2006-07-141-106/+55
| | | | | | | Convert some spaces to tabs Static what makes sense Remove unused includes git-svn-id: https://svn.musicpd.org/mpd/trunk@4328 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-131-1/+1
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Check that db_file exists before checking if we can write to it. Committed ↵J. Alexander Treuman2006-06-071-0/+30
| | | | | on behalf of qball. git-svn-id: https://svn.musicpd.org/mpd/trunk@4255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix log message when removing subdirectories.J. Alexander Treuman2006-05-151-3/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4185 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Jat/Q patch for checking permission on database before creating itQball Cow2006-05-081-0/+12
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4140 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge with mpd/trunk up to r3925Eric Wong2006-03-161-5/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* r1067@BL4ST: normalperson | 2005-12-30 19:21:28 -0800Eric Wong2005-12-311-0/+1
| | | | | Fix a couple of warnings (sbh, from oggflac branch) git-svn-id: https://svn.musicpd.org/mpd/trunk@3752 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* remove C++ style commentsEric Wong2005-11-191-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* DJWLindenaar balanced tree and master process patchQball Cow2005-11-161-1/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix stateFile path getting garbledWarren Dukes2005-03-061-2/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3029 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* config file change! now 'port' is optional and 'db_file' is required!Warren Dukes2005-03-061-17/+34
| | | | | | also, should have better error reporting when failing to open playlist or music directory's, or writing the db, etc git-svn-id: https://svn.musicpd.org/mpd/trunk@3027 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* free(name) in readDirectoryInfo after using itEric Wong2005-01-291-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2911 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* this shit really needs to be cleaned up, but its good enough for testing,Warren Dukes2004-11-151-0/+1
| | | | | intelligently use memmove, when inserting nodes in a sorted list git-svn-id: https://svn.musicpd.org/mpd/trunk@2677 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* don't to an unneccessary sortWarren Dukes2004-11-151-5/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2674 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* a few DEBUG statementsWarren Dukes2004-11-131-0/+8
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2642 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a bug in pringSongUrl, don't print leading '/' for songs in root dirWarren Dukes2004-11-121-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2631 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* don't store only relative paths in the directory structure, its probably notWarren Dukes2004-11-121-24/+25
| | | | | worth the savings in memory for the extra cpu it requires git-svn-id: https://svn.musicpd.org/mpd/trunk@2630 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ok, optimize memory sage of directorys, by iteratively creating the directories,Warren Dukes2004-11-111-35/+88
| | | | | | | | this code needs some serious testing: Note: The song name optimization i think is worth it, saves about 200k of ram on my syste, however, having to create directory names iteratively each time we print probably isn't worth the cpu. We only save about 10k of ram for the computer todo alot more work, and the code maybe a little messier git-svn-id: https://svn.musicpd.org/mpd/trunk@2604 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ok, now song->url is only the filename, not the full path to the songWarren Dukes2004-11-111-2/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2602 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* implement saved memory by not storing full pathWarren Dukes2004-11-111-9/+9
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2601 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge changes from metadata-rewrite branchWarren Dukes2004-11-101-182/+7
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* now one can specify multiple bind_to_addressesWarren Dukes2004-11-031-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2501 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* new command "addid", this is the same as "add" command, except it also ↵Warren Dukes2004-11-021-1/+1
| | | | | returns the songid of the added song. Note that "addid" does not work on directories git-svn-id: https://svn.musicpd.org/mpd/trunk@2487 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* listallinfo now prints out directoriesWarren Dukes2004-10-291-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2399 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge shank-rewrite-config changesWarren Dukes2004-10-281-1/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* spelling fixes from normalpersonWarren Dukes2004-06-291-3/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1710 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ok, addParentPathToDB now works!Warren Dukes2004-06-231-9/+31
| | | | | also, recursive directory checking for updating on a particular song path now work git-svn-id: https://svn.musicpd.org/mpd/trunk@1624 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* update now ignores/recognizes recursive directoriesWarren Dukes2004-06-231-4/+41
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1623 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* now we avoid recursive symlinks on creating the dbWarren Dukes2004-06-231-28/+88
| | | | | still needs to be implemented for updating git-svn-id: https://svn.musicpd.org/mpd/trunk@1622 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* only call opendir() once when updatingWarren Dukes2004-06-221-8/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1608 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* call stat() a few less times on updateWarren Dukes2004-06-221-8/+14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1607 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix C99 stuff for commandErrorWarren Dukes2004-06-151-6/+8
| | | | | also some slight optimizations to interfacePrintWithFD() and myfprintf() git-svn-id: https://svn.musicpd.org/mpd/trunk@1503 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add WARNING log method. it's the same as ERROR, except that when mpd starts,Warren Dukes2004-06-121-4/+3
| | | | | | warnings are buffered until the error log is opened, and then flushed to the error log. git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* new command, plchanges, and also add Num: to songinfo of playlistinfoWarren Dukes2004-06-051-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1339 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* finish ack error codesWarren Dukes2004-06-041-17/+17
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* clean up ACK error coding a little bitWarren Dukes2004-06-041-9/+8
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* '\n' are badWarren Dukes2004-06-021-0/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1296 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a nasty bug when deleting a stream from the playlistWarren Dukes2004-05-191-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1082 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix bug where db_update wasn't being set in readDirectoryDBWarren Dukes2004-05-171-6/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1037 09075e82-0dd4-0310-85a5-a0d7c8717e4f