home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip541.zip / UNZIP541.EXE / 32-dll / unzipstb.c < prev    next >
C/C++ Source or Header  |  2000-04-14  |  2KB  |  57 lines

  1. /*
  2.   Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.
  3.  
  4.   See the accompanying file LICENSE, version 2000-Apr-09 or later
  5.   (the contents of which are also included in unzip.h) for terms of use.
  6.   If, for some reason, all these files are missing, the Info-ZIP license
  7.   also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
  8. */
  9. /*---------------------------------------------------------------------------
  10.  
  11.   unzipstb.c
  12.  
  13.   Simple stub function for UnZip DLL (or shared library, whatever); does
  14.   exactly the same thing as normal UnZip, except for additional printf()s
  15.   of various version numbers, solely as a demonstration of what can/should
  16.   be checked when using the DLL.  (If major version numbers ever differ,
  17.   assume program is incompatible with DLL--especially if DLL version is
  18.   older.  This is not likely to be a problem with *this* simple program,
  19.   but most user programs will be much more complex.)
  20.  
  21.   ---------------------------------------------------------------------------*/
  22.  
  23. #include <stdio.h>
  24. #include "unzip.h"
  25. #include "version.h"
  26.  
  27. int main(int argc, char *argv[])
  28. {
  29.     static UzpVer *pVersion;   /* no pervert jokes, please... */
  30.  
  31.     pVersion = UzpVersion();
  32.  
  33.     printf("UnZip stub:  checking version numbers (DLL is dated %s)\n",
  34.       pVersion->date);
  35.     printf("   UnZip versions:    expecting %d.%d%d, using %d.%d%d%s\n",
  36.       UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, pVersion->unzip.major,
  37.       pVersion->unzip.minor, pVersion->unzip.patchlevel, pVersion->betalevel);
  38.     printf("   ZipInfo versions:  expecting %d.%d%d, using %d.%d%d\n",
  39.       ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, pVersion->zipinfo.major,
  40.       pVersion->zipinfo.minor, pVersion->zipinfo.patchlevel);
  41.  
  42. /*
  43.     D2_M*VER and os2dll.* are obsolete, though retained for compatibility:
  44.  
  45.     printf("   OS2 DLL versions:  expecting %d.%d%d, using %d.%d%d\n",
  46.       D2_MAJORVER, D2_MINORVER, D2_PATCHLEVEL, pVersion->os2dll.major,
  47.       pVersion->os2dll.minor, pVersion->os2dll.patchlevel);
  48.  */
  49.  
  50.     if (pVersion->flag & 2)
  51.         printf("   using zlib version %s\n", pVersion->zlib_version);
  52.     printf("\n");
  53.  
  54.     /* call the actual UnZip routine (string-arguments version) */
  55.     return UzpMain(argc, argv);
  56. }
  57.