Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/amiga/filedate.c  view on Meta::CPAN

/*
  Copyright (c) 1990-2002 Info-ZIP.  All rights reserved.

  See the accompanying file LICENSE, version 2000-Apr-09 or later
  (the contents of which are also included in zip.h) for terms of use.
  If, for some reason, all these files are missing, the Info-ZIP license
  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
*/
/* Low-level Amiga routines shared between Zip and UnZip.
 *
 * Contains:  FileDate()
 *            getenv()          [replaces inadequate standard library version]
 *            setenv()          [SAS/C only, replaces standard library version]
 *            set_TZ()          [SAS/C only]
 *            GetPlatformLocalTimezone() [callback from timezone.c tzset()]
 *            time()
 *            sendpkt()
 *            Agetch()
 *
 * The first five are used by most Info-ZIP programs except fUnZip.
 * The last two are used by all except the non-CRYPT version of fUnZip.
 * Probably some of the stuff in here is unused by ZipNote and ZipSplit too...
 * sendpkt() is used by Agetch() and FileDate(), and by screensize() in
 * amiga/amiga.c (UnZip); time() is used only by Zip.
 */


/* HISTORY/CHANGES
 *  2 Sep 92, Greg Roelofs, Original coding.
 *  6 Sep 92, John Bush, Incorporated into UnZip 5.1
 *  6 Sep 92, John Bush, Interlude "FileDate()" defined, which calls or
 *            redefines SetFileDate() depending upon AMIGADOS2 definition.
 * 11 Oct 92, John Bush, Eliminated AMIGADOS2 switch by determining
 *            revision via OpenLibrary() call.  Now only one version of
 *            the program runs on both platforms (1.3.x vs. 2.x)
 * 11 Oct 92, John Bush, Merged with Zip version and changed arg passing
 *            to take time_t input instead of struct DateStamp.
 *            Arg passing made to conform with utime().
 * 22 Nov 92, Paul Kienitz, fixed includes for Aztec and cleaned up some
 *            lint-ish errors; simplified test for AmigaDOS version.
 * 11 Nov 95, Paul Kienitz, added Agetch() for crypt password input and
 *            UnZip's "More" prompt -- simplifies crypt.h and avoids
 *            use of library code redundant with sendpkt().  Made it
 *            available to fUnZip, which does not use FileDate().
 * 22 Nov 95, Paul Kienitz, created a new tzset() that gets the current
 *            timezone from the Locale preferences.  These exist only under
 *            AmigaDOS 2.1 and up, but it is probably correctly set on more
 *            Amigas than the TZ environment variable is.  We check that
 *            only if TZ is not validly set.  We do not parse daylight
 *            savings syntax except to check for presence vs. absence of a
 *            DST part; United States rules are assumed.  This is better
 *            than the tzset()s in the Amiga compilers' libraries do.
 * 15 Jan 96, Chr. Spieler, corrected the logic when to select low level
 *            sendpkt() (when FileDate(), Agetch() or windowheight() is used),
 *            and AMIGA's Agetch() (CRYPT, and UnZip(SFX)'s UzpMorePause()).
 * 10 Feb 96, Paul Kienitz, re-fiddled that selection logic again, moved
 *            stuff around for clarity.
 * 16 Mar 96, Paul Kienitz, created a replacement localtime() to go with the
 *            new tzset(), because Aztec's is hopelessly broken.  Also
 *            gmtime(), which localtime() calls.
 * 12 Apr 96, Paul Kienitz, daylight savings was being handled incorrectly.
 * 21 Apr 96, Paul Kienitz, had to replace time() as well, Aztec's returns
 *            local time instead of GMT.  That's why their localtime() was bad,
 *            because it assumed time_t was already local, and gmtime() was
 *            the one that checked TZ.
 * 23 Apr 96, Chr. Spieler, deactivated time() replacement for UnZip stuff.
 *            Currently, the UnZip sources do not make use of time() (and do
 *            not supply the working mktime() replacement, either!).
 * 29 Apr 96, Paul Kienitz, created a replacement getenv() out of code that
 *            was previously embedded in tzset(), for reliable global test
 *            of whether TZ is set or not.
 * 19 Jun 96, Haidinger Walter, re-adapted for current SAS/C compiler.
 *  7 Jul 96, Paul Kienitz, smoothed together compiler-related changes.
 *  4 Feb 97, Haidinger Walter, added set_TZ() for SAS/C.
 * 23 Apr 97, Paul Kienitz, corrected Unix->Amiga DST error by adding
 *            mkgmtime() so localtime() could be used.
 * 28 Apr 97, Christian Spieler, deactivated mkgmtime() definition for ZIP;
 *            the Zip sources supply this function as part of util.c.
 * 24 May 97, Haidinger Walter, added time_lib support for SAS/C and moved
 *            set_TZ() to time_lib.c.
 * 12 Jul 97, Paul Kienitz, adapted time_lib stuff for Aztec.
 * 26 Jul 97, Chr. Spieler, old mkgmtime() fixed (ydays[] def, sign vs unsign).
 * 30 Dec 97, Haidinger Walter, adaptation for SAS/C using z-stat.h functions.
 * 19 Feb 98, Haidinger Walter, removed alloc_remember, more SAS.C fixes.
 * 23 Apr 98, Chr. Spieler, removed mkgmtime(), changed FileDate to convert to
 *            Amiga file-time directly.
 * 24 Apr 98, Paul Kienitz, clip Unix dates earlier than 1978 in FileDate().
 * 02 Sep 98, Paul Kienitz, C. Spieler, always include zip.h to get a defined
 *            header inclusion sequence that resolves all header dependencies.
 * 06 Jun 00, Paul Kienitz, removed time_lib.c due to its incompatible license,
 *            moved set_TZ() back here, replaced minimal tzset() and localtime()
 *            with new versions derived from GNU glibc source.  Gave locale_TZ()
 *            reasonable European defaults for daylight savings.
 * 17 Jun 00, Paul Kienitz, threw out GNU code because of objections to the GPL
 *            virus, replaced with similar functions based on the public domain
 *            timezone code at ftp://elsie.nci.nih.gov/pub.  As with the GNU
 *            stuff, support for timezone files and leap seconds was removed.
 * 23 Aug 00, Paul Kienitz, moved timezone code out from here into separate
 *            platform-independent module 'timezone.c'.
 * 31 Dec 00, Christian Spieler, moved system-specific timezone help funcions
 *            back in here, from 'timezone.c'.
 * 07 Jan 01, Paul Kienitz, Chr. Spieler, added missing #include "timezone.h"



( run in 1.767 second using v1.01-cache-2.11-cpan-a49fcb8fa48 )