home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip52.zip / unzipstb.c < prev    next >
C/C++ Source or Header  |  1995-11-24  |  2KB  |  44 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.     printf("   OS2 DLL versions:  expecting %d.%d%d, using %d.%d%d\n",
  33.       D2_MAJORVER, D2_MINORVER, PATCHLEVEL, pVersion->os2dll.major,
  34.       pVersion->os2dll.minor, pVersion->os2dll.patchlevel);
  35.     printf("   Win DLL versions:  expecting %d.%d%d, using %d.%d%d\n",
  36.       DW_MAJORVER, DW_MINORVER, PATCHLEVEL, pVersion->windll.major,
  37.       pVersion->windll.minor, pVersion->windll.patchlevel);
  38.     if (pVersion->flag & 2)
  39.         printf("   using zlib version %s\n", pVersion->zlib_version);
  40.     printf("\n");
  41.  
  42.     return UzpMain(argc, argv);
  43. }
  44.