aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-04-01directory: added directory_lookup_song()Max Kellermann1-25/+1
Moved code from db_get_song().
2009-04-01directory: renamed directory_get_directory()Max Kellermann1-1/+1
Renamed directory_get_directory() to directory_lookup_directory(). Added API documentation.
2009-03-13all: Update copyright header.Avuton Olrich1-7/+7
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-03-02directory: directory_load() returns GErrorMax Kellermann1-1/+5
Do error reporting with GLib's GError library in this library, too.
2009-03-02database: db_load() returns GErrorMax Kellermann1-15/+40
Do error reporting with GLib's GError library.
2009-03-02database: no CamelCaseMax Kellermann1-16/+15
Renamed a bunch of variables.
2009-02-27directory: moved DIRECTORY_* string constantsMax Kellermann1-0/+5
Moved some of them to to directory_save.c, and others to database.c.
2009-02-12database: don't load database after charset was reconfiguredMax Kellermann1-6/+4
When you change the filesystem charset, discard the old database file and create a new one. The old database file will most likely contain stale or invalid information.
2009-01-25database: eliminate "goto" usageMax Kellermann1-7/+8
http://xkcd.com/292/
2009-01-25use g_free() instead of free()Max Kellermann1-1/+1
On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
2009-01-18mapper: make the music_directory optionalMax Kellermann1-5/+23
Without a music_directory, MPD is an excellent streaming client.
2009-01-18database: pass database file name to db_init()Max Kellermann1-32/+36
Don't include conf.h in database.c.
2009-01-17conf: replaced getConfigParamValue() with config_get_string()Max Kellermann1-2/+3
Don't return a writable pointer.
2009-01-17conf: no CamelCase, part IMax Kellermann1-1/+1
Renamed functions, types, variables.
2009-01-04database: use stdboolMax Kellermann1-21/+20
Make db_load(), db_save() and db_check() return bool instead of int.
2009-01-04database: db_init() initializes library, does not updateMax Kellermann1-8/+2
For updating the database, directory_update_init() should be called explicitly.
2009-01-04stats: added stats_update()Max Kellermann1-4/+1
2009-01-04don't exit after --create-dbMax Kellermann1-7/+0
Start the daemon after --create-db. This makes --create-db a flag which discards the old database and starts with a fresh one.
2009-01-02database: use GLib instead of utils.hMax Kellermann1-2/+3
2009-01-01event_pipe: added pipe_event enum and callbacksMax Kellermann1-1/+0
Make the event_pipe (formerly main_notify) send/receive a set of events, with a callback for each one. The default event PIPE_EVENT_SIGNAL does not have a callback. It is still there for waking up the main thread, when it is waiting for the player thread.
2009-01-01event_pipe: renamed functions from main_notify_* to event_pipe_*Max Kellermann1-1/+1
Continuing the previous patch.
2009-01-01main_notify: renamed source to event_pipe.cMax Kellermann1-1/+1
We are going to migrate away from the concept of notifying the main thread. There should be events sent to it instead. This patch starts a series to implement that.
2008-12-29database: use GLib loggingMax Kellermann1-36/+38
2008-12-29removed os_compat.hMax Kellermann1-1/+6
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
2008-12-28utils: removed myFgets()Max Kellermann1-3/+7
Replaced myFgets() with fgets() + g_strchomp().
2008-11-05path: no CamelCaseMax Kellermann1-2/+2
Rename variables and functions.
2008-10-28utils: use g_str_has_prefix() instead of prefixcmp()Max Kellermann1-2/+2
Remove duplicated code from MPD.
2008-10-20path: replaced parent_path() with g_path_get_dirname()Max Kellermann1-4/+7
Again, GLib's version is more robust than ours.
2008-10-09update: make the job id unsignedMax Kellermann1-1/+1
Since the return value cannot be -1 anymore, we can make it unsigned.
2008-10-09update: job ID must be positiveMax Kellermann1-1/+1
The documentation for directory_update_init() was incorrect: a job ID must be positive, not non-negative. If the update queue is full and no job was created, it makes more sense to return 0 instead of -1, because it is more consistent with the return value of isUpdatingDB().
2008-10-09update: don't export updateDirectory()Max Kellermann1-1/+13
If the user requests database update during startup, call directory_update_init(). This should be changed to fully asynchronous update later. For this to work, main_notify has to be initialized before db_init().
2008-10-09database: renamed get_get_song() to db_get_song()Max Kellermann1-2/+2
Search'n'replace typo..
2008-10-09diretory: moved code to directory_save.c, directory_print.cMax Kellermann1-0/+1
Remove clutter from directory.c. Everything which saves or loads to/from the hard disk goes to directory_save.c, and code which sends directory information to the client is moved into directory_print.c.
2008-10-09database: removed local variable bufferSizeMax Kellermann1-3/+2
Use sizeof(buffer) instead.
2008-10-09database: simplify db_load()Max Kellermann1-47/+42
Removed a superfluous closure.
2008-10-08directory: path must not be NULLMax Kellermann1-2/+2
For the root directory, let's set path to an empty string. This saves a few checks.
2008-10-08directory: eliminate CamelCaseMax Kellermann1-10/+9
CamelCase is ugly, rename the functions.
2008-10-08database: renamed functions, "db_" prefix and no CamelCaseMax Kellermann1-19/+26
Yet another CamelCase removal patch.
2008-10-08database: removed printDirectoryInfo()Max Kellermann1-10/+0
The same can be achieved with directory_print(db_get_directory()).
2008-10-08directory: moved code to database.cMax Kellermann1-265/+54
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.
2008-10-08directory: converted isRootDirectory() to an inline functionMax Kellermann1-5/+5
The function isRootDirectory() is tiny and can be converted to an inline function. Don't allow name==NULL.
2008-10-08song: removed CamelCaseMax Kellermann1-1/+1
CamelCase is ugly... rename all functions.
2008-10-08song: converted typedef Song to struct songMax Kellermann1-6/+7
Again, a data type which can be forward-declared.
2008-10-08directory: converted typedef Directory to struct directoryMax Kellermann1-28/+33
The struct can be forward-declared by other headers, which relaxes the header dependencies.
2008-10-08update: merged exploreDirectory() into updateDirectory()Max Kellermann1-1/+1
exploreDirectory() duplicates some code in updateDirectory(). Merge both functions, and use directory_is_empty() to determine whether update or explore mode should be used.
2008-10-08directory: added directory_is_empty()Max Kellermann1-1/+1
directory_is_empty() is a tiny inline function which determine if a directory has any child objects (sub directories or songs).
2008-10-08directory: moved code to update.cMax Kellermann1-575/+17
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.
2008-10-07directory: fix return value in removeDeletedFromDirectoryEric Wong1-1/+1
oops :x
2008-10-07directory: serialize song deletes from playlist during updateEric Wong1-3/+28
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.
2008-10-07directory: use songvec_for_each for iteratorsEric Wong1-28/+30
Get rid of songvec_write so we can enforce proper locking