home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / source / rayce27s / djgcc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-02  |  1.6 KB  |  77 lines

  1. /*
  2.  * djgcc.c -- device dependent stuff for DJGCC compiler (DOS)
  3.  * 
  4.  * (c) 1994 Shawn McHorse <Shawn_McHorse@fcircus.sat.tx.us>
  5.  * 
  6.  * This program is free software; you can redistribute it and/or modify it
  7.  * under the terms of the GNU General Public License as published by the
  8.  * Free Software Foundation;
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License along
  16.  * with this program; if not, write to the Free Software Foundation, Inc.,
  17.  * 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  * 
  19.  */
  20.  
  21. #include "ray.h"
  22. #include "proto.h"
  23. #include "extern.h"
  24. #include <go32.h>
  25. #include <dpmi.h>
  26. #include <time.h>
  27.  
  28. PUBLIC void
  29. check_abort(void)
  30. {
  31.     if (keyboard_exit)
  32.     if (_go32_was_ctrl_break_hit())
  33.         abort_trace(0);
  34.     else
  35.         return;
  36. }
  37.  
  38. PRIVATE time_t  t0;
  39.  
  40. PUBLIC void
  41. timer_start(void)
  42. {
  43.     time(&t0);            /* Get starting time. */
  44. }
  45.  
  46. PUBLIC long
  47. timer_stop(void)
  48. {
  49.     time_t          t1;
  50.  
  51.     time(&t1);            /* Get ending time. */
  52.     return (long) 10 *difftime(t1, t0);    /* Return time difference, in
  53.                      * tenths of seconds. */
  54. }
  55.  
  56. PUBLIC void
  57. install_handlers(void)
  58. {
  59.     return;
  60. }
  61.  
  62. PUBLIC void
  63. init_machine(void)
  64. {
  65.     _go32_want_ctrl_break(1);    /* Tell GO32 to trap Ctrl-Break */
  66. }
  67.  
  68. #ifdef UNDEFINED
  69. PUBLIC unsigned long
  70. memory_left(void)
  71. {
  72.     return (_go32_dpmi_remaining_physical_memory() +
  73.         _go32_dpmi_remaining_virtual_memory());
  74. }
  75.  
  76. #endif
  77.