summaryrefslogtreecommitdiff
path: root/src/input/input_smb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/input_smb.c')
-rw-r--r--src/input/input_smb.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 7da9c1454..8bbbfdfe5 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -64,9 +64,10 @@ smb_plugin_get_capabilities (input_plugin_t *this_gen)
static off_t
-smb_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
+smb_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
{
smb_input_t *this = (smb_input_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n, num_bytes;
num_bytes = 0;
@@ -150,18 +151,6 @@ static uint32_t smb_plugin_get_blocksize (input_plugin_t *this_gen) {
return 0;
}
-static char
-*smb_class_get_description (input_class_t *this_gen)
-{
- return _("CIFS/SMB input plugin based on libsmbclient");
-}
-
-static const char
-*smb_class_get_identifier (input_class_t *this_gen)
-{
- return "smb";
-}
-
/*
* Sorting function, it comes from GNU fileutils package.
*/
@@ -256,8 +245,8 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
}
if ((dir = smbc_opendir(current_path_smb)) >= 0){
- xine_mrl_t *dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- xine_mrl_t *norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ xine_mrl_t *dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ xine_mrl_t *norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
int num_dir_files=0;
int num_norm_files=0;
while ((pdirent = smbc_readdir(dir)) != NULL){
@@ -456,14 +445,6 @@ smb_plugin_open (input_plugin_t *this_gen )
return 1;
}
-static void
-smb_class_dispose (input_class_t *this_gen)
-{
- smb_input_class_t *this = (smb_input_class_t *) this_gen;
-
- free (this);
-}
-
static input_plugin_t *
smb_class_get_instance (input_class_t *class_gen, xine_stream_t *stream,
const char *mrl)
@@ -518,11 +499,11 @@ static void
this->xine = xine;
this->input_class.get_instance = smb_class_get_instance;
- this->input_class.get_identifier = smb_class_get_identifier;
- this->input_class.get_description = smb_class_get_description;
+ this->input_class.identifier = "smb";
+ this->input_class.description = N_("CIFS/SMB input plugin based on libsmbclient");
this->input_class.get_dir = smb_class_get_dir;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = smb_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
_exit_error:
@@ -540,7 +521,7 @@ static const input_info_t input_info_smb = {
};
const plugin_info_t xine_plugin_info[] EXPORTED = {
- { PLUGIN_INPUT, 17, "smb", XINE_VERSION_CODE, &input_info_smb,
+ { PLUGIN_INPUT, 18, "smb", XINE_VERSION_CODE, &input_info_smb,
init_input_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};