aboutsummaryrefslogtreecommitdiffstats
path: root/src/StateFile.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-10-02Log: new logging library APIMax Kellermann1-13/+14
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
2013-10-02Listen, ...: add missing includesMax Kellermann1-1/+2
2013-08-07ConfigPath: return a Path objectMax Kellermann1-3/+4
Migrate all callers to use Path directly, instead of doing the conversion in each caller.
2013-04-08event/TimeoutMonitor: eliminate support for periodic eventsMax Kellermann1-2/+1
No caller needs this. Fixes use-after-free after returning from Client::OnTimeout().
2013-04-08StateFile: schedule timer only after a changeMax Kellermann1-15/+6
Save the state file 2 minutes after the last change. This reduces the disruptions by an idle MPD, and MPD can be paged out permanently until it is used.
2013-04-08StateFile: move code to RememberVersions(), IsModified()Max Kellermann1-12/+21
2013-02-02StateFile: use file system API, log in UTF-8Denis Krjuchkov1-7/+9
2013-01-18Path: new class "Path" wraps filesystem path stringsMax Kellermann1-3/+3
2013-01-14event/TimeoutMonitor: wrapper for g_timeout_source_new()Max Kellermann1-13/+5
2013-01-14StateFile: convert to a classMax Kellermann1-64/+34
2013-01-14Main, IOThread: move GMainLoop setup code to class EventLoopMax Kellermann1-3/+5
2013-01-07volume: convert to C++Max Kellermann1-4/+1
2013-01-05Partition: new class, container for Playlist and PlayerControlMax Kellermann1-15/+19
This is the beginning of multi-player support. There will be support for multiple Partition objects in one MPD process.
2013-01-04playlist: convert to C++Max Kellermann1-1/+1
2013-01-03TextFile: convert to a classMax Kellermann1-12/+4
2013-01-03text_file: convert to C++Max Kellermann1-1/+1
2013-01-02db_save, state_file: convert to C++Max Kellermann1-5/+8
2012-07-10require GLib 2.16Max Kellermann1-1/+0
GLib 2.16 was released more than 4 years ago. Let's remove some cruft from the glib_compat.h header, and avoid new cruft to it.
2012-03-06use g_strerror() instead of strerror()Max Kellermann1-2/+2
Make sure we get a UTF-8 encoded string.
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-14/+17
Allocate a player_control object where needed, and pass it around. Each "client" object is associated with a "player_control" instance. This prepares multi-player support.
2010-07-25state_file: use the text_file libraryMax Kellermann1-5/+8
Don't use a large stack buffer.
2010-07-25database, ...: remove EINTR checks after stdio callsMax Kellermann1-2/+2
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.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-11-12include config.h in all sourcesMax Kellermann1-0/+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.
2009-11-10configure.ac: require GLib 2.12Max Kellermann1-0/+1
Drop the required GLib version from 2.16 to 2.12, because many current systems still don't have GLib 2.16. This requires several new compatibility functions in glib_compat.h.
2009-10-13state_file: use g_timeout_add_seconds()Max Kellermann1-2/+3
2009-10-08state_file: save only if something has changedMax Kellermann1-0/+22
If nothing has changed since the last save, don't save the state file. Saving will spin up the hard drive, which is undesirable on hosts where MPD is idling in background.
2009-10-06output_state: no CamelCaseMax Kellermann1-2/+2
2009-07-15state_file: don't rewind the stream while reading the state fileMax Kellermann1-5/+11
Parse the state file line by line, let each subsystem probe a line. Only the playlist_state code gets the FILE pointer to read the following lines.
2009-07-15state_file: simplified state_file_finish()Max Kellermann1-4/+6
Return early from the destructor function when there is no configured state file. Don't check the timer, don't call g_free(NULL).
2009-07-15state_file: fixed debug messagesMax Kellermann1-1/+3
Print "Loading" instead of "Saving" in state_file_read(). Added debug message to state_file_write().
2009-07-14playlist: removed {save,read}PlaylistState()Max Kellermann1-2/+3
Those were only wrappers for playlist_state_{save,restore}(). Since sf_callbacks has been removed, we can call the latter functions directly.
2009-07-14state_file: eliminated the sf_callbacks arrayMax Kellermann1-17/+9
There are very few callbacks, and they are not meant to be pluggable. Let's eliminate the array and call the load/save functions manually.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+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-02-10audio: moved state file code to output_state.cMax Kellermann1-1/+1
2009-01-18main: moved the save_state timer to state_file.cMax Kellermann1-2/+26
The state_file library should manage its own regular saves.
2009-01-18state_file: added state_file_init() and state_file_finish()Max Kellermann1-21/+31
The constructor/destructor interface should hide the functions read_state_file() and write_state_file().
2009-01-18state_file: include cleanupMax Kellermann1-1/+0
2009-01-17conf: no CamelCase, part IMax Kellermann1-1/+1
Renamed functions, types, variables.
2009-01-03state_file: use GLib instead of utils.h / stat()Max Kellermann1-3/+3
2009-01-03state_file: errors are non-fatal in read_state_file()Max Kellermann1-16/+3
If the state file cannot be read, for whatever reason, don't abort MPD. The state file isn't _that_ important.
2008-12-29state_file: use GLib loggingMax Kellermann1-8/+10
2008-12-02replaced mpd_noreturn by G_GNUC_NORETURNThomas Jansen1-1/+1
We want to remove gcc.h eventually. This takes care of all the G_GNUC_NORETURN macros.
2008-12-02replaced mpd_likely/mpd_unlikely by G_LIKELY/G_UNLIKELYThomas Jansen1-3/+3
We want to remove gcc.h eventually. This takes care of all the G_LIKELY/G_UNLIKELY macros.
2008-10-08don't include os_compat.hMax Kellermann1-1/+3
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-09-23Remove EINTR checking for open(2)Eric Wong1-2/+1
open(2) should only interrupt on "slow" devices, afaik... [mk: still using fopen()]
2008-03-26unsigned countersMax Kellermann1-2/+2
Use unsigned variables for storing the count of items or for iteration variables. Since there can never be a negative number of items, it makes sense to use an unsigned data type here. This change is safe because the unsigned values are only used for adddressing array items. git-svn-id: https://svn.musicpd.org/mpd/trunk@7214 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-6/+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-08-27export FATAL() with noreturn attributeEric Wong1-1/+0
This attribute was set in log.c, but not exported to other modules in log.h This allows us to remove some unneccessary variable initializations that were added in r6277. I did audioOutput_shout.c a bit differently, to avoid some jumps. before: $ size src/mpd text data bss dec hex filename 225546 4040 14600 244186 3b9da src/mpd after: $ size src/mpd text data bss dec hex filename 224698 4040 14600 243338 3b68a src/mpd git-svn-id: https://svn.musicpd.org/mpd/trunk@6821 09075e82-0dd4-0310-85a5-a0d7c8717e4f