aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* directory: always maintain sorted properties vectorsEric Wong2008-10-121-4/+0
| | | | | | | | | This allows clients to see sorted results while we're updating the DB and removes the need for us to have to sort manually. We'll have to write separate routines for managing stored playlists with songvecs eventually; but that's for another day.
* directory: make music_root global and avoid runtime initializationEric Wong2008-10-121-22/+6
| | | | | | | | | | mpd can't function without music_root; so don't bother allocating it on the heap nor checking to see if it's initialized. Don't allow directory_new() to create a directory w/o a parent or with an empty path, either: root is root and there can be only one</highlander>.
* directory: don't use identical struct and variable namesEric Wong2008-10-111-10/+9
| | | | | | Duplicated tokens in close proximity takes too long for my head to parse; and "dir" is an easy and common abbreviation for "directory".
* update: job ID must be positiveMax Kellermann2008-10-111-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-111-1/+9
| | | | | | | | 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().
* diretory: moved code to directory_save.c, directory_print.cMax Kellermann2008-10-111-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-111-3/+2
| | | | Use sizeof(buffer) instead.
* database: simplify db_load()Max Kellermann2008-10-111-47/+42
| | | | Removed a superfluous closure.
* directory: path must not be NULLMax Kellermann2008-10-111-2/+2
| | | | | For the root directory, let's set path to an empty string. This saves a few checks.
* directory: eliminate CamelCaseMax Kellermann2008-10-111-9/+9
| | | | | | | | CamelCase is ugly, rename the functions. [ew: "directory_get_directory" was too confusing, using "directory_get_subdir" instead (old function was named "getSubDirectory")]
* database: renamed functions, "db_" prefix and no CamelCaseMax Kellermann2008-10-111-17/+17
| | | | Yet another CamelCase removal patch.
* database: removed printDirectoryInfo()Max Kellermann2008-10-111-9/+0
| | | | The same can be achieved with directory_print(db_get_directory()).
* directory: moved code to database.cMax Kellermann2008-10-111-0/+321
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.