InputPlugin: allow init() to soft-fail

Add enum InputResult which is a tri-state.  Input plugins may now fail
and just become unavailable.
This commit is contained in:
Max Kellermann
2014-03-02 00:17:32 +01:00
parent 7453c26ec4
commit 2bf2f34b12
6 changed files with 65 additions and 16 deletions

View File

@@ -91,17 +91,17 @@ public:
*
*/
static bool
static InputPlugin::InitResult
input_smbclient_init(gcc_unused const config_param &param, Error &error)
{
if (!SmbclientInit(error))
return false;
return InputPlugin::InitResult::UNAVAILABLE;
// TODO: create one global SMBCCTX here?
// TODO: evaluate config_param, call smbc_setOption*()
return true;
return InputPlugin::InitResult::SUCCESS;
}
static InputStream *