home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / unzipstb.c < prev    next >
C/C++ Source or Header  |  1997-02-23  |  2KB  |  48 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.   unzipstb.c
  4.  
  5.   Simple stub function for UnZip DLL (or shared library, whatever); does
  6.   exactly the same thing as normal UnZip, except for additional printf()s
  7.   of various version numbers, solely as a demonstration of what can/should
  8.   be checked when using the DLL.  (If major version numbers ever differ,
  9.   assume program is incompatible with DLL--especially if DLL version is
  10.   older.  This is not likely to be a problem with *this* simple program,
  11.   but most user programs will be much more complex.)
  12.  
  13.   ---------------------------------------------------------------------------*/
  14.  
  15. #include "unzip.h"
  16. #include "version.h"
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20.     static UzpVer *pVersion;   /* no pervert jokes, please... */
  21.  
  22.     pVersion = UzpVersion();
  23.  
  24.     printf("UnZip stub:  checking version numbers (DLL is dated %s)\n",
  25.       pVersion->date);
  26.     printf("   UnZip versions:    expecting %d.%d%d, using %d.%d%d%s\n",
  27.       UZ_MAJORVER, UZ_MINORVER, PATCHLEVEL, pVersion->unzip.major,
  28.       pVersion->unzip.minor, pVersion->unzip.patchlevel, pVersion->betalevel);
  29.     printf("   ZipInfo versions:  expecting %d.%d%d, using %d.%d%d\n",
  30.       ZI_MAJORVER, ZI_MINORVER, PATCHLEVEL, pVersion->zipinfo.major,
  31.       pVersion->zipinfo.minor, pVersion->zipinfo.patchlevel);
  32.  
  33. /*
  34.     D2_M*VER and os2dll.* are obsolete, though retained for compatibility:
  35.  
  36.     printf("   OS2 DLL versions:  expecting %d.%d%d, using %d.%d%d\n",
  37.       D2_MAJORVER, D2_MINORVER, PATCHLEVEL, pVersion->os2dll.major,
  38.       pVersion->os2dll.minor, pVersion->os2dll.patchlevel);
  39.  */
  40.  
  41.     if (pVersion->flag & 2)
  42.         printf("   using zlib version %s\n", pVersion->zlib_version);
  43.     printf("\n");
  44.  
  45.     /* call the actual UnZip routine (string-arguments version) */
  46.     return UzpMain(argc, argv);
  47. }
  48.