home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / QLOG00.ZIP / MAIN.C < prev    next >
Text File  |  1992-08-18  |  2KB  |  86 lines

  1. #ifndef lint
  2. #endif
  3.  
  4. /*
  5.  * Copyright (c) International Business Machines Corporation
  6.  *         1991, 1992
  7.  */
  8.  
  9. #include "animal.h"
  10. #include "dog.h"
  11. #include "ldog.h"
  12. #include "bdog.h"
  13.  
  14.  
  15. /*         ******************************************
  16.            * External SOMPrintf example.  QlogSOM   *
  17.            * hooks SOM to send copies of string to  *
  18.            * external QLOG PM application.  Requires*
  19.            * Qlogr.lib and Qlog.exe.                *
  20.            *                            ldl010392   *
  21.            ******************************************   */
  22. void QlogSOM( void ) ;
  23.  
  24. void main(int argc)
  25. {
  26.     Animal *myAnimal;
  27.     Dog *myDog;
  28.     LittleDog *myLittleDog;
  29.     BigDog *myBigDog;
  30.  
  31.     /*
  32.      *  The hook ..... ldl010392
  33.      */
  34.     QlogSOM() ;
  35.  
  36.     /*
  37.      * Create classes.
  38.      */
  39.     AnimalNewClass(Animal_MajorVersion, Animal_MinorVersion);
  40.     DogNewClass(Dog_MajorVersion, Dog_MinorVersion);
  41.     LittleDogNewClass(LittleDog_MajorVersion, LittleDog_MinorVersion);
  42.     BigDogNewClass(BigDog_MajorVersion, BigDog_MinorVersion);
  43.  
  44.     SOM_TraceLevel = (argc > 1 ? 1 : 0);
  45.  
  46.     /*
  47.      * Create objects using constructors
  48.      */
  49.     myAnimal = _newAnimal(_Animal, "Roar!!!");
  50.     myDog = _newDog(_Dog, "Grrr", "Retriever", "Yellow");
  51.     myLittleDog = _newDog(_LittleDog, "unknown noise",
  52.               "French Poodle", "Black");
  53.     myBigDog = _newDog(_BigDog, "unknown noise",
  54.                "German Shepherd", "Brown");
  55.  
  56.     /*
  57.      * Display objects.
  58.      */
  59.     somPrintf("=====================\n");
  60.     somPrintf("myAnimal:\n");
  61.     _display(myAnimal);
  62.  
  63.     somPrintf("=====================\n");
  64.     somPrintf("myDog:\n");
  65.     _display(myDog);
  66.  
  67.     somPrintf("=====================\n");
  68.     somPrintf("myLittleDog:\n");
  69.     _display(myLittleDog);
  70.  
  71.     somPrintf("=====================\n");
  72.     somPrintf("myBigDog:\n");
  73.     _display(myBigDog);
  74.  
  75.     /*
  76.      * Free objects.
  77.      */
  78.     somPrintf("\n");
  79.     _somFree(myAnimal);
  80.     _somFree(myDog);
  81.     _somFree(myLittleDog);
  82.     _somFree(myBigDog);
  83.  
  84.     exit(0);
  85. }
  86.