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.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 1b1f15565..44fa96bfd 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -15,9 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * $Id: input_smb.c,v 1.16 2007/01/26 17:06:05 dgp85 Exp $
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
@@ -25,10 +23,10 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/input_plugin.h>
#include <libsmbclient.h>
#include <sys/types.h>
@@ -66,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;
@@ -152,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.
*/
@@ -258,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){
@@ -458,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)
@@ -520,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:
@@ -542,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 }
};