Commit Graph

33 Commits

Author SHA1 Message Date
Avuton Olrich 9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Max Kellermann 5b82ffc291 include config.h in all sources
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-12 09:17:03 +01:00
Max Kellermann b722d3d7f3 configure.ac: require GLib 2.12
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-11-10 21:14:22 +01:00
Max Kellermann a9dc0e816c state_file: use g_timeout_add_seconds() 2009-10-13 16:12:44 +02:00
Max Kellermann ecb118f1ed state_file: save only if something has changed
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-08 15:22:39 +02:00
Max Kellermann 1e663b1869 output_state: no CamelCase 2009-10-06 10:30:10 +02:00
Max Kellermann f7cc5b2efd state_file: don't rewind the stream while reading the state file
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-15 16:57:37 +02:00
Max Kellermann df7d7732c6 state_file: simplified state_file_finish()
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-15 14:32:29 +02:00
Max Kellermann 889b1c1eae state_file: fixed debug messages
Print "Loading" instead of "Saving" in state_file_read().  Added debug
message to state_file_write().
2009-07-15 14:29:30 +02:00
Max Kellermann 5a886da93b playlist: removed {save,read}PlaylistState()
Those were only wrappers for playlist_state_{save,restore}().  Since
sf_callbacks has been removed, we can call the latter functions
directly.
2009-07-14 21:28:26 +02:00
Max Kellermann 9206f54979 state_file: eliminated the sf_callbacks array
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-07-14 21:15:12 +02:00
Avuton Olrich 0aee49bdf8 all: Update copyright header.
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-13 11:51:55 -07:00
Max Kellermann 49ff2aceb5 audio: moved state file code to output_state.c 2009-02-10 18:51:39 +01:00
Max Kellermann 0dd2dfff9d main: moved the save_state timer to state_file.c
The state_file library should manage its own regular saves.
2009-01-18 18:10:15 +01:00
Max Kellermann 84de45afba state_file: added state_file_init() and state_file_finish()
The constructor/destructor interface should hide the functions
read_state_file() and write_state_file().
2009-01-18 18:09:50 +01:00
Max Kellermann 1482b22351 state_file: include cleanup 2009-01-18 17:54:50 +01:00
Max Kellermann 4d472c265e conf: no CamelCase, part I
Renamed functions, types, variables.
2009-01-17 20:23:27 +01:00
Max Kellermann 63e240131e state_file: use GLib instead of utils.h / stat() 2009-01-03 14:53:29 +01:00
Max Kellermann dcff29e5aa state_file: errors are non-fatal in read_state_file()
If the state file cannot be read, for whatever reason, don't abort
MPD.  The state file isn't _that_ important.
2009-01-03 14:53:23 +01:00
Max Kellermann 409ee38b42 state_file: use GLib logging 2008-12-29 17:29:23 +01:00
Thomas Jansen e6ae40982e replaced mpd_noreturn by G_GNUC_NORETURN
We want to remove gcc.h eventually. This takes care of all the
G_GNUC_NORETURN macros.
2008-12-02 02:42:19 +01:00
Thomas Jansen 2720585731 replaced mpd_likely/mpd_unlikely by G_LIKELY/G_UNLIKELY
We want to remove gcc.h eventually. This takes care of all the
G_LIKELY/G_UNLIKELY macros.
2008-12-02 02:22:43 +01:00
Max Kellermann 71351160b1 don't include os_compat.h
When there are standardized headers, use these instead of the bloated
os_compat.h.
2008-10-08 10:49:29 +02:00
Eric Wong 260e1a9037 Remove EINTR checking for open(2)
open(2) should only interrupt on "slow" devices, afaik...

[mk: still using fopen()]
2008-09-23 22:38:36 +02:00
Max Kellermann 1d97bbbdd9 unsigned counters
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-03-26 10:38:48 +00:00
Eric Wong cb8f1af3bd Cleanup #includes of standard system headers and put them in one place
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
2008-01-03 07:29:49 +00:00
Eric Wong 0f2e9ee662 export FATAL() with noreturn attribute
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
2007-08-27 08:05:55 +00:00
J. Alexander Treuman 93e68adc79 After changing ERROR();exit() to FATAL(), gcc incorrectly detects some
uninitialized variables and non-returning functions that return.  Let's
tell it to stfu.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:20:53 +00:00
J. Alexander Treuman bba444524e Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a single
call to FATAL().

git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:15:54 +00:00
Avuton Olrich a061da8fb5 The massive copyright update
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05 03:22:33 +00:00
Eric Wong b443363aa6 Don't initialize globals to zero (or NULL)
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
2007-01-14 03:07:53 +00:00
Eric Wong 44f9e16922 software volume can now be saved and read from the state file
git-svn-id: https://svn.musicpd.org/mpd/trunk@4495 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30 23:32:54 +00:00
Eric Wong 12aec5738b Standardize state_file handling routines.
This way it's easier to manage and extend.

git-svn-id: https://svn.musicpd.org/mpd/trunk@4494 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30 23:32:47 +00:00