input/smbclient: move code to lib/smbclient/Init.cxx

This commit is contained in:
Max Kellermann
2014-01-25 23:29:42 +01:00
parent 9b1fbdbca6
commit 86ca5b3f16
4 changed files with 87 additions and 19 deletions

View File

@@ -19,6 +19,7 @@
#include "config.h"
#include "SmbclientInputPlugin.hxx"
#include "lib/smbclient/Init.hxx"
#include "../InputStream.hxx"
#include "../InputPlugin.hxx"
#include "util/StringUtil.hxx"
@@ -26,8 +27,6 @@
#include <libsmbclient.h>
#include <string.h>
class SmbclientInputStream {
InputStream base;
@@ -80,19 +79,6 @@ public:
}
};
static void
mpd_smbc_get_auth_data(gcc_unused const char *srv,
gcc_unused const char *shr,
char *wg, gcc_unused int wglen,
char *un, gcc_unused int unlen,
char *pw, gcc_unused int pwlen)
{
// TODO: implement
strcpy(wg, "WORKGROUP");
strcpy(un, "foo");
strcpy(pw, "bar");
}
/*
* InputPlugin methods
*
@@ -101,11 +87,8 @@ mpd_smbc_get_auth_data(gcc_unused const char *srv,
static bool
input_smbclient_init(gcc_unused const config_param &param, Error &error)
{
constexpr int debug = 0;
if (smbc_init(mpd_smbc_get_auth_data, debug) < 0) {
error.SetErrno("smbc_init() failed");
if (!SmbclientInit(error))
return false;
}
// TODO: create one global SMBCCTX here?