Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/cmsmvs/unzmvsc.job  view on Meta::CPAN

//*
//* LE COMPILE FOR UNZIP541.
//* ALL STEPS SHOULD GET COND CODE 0 EXCEPT FOR PLINK.PLKED WHICH GETS 4.
//*
//CBC    JCLLIB ORDER=CBC.SCBCPRC
//UNZIP EXEC EDCC,COND=(0,NE),CREGSIZ='0M',
//    INFILE='USERID.UNZIP.C(UNZIP)',
//    OUTFILE='USERID.UNZIP.OBJ(UNZIP),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=USERID.UNZIP.H,DISP=SHR
//CRC32 EXEC EDCC,COND=(0,NE),CREGSIZ='0M',
//    INFILE='USERID.UNZIP.C(CRC32)',
//    OUTFILE='USERID.UNZIP.OBJ(CRC32),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',

unzip-6.0/windll/csharp/Unzip.cs  view on Meta::CPAN

    private RestoreTimeStampsEnum m_RestoreTimeStamps;
    private UTF8NameTranslationEnum m_UTF8NameTranslation;
    private PrivilegeEnum m_Privilege;


    #endregion

    #region Structures

    // Callback Large String
    protected struct UNZIPCBChar
    {
      [MarshalAs( UnmanagedType.ByValArray, SizeConst= 32000, ArraySubType = UnmanagedType.U1)]
      public byte [] ch;
    }

    // Callback Small String (size of a filename buffer)
    protected struct UNZIPCBCh
    {
      [MarshalAs( UnmanagedType.ByValArray, SizeConst= 260, ArraySubType = UnmanagedType.U1)]
      public byte [] ch;
    }

    //UNZIP32.DLL DCLIST Structure
    [ StructLayout( LayoutKind.Sequential )]
    protected struct DCLIST
    {
      public uint StructVersID;       // struct version id (= UZ_DCL_STRUCTVER)

unzip-6.0/windll/csharp/Unzip.cs  view on Meta::CPAN


    //Callback For UNZIP32.DLL - DLL Service Function
    protected delegate int UZDLLServiceCallback([MarshalAs(UnmanagedType.LPStr)]String fname,
                                                ulong ucsize);

    //Callback For UNZIP32.DLL - DLL Service Function (no-Int64 variant, not used here)
    protected delegate int UZDLLServiceCBck_32([MarshalAs(UnmanagedType.LPStr)]String fname,
                                               uint ucsize_lo, uint ucsize_hi);

    //Callback For UNZIP32.DLL - Password Function
    protected delegate int UZDLLPasswordCallback(ref UNZIPCBCh pwd, int bufsize,
                                                 [MarshalAs(UnmanagedType.LPStr)]String msg,
                                                 [MarshalAs(UnmanagedType.LPStr)]String entryname);

    //Callback For UNZIP32.DLL - Replace Function To Overwrite Files
    protected delegate int UZDLLReplaceCallback(ref UNZIPCBCh fname, uint fnbufsiz);

    #endregion

    #region Events

    public event UnZipDLLPrintMessageEventHandler ReceivePrintMessage;
    public event UnZipDLLServiceMessageEventHandler ReceiveServiceMessage;

    #endregion

unzip-6.0/windll/csharp/Unzip.cs  view on Meta::CPAN

                               ulong ucsize)
    {
      //Raise this event
      UnZipDLLServiceMessageEventArgs e =
          new UnZipDLLServiceMessageEventArgs(m_ZipFileSize, fname, unchecked(ucsize));
      OnReceiveServiceMessage (e);

      return m_Stop;
    }

    protected int UZDLLPassword(ref UNZIPCBCh pwd, int bufsize,
                        [MarshalAs(UnmanagedType.LPStr)]String msg,
                        [MarshalAs(UnmanagedType.LPStr)]String entryname)
    {
      if (m_Password == null | m_Password == string.Empty) return -1;

      if (m_Password.Length >= bufsize)
      {
        MessageBox.Show("Length of supplied password exceeds available pw buffer size "
                    + bufsize.ToString() + "!", "Password Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);

unzip-6.0/windll/csharp/Unzip.cs  view on Meta::CPAN


      //clear the byte array
      for (int i = 0; i < bufsize; i ++)
        pwd.ch[i] = 0;

      m_EncodingANSI.GetBytes(m_Password, 0, m_Password.Length, pwd.ch, 0);

      return 0;
    }

    protected int UZDLLReplace(ref UNZIPCBCh fname, uint fnbufsiz)
    {
      ReplaceFileOptionsEnum ReplaceFileOption = ReplaceFileOptionsEnum.ReplaceNo; //Default
      string s = string.Empty;
      int i = 0;

      if (fnbufsiz > fname.ch.Length) fnbufsiz = (uint)fname.ch.Length;
      for (i = 0; i < fnbufsiz; i++)
        if (fname.ch[i] == 0) break;
      s = m_EncodingANSI.GetString(fname.ch, 0, i);

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN


'Current structure version ID of the DCLIST structure layout
Private Const cUz_DCLStructVer As Long = &H600

'-- C Style argv
Private Type UNZIPnames
  uzFiles(0 To 99) As String
End Type

'-- Callback Large "String"
Private Type UNZIPCBChar
  ch(32800) As Byte
End Type

'-- Callback Small "String"
Private Type UNZIPCBCh
  ch(256) As Byte
End Type

'-- UNZIP32.DLL DCL Structure
Private Type DCLIST
  StructVersID      As Long    ' Currently version &H600 of this structure
  ExtractOnlyNewer  As Long    ' 1 = Extract Only Newer/New, Else 0
  SpaceToUnderscore As Long    ' 1 = Convert Space To Underscore, Else 0
  PromptToOverwrite As Long    ' 1 = Prompt To Overwrite Required, Else 0
  fQuiet            As Long    ' 2 = No Messages, 1 = Less, 0 = All

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN

    ByVal ucsize_hi As Long, _
    ByVal csiz_lo As Long, _
    ByVal csiz_hi As Long, _
    ByVal cfactor As Integer, _
    ByVal mo As Integer, _
    ByVal dy As Integer, _
    ByVal yr As Integer, _
    ByVal hh As Integer, _
    ByVal mm As Integer, _
    ByVal c As Byte, _
    ByRef fname As UNZIPCBCh, _
    ByRef meth As UNZIPCBCh, _
    ByVal crc As Long, _
    ByVal fCrypt As Byte)

  Dim s0     As String
  Dim xx     As Long
  Dim cCh    As Byte
  Dim strout As String * 80
  Dim ucsize As Double
  Dim csiz   As Double

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN

  '     s0 = s0 & Chr$(meth.ch(xx))
  ' Next xx

  '-- Do Not Modify Below!!!
  uZipMessage = uZipMessage & strout & vbNewLine
  uZipNumber = uZipNumber + 1

End Sub

'-- Callback For UNZIP32.DLL - Print Message Function
Public Function UZDLLPrnt(ByRef fname As UNZIPCBChar, ByVal x As Long) As Long

  Dim s0 As String
  Dim xx As Long
  Dim cCh As Byte

  '-- Always implement a runtime error handler in Callback Routines!
  On Error Resume Next

  s0 = ""

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN

  Next

  '-- Assign Zip Information
  uZipInfo = uZipInfo & s0

  UZDLLPrnt = 0

End Function

'-- Callback For UNZIP32.DLL - DLL Service Function
Public Function UZDLLServ_I32(ByRef mname As UNZIPCBChar, _
         ByVal lUcSiz_Lo As Long, ByVal lUcSiz_Hi As Long) As Long

  Dim UcSiz As Double
  Dim s0 As String
  Dim xx As Long

  '-- Always implement a runtime error handler in Callback Routines!
  On Error Resume Next

  ' Parameters lUcSiz_Lo and lUcSiz_Hi contain the uncompressed size

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN

  Next
  ' At this point, s0 contains the message passed from the DLL
  ' (like the current file being extracted)
  ' It is up to the developer to code something useful here :)

  UZDLLServ_I32 = 0 ' Setting this to 1 will abort the zip!

End Function

'-- Callback For UNZIP32.DLL - Password Function
Public Function UZDLLPass(ByRef pwbuf As UNZIPCBCh, _
  ByVal bufsiz As Long, ByRef promptmsg As UNZIPCBCh, _
  ByRef entryname As UNZIPCBCh) As Long

  Dim prompt     As String
  Dim xx         As Long
  Dim szpassword As String

  '-- Always implement a runtime error handler in Callback Routines!
  On Error Resume Next

  UZDLLPass = -1  'IZ_PW_CANCEL

unzip-6.0/windll/vb/vbunzip.bas  view on Meta::CPAN


  pwbuf.ch(xx) = 0 ' Put Null Terminator For C

  UZDLLPass = 0   ' IZ_PW_ENTERED

End Function

'-- Callback For UNZIP32.DLL - Report Function To Overwrite Files.
'-- This Function Will Display A MsgBox Asking The User
'-- If They Would Like To Overwrite The Files.
Public Function UZDLLReplacePrmt(ByRef fname As UNZIPCBChar, _
                                 ByVal fnbufsiz As Long) As Long

  Dim s0 As String
  Dim xx As Long
  Dim cCh As Byte
  Dim bufmax As Long

  '-- Always implement a runtime error handler in Callback Routines!
  On Error Resume Next



( run in 0.379 second using v1.01-cache-2.11-cpan-e1769b4cff6 )