aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* database: require X_OK on parent directory, not R_OKMax Kellermann2011-07-181-1/+1
| | | | | For accessing the child of a directory, one needs X_OK on the directory.
* database, ...: remove EINTR checks after stdio callsMax Kellermann2010-07-251-4/+4
| | | | | | MPD doesn't have child processes anymore, and thus we're not expecting to receive SIGCHLD very often. Since hard disk access isn't interrupted by signals anyway, we don't need those excessive checks.
* database: remove outdated commentMax Kellermann2010-07-211-1/+0
|
* Update copyright notices.Avuton Olrich2009-12-311-1/+1
|
* include config.h in all sourcesMax Kellermann2009-11-121-1/+1
| | | | | | After we've been hit by Large File Support problems several times in the past week (which only occur on 32 bit platforms, which I don't have), this is yet another attempt to fix the issue.
* database: I/O error handling in db_save()Max Kellermann2009-11-071-1/+3
| | | | Check ferror() instead of the fprintf() return value.
* database: rescan after metadata_to_use changeMax Kellermann2009-11-041-0/+32
| | | | | | Store a list of supported tag items in the database. When loading a database which does not have a matching list, we must rescan in order to get the missing information.
* song_save: load one song at a timeMax Kellermann2009-11-011-1/+1
| | | | | Changed songvec_load() to song_load(). Added start and end markers for each song. Removed the "key" line, it's redundant.
* database: save database format versionMax Kellermann2009-11-011-1/+17
|
* database: use strcmp() instead of g_str_has_prefix()Max Kellermann2009-11-011-1/+1
|
* database: removed redundant music_root allocationMax Kellermann2009-11-011-2/+0
| | | | The "music_root" global variable is allocated by db_init().
* text_file: allocate line buffers dynamicallyMax Kellermann2009-11-011-19/+19
| | | | | | | Use a single GString buffer object in all functions loading the database. Enlarge it automatically for long lines. This eliminates the maximum line length for tag values. There is still an upper limit of 512 kB to prevent denial of service, but that's reasonable I guess.
* database: fixed NULL pointer dereference after charset changeMax Kellermann2009-06-301-4/+5
| | | | | | | When the filesystem_charset is changed in mpd.conf, MPD should discard the old database. In this error branch, MPD did not fill the GError object properly, and logged a warning message instead, which caused a segmentation fault.
* directory: added directory_lookup_song()Max Kellermann2009-04-011-25/+1
| | | | Moved code from db_get_song().
* directory: renamed directory_get_directory()Max Kellermann2009-04-011-1/+1
| | | | | Renamed directory_get_directory() to directory_lookup_directory(). Added API documentation.
* all: Update copyright header.Avuton Olrich2009-03-131-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.
* directory: directory_load() returns GErrorMax Kellermann2009-03-021-1/+5
| | | | Do error reporting with GLib's GError library in this library, too.
* database: db_load() returns GErrorMax Kellermann2009-03-021-15/+40
| | | | Do error reporting with GLib's GError library.
* database: no CamelCaseMax Kellermann2009-03-021-16/+15
| | | | Renamed a bunch of variables.
* directory: moved DIRECTORY_* string constantsMax Kellermann2009-02-271-0/+5
| | | | Moved some of them to to directory_save.c, and others to database.c.
* database: don't load database after charset was reconfiguredMax Kellermann2009-02-121-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.
* database: eliminate "goto" usageMax Kellermann2009-01-251-7/+8
| | | | http://xkcd.com/292/
* use g_free() instead of free()Max Kellermann2009-01-251-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.
* mapper: make the music_directory optionalMax Kellermann2009-01-181-5/+23
| | | | Without a music_directory, MPD is an excellent streaming client.
* database: pass database file name to db_init()Max Kellermann2009-01-181-32/+36
| | | | Don't include conf.h in database.c.
* conf: replaced getConfigParamValue() with config_get_string()Max Kellermann2009-01-171-2/+3
| | | | Don't return a writable pointer.
* conf: no CamelCase, part IMax Kellermann2009-01-171-1/+1
| | | | Renamed functions, types, variables.
* database: use stdboolMax Kellermann2009-01-041-21/+20
| | | | Make db_load(), db_save() and db_check() return bool instead of int.
* database: db_init() initializes library, does not updateMax Kellermann2009-01-041-8/+2
| | | | | For updating the database, directory_update_init() should be called explicitly.
* stats: added stats_update()Max Kellermann2009-01-041-4/+1
|
* don't exit after --create-dbMax Kellermann2009-01-041-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.
* database: use GLib instead of utils.hMax Kellermann2009-01-021-2/+3
|
* event_pipe: added pipe_event enum and callbacksMax Kellermann2009-01-011-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.
* event_pipe: renamed functions from main_notify_* to event_pipe_*Max Kellermann2009-01-011-1/+1
| | | | Continuing the previous patch.
* main_notify: renamed source to event_pipe.cMax Kellermann2009-01-011-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.
* database: use GLib loggingMax Kellermann2008-12-291-36/+38
|
* removed os_compat.hMax Kellermann2008-12-291-1/+6
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* utils: removed myFgets()Max Kellermann2008-12-281-3/+7
| | | | Replaced myFgets() with fgets() + g_strchomp().
* path: no CamelCaseMax Kellermann2008-11-051-2/+2
| | | | Rename variables and functions.
* utils: use g_str_has_prefix() instead of prefixcmp()Max Kellermann2008-10-281-2/+2
| | | | Remove duplicated code from MPD.
* path: replaced parent_path() with g_path_get_dirname()Max Kellermann2008-10-201-4/+7
| | | | Again, GLib's version is more robust than ours.
* update: make the job id unsignedMax Kellermann2008-10-091-1/+1
| | | | Since the return value cannot be -1 anymore, we can make it unsigned.
* update: job ID must be positiveMax Kellermann2008-10-091-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().
* update: don't export updateDirectory()Max Kellermann2008-10-091-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().
* database: renamed get_get_song() to db_get_song()Max Kellermann2008-10-091-2/+2
| | | | Search'n'replace typo..
* diretory: moved code to directory_save.c, directory_print.cMax Kellermann2008-10-091-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.
* database: removed local variable bufferSizeMax Kellermann2008-10-091-3/+2
| | | | Use sizeof(buffer) instead.
* database: simplify db_load()Max Kellermann2008-10-091-47/+42
| | | | Removed a superfluous closure.
* directory: path must not be NULLMax Kellermann2008-10-081-2/+2
| | | | | For the root directory, let's set path to an empty string. This saves a few checks.
* directory: eliminate CamelCaseMax Kellermann2008-10-081-10/+9
| | | | CamelCase is ugly, rename the functions.