OPTIONS "WINFUNC NOSOURCE C_CALL"
NUMERIC DIGITS 10
LIBRARY rexxgui
DO
zipprint = '32, void, 32u'
zippassword = '32, void, 32, void, void'
zipreplace = '32, void'
zipservice = '32, void, 32u'
ziplist = ", 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, char, str *, str *, 32u, char"
zipfuncs = "func ZIPPRINT, void, func ZIPREPLACE, func ZIPPASSWORD, func ZIPLIST, func ZIPSERVICE, 32u, 32u, 32u, 32u, 32u"
zipflags = "32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, str *, str *"
FUNCDEF("UnzipAll", "32, 32u, 32u, 32u, 32u, struct ZIPFLAGS, struct ZIPFUNCS", "unzip32", "Wiz_SingleEntryUnzip")
CATCH FAILURE
CONDITION("M")
RETURN
END
err = guifile('FN', 'EXISTING', 'Pick out file to unzip', 'Zip files (*.zip)|*.zip|All files (*.*)|*.*')
IF err = '' THEN DO
zipflags. = 0
zipflags.10 = 1
zipflags.11 = 1
zipflags.16 = fn
zipflags.17 = SEARCHPATH('%TEMP%')
zipfuncs. = 0
zipfuncs.1 = 'ZipPrint'
zipfuncs.3 = 'ZipReplace'
zipfuncs.4 = 'ZipPassword'
zipfuncs.5 = 'ZipList'
zipfuncs.6 = 'ZipService'
retcode = unzipall(, , , , zipflags, zipfuncs)
IF retcode \== 0 THEN SAY "Error unzipping..." retcode
END
RETURN
zippassword:
RETURN 1
ziplist:
IF ARG(3) = 100 THEN compfactor = "100%"
ELSE DO
IF ARG(2) > ARG(1) THEN sgn = '-'
ELSE sgn = ' '
compfactor = sgn || ARG(3) || '%'
END
SAY ARG(1) ARG(2) compfactor ARG(4) || '-' || ARG(5) || '-' || ARG(6) ARG(7) || ':' || ARG(8) ARG(9) || ARG(10)
RETURN
zipprint:
IF ARG(2) > 0 THEN DO
def = 'char[' || ARG(2) || ']'
IF CONVERTDATA(ARG(1), 'text', def) \== "" THEN SAY text
END
RETURN ARG(2)
zipreplace:
RETURN 1
zipservice:
RETURN 0 |
|