[fix] option return values are different from property return values

Fix into "options: simplify somewhat by introducing a union for option values"
commands: remove fallback for M_PROPERTY_PARSE and M_PROPERTY_TO_STRING

These should never be overridden by property implementations anyway,
because it would likely result in inconsistencies. The right way to do
this is adding a new m_option type.

Also some cosmetics.
commands: cosmetic changes mostly to m_property.h

The Doxygen-style documentation commands were nothing but bloat.

Also move mp_property_do() and mp_property_print() to command.h, where
they should belong, and fix their argument types. m_property.c/h is
supposed to be generic, while command.h provides declarations specific
to the mplayer core.
oops
commands: don't replicate mapping to option in levels_property_helper

This should be done by mp_property_generic_option() only. Also reindent
levels_property_helper() to make it a little bit more readable.

Remove the m_option_get_ptr() function, which doesn't really make sense
anymore.
commands: cosmetics: reindent colormatrix property
commands: make some properties simpler
commands: don't let M_PROPERTY_SET clobber the caller's *arg

When the value *arg passed to M_PROPERTY_SET was invalid, *arg might
have been clamped to the valid value range. This is how it was intended,
but changing the caller's value in a set operation is rather unclean.

Fix this, and because it's convenient, also change the semantics of
M_PROPERTY_SET to always reject invalid values, rather than trying to
clamp them. Since the clamping functionality wasn't actually used,
because all values passed to M_PROPERTY_SET were already varified, this
doesn't have any downsides.
commands: make M_PROPERTY_GET_TYPE return an option copy

Change the type of the arg for this action from m_option** to m_option*.
This makes it easier to change some aspects of the option dynamically.
commands: remove M_PROPERTY_SWITCH from edition property

Instead, communicate the new value range with M_PROPERTY_GET_TYPE. Add
M_PROPERTY_GET_WRAP to allow properties to enable cycling instead of
stopping at min/max.
commands: make "aspect" property writeable, replaces "switch_ratio"

Move the code for "switch_ratio" to the M_PROPERTY_SET case of the
"aspect" property. The rules are exactly the same, e.g. setting a ratio
smaller than 0.1 sets the pixel aspect ratio to 1:1. For now, we define
that writing "0" sets the PAR to 1:1, and disallow -1 (possibly reserve
it to reset to default aspect ratio).
commands: replace "switch" with "add" and "cycle"

Now it depends on the command whether a property wraps around, or stops
at min/max valid property value.

For practically all properties, it's quite unambiguous what the "switch"
command should have done, and there's technically no need to replace it
with these new commands. More over, most properties that cycle are
boolean anyway. But it seems more orthogonal to make the difference
explicit, rather than hardcoding it. Having different commands also
makes it more explicit to the user what these commands do, both just due
to the naming, and what wrapping policy is used. The code is simpler
too.
input.conf: fix deprecated commands
input: verify input.conf on loading

When input.conf is loaded, verify each command and print a warning if
it's invalid or uses legacy commands. This is done for both the user's
and the embedded config files.

The diff is a bit noisy, because mp_input_parse_cmd() is changed to take
a bstr as argument instead of a char*.
commands: cosmetics
input: handle escapes always in command parser

Previously, both the command parser and property expansion
(m_properties_expand_string) handled escapes with '\'. Move all escape
handling into the command parser, and remove it from the property code.

This removes the need to escape strings twice for commands that use
property expansion.

The command parser is practically rewritten: it uses m_option for the
actual parsing, and reduces hackish C-string handling.
input: warn about non-existing commands, add explicit "ignore" command

If a command is not found, warn about it at loading time (just like
other command parsing errors are printed at loading time).

Add an explicit "ignore" command. input.conf tells user to use this
command to cancel out existing mapping. This clashed with the
warning added in this commit. Make "ignore" a real command and remove
the special casing for it from get_cmd_from_keys(). Now "ignore" is
ignored because it's not handled in command.c.
Fix MP_TARRAY_GROW macro

This macro is supposed to make sure an array has enough memory allocated
for a given number of elements. Unfortunately, a condition was inverted
(I... what???). It only allocated if there was still enough memory left,
or only one additional element had to be allocated.

Since this macro was only used by MP_TARRAY_APPEND, this case was never
actually triggered. It's still utter non-sense.
commands: change property expansion format string

This affects property format strings like they are used in the
"show_text" input command, for --playing-msg, and other places.

To quote the documentation comment on m_properties_expand_string():

    ${NAME} is expanded to the value of property NAME.
    If NAME starts with '=', use the raw value of the property.
    ${NAME:STR} expands to the property, or STR if the property is not
    available.
    ${?NAME:STR} expands to STR if the property is available.
    ${!NAME:STR} expands to STR if the property is not available.
    STR is recursively expanded using the same rules.
    "$$" can be used to escape "$", and "$}" to escape "}".

Most importantly, "?(property:str)" becomes "${?property:str}".

Make the simple fallback case easier, e.g. "${property:fallback}"
instead of "${property}?(!property:fallback)".

By default, properties which are unavailable or don't exist are turned
into a string signaling the status (e.g. "(unavailable)"), instead of
an empty string. If an empty string is desired, this has to be done
explicitly: "${property:}" (the fallback part is an empty string). Raw
properties still return an empty string on error.

Add the ability to escape the format meta characters. "$" is used for
escaping, because escaping with "\" is taken by the commands parser on
the layer below.

m_properties_expand_string() now returns a talloc'ed pointer, instead of
a malloc'ed one.
talloc: fix strndup group of functions

This bug has been fixed years ago in upstream talloc.