]> git.sesse.net Git - vlc/blob - modules/access/zip/zip.h
Zip: don't use hacks but rewrite the path.
[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/vlc.h>
32 #include <vlc_common.h>
33 #include <vlc_url.h>
34 #include <vlc_strings.h>
35 #include <vlc_arrays.h>
36 #include <vlc_plugin.h>
37 #include <vlc_stream.h>
38 #include "unzip.h"
39 #include "ioapi.h"
40
41 #include <assert.h>
42
43 #define ZIP_FILENAME_LEN 512
44 #define ZIP_BUFFER_LEN 32768
45 #define ZIP_SEP      "|"
46 #define ZIP_SEP_CHAR '|'
47
48
49 /** **************************************************************************
50  * Module access points: stream_filter
51  *****************************************************************************/
52 int StreamOpen( vlc_object_t* );
53 void StreamClose( vlc_object_t* );
54
55 /** **************************************************************************
56  * Module access points: access
57  *****************************************************************************/
58 int AccessOpen( vlc_object_t *p_this );
59 void AccessClose( vlc_object_t *p_this );
60
61 /** **************************************************************************
62  * zipIO function headers : how to use vlc_stream to read the zip
63  * Note: static because the implementations differ
64  *****************************************************************************/
65 static void* ZCALLBACK ZipIO_Open( void* opaque, const char* filename, int m );
66 static uLong ZCALLBACK ZipIO_Read( void*, void* stream, void* buf, uLong sz );
67 static uLong ZCALLBACK ZipIO_Write( void*, void* stream, const void*, uLong );
68 static long ZCALLBACK ZipIO_Tell( void*, void* stream );
69 static long ZCALLBACK ZipIO_Seek( void*, void* stream, uLong offset, int ori );
70 static int ZCALLBACK ZipIO_Close( void*, void* stream );
71 static int ZCALLBACK ZipIO_Error( void*, void* stream );
72
73 #endif /* ZIP_ACCESSDEMUX_H */