zip.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * zip.h: Module (access+filter) to extract different archives, based on zlib
00003  *****************************************************************************
00004  * Copyright (C) 2009 the VideoLAN team
00005  * $Id: 6137a0e6aa06cfb1d97809322d79c99f47bf4bb7 $
00006  *
00007  * Authors: Jean-Philippe André <jpeg@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /** **************************************************************************
00025  * Common includes and shared headers
00026  *****************************************************************************/
00027 
00028 #ifndef ZIP_ACCESSDEMUX_H
00029 #define ZIP_ACCESSDEMUX_H
00030 
00031 #include <vlc_common.h>
00032 #include <vlc_url.h>
00033 #include <vlc_strings.h>
00034 #include <vlc_arrays.h>
00035 #include <vlc_plugin.h>
00036 #include <vlc_stream.h>
00037 #include "unzip.h"
00038 #include "ioapi.h"
00039 
00040 #include <assert.h>
00041 
00042 #define ZIP_FILENAME_LEN 512
00043 #define ZIP_BUFFER_LEN 32768
00044 #define ZIP_SEP      "!/"
00045 #define ZIP_SEP_LEN  2
00046 
00047 
00048 /** **************************************************************************
00049  * Module access points: stream_filter
00050  *****************************************************************************/
00051 int StreamOpen( vlc_object_t* );
00052 void StreamClose( vlc_object_t* );
00053 
00054 /** **************************************************************************
00055  * Module access points: access
00056  *****************************************************************************/
00057 int AccessOpen( vlc_object_t *p_this );
00058 void AccessClose( vlc_object_t *p_this );
00059 
00060 /** Common function */
00061 bool isAllowedChar( char c );
00062 
00063 /** **************************************************************************
00064  * zipIO function headers : how to use vlc_stream to read the zip
00065  * Note: static because the implementations differ
00066  *****************************************************************************/
00067 static void* ZCALLBACK ZipIO_Open( void* opaque, const char* filename, int m );
00068 static uLong ZCALLBACK ZipIO_Read( void*, void* stream, void* buf, uLong sz );
00069 static uLong ZCALLBACK ZipIO_Write( void*, void* stream, const void*, uLong );
00070 static long ZCALLBACK ZipIO_Tell( void*, void* stream );
00071 static long ZCALLBACK ZipIO_Seek( void*, void* stream, uLong offset, int ori );
00072 static int ZCALLBACK ZipIO_Close( void*, void* stream );
00073 static int ZCALLBACK ZipIO_Error( void*, void* stream );
00074 
00075 #endif /* ZIP_ACCESSDEMUX_H */

Generated on Tue May 25 08:04:53 2010 for VLC by  doxygen 1.5.6