]> git.sesse.net Git - vlc/blob - modules/access/zip/zip.h
Merge branch 'master' into lpcm_encoder
[vlc] / modules / access / zip / zip.h
1 /*****************************************************************************
2  * zip.h: Module (access+filter) to extract different archives, based on zlib
3  *****************************************************************************
4  * Copyright (C) 2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Philippe AndrĂ© <jpeg@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 /** **************************************************************************
25  * Common includes and shared headers
26  *****************************************************************************/
27
28 #ifndef ZIP_ACCESSDEMUX_H
29 #define ZIP_ACCESSDEMUX_H
30
31 #include <vlc_common.h>
32 #include <vlc_url.h>
33 #include <vlc_strings.h>
34 #include <vlc_arrays.h>
35 #include <vlc_plugin.h>
36 #include <vlc_stream.h>
37 #include "unzip.h"
38 #include "ioapi.h"
39
40 #include <assert.h>
41
42 #define ZIP_FILENAME_LEN 512
43 #define ZIP_BUFFER_LEN 32768
44 #define ZIP_SEP      "!/"
45 #define ZIP_SEP_LEN  2
46
47
48 /** **************************************************************************
49  * Module access points: stream_filter
50  *****************************************************************************/
51 int StreamOpen( vlc_object_t* );
52 void StreamClose( vlc_object_t* );
53
54 /** **************************************************************************
55  * Module access points: access
56  *****************************************************************************/
57 int AccessOpen( vlc_object_t *p_this );
58 void AccessClose( vlc_object_t *p_this );
59
60 /** Common function */
61 bool isAllowedChar( char c );
62
63 /** **************************************************************************
64  * zipIO function headers : how to use vlc_stream to read the zip
65  * Note: static because the implementations differ
66  *****************************************************************************/
67 static void* ZCALLBACK ZipIO_Open( void* opaque, const char* filename, int m );
68 static uLong ZCALLBACK ZipIO_Read( void*, void* stream, void* buf, uLong sz );
69 static uLong ZCALLBACK ZipIO_Write( void*, void* stream, const void*, uLong );
70 static long ZCALLBACK ZipIO_Tell( void*, void* stream );
71 static long ZCALLBACK ZipIO_Seek( void*, void* stream, uLong offset, int ori );
72 static int ZCALLBACK ZipIO_Close( void*, void* stream );
73 static int ZCALLBACK ZipIO_Error( void*, void* stream );
74
75 #endif /* ZIP_ACCESSDEMUX_H */