aboutsummaryrefslogtreecommitdiffstats
path: root/src/tagTracker.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-08-29tag: converted tag_item.value to a char arrayMax Kellermann1-10/+0
The value is stored in the same memory allocation as the tag_item struct; this saves memory because we do not store the value pointer anymore. Also remove the getTagItemString()/removeTagItemString() dummies.
2008-08-29removed tree.cMax Kellermann1-85/+69
This patch makes MPD consume much more memory because string pooling is disabled, but it prepares the next bunch of patches. Replace the code in tagTracker.c with naive algorithms without the tree code. For now, this should do; later we should find better algorithms, especially for getNumberOfTagItems(), which has become wasteful with temporary memory.
2008-08-29pass constant pointersMax Kellermann1-1/+1
And again, convert arguments to const.
2008-04-12whitespace cleanupMax Kellermann1-14/+14
git-svn-id: https://svn.musicpd.org/mpd/trunk@7320 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12clean up CPP includesMax Kellermann1-2/+1
Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-26fix -Waggregate-returnMax Kellermann1-7/+7
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7145 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-3/+1
This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong1-9/+1
Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-2/+4
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
2006-08-07sparse / gcc-2.95 / -pedantic fixesEric Wong1-1/+1
Not everybody has access to the latest and greatest compilers. git-svn-id: https://svn.musicpd.org/mpd/trunk@4595 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-06merge changes from mpd-tree:Warren Dukes1-76/+61
-use tree for tagTracker -eliminate the master process git-svn-id: https://svn.musicpd.org/mpd/trunk@4571 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30interface/connection malloc reductions from mpd-keEric Wong1-3/+3
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
2006-07-20Add mpd-indent.shAvuton Olrich1-43/+56
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
2006-07-17sparse: ANSI-fy function declarationsEric Wong1-1/+1
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
2006-07-16remove the glib library dependencyEric Wong1-63/+55
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
2006-07-15[CLEANUP] Cleanup whitespace->tabsAvuton Olrich1-33/+7
Remove dead code Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-0/+18
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-11-19remove C++ style commentsEric Wong1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@3689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-11-16DJWLindenaar balanced tree and master process patchQball Cow1-65/+69
git-svn-id: https://svn.musicpd.org/mpd/trunk@3669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-15get rid of a gcc warningWarren Dukes1-4/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@2682 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-15this shit really needs to be cleaned up, but its good enough for testing,Warren Dukes1-10/+13
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
2004-11-15oops, forgot to remove some DEBUG statmentsWarren Dukes1-3/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@2673 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-15insert stuff in tagTracker in sorted order, hopefully this makes it fasterWarren Dukes1-12/+10
git-svn-id: https://svn.musicpd.org/mpd/trunk@2672 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-14put tracking titles back in tag trackerWarren Dukes1-5/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@2654 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-14fix test (we're not adding title's to the tag tracker)Warren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2653 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-14testWarren Dukes1-1/+9
git-svn-id: https://svn.musicpd.org/mpd/trunk@2652 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-13a few DEBUG statementsWarren Dukes1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@2642 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-11somehow a } went missingWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2609 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-11ok, tagtracker now tracks title, this has the disadvantage of needing to sortWarren Dukes1-13/+30
the title tracker list, and it wastes more memory. But it makes implementing list command elegant, since we've just visit tags, then print out the visited tags in tag tracker (which has the benefit of making sure everything is in sorted order) git-svn-id: https://svn.musicpd.org/mpd/trunk@2608 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-11better saved memmory displayWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2607 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-11ok, now song->url is only the filename, not the full path to the songWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2602 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-10merge changes from metadata-rewrite branchWarren Dukes1-0/+142
git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f