1 /*****************************************************************************
2 * zip.h: Module (access+filter) to extract different archives, based on zlib
3 *****************************************************************************
4 * Copyright (C) 2009 the VideoLAN team
7 * Authors: Jean-Philippe André <jpeg@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /** **************************************************************************
25 * Common includes and shared headers
26 *****************************************************************************/
28 #ifndef ZIP_ACCESSDEMUX_H
29 #define ZIP_ACCESSDEMUX_H
32 #include <vlc_common.h>
34 #include <vlc_strings.h>
35 #include <vlc_arrays.h>
36 #include <vlc_plugin.h>
37 #include <vlc_stream.h>
43 #define ZIP_FILENAME_LEN 512
44 #define ZIP_BUFFER_LEN 32768
46 #define ZIP_SEP_CHAR '|'
49 /** **************************************************************************
50 * Module access points: stream_filter
51 *****************************************************************************/
52 int StreamOpen( vlc_object_t* );
53 void StreamClose( vlc_object_t* );
55 /** **************************************************************************
56 * Module access points: access
57 *****************************************************************************/
58 int AccessOpen( vlc_object_t *p_this );
59 void AccessClose( vlc_object_t *p_this );
61 /** Common function */
62 bool isAllowedChar( char c );
64 /** **************************************************************************
65 * zipIO function headers : how to use vlc_stream to read the zip
66 * Note: static because the implementations differ
67 *****************************************************************************/
68 static void* ZCALLBACK ZipIO_Open( void* opaque, const char* filename, int m );
69 static uLong ZCALLBACK ZipIO_Read( void*, void* stream, void* buf, uLong sz );
70 static uLong ZCALLBACK ZipIO_Write( void*, void* stream, const void*, uLong );
71 static long ZCALLBACK ZipIO_Tell( void*, void* stream );
72 static long ZCALLBACK ZipIO_Seek( void*, void* stream, uLong offset, int ori );
73 static int ZCALLBACK ZipIO_Close( void*, void* stream );
74 static int ZCALLBACK ZipIO_Error( void*, void* stream );
76 #endif /* ZIP_ACCESSDEMUX_H */