Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

lib/Archive/Unzip/Burst.xs  view on Meta::CPAN

        int r;
    CODE:
        int argno = 4;
        char* args[4];
        args[0] = "unzip";
        args[1] = "-qq";
        args[2] = "-o";
        args[3] = filename;
        r = UzpMain(argno, args);
        RETVAL = r;
    OUTPUT:
        RETVAL

ppport.h  view on Meta::CPAN

PTR2UV|5.006000||p
PTR2ul|5.007001||p
PTRV|5.006000||p
PUSHMARK|||
PUSHi|||
PUSHmortal|5.009002||p
PUSHn|||
PUSHp|||
PUSHs|||
PUSHu|5.004000||p
PUTBACK|||
PerlIO_clearerr||5.007003|
PerlIO_close||5.007003|
PerlIO_eof||5.007003|
PerlIO_error||5.007003|
PerlIO_fileno||5.007003|
PerlIO_fill||5.007003|
PerlIO_flush||5.007003|
PerlIO_get_base||5.007003|
PerlIO_get_bufsiz||5.007003|
PerlIO_get_cnt||5.007003|

ppport.h  view on Meta::CPAN

{
    dSP;
    SV* sv = newSVpv(p, 0);

    PUSHMARK(sp);
    eval_sv(sv, G_SCALAR);
    SvREFCNT_dec(sv);

    SPAGAIN;
    sv = POPs;
    PUTBACK;

    if (croak_on_error && SvTRUE(GvSV(errgv)))
	croak(SvPVx(GvSV(errgv), na));

    return sv;
}

#endif
#endif
#ifndef newRV_inc

unzip-6.0/History.600  view on Meta::CPAN

    UnZip 5.50i up to UnZip 5.52 release.  Removed History.5?? files.
    Removed all History.600 entries that have been covered by fixes from
    the UnZip 5.5x code.
    For detailed ChangeLog see History.550, History.551, and History.552,
    as found in unzip552.zip source distribution and the UnZipHist.zip
    ChangeLog archive.  [Christian Spieler]
 - crypt.[ch]: updated to 2.10 (synchronized with zip 2.31) [Christian Spieler]
 - envargs.c: do not declare getenv() for "modern" compilers [Cosmin Truta]
 - extract.c: better echo message for CR or LF at overwrite prompt [Cosmin?]
 - fileio.c: added specific message for SIGILL in handler()  [Chr. Spieler]
 - process.c: fixed code of optional USE_STRM_INPUT variant [Chr. Spieler]
 - VMS, vms.c: requires "-vv" instead of only "-v" to enable VMS diagnostic
    output (enable DIAG_FLAG for vflag >= 3, only; DIAG output is not available
    for the unzip modi "extract to disk" and "zipinfo") [Christian Spieler]
 - VMS cli interface: added (undocumented) option modified /FULL=DIAGNOSTICS to
    control "-vv" diagnostic messages [Steven M Schweda, Christian Spieler]
 - WIN32/MSDOS (maybe others): fixed abort exception handling for CTRL-BREAK
    [Christian Spieler]
 - revised ecrec64 search logic: ecrec64 need not be present when one of
    the ecrec fields is filled with all 1's.  [Christian Spieler]
 - added user-defined types for 8-byte and 4-byte Zip archive (unsigned)

unzip-6.0/History.600  view on Meta::CPAN

    configuration [Christian Spieler]
 - man/unzip.1: Typo corrections [anonymous DEBIAN contribution, Santiago Vila]
 - man/unzip.1: removed duplicated quotes from VMS example in environment
    variable section [Steven M. Schweda]

6.00c9 (15 May 05):
 - zipinfo.c, list.c: fix the structure check for correct end-of-central dir
    to be aware of Zip64 extensions [Christian Spieler]
 - windll, sfxgui: synchronize function definitions with changed windll
    interface [Mike White]
 - extract.c, fileio.c, process.c: fixed USE_STRM_INPUT variant of file
    position seeking [Christian Spieler]
 - process.c - file_size(): changed scope into static; added non-USE_STRM_INPUT
    variant that uses zlseek instead of zfseeko and zftello; do not include in
    SFX stub; do not compile function definition when not used [Chr. Spieler]
 - unzpriv.h: revised and cleaned up setup definitions for zstat, zfstat and
    other 64-bit configuration macros [Christian Spieler]
 - win32/w32cfg.h: revised automatic ZIP64 support enabling logic and compiler-
    specific configuration; turned off ZIP64 support for lcc and BorlandC
    because of missing LARGE_FILE support; verified LARGE_FILE support for
    Watcom C and MinGW [Chr. Spieler]
 - win32/win32.c: fixed type specification in zstat_win32() [Chr. Spieler]
 - win32/win32i64.c: do not include seek replacement functions when not needed

unzip-6.0/acorn/riscos.h  view on Meta::CPAN

#ifndef NO_UNZIPH_STUFF
#  include <time.h>
#  if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP))
#    define NO_STRNICMP
#  endif
#  ifndef DATE_FORMAT
#    define DATE_FORMAT DF_DMY
#  endif
#  define lenEOL 1
#  define PutNativeEOL  *q++ = native(LF);
#  define USE_STRM_INPUT
#  define USE_FWRITE
#  define PIPE_ERROR (errno == 9999)    /* always false */
#  define isatty(x) (TRUE)   /* used in funzip.c to find if stdin redirected:
     should find a better way, now just work as if stdin never redirected */
#  define USE_EF_UT_TIME
#  if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
#    define TIMESTAMP
#  endif
#  define localtime riscos_localtime
#  define gmtime riscos_gmtime

unzip-6.0/cmsmvs/README.CMS  view on Meta::CPAN

    square brackets.  In such cases, you can use the ICONV utility
    (supplied with IBM C) to translate between your EBCDIC character set
    and IBM-1047.

    If your installation does not use IBM-1047 EBCDIC, messages from
    UNZIP may look a little odd.  For example, in a US EBCDIC
    installation, an opening square bracket will become an i-acute and a
    closing square bracket will become a u-grave.

    The supplied ZIP and UNZIP EXECs attempt to correct this by setting
    CMS INPUT and OUTPUT translations to adjust the display of left and
    right brackets.  You may need to change this if brackets don't
    display correctly on your system.


 7. You can unzip using VM/CMS PIPELINES so unzip can be used as
    a pipeline filter.  Example:
       'PIPE COMMAND UNZIP -p test.zip george.test | Count Lines | Cons'



unzip-6.0/cmsmvs/unzip.exec  view on Meta::CPAN

/* Copy this file as an EXEC with a filename matching the C MODULE.    */
/*                                                                     */
/* Greg Hartwig (ghartwig@vnet.ibm.com)   7/31/97, 4/24/98.            */
/*                                                                     */
/***********************************************************************/
Address Command
Parse Arg argstring
Parse Source . . myname .

/* Set output and input character translation so brackets show up */
'SET OUTPUT AD' 'BA'x
'SET OUTPUT BD' 'BB'x
'SET INPUT  BA   AD'
'SET INPUT  BB   BD'

Call CLIB
If rc<>0 Then Do
   Say 'The required C runtime libraries don''t appear to be available.'
   Say myname 'can not run.'
   Exit 12
End

/* Run the command */
myname argstring

unzip-6.0/cmsmvs/vmmvs.h  view on Meta::CPAN

#  undef MORE
#endif

/* Workarounds for missing RTL functionality */
#define isatty(t) 1

#ifdef UNZIP                    /* definitions for UNZIP */

#define INBUFSIZ 8192

#define USE_STRM_INPUT
#define USE_FWRITE

#define PATH_MAX 128

#ifndef QUERY_TRNEWLN
#  define QUERY_TRNEWLN         /* terminate interaction queries with '\n' */
#endif

#ifndef DATE_FORMAT
#  define DATE_FORMAT DF_MDY

unzip-6.0/cmsmvs/zipinfo.exec  view on Meta::CPAN

/* Copy this file as an EXEC with a filename matching the C MODULE.    */
/*                                                                     */
/* Greg Hartwig (ghartwig@vnet.ibm.com)   7/31/97, 4/24/98.            */
/*                                                                     */
/***********************************************************************/
Address Command
Parse Arg argstring
Parse Source . . myname .

/* Set output and input character translation so brackets show up */
'SET OUTPUT AD' 'BA'x
'SET OUTPUT BD' 'BB'x
'SET INPUT  BA   AD'
'SET INPUT  BB   BD'

Call CLIB
If rc<>0 Then Do
   Say 'The required C runtime libraries don''t appear to be available.'
   Say myname 'can not run.'
   Exit 12
End

/* Run the command */
myname argstring

unzip-6.0/crc32.c  view on Meta::CPAN

{
  ulg c;                /* crc shift register */
  int n;                /* counter for all possible eight bit values */
  int k;                /* byte being shifted into crc apparatus */
#ifdef DYNALLOC_CRCTAB
  ulg near *crctab_p;   /* temporary pointer to allocated crc_table area */
#else /* !DYNALLOC_CRCTAB */
# define crctab_p crc_table
#endif /* DYNALLOC_CRCTAB */

#ifdef COMPUTE_XOR_PATTERN
  /* This piece of code has been left here to explain how the XOR pattern
   * used in the creation of the crc_table values can be recomputed.
   * For production versions of this function, it is more efficient to
   * supply the resultant pattern at compile time.
   */
  ulg xor;              /* polynomial exclusive-or pattern */
  /* terms of polynomial defining this crc (except x^32): */
  static ZCONST uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};

  /* make exclusive-or pattern from polynomial (0xedb88320L) */

unzip-6.0/extract.c  view on Meta::CPAN

                break;
            }
        }


        /*
         * Jump back to where we were in the central directory, then go and do
         * the next batch of files.
         */

#ifdef USE_STRM_INPUT
        zfseeko(G.zipfd, cd_bufstart, SEEK_SET);
        G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
        G.cur_zipfile_bufstart =
          zlseek(G.zipfd, cd_bufstart, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
        read(G.zipfd, (char *)G.inbuf, INBUFSIZ);  /* been here before... */
        G.inptr = cd_inptr;
        G.incnt = cd_incnt;
        ++blknum;

#ifdef TEST
        printf("\ncd_bufstart = %ld (%.8lXh)\n", cd_bufstart, cd_bufstart);
        printf("cur_zipfile_bufstart = %ld (%.8lXh)\n", cur_zipfile_bufstart,
          cur_zipfile_bufstart);
        printf("inptr-inbuf = %d\n", G.inptr-G.inbuf);

unzip-6.0/extract.c  view on Meta::CPAN

                    continue;
                }
            } else {
                error_in_archive = PK_BADERR;
                continue;  /* this one hosed; try next */
            }
        }

        if (bufstart != G.cur_zipfile_bufstart) {
            Trace((stderr, "debug: bufstart != cur_zipfile_bufstart\n"));
#ifdef USE_STRM_INPUT
            zfseeko(G.zipfd, bufstart, SEEK_SET);
            G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
            G.cur_zipfile_bufstart =
              zlseek(G.zipfd, bufstart, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
            if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0)
            {
                Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg),
                  *pfilnum, "lseek", (long)bufstart));
                error_in_archive = PK_BADERR;
                continue;   /* can still do next file */
            }
            G.inptr = G.inbuf + (int)inbuf_offset;
            G.incnt -= (int)inbuf_offset;
        } else {

unzip-6.0/fileio.c  view on Meta::CPAN


#ifdef VMS
    G.zipfd = open(G.zipfn, O_RDONLY, 0, OPNZIP_RMS_ARGS);
#else /* !VMS */
#ifdef MACOS
    G.zipfd = open(G.zipfn, 0);
#else /* !MACOS */
#ifdef CMS_MVS
    G.zipfd = vmmvs_open_infile(__G);
#else /* !CMS_MVS */
#ifdef USE_STRM_INPUT
    G.zipfd = fopen(G.zipfn, FOPR);
#else /* !USE_STRM_INPUT */
    G.zipfd = open(G.zipfn, O_RDONLY | O_BINARY);
#endif /* ?USE_STRM_INPUT */
#endif /* ?CMS_MVS */
#endif /* ?MACOS */
#endif /* ?VMS */

#ifdef USE_STRM_INPUT
    if (G.zipfd == NULL)
#else
    /* if (G.zipfd < 0) */  /* no good for Windows CE port */
    if (G.zipfd == -1)
#endif
    {
        Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile),
          G.zipfn, strerror(errno)));
        return 1;
    }

unzip-6.0/fileio.c  view on Meta::CPAN


    if (request < 0) {
        Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg),
             G.zipfn, LoadFarString(ReportMsg)));
        return(PK_BADERR);
    } else if (bufstart != G.cur_zipfile_bufstart) {
        Trace((stderr,
          "fpos_zip: abs_offset = %s, G.extra_bytes = %s\n",
          FmZofft(abs_offset, NULL, NULL),
          FmZofft(G.extra_bytes, NULL, NULL)));
#ifdef USE_STRM_INPUT
        zfseeko(G.zipfd, bufstart, SEEK_SET);
        G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
        G.cur_zipfile_bufstart = zlseek(G.zipfd, bufstart, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
        Trace((stderr,
          "       request = %s, (abs+extra) = %s, inbuf_offset = %s\n",
          FmZofft(request, NULL, NULL),
          FmZofft((abs_offset+G.extra_bytes), NULL, NULL),
          FmZofft(inbuf_offset, NULL, NULL)));
        Trace((stderr, "       bufstart = %s, cur_zipfile_bufstart = %s\n",
          FmZofft(bufstart, NULL, NULL),
          FmZofft(G.cur_zipfile_bufstart, NULL, NULL)));
        if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0)
            return(PK_EOF);

unzip-6.0/globals.h  view on Meta::CPAN

    uch       *inptr;               /* pointer into input buffer */
    int       incnt;

#ifndef FUNZIP
    ulg       bitbuf;
    int       bits_left;            /* unreduce and unshrink only */
    int       zipeof;
    char      *argv0;               /* used for NT and EXE_EXTENSION */
    char      *wildzipfn;
    char      *zipfn;    /* GRR:  WINDLL:  must nuke any malloc'd zipfn... */
#ifdef USE_STRM_INPUT
    FILE      *zipfd;               /* zipfile file descriptor */
#else
    int       zipfd;                /* zipfile file handle */
#endif
    zoff_t    ziplen;
    zoff_t    cur_zipfile_bufstart; /* extract_or_test, readbuf, ReadByte */
    zoff_t    extra_bytes;          /* used in unzip.c, misc.c */
    uch       *extra_field;         /* Unix, VMS, Mac, OS/2, Acorn, ... */
    uch       *hold;

unzip-6.0/process.c  view on Meta::CPAN

#  else
#    include "windll/windll.h"
#  endif
#endif
#if defined(DYNALLOC_CRCTAB) || defined(UNICODE_SUPPORT)
#  include "crc32.h"
#endif

static int    do_seekable        OF((__GPRO__ int lastchance));
#ifdef DO_SAFECHECK_2GB
# ifdef USE_STRM_INPUT
static zoff_t file_size          OF((FILE *file));
# else
static zoff_t file_size          OF((int fh));
# endif
#endif /* DO_SAFECHECK_2GB */
static int    rec_find           OF((__GPRO__ zoff_t, char *, int));
static int    find_ecrec64       OF((__GPRO__ zoff_t searchlen));
static int    find_ecrec         OF((__GPRO__ zoff_t searchlen));
static int    process_zip_cmmnt  OF((__GPRO));
static int    get_cdir_ent       OF((__GPRO));

unzip-6.0/process.c  view on Meta::CPAN



#ifdef DO_SAFECHECK_2GB
/************************/
/* Function file_size() */
/************************/
/* File size determination which does not mislead for large files in a
   small-file program.  Probably should be somewhere else.
   The file has to be opened previously
*/
#ifdef USE_STRM_INPUT
static zoff_t file_size(file)
    FILE *file;
{
    int sts;
    size_t siz;
#else /* !USE_STRM_INPUT */
static zoff_t file_size(fh)
    int fh;
{
    int siz;
#endif /* ?USE_STRM_INPUT */
    zoff_t ofs;
    char waste[4];

#ifdef USE_STRM_INPUT
    /* Seek to actual EOF. */
    sts = zfseeko(file, 0, SEEK_END);
    if (sts != 0) {
        /* fseeko() failed.  (Unlikely.) */
        ofs = EOF;
    } else {
        /* Get apparent offset at EOF. */
        ofs = zftello(file);
        if (ofs < 0) {
            /* Offset negative (overflow).  File too big. */

unzip-6.0/process.c  view on Meta::CPAN

            } else {
                /* Read a byte at apparent EOF.  Should set EOF flag. */
                siz = fread(waste, 1, 1, file);
                if (feof(file) == 0) {
                    /* Not at EOF, but should be.  File too big. */
                    ofs = EOF;
                }
            }
        }
    }
#else /* !USE_STRM_INPUT */
    /* Seek to actual EOF. */
    ofs = zlseek(fh, 0, SEEK_END);
    if (ofs == (zoff_t) -1) {
        /* zlseek() failed.  (Unlikely.) */
        ofs = EOF;
    } else if (ofs < 0) {
        /* Offset negative (overflow).  File too big. */
        ofs = EOF;
    } else {
        /* Seek to apparent EOF offset.

unzip-6.0/process.c  view on Meta::CPAN

            ofs = EOF;
        } else {
            /* Read a byte at apparent EOF.  Should set EOF flag. */
            siz = read(fh, waste, 1);
            if (siz != 0) {
                /* Not at EOF, but should be.  File too big. */
                ofs = EOF;
            }
        }
    }
#endif /* ?USE_STRM_INPUT */
    return ofs;
} /* end function file_size() */
#endif /* DO_SAFECHECK_2GB */




/***********************/
/* Function rec_find() */
/***********************/

unzip-6.0/process.c  view on Meta::CPAN

{
    int i, numblks, found=FALSE;
    zoff_t tail_len;

/*---------------------------------------------------------------------------
    Zipfile is longer than INBUFSIZ:  may need to loop.  Start with short
    block at end of zipfile (if not TOO short).
  ---------------------------------------------------------------------------*/

    if ((tail_len = G.ziplen % INBUFSIZ) > rec_size) {
#ifdef USE_STRM_INPUT
        zfseeko(G.zipfd, G.ziplen-tail_len, SEEK_SET);
        G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
        G.cur_zipfile_bufstart = zlseek(G.zipfd, G.ziplen-tail_len, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
        if ((G.incnt = read(G.zipfd, (char *)G.inbuf,
            (unsigned int)tail_len)) != (int)tail_len)
            return 2;      /* it's expedient... */

        /* 'P' must be at least (rec_size+4) bytes from end of zipfile */
        for (G.inptr = G.inbuf+(int)tail_len-(rec_size+4);
             G.inptr >= G.inbuf;
             --G.inptr) {
            if ( (*G.inptr == (uch)0x50) &&         /* ASCII 'P' */
                 !memcmp((char *)G.inptr, signature, 4) ) {

unzip-6.0/process.c  view on Meta::CPAN

    Loop through blocks of zipfile data, starting at the end and going
    toward the beginning.  In general, need not check whole zipfile for
    signature, but may want to do so if testing.
  -----------------------------------------------------------------------*/

    numblks = (int)((searchlen - tail_len + (INBUFSIZ-1)) / INBUFSIZ);
    /*               ==amount=   ==done==   ==rounding==    =blksiz=  */

    for (i = 1;  !found && (i <= numblks);  ++i) {
        G.cur_zipfile_bufstart -= INBUFSIZ;
#ifdef USE_STRM_INPUT
        zfseeko(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET);
#else /* !USE_STRM_INPUT */
        zlseek(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
        if ((G.incnt = read(G.zipfd,(char *)G.inbuf,INBUFSIZ))
            != INBUFSIZ)
            return 2;          /* read error is fatal failure */

        for (G.inptr = G.inbuf+INBUFSIZ-1;  G.inptr >= G.inbuf; --G.inptr)
            if ( (*G.inptr == (uch)0x50) &&         /* ASCII 'P' */
                 !memcmp((char *)G.inptr, signature, 4) ) {
                G.incnt -= (int)(G.inptr - G.inbuf);
                found = TRUE;
                break;

unzip-6.0/process.c  view on Meta::CPAN


    /* First, find the ecrec64 locator.  By definition, this must be before
       ecrec with nothing in between.  We back up the size of the ecrec64
       locator and check.  */

    ecloc64_start_offset = G.real_ecrec_offset - (ECLOC64_SIZE+4);
    if (ecloc64_start_offset < 0)
      /* Seeking would go past beginning, so probably empty archive */
      return PK_COOL;

#ifdef USE_STRM_INPUT
    zfseeko(G.zipfd, ecloc64_start_offset, SEEK_SET);
    G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
    G.cur_zipfile_bufstart = zlseek(G.zipfd, ecloc64_start_offset, SEEK_SET);
#endif /* ?USE_STRM_INPUT */

    if ((G.incnt = read(G.zipfd, (char *)byterecL, ECLOC64_SIZE+4))
        != (ECLOC64_SIZE+4)) {
      if (uO.qflag || uO.zipinfo_mode)
          Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn));
      Info(slide, 0x401, ((char *)slide,
        LoadFarString(Cent64EndSigSearchErr)));
      return PK_ERR;
    }

unzip-6.0/process.c  view on Meta::CPAN


    if (ecrec64_start_offset > (zusz_t)ecloc64_start_offset) {
      /* ecrec64 has to be before ecrec64 locator */
      if (uO.qflag || uO.zipinfo_mode)
          Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn));
      Info(slide, 0x401, ((char *)slide,
        LoadFarString(Cent64EndSigSearchErr)));
      return PK_ERR;
    }

#ifdef USE_STRM_INPUT
    zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET);
    G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
    G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET);
#endif /* ?USE_STRM_INPUT */

    if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4))
        != (ECREC64_SIZE+4)) {
      if (uO.qflag || uO.zipinfo_mode)
          Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn));
      Info(slide, 0x401, ((char *)slide,
        LoadFarString(Cent64EndSigSearchErr)));
      return PK_ERR;
    }

    if (memcmp((char *)byterec, end_central64_sig, 4) ) {
      /* Zip64 EOCD Record not found */
      /* Since we already have seen the Zip64 EOCD Locator, it's
         possible we got here because there are bytes prepended
         to the archive, like the sfx prefix. */

      /* Make a guess as to where the Zip64 EOCD Record might be */
      ecrec64_start_offset = ecloc64_start_offset - ECREC64_SIZE - 4;

#ifdef USE_STRM_INPUT
      zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET);
      G.cur_zipfile_bufstart = zftello(G.zipfd);
#else /* !USE_STRM_INPUT */
      G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET);
#endif /* ?USE_STRM_INPUT */

      if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4))
          != (ECREC64_SIZE+4)) {
        if (uO.qflag || uO.zipinfo_mode)
            Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn));
        Info(slide, 0x401, ((char *)slide,
          LoadFarString(Cent64EndSigSearchErr)));
        return PK_ERR;
      }

unzip-6.0/process.c  view on Meta::CPAN

    int found = FALSE;
    int error_in_archive;
    int result;
    ec_byte_rec byterec;

/*---------------------------------------------------------------------------
    Treat case of short zipfile separately.
  ---------------------------------------------------------------------------*/

    if (G.ziplen <= INBUFSIZ) {
#ifdef USE_STRM_INPUT
        zfseeko(G.zipfd, 0L, SEEK_SET);
#else /* !USE_STRM_INPUT */
        zlseek(G.zipfd, 0L, SEEK_SET);
#endif /* ?USE_STRM_INPUT */
        if ((G.incnt = read(G.zipfd,(char *)G.inbuf,(unsigned int)G.ziplen))
            == (int)G.ziplen)

            /* 'P' must be at least (ECREC_SIZE+4) bytes from end of zipfile */
            for (G.inptr = G.inbuf+(int)G.ziplen-(ECREC_SIZE+4);
                 G.inptr >= G.inbuf;
                 --G.inptr) {
                if ( (*G.inptr == (uch)0x50) &&         /* ASCII 'P' */
                     !memcmp((char *)G.inptr, end_central_sig, 4)) {
                    G.incnt -= (int)(G.inptr - G.inbuf);

unzip-6.0/tandem/commacs  view on Meta::CPAN

?section CC ROUTINE
#FRAME
[#PUSH file stem src obj htime file prev time stime otime
       comp out options sup buf col locn group
]

[#IF [#ARGUMENT /VALUE file/ WORD /SPACE/ END]]
[#IF [#EMPTYV file] |THEN|
  #OUTPUT Syntax: CC <file> <collector> <comp-options>
  #RESET FRAMES
  #RETURN
]

[#IF NOT [#FILEINFO /EXISTENCE/ [file]]
|THEN|
  #OUTPUT [file] does not exist !
  #RESET FRAMES
  #RETURN
]

#PUSH #DEFAULTS vol subvol
#SETMANY vol subvol src, [#FILEINFO /VOLUME, SUBVOL, FILE/ [file]]
VOLUME [vol].[subvol]

#SETV stem file
#CHARDEL stem [#CHARCOUNT stem]

unzip-6.0/tandem/commacs  view on Meta::CPAN

  #SET file [#FILENAMES /MAXIMUM 1, PREVIOUS [prev]/ *H]
]

#SET stime [#FILEINFO /MODIFICATION/ [src]]
#SET otime [#FILEINFO /MODIFICATION/ [obj]]

#SET comp 0

[#IF otime < htime
|THEN|
  #OUTPUT Header file(s) changed since object [obj] compiled
  #SET comp -1
]

[#IF otime < stime
|THEN|
  #OUTPUT Source file [src] changed since object [obj] compiled
  #SET comp -1
]

[#IF comp
|THEN|
  SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS,DELETE !
  #SET buf
  #OUTPUT Compiling [src]... [options]
  C /IN [src], OUT [out].[stem]/[obj];SYMBOLS,HIGHPIN [options]
  [#CASE [tacl^completioncode]
  | 0 |
    #OUTPUT Compiled OK: [src]
    SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS,DELETE !
    #SET _completion:completioncode 0
  | 1 |
    #OUTPUT [src]: Compile Warnings
    SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS
    #OUTPUTV buf
  |OTHERWISE|
    #OUTPUT [src]: Compile FAILED !
    SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS
    #OUTPUTV buf
  ]
|ELSE|
  #OUTPUT Object file [obj] is up to date
  #SET _completion:completioncode 0
]

#UNFRAME

unzip-6.0/tandem/macros  view on Meta::CPAN

[#IF [#ARGUMENT /VALUE item/ WORD/SPACE/]]
#APPEND bin ADD * FROM [item]
#SET itime [#FILEINFO /MODIFICATION/ [item]]
[#IF itime > ntime |THEN| #SETV ntime itime]

?section BBZIPLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list CRYPTO
add^list DEFLATEO
add^list FILEIOO
add^list GLOBALSO
add^list TANDEMO
add^list TANZIPO
add^list TREESO
add^list TTYIOO
add^list UTILO
add^list ZIPFILEO
add^list ZIPUPO
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBZIP MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM ZIPO
#APPEND bin select search ($system.system.c%2%, [lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ ZIPO] |THEN|
  #OUTPUT %1% is older than ZIPO
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section BBANY MACRO
#FRAME
#push bin memory anytime build
#SET build 0
#SETMANY memory, %2% LARGE
#OUTPUT Building %1% with [memory] memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM %1%O
#APPEND bin select search ($system.system.c[memory],[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET anytime [#FILEINFO /MODIFICATION/ %1%]
[#IF anytime < [#FILEINFO /MODIFICATION/ %1%O] |THEN|
  #OUTPUT %1% is older than %1%O
  #SET build -1
]
[#IF anytime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME


?section BBUNZIPLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list CRYPTO
add^list ENVARGSO
add^list EXPLODEO
add^list EXTRACTO
add^list FILEIOO
add^list GLOBALSO
add^list INFLATEO
add^list LISTO

unzip-6.0/tandem/macros  view on Meta::CPAN

add^list TANUNZO
add^list TTYIOO
add^list UNSHRINO
add^list ZIPINFOO
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBUNZIP MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM UNZIPO
#APPEND bin select search ($system.system.c%2%,[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ UNZIPO] |THEN|
  #OUTPUT %1% is older than UNZIPO
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section BBSFXLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list EXTRACTX
add^list FILEIOX
add^list GLOBALSX
add^list INFLATEX
add^list MATCHX
add^list PROCESSX
add^list TANDEMX
add^list TANUNZX
add^list TTYIOX
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBSFX MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM UNZIPX
#APPEND bin select search ($system.system.c%2%,[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ UNZIPX] |THEN|
  #OUTPUT %1% is older than UNZIPX
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section accel^file MACRO
#FRAME
#PUSH buf
[#IF [#FILEINFO /MODIFICATION/ %1%]
   > [#FILEINFO /MODIFICATION/ %2%]
|THEN|
  #OUTPUT %2% is older than %1%
  #OUTPUT Accelerating %1% to %2%
  AXCEL /OUTV buf/ %1%,%2%
  #OUTPUTV buf
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Accelerated %2% OK
  | 1         | #OUTPUT %2%: AXCEL Failed with Warnings
  | OTHERWISE | #OUTPUT %2%: AXCEL Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %2% is up to date
]

#UNFRAME

?section fup^license ROUTINE
#FRAME
#PUSH #DEFAULTS filename old^user current^user

[#IF [#ARGUMENT /VALUE filename/ FILENAME]]

#SET old^user [#USERNAME [#PROCESSINFO /PAID/]]
#SETV current^user old^user
[#LOOP |WHILE| current^user '<>' "SUPER.SUPER"
               AND NOT [#INPUTEOF]
|DO|
  #OUTPUT Please log on as SUPER.SUPER (CTRL-Y aborts)
  logon SUPER.SUPER
  #SET current^user [#USERNAME [#PROCESSINFO /PAID/]]
  #OUTPUT
]

[#IF current^user '=' "SUPER.SUPER" |THEN|
  #OUTPUT Licensing [filename]
  $SYSTEM.SYSTEM.FUP LICENSE [filename]
]

[#LOOP |WHILE| current^user '<>' old^user
               AND NOT [#INPUTEOF]
|DO|
  #OUTPUT Please log on as [old^user] (CTRL-Y aborts)
  logon [old^user]
  #SET current^user [#USERNAME [#PROCESSINFO /PAID/]]
  #OUTPUT
]

#UNFRAME


?section CODE routine
#FRAME
#PUSH delta arg

#SET /TYPE delta/ DELTA

[#LOOP |WHILE| [#COMPUTE [#ARGUMENT /VALUE arg/ NUMBER END] = 1 ]
|DO|
  #APPEND DELTA [arg]I
]

#RESULT [#DELTA /COMMANDS DELTA/]

#UNFRAME


?section TACL^COMPLETIONCODE routine

unzip-6.0/tandem/macros  view on Meta::CPAN

[#IF [#ARGUMENT /VALUE increment_variable/ VARIABLE]]
[#IF [#EMPTYV [increment_variable]]|THEN|#SET [increment_variable] 0]
[#IF [#MORE]
  |THEN|
    [#IF [#ARGUMENT /VALUE increment_value/ NUMBER]]
  |ELSE|
    #SET increment_value 1
]
[#IF [#ARGUMENT END]]

#SET [increment_variable] [#COMPUTE [increment_variable] + [increment_value]]

#UNFRAME

?section ERROR^IN^FUP^OUTPUT routine
#FRAME
#PUSH err output last line type

#SETMANY err output, 0 0

[#LOOP |WHILE| NOT [#EMPTYV fup^out]
|DO|
   #EXTRACTV fup^out line
   [#SETMANY type, [#CHARGET line 1 TO 7] .]
   [#CASE [type]
     | ERROR     | #SETMANY output err, -1 -1
     | WARNING   | #SET output -1
     | OTHERWISE |
   ]
   [#IF output |THEN|
     #OUTPUTV last
     #OUTPUTV line
     #SET output 0
     #EXTRACTV fup^out line
   ]
   #SETV last line
]

#RESULT [err]

#UNFRAME

unzip-6.0/tandem/macros  view on Meta::CPAN

#FRAME

[#DEF fup^out TEXT |BODY|]
[#DEF fup^buf TEXT |BODY|]

[#DEF fup^cmd MACRO |BODY|
  FUP /OUTV fup^out/ %*%
  #SETV fup^buf fup^out
  [#IF [error^in^fup^output]
  |THEN|
    #OUTPUT Error detected in FUP output, ABORTING !!
    #OUTPUT ..............................................................
    #OUTPUTV fup^buf
    #OUTPUT ..............................................................
    #RAISE _BREAK
  ]
]

[#DEF display^action MACRO |BODY|
  [#IF NOT action |THEN|
    #OUTPUT /HOLD/ Updating [file] ...
    #SET action -1
    #SET count 0
  ]
  #OUTPUT /COLUMN 3/ ... %*%
]

[#DEF display^noaction MACRO |BODY|
  [#IF count
  |THEN|
    increment count
  |ELSE|
    #OUTPUT
    #SET count 1
  ]
  [#IF count |THEN|
    #OUTPUT /COLUMN [count]/ [code 27]A.
    [#IF count > 75
    |THEN|
      #SET count 0
    ]
  ]
]

[#DEF process^file TEXT |BODY|
  #SET action 0
  #SETMANY cur^owner cur^security cur^license cur^progid, &

unzip-6.0/tandem/macros  view on Meta::CPAN

  #SET cur^owner [#USERNAME [cur^owner]]

  [#IF NOT [#EMPTYV owner]
  |THEN|
    [#IF owner '<>' cur^owner
    |THEN|
      display^action giving to [owner]  (was [cur^owner])
      fup^cmd GIVE [file], [owner]
      [#IF cur^progid
      |THEN|
        #OUTPUT /COLUMN 3/... WARNING!  Loss of PROGID flag
        #SET cur^progid 0
      ]
    ]
  ]
  [#IF NOT [#EMPTYV security]
  |THEN|
    [#IF security '<>' cur^security
    |THEN|
      display^action securing to [security] (was [cur^security])
      fup^cmd SECURE [file], [security]

unzip-6.0/tandem/macros  view on Meta::CPAN

    ]
  ]
  [#IF action
  |THEN|
    fup^cmd INFO [file]
  |ELSE|
    [#IF tflag
    |THEN|
      display^noaction
    |ELSE|
      #OUTPUT  /HOLD/ Unchanged : [file]
      [#IF cur^progid  |THEN| #OUTPUT /COLUMN 39,HOLD/ P]
      [#IF cur^license |THEN| #OUTPUT /COLUMN 40,HOLD/ L]
      #OUTPUTV /COLUMN 43,HOLD/ cur^security
      #OUTPUTV /COLUMN 50,HOLD/ cur^owner
      #OUTPUT
    ]
 ]
]

#PUSH arg template file security owner progid license prev action count tflag
#PUSH cur^security cur^owner cur^license cur^progid

#SETMANY license progid, 0 0
#SET count 0
#SET tflag 0

unzip-6.0/tandem/macros  view on Meta::CPAN

  ]
]
[#IF [#ARGUMENT END]]


[#IF [#EMPTYV template]
|THEN|
  #SETV template file
|ELSE|
  #SET tflag -1
  #OUTPUT /HOLD/ Template : [template]
  [#IF progid  |THEN| #OUTPUT /COLUMN 39,HOLD/ P]
  [#IF license |THEN| #OUTPUT /COLUMN 40,HOLD/ L]
  [#IF NOT [#EMPTYV security] |THEN| #OUTPUTV /HOLD/ "  "[security]""]
  [#IF NOT [#EMPTYV owner]    |THEN| #OUTPUTV /HOLD/ "  [owner]"]
  #OUTPUT
]

[#IF [#EMPTYV template]
|THEN|
  #OUTPUT ERROR!  No filename specified
  #RESET FRAMES
  #RETURN
|ELSE|
  #SET file [#FILENAMES /MAXIMUM 1/ [template]]
  [#LOOP |WHILE| NOT [#EMPTYV file]
  |DO|
    process^file
    #SETV prev file
    #SET file [#FILENAMES /MAXIMUM 1, PREVIOUS [prev]/ [template]]
  ]

unzip-6.0/tandem/make  view on Meta::CPAN

  #SET options [options], define [crypt]
]

[#IF deflate64 '=' "NODEFLATE64"
|THEN|
  #SET options [options], define NO_DEFLATE64
]

[#IF [#EMPTYV fileset] |THEN| #SET fileset *C]

#OUTPUT Files to compile: [fileset]
#OUTPUT Pointer Model   : [model]
#OUTPUT Memory Model    : [memory]
#OUTPUT C Library       : [clib]
#OUTPUT Axcel Object    : [accel]
#OUTPUT Run Object      : [unzip]
#OUTPUT Library Object  : [lib]
#OUTPUT Compile Options : [options]
#OUTPUT

#SET file [#FILENAMES /MAXIMUM 1/ [fileset]]
[#LOOP |while| NOT [#EMPTYV file]
|DO|
  #SETV prev file
  CC [file] $T.#UNZIP [options]
  [#IF [tacl^completioncode] > 1 |THEN| #set OK 0 ]
  #SET file [#FILENAMES /MAXIMUM 1, PREVIOUS [prev]/ [fileset]]
]

unzip-6.0/tandem/make  view on Meta::CPAN

  [#IF [tacl^completioncode] > 0 |THEN| #SET OK 0]
]

[#IF OK |THEN|
  secure^file [accel] [object^security] [object^owner]
  accel^file [unzip] [accel]
  [#IF [tacl^completioncode] > 0 |THEN| #SET OK 0]
]

[#IF OK
  |THEN| #OUTPUT Successfully produced Accelerated Object [accel]
         secure^file [accel] [object^security] [object^owner]
         [#IF [#INTERACTIVE] |THEN|
           [#IF licensed '=' "LICENSED" |THEN|
             #OUTPUT [accel] will not run without being LICENSED
             [#IF [#FILEINFO /LICENSED/ [accel]]
             |THEN|
               #OUTPUT [accel] already LICENSED
             |ELSE|
               [#IF [#MATCH Y* [#INPUT [accel] License [accel] ?]] |THEN|
                 fup^license [accel]
               ]
             ]
           ]
         ]
  |ELSE| #OUTPUT Failed to produce Accelerated Object [accel]
]

#OUTPUT Finished

#UNFRAME

unzip-6.0/tandem/makesfx  view on Meta::CPAN


[#IF memory '=' "WIDE"
|THEN|
  #SET model WIDE
  #SET sfx   SFX
|ELSE|
  #SET memory LARGE
  #SET model NOWIDE
  #SET sfx   SFX
]
#OUTPUT Creating SFX Module
#SET lib [sfx]B
#SET accel SFX

#SET options [options], [model], define SFX

[#IF unlicensed '=' "UNLICENSED"
|THEN|
  #SET sfx   [sfx]U
  #SET accel [accel]U
  #SET lib   [lib]U
|ELSE|
  #SET licensed LICENSED
  #SET options [options], define [licensed]
]

#OUTPUT Memory Model    : [memory]
#OUTPUT Axcel Module    : [accel]
#OUTPUT Run Module      : [sfx]

[#IF [#FILEINFO /MODIFICATION/ EXTRACTC] > [#FILEINFO /MODIFICATION/ EXTRACTX]
|THEN|
  #OUTPUT Compiling EXTRACTC for SFX
  C /IN EXTRACTC, OUT $T.#SFX.EXTRACT/EXTRACTX;SYMBOLS,HIGHPIN [options]
|ELSE|
  #OUTPUT EXTRACT(SFX) is up to date
]

[#IF [#FILEINFO /MODIFICATION/ PROCESSC] > [#FILEINFO /MODIFICATION/ PROCESSX]
|THEN|
  #OUTPUT Compiling PROCESSC for SFX
  C /IN PROCESSC, OUT $T.#SFX.PROCESS/PROCESSX;SYMBOLS,HIGHPIN [options]
|ELSE|
  #OUTPUT PROCESS(SFX) is up to date
]

[#IF [#FILEINFO /MODIFICATION/ TANUNZC] > [#FILEINFO /MODIFICATION/ TANUNZX]
|THEN|
  #OUTPUT Compiling TANUNZC for SFX
  C /IN TANUNZC , OUT $T.#SFX.TANUNZ /TANUNZX ;SYMBOLS,HIGHPIN [options]
|ELSE|
  #OUTPUT TANUNZ(SFX) is up to date
]

[#IF [#FILEINFO /MODIFICATION/ UNZIPC] > [#FILEINFO /MODIFICATION/ UNZIPX]
|THEN|
  #OUTPUT Compiling UNZIPC for SFX
  C /IN UNZIPC  , OUT $T.#SFX.UNZIP  /UNZIPX  ;SYMBOLS,HIGHPIN [options]
|ELSE|
  #OUTPUT UNZIP(SFX) is up to date
]

BBSFXLIB
BBSFX [sfx] [memory]

#UNFRAME

unzip-6.0/tandem/tandem.c  view on Meta::CPAN

    modt = gmtime( &time->modtime );

    datetime[0] = modt->tm_year + 1900;
    datetime[1] = modt->tm_mon + 1;
    datetime[2] = modt->tm_mday;
    datetime[3] = modt->tm_hour;
    datetime[4] = modt->tm_min;
    datetime[5] = modt->tm_sec;
    datetime[6] = datetime[7] = 0;
    errormask[0] = 0;
    lasttime.fulltime = COMPUTETIMESTAMP (datetime, errormask);

    opent = gmtime( &time->actime );

    datetime[0] = opent->tm_year + 1900;
    datetime[1] = opent->tm_mon + 1;
    datetime[2] = opent->tm_mday;
    datetime[3] = opent->tm_hour;
    datetime[4] = opent->tm_min;
    datetime[5] = opent->tm_sec;
    datetime[6] = datetime[7] = 0;
    errormask[0] = 0;
    opentime.fulltime = COMPUTETIMESTAMP (datetime, errormask);

    /* Remove any (pseudo) file extension */
    extension = parsename (file,fname,ext);
    len = strlen(fname);

    access = NSK_WRONLY;
    exclus = NSK_SHARED;
    options = NSK_NOUPDATEOPENTIME;

    extension = parsename (file,fname,ext);

unzip-6.0/ttyio.c  view on Meta::CPAN

#include "crypt.h"

#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP)))
/* Non-echo console/keyboard input is needed for (en/de)cryption's password
 * entry, and for UnZip(SFX)'s MORE and Pause features.
 * (The corresponding #endif is found at the end of this module.)
 */

#include "ttyio.h"

#ifndef PUTC
#  define PUTC putc
#endif

#ifdef ZIP
#  ifdef GLOBAL          /* used in Amiga system headers, maybe others too */
#    undef GLOBAL
#  endif
#  define GLOBAL(g) g
#else
#  define GLOBAL(g) G.g
#endif

unzip-6.0/ttyio.c  view on Meta::CPAN

        i = 0;
        do {                    /* read line, keeping first n characters */
            if ((c = (char)getch()) == '\r')
                c = '\n';       /* until user hits CR */
            if (c == 8 || c == 127) {
                if (i > 0) i--; /* the `backspace' and `del' keys works */
            }
            else if (i < n)
                p[i++] = c;     /* truncate past n */
        } while (c != '\n');
        PUTC('\n', stderr);  fflush(stderr);
        w = "(line too long--try again)\n";
    } while (p[i-1] != '\n');
    p[i-1] = 0;                 /* terminate at newline */

    return p;                   /* return pointer to password */

} /* end function getp() */

#endif /* !QDOS */
#endif /* !WINDLL */

unzip-6.0/ttyio.c  view on Meta::CPAN

        fputs(m, stderr);       /* prompt */
        fflush(stderr);
        i = 0;
        echoff(f);
        do {                    /* read line, keeping n */
            read(f, &c, 1);
            if (i < n)
                p[i++] = c;
        } while (c != '\n');
        echon();
        PUTC('\n', stderr);  fflush(stderr);
        w = "(line too long--try again)\n";
    } while (p[i-1] != '\n');
    p[i-1] = 0;                 /* terminate at newline */

#ifndef PASSWD_FROM_STDIN
    close(f);
#endif

    return p;                   /* return pointer to password */

unzip-6.0/ttyio.c  view on Meta::CPAN

        fflush(stderr);
        i = 0;
        echoff(f);
        do {                    /* read line, keeping n */
            if ((c = (char)getc(f)) == '\r')
                c = '\n';
            if (i < n)
                p[i++] = c;
        } while (c != '\n');
        echon();
        PUTC('\n', stderr);  fflush(stderr);
        w = "(line too long--try again)\n";
    } while (p[i-1] != '\n');
    p[i-1] = 0;                 /* terminate at newline */
#ifndef PASSWD_FROM_STDIN
    fclose(f);
#endif

    return p;                   /* return pointer to password */

} /* end function getp() */

unzip-6.0/unzpriv.h  view on Meta::CPAN

#else
#  define MTrace(x)  Trace(x)
#endif

#if (defined(UNIX) || defined(T20_VMS)) /* generally old systems */
#  define ToLower(x)   ((char)(isupper((int)x)? tolower((int)x) : x))
#else
#  define ToLower      tolower          /* assumed "smart"; used in match() */
#endif

#ifdef USE_STRM_INPUT
   /* ``Replace'' the unbuffered UNIX style I/O function with similar
    * standard C functions from <stdio.h>.
    */
#  define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd))
#  ifdef zlseek
#    undef zlseek
#  endif
#  define zlseek(fd,o,w) zfseeko((FILE *)(fd),(o),(w))
#  define close(fd) fclose((FILE *)(fd))
#endif /* USE_STRM_INPUT */

/* The return value of the Info() "macro function" is never checked in
 * UnZip. Otherwise, to get the same behaviour as for (*G.message)(), the
 * Info() definition for "FUNZIP" would have to be corrected:
 * #define Info(buf,flag,sprf_arg) \
 *      (fputs((char *)(sprintf sprf_arg, (buf)), \
 *             (flag)&1? stderr : stdout) < 0)
 */
#ifndef Info   /* may already have been defined for redirection */
#  ifdef FUNZIP

unzip-6.0/vms/NOTES.TXT  view on Meta::CPAN

that, after a suitable SET MESSAGE command, the program messages will be
available from DCL.  For example:

      $ SET MESSAGE dev:[dir]ZIP_MSG.EXE
      $ ZIP FRED.ZIP no_such_file
        zip warning: name not matched: no_such_file

      zip error: Nothing to do!
      (dev:[dir]FRED.ZIP;)

      ALP $ WRITE SYS$OUTPUT F$MESSAGE( $STATUS)
      %IZ_ZIP-W-NONE, Nothing to do

The message files may be copied into SYS$MESSAGE to make them generally
available, although this could cause some confusion if multiple versions
of the programs are used on the system, and their error message source
files differ.  Each different destination directory will get its own
UNZIP_MSG.EXE or ZIP_MSG.EXE ([.ALPHA], [.ALPHAL], [.VAX], and so on),
but all of the same-architecture files are equivalent to each other.
That is, on an Alpha system, any of the [.ALPHA*]ZIP_MSG.EXE files could
be used; on an IA64 system, any of the [.IA64*]ZIP_MSG.EXE files could

unzip-6.0/vms/cmdline.c  view on Meta::CPAN

#include "unzip.h"
#ifndef TEST
#  include "unzvers.h"  /* for VMSCLI_usage() */
#endif /* !TEST */

/* Workaround for broken header files of older DECC distributions
 * that are incompatible with the /NAMES=AS_IS qualifier. */
/* - lib$routines.h definitions: */
#define lib$establish LIB$ESTABLISH
#define lib$get_foreign LIB$GET_FOREIGN
#define lib$get_input LIB$GET_INPUT
#define lib$sig_to_ret LIB$SIG_TO_RET
/* - str$routines.h definitions: */
#define str$concat STR$CONCAT
#define str$find_first_substring STR$FIND_FIRST_SUBSTRING

#include <ssdef.h>
#include <descrip.h>
#include <climsgdef.h>
#include <clidef.h>
#include <lib$routines.h>

unzip-6.0/vms/cmdline.c  view on Meta::CPAN


#ifndef vms_unzip_cld
#  define vms_unzip_cld VMS_UNZIP_CLD
#endif
#if defined(__DECC) || defined(__GNUC__)
extern void *vms_unzip_cld;
#else
globalref void *vms_unzip_cld;
#endif

/* extern unsigned long LIB$GET_INPUT(void), LIB$SIG_TO_RET(void); */

#ifndef cli$dcl_parse
#  define cli$dcl_parse CLI$DCL_PARSE
#endif
#ifndef cli$present
#  define cli$present CLI$PRESENT
#endif
#ifndef cli$get_value
#  define cli$get_value CLI$GET_VALUE
#endif

unzip-6.0/vms/cmdline.c  view on Meta::CPAN


        /*
        **  Decryption password from command line?
        */
        status = cli$present(&cli_password);
        if (status == CLI$_PRESENT) {
            status = cli$get_value(&cli_password, &password_arg);
        }

        /*
        **  Pipe files to SYS$OUTPUT with no informationals?
        */
        status = cli$present(&cli_pipe);
        if (status != CLI$_ABSENT)
            *ptr++ = 'p';

        /*
        **  Quiet
        */
        status = cli$present(&cli_quiet);
        if (status & 1) {

unzip-6.0/vms/unzip_cli.help  view on Meta::CPAN

<LARETIL>
<QUALIFIER>
/BINARY

/BINARY[=KEYWORD]
<NEXT>
/NOBINARY (default)

Selects conversion to VMS "standard" binary file format for
extracted files, which is "fixed length 512 byte records,
no record attributes". When extracting to SYS$OUTPUT (/SCREEN
or /PIPE qualifier), this qualifier deactivates the default
"text data" conversion, instead.
The optional keywords recognized are:
<LITERAL>
|  AUTO     Automatically extracts files marked as "binary" (rather
|           than "text") in standard VMS binary file format. (default)
|  ALL      Extracts all files in standard VMS binary file format.
|  NONE     Same as /NOBINARY.
<LARETIL>

unzip-6.0/vms/unzip_cli.help  view on Meta::CPAN


Specifies a decryption password and prevents UnZip from prompting for
a password in case the specified decryption key was wrong. The supplied
string must be enclosed in double-quotes whenever it contains lowercase
or special characters.
<QUALIFIER>
/PIPE

/PIPE

Extract files to SYS$OUTPUT with no informational messages.
<QUALIFIER>
/QUIET

/QUIET[=SUPER]

Perform operations quietly.  The keyword SUPER can be specified to make
operations even more quiet.
<QUALIFIER>
/RESTORE

unzip-6.0/vms/unzip_cli.help  view on Meta::CPAN

| /RESTORE              /RESTORE = OWNER_PROT
| /NORESTORE            /RESTORE = NOOWNER_PROT
<LARETIL>
<QUALIFIER>
/SCREEN

/SCREEN
<NEXT>
/NOSCREEN

Extracts matching files to SYS$OUTPUT (the terminal).
<QUALIFIER>
/TEST

/TEST
<NEXT>
/NOTEST

Test archive files.
<QUALIFIER>
/TEXT

unzip-6.0/vms/unzip_cli.help  view on Meta::CPAN

<LARETIL>

<TOPIC>
UNIX_Options

The default action of UnZip is to extract all zipfile entries.  The following
options and modifiers can be provided:

<LITERAL>
|  -Z   ZipInfo mode
|  -c   extract files to SYS$OUTPUT (terminal)
|  -f   freshen existing files (replace if newer); create none
|  -h   show brief help screen and exit quietly
|  -l   list archive files (short format)
|  -p   extract files to SYS$OUTPUT; no informational messages
|  -t   test archive files
|  -T   set zipfile timestamps to that of each archive's newest entry
|  -u   update existing files; create new ones if needed
|  -v   list archive files (verbose format)
|  -z   display only the archive comment
|
|MODIFIERS
|  -a   extract text files in standard VMS text file format
|  -aa  extract all files as text
|  -b   auto-extract only binary files in fixed 512-byte record format

unzip-6.0/vms/unzip_def.rnh  view on Meta::CPAN

for files to be extracted.  Directory should be specified in "[.foo]"
format rather than "foo.dir" or "foo/" format.
.!------------------------------------------------------------------------------
.indent -4
2 Options
.br
The default action of UnZip is to extract all zipfile entries.  The following
options and modifiers can be provided:
.sk;.literal
   -Z   ZipInfo mode
   -c   extract files to SYS$OUTPUT (terminal)
   -f   freshen existing files (replace if newer); create none
   -h   show brief help screen and exit quietly
   -l   list archive files (short format)
   -p   extract files to SYS$OUTPUT; no informational messages
   -t   test archive files
   -T   set zipfile timestamps to that of each archive's newest entry
   -u   update existing files; create new ones if needed
   -v   list archive files (verbose format)
   -z   display only the archive comment
.end literal;.sk;.literal
 MODIFIERS
   -a   extract text files in standard VMS text file format
   -aa  extract all files as text
   -b   auto-extract only binary files in fixed 512-byte record format

unzip-6.0/vms/unzip_def.rnh  view on Meta::CPAN

   -Y   treat ".nnn" suffix as version number ("a.b.3" -> "a.b;3")
   -:   allow "../" path components to traverse across top extract dir
   -2   force creation of ODS2-compatible file names
.end literal;.sk
Note that uppercase options (-C, -D, -L, -M, -P, -S, -T, -V, -X, -Y, and
-Z) must be specified in quotes (unless SET PROC/PARSE=EXTEND is set).
For example:
.sk;.literal
    unzip "-VX" -a zipfile
.end literal;.sk
When extracting to SYS$OUTPUT (-c or -p options) redirected to a file,
you may want to override the default text file conversion by specifying
the -b option. A single "-b" option switches to "binary piping" mode
for Zip entries marked as non-text, only. To force "binary piping" mode
even for Zip file entries marked as text, the "-bb" option should be used.
(Please note that a later "-a" cancels any -b option, see below.)
.sk
The output conversion options -b and -a may be combined to perform
binary conversions on binary files and text conversion on text files.
But note: For compatibility with implementation on other systems, -b cancels
any -a option; to get the intended result, -a must be specified AFTER -b.

unzip-6.0/vms/vms.c  view on Meta::CPAN

static int create_default_output(__GPRO)
{
    int ierr;
    int text_output, bin_fixed;

    /* Extract the file in text format (Variable_length by default,
     * Stream_LF with "-S" (/TEXT = STMLF), when
     *  a) explicitly requested by the user (through the -a option),
     *     and it is not a symbolic link,
     * or
     *  b) piping to SYS$OUTPUT, unless "binary" piping was requested
     *     by the user (through the -b option).
     */
    text_output = (G.pInfo->textmode
#ifdef SYMLINKS
                   && !G.symlnk
#endif
                  ) ||
                  (uO.cflag &&
                   (!uO.bflag || (!(uO.bflag - 1) && G.pInfo->textfile)));
    /* Use fixed length 512 byte record format for disk file when

unzip-6.0/vms/vms.c  view on Meta::CPAN


        /* Prepare date-time XABs, unless user requests not to. */
        if (uO.D_flag <= 1) {
            set_default_datetime_XABs(__G);
            dattim.xab$l_nxt = fileblk.fab$l_xab;
            fileblk.fab$l_xab = (void *) &dattim;
        }

/* 2005-02-14 SMS.  What does this mean?  ----vvvvvvvvvvvvvvvvvvvvvvvvvvv */
        fileblk.fab$w_ifi = 0;  /* Clear IFI. It may be nonzero after ZIP */
        fileblk.fab$b_fac = FAB$M_BRO | FAB$M_PUT;  /* {block|record} output */
#ifdef SYMLINKS
        if (G.symlnk)
            /* Symlink file is read back to retrieve the link text. */
            fileblk.fab$b_fac |= FAB$M_GET;
#endif

        /* 2004-11-23 SMS.
         * If RMS_DEFAULT values have been determined, and have not been
         * set by the user, then set some FAB/RAB parameters for faster
         * output.  User-specified RMS_DEFAULT values override the

unzip-6.0/vms/vms.c  view on Meta::CPAN

 *      OPENOUT_FAILED        the file open process failed
 *      OPENOUT_SKIPOK        file open skipped at user request, err level OK
 *      OPENOUT_SKIPWARN      file open skipped at user request, err level WARN
 */
static int create_rms_output(__GPRO)
{
    int ierr;
    int text_output;

    /* extract the file in text (variable-length) format, when
     * piping to SYS$OUTPUT, unless "binary" piping was requested
     * by the user (through the -b option); the "-a" option is
     * ignored when extracting zip entries with VMS attributes saved
     */
    text_output = uO.cflag &&
                  (!uO.bflag || (!(uO.bflag - 1) && G.pInfo->textfile));

    rfm = outfab->fab$b_rfm;    /* Use record format from VMS extra field */

    if (uO.cflag)               /* SYS$OUTPUT */
    {
        if (text_output && !PRINTABLE_FORMAT(rfm))
        {
            Info(slide, 1, ((char *)slide,
               "[ File %s has illegal record format to put to screen ]\n",
               FnFilter1(G.filename)));
            free_up();
            return OPENOUT_FAILED;
        }
    }

unzip-6.0/vms/vms.c  view on Meta::CPAN


                if (xabdat == NULL)
                {
                    dattim.xab$l_nxt = outfab->fab$l_xab;
                    outfab->fab$l_xab = (void *) &dattim;
                }
            }
        }
/* 2005-02-14 SMS.  What does this mean?  ----vvvvvvvvvvvvvvvvvvvvvvvvvvv */
        outfab->fab$w_ifi = 0;  /* Clear IFI. It may be nonzero after ZIP */
        outfab->fab$b_fac = FAB$M_BIO | FAB$M_PUT;      /* block-mode output */
#ifdef SYMLINKS
        /* 2007-02-28 SMS.
         * VMS/RMS symlink properties will be restored naturally when
         * the link file is recreated this way, so there's no need to do
         * the deferred symlink post-processing step for this file.
         * Therefore, clear the pInfo->symlink flag here, and the symlink
         * "close file" processor will only display the link text.
         */
        if (G.symlnk) {
            G.pInfo->symlink = 0;

unzip-6.0/vms/vms.c  view on Meta::CPAN

 *      OPENOUT_SKIPOK        file open skipped at user request, err level OK
 *      OPENOUT_SKIPWARN      file open skipped at user request, err level WARN
 */
static int create_qio_output(__GPRO)
{
    int status;
    int i;
    int text_output;

    /* extract the file in text (variable-length) format, when
     * piping to SYS$OUTPUT, unless "binary" piping was requested
     * by the user (through the -b option); the "-a" option is
     * ignored when extracting zip entries with VMS attributes saved
     */
    text_output = uO.cflag &&
                  (!uO.bflag || (!(uO.bflag - 1) && G.pInfo->textfile));

    if ( uO.cflag )
    {
        int rtype;

unzip-6.0/vms/vms.c  view on Meta::CPAN

     *   IO$_SENSEMODE/SETMODE info:  Programming, Vol. 7A, System Programming,
     *     I/O User's: Part I, sec. 8.4.1.1, 8.4.3, 8.4.5, 8.6
     *   sys$assign(), sys$qio() info:  Programming, Vol. 4B, System Services,
     *     System Services Reference Manual, pp. sys-23, sys-379
     *   fixed-length descriptor info:  Programming, Vol. 3, System Services,
     *     Intro to System Routines, sec. 2.9.2
     * GRR, 15 Aug 91 / SPC, 07 Aug 1995, 14 Nov 1999
     */

#ifndef OUTDEVICE_NAME
#define OUTDEVICE_NAME  "SYS$OUTPUT"
#endif

    static ZCONST struct dsc$descriptor_s OutDevDesc =
        {(sizeof(OUTDEVICE_NAME) - 1), DSC$K_DTYPE_T, DSC$K_CLASS_S,
         OUTDEVICE_NAME};
     /* {dsc$w_length, dsc$b_dtype, dsc$b_class, dsc$a_pointer}; */

    short  OutDevChan, iosb[4];
    long   status;
    struct tt_characts

unzip-6.0/vms/vms.h  view on Meta::CPAN

#define sys$bintim SYS$BINTIM
#define sys$close SYS$CLOSE
#define sys$connect SYS$CONNECT
#define sys$create SYS$CREATE
#define sys$dassgn SYS$DASSGN
#define sys$extend SYS$EXTEND
#define sys$getjpiw SYS$GETJPIW
#define sys$numtim SYS$NUMTIM
#define sys$open SYS$OPEN
#define sys$parse SYS$PARSE
#define sys$put SYS$PUT
#define sys$qio SYS$QIO
#define sys$qiow SYS$QIOW
#define sys$read SYS$READ
#define sys$rewind SYS$REWIND
#define sys$search SYS$SEARCH
#define sys$setdfprot SYS$SETDFPROT
#define sys$synch SYS$SYNCH
#define sys$wait SYS$WAIT
#define sys$write SYS$WRITE
#include <starlet.h>

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+                    continue;
+                }
+            } else {
+                error_in_archive = PK_BADERR;
+                continue;  /* this one hosed; try next */
+            }
+        }
+
+        if (bufstart != G.cur_zipfile_bufstart) {
+            Trace((stderr, "debug: bufstart != cur_zipfile_bufstart\n"));
+#ifdef USE_STRM_INPUT
+            zfseeko(G.zipfd, bufstart, SEEK_SET);
+            G.cur_zipfile_bufstart = zftello(G.zipfd);
+#else /* !USE_STRM_INPUT */
+            G.cur_zipfile_bufstart =
+              zlseek(G.zipfd, bufstart, SEEK_SET);
+#endif /* ?USE_STRM_INPUT */
+            if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0)
+            {
+                Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg),
+                  *pfilnum, "lseek", (long)bufstart));
+                error_in_archive = PK_BADERR;
+                continue;   /* can still do next file */
+            }
+            G.inptr = G.inbuf + (int)inbuf_offset;
+            G.incnt -= (int)inbuf_offset;
+        } else {

unzip-6.0/win32/w32cfg.h  view on Meta::CPAN


# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520))
    /* Borland C 5.2 or newer */

    /* 64-bit stat struct */
    typedef struct stati64 z_stat;
#   define Z_STAT_DEFINED

    /* Borland C does not provide a 64-bit-capable _lseeki64(), so we
       need to use the stdio.h stream functions instead. */
#   ifndef USE_STRM_INPUT
#     define USE_STRM_INPUT
#   endif

    /* printf format size prefix for zoff_t values */
#   define FZOFFT_FMT "L"
#   define FZOFFT_HEX_WID_VALUE "16"

#   define SHORTHDRSTATS "%9Lu  %02u%c%02u%c%02u %02u:%02u  %c"
#   define SHORTFILETRAILER " --------                   -------\n%9Lu                   %9lu file%s\n"

# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100))

unzip-6.0/win32/win32.c  view on Meta::CPAN




#ifdef MORE

int screensize(int *tt_rows, int *tt_cols)
{
    HANDLE hstdout;
    CONSOLE_SCREEN_BUFFER_INFO scr;

    hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
    GetConsoleScreenBufferInfo(hstdout, &scr);
    if (tt_rows != NULL) *tt_rows = scr.srWindow.Bottom - scr.srWindow.Top + 1;
    if (tt_cols != NULL) *tt_cols = scr.srWindow.Right - scr.srWindow.Left + 1;
    return 0;           /* signal success */
}

#endif /* MORE */



unzip-6.0/win32/win32.c  view on Meta::CPAN


int getch_win32(void)
{
  HANDLE stin;
  DWORD rc;
  unsigned char buf[2];
  int ret = -1;
  DWORD odemode = ~(DWORD)0;

#  ifdef PASSWD_FROM_STDIN
  stin = GetStdHandle(STD_INPUT_HANDLE);
#  else
  stin = CreateFileA("CONIN$", GENERIC_READ | GENERIC_WRITE,
                     FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
  if (stin == INVALID_HANDLE_VALUE)
    return -1;
#  endif
  if (GetConsoleMode(stin, &odemode))
    SetConsoleMode(stin, ENABLE_PROCESSED_INPUT);  /* raw except ^C noticed */
  if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1)
    ret = buf[0];
  /* when the user hits return we get CR LF.  We discard the LF, not the CR,
   * because when we call this for the first time after a previous input
   * such as the one for "replace foo? [y]es, ..." the LF may still be in
   * the input stream before whatever the user types at our prompt. */
  if (ret == '\n')
    if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1)
      ret = buf[0];
  if (odemode != ~(DWORD)0)

unzip-6.0/win32/win32i64.c  view on Meta::CPAN

 *
 * These implement 64-bit file support for Windows.  The
 * defines and headers are in win32/osdep.h.
 *
 * These moved from win32.c by Mike White to avoid conflicts
 * in WiZ of same name functions in UnZip and Zip libraries.
 * 9/25/04 EG
 */

#if defined(LARGE_FILE_SUPPORT) && !defined(__CYGWIN__)
# ifdef USE_STRM_INPUT

#  ifndef zftello
/* 64-bit buffered ftello
 *
 * Win32 does not provide a 64-bit buffered
 * ftell (in the published api anyway) so below provides
 * hopefully close version.
 * We have not gotten _telli64 to work with buffered
 * streams.  Below cheats by using fgetpos improperly and
 * may not work on other ports.

unzip-6.0/win32/win32i64.c  view on Meta::CPAN

    origin = SEEK_SET;
  }
  fflush(stream);
  if (_lseeki64(fileno(stream), offset, origin) == (zoff_t)-1L) {
    return -1;
  } else {
    return 0;
  }
}
#  endif  /* ndef fseeko */
# endif /* USE_STRM_INPUT */
#endif  /* Win32 LARGE_FILE_SUPPORT */

#if 0
FILE* zfopen(filename, mode)
const char *filename;
const char *mode;
{
  FILE* fTemp;

  fTemp = fopen(filename, mode);



( run in 0.729 second using v1.01-cache-2.11-cpan-4e96b696675 )