Example #1
0
        public ZipStream(Stream dataStream, bool ownsStream)
        {
            // FIXME: Not necessarily true
            canRead  = true;
            canSeek  = true;
            canWrite = true;

            DataStream = dataStream;
            OwnsStream = ownsStream;

            ZlibFileFuncDef32 f32 = new ZlibFileFuncDef32();

            f32.opaque      = IntPtr.Zero;
            f32.zclose_file = CloseFile_Native;
            f32.zerror_file = TestError_Native;
            f32.zopen_file  = OpenFile_Native;
            f32.zread_file  = ReadFile_Native32;
            f32.zseek_file  = SeekFile_Native32;
            f32.ztell_file  = TellFile_Native32;
            f32.zwrite_file = WriteFile_Native32;
            IOFunctions32   = f32;

            ZlibFileFuncDef64 f64 = new ZlibFileFuncDef64();

            f64.opaque      = IntPtr.Zero;
            f64.zclose_file = CloseFile_Native;
            f64.zerror_file = TestError_Native;
            f64.zopen_file  = OpenFile_Native;
            f64.zread_file  = ReadFile_Native64;
            f64.zseek_file  = SeekFile_Native64;
            f64.ztell_file  = TellFile_Native64;
            f64.zwrite_file = WriteFile_Native64;
            IOFunctions64   = f64;
        }
Example #2
0
		public static ZipHandle OpenArchive32 (ZlibFileFuncDef32 funcDef, Append append)
		{
			ZipHandle h = zipOpen2_32 ("", (int) append, IntPtr.Zero, ref funcDef);
			if (h.IsInvalid)
				throw new Exception ("Could not open the zip archive");
			return h;
		}
Example #3
0
		public ZipStream (Stream dataStream, bool ownsStream)
		{
			// FIXME: Not necessarily true
			canRead = true;
			canSeek = true;
			canWrite = true;

			DataStream = dataStream;
			OwnsStream = ownsStream;
			
			ZlibFileFuncDef32 f32 = new ZlibFileFuncDef32 ();
			f32.opaque = IntPtr.Zero;
			f32.zclose_file = CloseFile_Native;
			f32.zerror_file = TestError_Native;
			f32.zopen_file = OpenFile_Native;
			f32.zread_file = ReadFile_Native32;
			f32.zseek_file = SeekFile_Native32;
			f32.ztell_file = TellFile_Native32;
			f32.zwrite_file = WriteFile_Native32;
			IOFunctions32 = f32;

			ZlibFileFuncDef64 f64 = new ZlibFileFuncDef64 ();
			f64.opaque = IntPtr.Zero;
			f64.zclose_file = CloseFile_Native;
			f64.zerror_file = TestError_Native;
			f64.zopen_file = OpenFile_Native;
			f64.zread_file = ReadFile_Native64;
			f64.zseek_file = SeekFile_Native64;
			f64.ztell_file = TellFile_Native64;
			f64.zwrite_file = WriteFile_Native64;
			IOFunctions64 = f64;
		}
Example #4
0
        public static ZipHandle OpenArchive32(ZlibFileFuncDef32 funcDef, Append append)
        {
            ZipHandle h = zipOpen2_32("", (int)append, IntPtr.Zero, ref funcDef);

            if (h.IsInvalid)
            {
                throw new Exception("Could not open the zip archive");
            }
            return(h);
        }
Example #5
0
        public static UnzipHandle OpenArchive32(ZlibFileFuncDef32 fileFuncs)
        {
            UnzipHandle handle = unzOpen2_32("", ref fileFuncs);

            if (handle.IsInvalid)
            {
                throw new Exception("Could not open unzip archive");
            }
            return(handle);
        }
Example #6
0
		static extern ZipHandle zipOpen2_32 (string pathname,
		                                     int append,
		                                     IntPtr globalcomment, // zipcharpc*
		                                     ref ZlibFileFuncDef32 pzlib_filefunc_def); // zlib_filefunc_def*
Example #7
0
 static extern ZipHandle zipOpen2_32(string pathname,
                                     int append,
                                     IntPtr globalcomment,                      // zipcharpc*
                                     ref ZlibFileFuncDef32 pzlib_filefunc_def); // zlib_filefunc_def*
Example #8
0
		static extern UnzipHandle unzOpen2_32 (string path,
		                                       ref ZlibFileFuncDef32 pzlib_filefunc_def);
Example #9
0
		public static UnzipHandle OpenArchive32 (ZlibFileFuncDef32 fileFuncs)
		{
			UnzipHandle handle = unzOpen2_32 ("", ref fileFuncs);
			if (handle.IsInvalid)
				throw new Exception ("Could not open unzip archive");
			return handle;
		}
Example #10
0
 static extern UnzipHandle unzOpen2_32(string path,
                                       ref ZlibFileFuncDef32 pzlib_filefunc_def);