[Mono-dev] Understanding ZipSharp and Native(Un)Zip - any MonoPosixHelper gurus?

2014-10-30 Thread Maury Markowitz
I'm hoping someone familiar with MonoPosixHelper and/or WindowsBase will see 
this.

I am attempting to port System.IO.Package to iOS. I have made some progress, to 
the point where my somewhat stripped-down WindowsBase is compiling under 
Xamarin on the Mac, and I can run the Packaging functions to the point of 
decompressing the file.

Following through the code, this appears to ultimately fail on this:

   [DllImport (MonoPosixHelper, 
CallingConvention=CallingConvention.Cdecl)]
   static extern int unzOpenCurrentFile2 (UnzipHandle handle,
  out int method,
  out int level,
  int raw);

Looking over MonoPosixHelper, it *appears* this consists largely of Zlib. Zlib 
is already installed on Mac/iOS in /usr/lib. So, in theory, P/Invoke should 
work given a few tweaks to the DllImport.

However, I cannot find any function called unzOpenCurrentFile2 in 
MonoPosixHelper. I found some sort of mapping in WindowBase's IOFunctions.cs, 
but I'm not sure I understand it's purpose, nor if it is in any way related to 
this.

I can't shake the feeling that simply changing that DllImport is all I need, 
but I am too confused by the naming to be sure. Any pointers would be greatly 
appreciated!

p.s. My apologies if this double-posts, I got some sort of bounce message.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Understanding ZipSharp and Native(Un)Zip - any MonoPosixHelper gurus?

2014-10-30 Thread Alexander Köplinger
I'm not really familiar with MonoPosixHelper, but it looks like on mobile it 
uses the __Internal P/Invoke:
 
https://github.com/mono/mono/blob/f39bebefeaa15cdde051d428f6bdc7e3e80b2c10/mcs/class/System/System.IO.Compression/DeflateStream.cs#L480-L484
 
Maybe that helps.
-- Alex
 
 From: maury.markow...@gmail.com
 Date: Thu, 30 Oct 2014 10:05:50 -0400
 To: mono-devel-list@lists.ximian.com
 Subject: [Mono-dev] Understanding ZipSharp and Native(Un)Zip - any
 MonoPosixHelper gurus?
 
 I'm hoping someone familiar with MonoPosixHelper and/or WindowsBase will see 
 this.
 
 I am attempting to port System.IO.Package to iOS. I have made some progress, 
 to the point where my somewhat stripped-down WindowsBase is compiling under 
 Xamarin on the Mac, and I can run the Packaging functions to the point of 
 decompressing the file.
 
 Following through the code, this appears to ultimately fail on this:
 
[DllImport (MonoPosixHelper, 
 CallingConvention=CallingConvention.Cdecl)]
static extern int unzOpenCurrentFile2 (UnzipHandle handle,
   out int method,
   out int level,
   int raw);
 
 Looking over MonoPosixHelper, it *appears* this consists largely of Zlib. 
 Zlib is already installed on Mac/iOS in /usr/lib. So, in theory, P/Invoke 
 should work given a few tweaks to the DllImport.
 
 However, I cannot find any function called unzOpenCurrentFile2 in 
 MonoPosixHelper. I found some sort of mapping in WindowBase's IOFunctions.cs, 
 but I'm not sure I understand it's purpose, nor if it is in any way related 
 to this.
 
 I can't shake the feeling that simply changing that DllImport is all I need, 
 but I am too confused by the naming to be sure. Any pointers would be greatly 
 appreciated!
 
 p.s. My apologies if this double-posts, I got some sort of bounce message.
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
  ___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Understanding ZipSharp and Native(Un)Zip - any MonoPosixHelper gurus?

2014-10-30 Thread Maury Markowitz
 On Oct 30, 2014, at 10:18 AM, Alexander Köplinger 
 alex.koeplin...@outlook.com wrote:
 
 I'm not really familiar with MonoPosixHelper, but it looks like on mobile it 
 uses the __Internal P/Invoke:
  
 https://github.com/mono/mono/blob/f39bebefeaa15cdde051d428f6bdc7e3e80b2c10/mcs/class/System/System.IO.Compression/DeflateStream.cs#L480-L484
  
 Maybe that helps.

It may indeed. I only had the Win version so I did not see this code, so I'll 
go get the MONOTOUCH code and compare.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list