1. 08 Oct, 2008 2 commits
  2. 07 Oct, 2008 2 commits
  3. 29 Sep, 2008 2 commits
    • Eric Wong's avatar
      Switch to C99 types (retaining compat with old compilers) · 0352766d
      Eric Wong authored
      Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the
      mind needs to retrain itself to skip over the first 4 tokens of
      a type to get to its meaning.  So avoid having extra characters
      on my terminal to make it easier to follow code at 2:30 am in
      the morning.
      
      Please report any new issues you may come across on Free
      toolchains.  I realize how difficult it can be to build/maintain
      cross-compiling toolchains and I have no intention of forcing
      people to upgrade their toolchains to build mpd.
      
      Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
      0352766d
    • Eric Wong's avatar
      allow searching for albums with an empty tag · a4019f7d
      Eric Wong authored
      tfing wrote:
      > I have quite some files with an empty album tag as they do not come
      > from a particular album.
      >
      > If I want to look for those files and browse them, this happens:
      > :: nc localhost 6600
      > OK MPD 0.12.0
      > find album ""
      > ACK [2@0] {find} too few arguments for "find"
      >
      > I'd like to be able to browse those files in a client like gmpc.
      > So these 2 items would have to be developed:
      > - list album should report that some files have an empty tag
      > - it should be possible to search for an empty tag with the find command
      
      Patch-by: Marc Pavot
      ref: http://musicpd.org/mantis/view.php?id=464
      a4019f7d
  4. 23 Sep, 2008 1 commit
    • Eric Wong's avatar
      Replace SongList with struct songvec · 0bec1d38
      Eric Wong authored
      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).
      0bec1d38
  5. 08 Sep, 2008 1 commit
    • Max Kellermann's avatar
      use strset.h instead of tagTracker.h · f0e64ceb
      Max Kellermann authored
      With a large music database, the linear string collection in
      tagTracker.c becomes very slow.  We implemented that in a
      quick'n'dirty fashion when we removed tree.c, and now we rewrite it
      using the fast hashed string set.
      f0e64ceb
  6. 07 Sep, 2008 7 commits
    • Max Kellermann's avatar
      tag: don't pass "fd" to printVisitedInTagTracker() · 4665f2bf
      Max Kellermann authored
      Pass the client struct instead of the raw file descriptor.
      4665f2bf
    • Max Kellermann's avatar
      pass "struct client" to dbUtils.c, song.c, tag_print.c · dc8b64fd
      Max Kellermann authored
      Don't pass the raw file descriptor around.  This migration patch is
      rather large, because all of the sources have inter dependencies - we
      have to change all of them at the same time.
      dc8b64fd
    • Max Kellermann's avatar
      directory: don't pass fd to traverseAllIn() · f320c9fa
      Max Kellermann authored
      This patch continues the work of the previous patch: don't pass a file
      descriptor at all to traverseAllIn().  Since this fd was only used to
      report "directory not found" errors, we can easily move that check to
      the caller.  This is a great relief, since it removes the dependency
      on a client connection from a lot of enumeration functions.
      f320c9fa
    • Max Kellermann's avatar
      directory: don't pass fd to traverseAllIn() callbacks · 528be8a0
      Max Kellermann authored
      Database traversal should be generic, and not bound to a client
      connection.  This is the first step: no file descriptor for the
      callback functions forEachSong() and forEachDir().  If a callback
      needs the file descriptor, it has to be passed in the void*data
      pointer somehow; some callbacks might need a new struct for passing
      more than one parameter.  This might look a bit cumbersome right now,
      but our goal is to have a clean API.
      528be8a0
    • Max Kellermann's avatar
      playlist: don't pass "fd" to storedPlaylist.c functions · a8b225f9
      Max Kellermann authored
      Return an "enum playlist_result" value instead of calling
      commandError() in storedPlaylist.c.
      a8b225f9
    • Max Kellermann's avatar
      playlist: don't pass "fd" to playlist.c functions · 8d2830b3
      Max Kellermann authored
      The playlist library shouldn't talk to the client if possible.
      Introduce the "enum playlist_result" type which the caller
      (i.e. command.c) may use to generate an error message.
      8d2830b3
    • Max Kellermann's avatar
      song: moved code to song_print.c, song_save.c · 75aa8dad
      Max Kellermann authored
      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.
      75aa8dad
  7. 06 Sep, 2008 1 commit
  8. 29 Aug, 2008 2 commits
  9. 26 Aug, 2008 2 commits
  10. 26 Mar, 2008 1 commit
  11. 26 Jan, 2008 2 commits
  12. 16 May, 2007 1 commit
  13. 26 Apr, 2007 2 commits
  14. 25 Apr, 2007 1 commit
  15. 05 Apr, 2007 1 commit
  16. 24 Feb, 2007 1 commit
  17. 11 Dec, 2006 2 commits
  18. 20 Nov, 2006 1 commit
  19. 27 Oct, 2006 1 commit
  20. 26 Aug, 2006 1 commit
    • Eric Wong's avatar
      Replace strdup and {c,re,m}alloc with x* variants to check for OOM errors · 90847fc8
      Eric Wong authored
      I'm checking for zero-size allocations and assert()-ing them,
      so we can more easily get backtraces and debug problems, but we'll
      also allow -DNDEBUG people to live on the edge if they wish.
      
      We do not rely on errno when checking for OOM errors because
      some implementations of malloc do not set it, and malloc
      is commonly overridden by userspace wrappers.
      
      I've spent some time looking through the source and didn't find any
      obvious places where we would explicitly allocate 0 bytes, so we
      shouldn't trip any of those assertions.
      
      We also avoid allocating zero bytes because C libraries don't
      handle this consistently (some return NULL, some not); and it's
      dangerous either way.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      90847fc8
  21. 09 Aug, 2006 1 commit
  22. 30 Jul, 2006 1 commit
    • Eric Wong's avatar
      interface/connection malloc reductions from mpd-ke · 4cf5d04c
      Eric Wong authored
      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
      4cf5d04c
  23. 20 Jul, 2006 1 commit
  24. 17 Jul, 2006 1 commit
    • Eric Wong's avatar
      sparse: ANSI-fy function declarations · a234780a
      Eric Wong authored
      These are just warnings from sparse, but it makes the output
      easier to read.  I ran this through a quick perl script, but
      of course verified the output by looking at the diff and making
      sure the thing still compiles.
      
      here's the quick perl script I wrote to generate this patch:
      ----------- 8< -----------
      use Tie::File;
      defined(my $pid = open my $fh, '-|') or die $!;
      if (!$pid) {
      open STDERR, '>&STDOUT' or die $!;
      exec 'sparse', @ARGV or die $!;
      }
      my $na = 'warning: non-ANSI function declaration of function';
      while (<$fh>) {
      print STDERR $_;
      if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) {
      my ($f, $l, $pos, $func) = ($1, $2, $3, $4);
      $l--;
      tie my @x, 'Tie::File', $f or die "$!: $f";
      print '-', $x[$l], "\n";
      $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/;
      print '+', $x[$l], "\n";
      untie @x;
      }
      }
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      a234780a
  25. 15 Jul, 2006 1 commit
  26. 14 Jul, 2006 1 commit