home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / clock.zip / CLOCK.C < prev    next >
Text File  |  1987-01-03  |  2KB  |  47 lines

  1. /***************************************************************CLOCK.C
  2. * name:        CLOCK - analog clock display
  3. *
  4. * function:    Displays analog clock (with hands) on screen
  5. *
  6. * description:    This is the main program that calls all the functions
  7. *        and subroutines.  Essentially, all it performs is
  8. *        the scheduling function that a multi-tasking operating
  9. *        system would.  
  10. *        It also sets up all the global memory areas.
  11. *******************************************************************
  12. * 11/22/86 -RBM- original design
  13. *******************************************************************/
  14.  
  15. /***************************
  16.  * MAIN PROGRAM
  17.  ***************************/
  18. #define XTRNALGLOBALS 0            /* globals defined in this module */
  19. #include "E:CLKGBL.H"            /* setup global storage */
  20.  
  21. main ()
  22. {
  23.     int ch = 0;    /* character input from keyboard */
  24.  
  25.     clkizn();    /* one-time initialization */
  26.     clksiz();    /* determine size, colors, and location */
  27.     clkclr();    /* clear screen area for clock */
  28.     clkfac();    /* paint clock's face */
  29.  
  30.     while (ch == 0)            /* check for any key pressed */
  31.         {            /* loop till any key pressed */
  32.         clktim();        /* get time */
  33.         clkpnt();        /* paint hands */
  34.         ch = clkkyb();        /* see if character at keyboard */
  35.         clkhrh();        /* compute hour hand */
  36.         clkmnh();        /* compute minute hand */
  37.         clksch();        /* compute second hand */
  38.         };
  39.     
  40.  
  41.     sreg.ax = 0X0003;        /* restore screen mode */
  42.     sreg.bx = sreg.cx = sreg.dx = 0;
  43.     csysint(VIDEO, &sreg, &rreg);
  44.  
  45. }                /******* END OF PROGRAM **************/
  46.  
  47.