Commit Graph

47 Commits

Author SHA1 Message Date
Denis Krjuchkov 01a45a53aa cmdline: bunch of fixes related to config file selection
- fix potential memory leak of system_path

  'Potential' because currently g_get_system_config_dirs()
  returns single entry on Windows, but that might change.

- remove incorrect g_free() call

  It's not required at all because
  g_get_system_config_dirs() returns GLib owned memory.

- remove extra semicolon
2013-01-03 19:45:51 +01:00
Max Kellermann 4eb57e1e9a Merge branch 'v0.16.x'
Conflicts:
	src/cmdline.c
	src/decoder/wildmidi_decoder_plugin.c
	src/gcc.h
	src/glib_compat.h
	src/input_stream.c
	src/output_list.c
	src/output_thread.c
	valgrind.suppressions
2012-06-12 23:22:03 +02:00
Max Kellermann ae70875f45 cmdline: consistent plugin listings 2012-06-12 22:29:04 +02:00
Max Kellermann eda7410f4c cmdline: dump list of input plugins 2012-06-12 22:24:42 +02:00
Max Kellermann 5b21742095 cmdline: dump list of playlist plugins 2012-06-12 22:16:13 +02:00
Max Kellermann d5b9be0393 cmdline: change --version formatting 2012-06-12 21:15:46 +02:00
Max Kellermann d2d9b45a81 decoder_list: add _for_each() macros 2012-06-12 21:15:46 +02:00
Max Kellermann 48da345e79 cmdline: don't initalise archive plugins for --version
Dump all archive plugins, even those that fail to initialise.
2012-06-12 20:52:04 +02:00
Max Kellermann 9604e0aad2 cmdline: update copyright year 2012-06-12 19:55:30 +02:00
Denis Krjuchkov 25d053cbf2 Work around incorrect g_file_test() behavior on Win32
g_file_test is redefined to be g_file_test_utf8 and thus can't handle
non-ASCII characters. This fix adds simple wrapper (taken from glib)
that fixes encoding and calls g_file_test_utf8. All required inclusions
of glib_compat.h are added as well.
2012-06-12 19:31:19 +02:00
Max Kellermann aa4f45b9a5 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-12-13 21:57:44 +01:00
Avuton Olrich f5d3859238 cmdline: Remove duplicate g_free()s 2011-12-12 09:20:00 +01:00
Max Kellermann c6cbcc2c25 copyright year 2011 2011-01-29 10:13:54 +01:00
Thomas Jansen 28bcb8bdf5 eliminate g_error() usage
Replaced all occurrences of g_error() with MPD_ERROR() located in a new header
file 'mpd_error.h'. This macro uses g_critical() to print the error message
and then exits gracefully in contrast to g_error() which would internally call
abort() to produce a core dump.

The macro name is distinctive and allows to find all places with dubious error
handling. The long-term goal is to get rid of MPD_ERROR() altogether. To
facilitate the eventual removal of this macro it was added in a new header
file rather than to an existing header file.

This fixes #2995 and #3007.
2010-09-25 15:00:43 +02:00
Avuton Olrich 894573657d cmdline: Add default config paths for win32. 2010-05-20 06:56:43 -07:00
Avuton Olrich 9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Viliam Mateicka d37b4bb199 cmdline: print out list of encoders in --version info 2009-11-17 20:39:26 +01: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 4624dfcb30 decoder_list: moved print_all_decoders() to cmdline.c
Export the decoder_plugins array.  The function
decoder_plugin_print_all_decoders() it is UI specific and should not
live in this backend library.
2009-11-07 15:46:45 +01:00
Max Kellermann 4390d72b14 configure.ac: require GLib 2.16
Accidently, MPD has been using several GLib 2.16 functions for a
while, and nobody noticed yet.  To simplify the code base, let's bump
the minimum GLib version for MPD to 2.16.  That version is old enough,
and it's reasonable to expect users to have it.
2009-10-13 16:12:43 +02:00
Max Kellermann 06d5d4b03e conf: handle fatal errors with GError
Don't call g_error(), which will abort the process and dump core.

This patch does not affect all the config_get_X() functions.  These
need some more refactoring.
2009-09-24 21:40:07 +02:00
Max Kellermann 1b227e0145 cmdline: handle fatal errors with GError
Don't call g_error(), which will abort the process and dump core.
2009-09-24 21:40:05 +02:00
Max Kellermann a86f9b8035 cmdline: removed options --create-db and --no-create-db
Both options are deprecated, and should not be used anymore.  Many
users get confused by their presence.
2009-09-20 23:31:35 +02:00
Max Kellermann 9322f04529 cmdline: obey $(sysconfdir) for default mpd.conf location
Instead of hard-coding the path "/etc/mpd.conf", use the configured
$(sysconfdir) path.  This can be set with:

 ./configure --sysconfdir=/etc

Note that this changes the default path to "/usr/local/etc/mpd.conf",
given the default prefix "/usr/local".  This is actually more correct
than the old default.
2009-07-28 16:17:18 +02:00
Eugeny N Dzhurinsky bdb1965b50 cmdline: renamed options.stderr to options.log_stderr
On FreeBSD, "stderr" is a macro, and using this name for a struct
member breaks the build.

[mk: renamed _stderr to log_stderr]
2009-07-22 13:40:19 +02:00
Max Kellermann 7261739526 cmdline: renamed option "--stdout" to "--stderr"
Since version 0.14, MPD has been logging to standard error instead of
standard output.  The option name should reflect that.  The old option
continues to work, we will remove it in a future MPD release.
2009-07-15 18:27:32 +02:00
Max Kellermann 62f9df98b4 cmdline: no CamelCase
Renamed type, variables and functions.
2009-07-15 18:22:49 +02:00
Viliam Mateicka 71cd24954a move printAllOutputPluginTypes to output_list.c 2009-03-21 09:45:42 +01: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
Avuton Olrich e7f034dcef cmdline: Print available protocols when --version is run. 2009-03-03 21:25:19 +01:00
Max Kellermann ae87abae59 use GLIB_CHECK_VERSION()
Use GLIB_CHECK_VERSION() instead of manually checking
GLIB_MAJOR_VERSION, ...
2009-03-01 00:37:22 +01:00
Max Kellermann 5ea8a0df3f decoder_list: print decoder list with suffixes
Print the list of suffixes supported by each decoder, instead of
prining a list of all suffixes of all decoders with duplicates.
2009-02-28 15:29:51 +01:00
Avuton Olrich 1b79449ef1 cmdline: Alphabetical help order like other GNU projects. 2009-02-25 15:34:57 -08:00
Avuton Olrich de07547426 cmdline: Add --no-config to explicitly set daemon default options. 2009-02-25 15:30:52 -08:00
Max Kellermann 0a0736fc4e log: added log_early_init() for early debug messages 2009-02-19 08:35:20 +01:00
Max Kellermann 4d472c265e conf: no CamelCase, part I
Renamed functions, types, variables.
2009-01-17 20:23:27 +01:00
Jérôme Quelin ae5517b0b3 allow ~/.mpd/mpd.conf as alternate config file
mpd uses some additional files to work, such as pid_file, state_file,
db_file, etc. when running mpd as non-root user, it is often that those
files end in ~/.mpd

in that case, we end up with 2 entries in a user's home, .mpdconf and
.mpd - which clutters homedirs.

this patch allows ~/.mpd/mpd.conf as an alternative to ~/.mpdconf,
allowing for a cleaner homedir
2009-01-14 14:31:55 +01:00
Max Kellermann e4a53df7db don't exit after --create-db
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-04 20:31:23 +01:00
Max Kellermann 65f037eb32 cmdline: exit after --version
Don't start the daemon when MPD is called with "--version".
2009-01-01 18:26:59 +01:00
Viliam Mateicka 4cc0caf1af print supported decoders in --version 2008-12-30 14:17:15 +01:00
Max Kellermann 95b3430f52 removed os_compat.h
Only include headers which are really needed.  os_compat.h aimed to
make MPD easily portable, but was never actually made portable.
2008-12-29 17:28:32 +01:00
Max Kellermann 8dc92ad284 log: deprecated "error_file" option
Removed the "error_file" option.  There is only one log file now.  If
a user wants to see only the errors, he should configure a log_level.
2008-12-28 19:48:52 +01:00
Viliam Mateicka b2fc0ee274 cmdline: fixed option_no_createdb usage 2008-12-27 20:16:32 +01:00
Max Kellermann 83fc948008 cmdline: use g_build_filename() for ~/.mpdconf
Build the path with g_build_filename().  Also use g_get_home_dir() and
g_file_test().
2008-12-27 19:46:43 +01:00
Max Kellermann f5ff00bba4 cmdline: use GLib's option parser
Eliminate duplicated code.  The GLib code is much more mature than
MPD's custom parser.
2008-12-27 19:36:03 +01:00
Max Kellermann 357712c8f3 cmdline: use gboolean instead of int
Prepare for the migration to the GLib option parser, which uses
gboolean for flags.
2008-12-27 19:35:30 +01:00
Max Kellermann 786bb8cc33 moved command line parser to cmdline.c 2008-12-27 19:03:33 +01:00