home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / bytewarp.zip / SYSSPEC.H < prev    next >
C/C++ Source or Header  |  1995-11-02  |  3KB  |  146 lines

  1. /*
  2. ** sysspec.h
  3. ** Header file for sysspec.c
  4. ** BYTEmark (tm)
  5. ** BYTE's Native Mode Benchmarks
  6. ** Rick Grehan, BYTE Magazine
  7. **
  8. ** Creation:
  9. ** Revision: 3/95
  10. **
  11. ** DISCLAIMER
  12. ** The source, executable, and documentation files that comprise
  13. ** the BYTEmark benchmarks are made available on an "as is" basis.
  14. ** This means that we at BYTE Magazine have made every reasonable
  15. ** effort to verify that the there are no errors in the source and
  16. ** executable code.  We cannot, however, guarantee that the programs
  17. ** are error-free.  Consequently, McGraw-HIll and BYTE Magazine make
  18. ** no claims in regard to the fitness of the source code, executable
  19. ** code, and documentation of the BYTEmark.
  20. **  Furthermore, BYTE Magazine, McGraw-Hill, and all employees
  21. ** of McGraw-Hill cannot be held responsible for any damages resulting
  22. ** from the use of this code or the results obtained from using
  23. ** this code.
  24. */
  25.  
  26. /*
  27. ** Standard includes
  28. */
  29. #include <stdlib.h>
  30. #include <stdio.h>
  31. #include <time.h>
  32. #include <string.h>
  33.  
  34. #include "nmglobal.h"
  35.  
  36. #ifndef MAC
  37. #include <malloc.h>
  38. #endif
  39.  
  40.  
  41. /*
  42. ** System-specific includes
  43. */
  44.  
  45. #ifdef DOS16MEM
  46. #include "dos.h"
  47. #endif
  48.  
  49. /* #include "time.h"
  50. #include "io.h"
  51. #include "fcntl.h"
  52. #include "sys\stat.h" */
  53. /* Removed for MSVC++
  54. #include "alloc.h"
  55. */
  56.  
  57. /*
  58. ** MAC Time Manager routines (from Code Warrior)
  59. */
  60. #ifdef MACTIMEMGR
  61. #include <memory.h>
  62. #include <lowmem.h>
  63. #include <Types.h>
  64. #include <Timer.h>
  65. extern struct TMTask myTMTask;
  66. extern long MacHSTdelay,MacHSTohead;
  67. #endif
  68.  
  69. /*
  70. ** Windows 3.1 timer defines
  71. */
  72. #ifdef WIN31TIMER
  73. #include <windows.h>
  74. #include <toolhelp.h>
  75. TIMERINFO win31tinfo;
  76. HANDLE hThlp;
  77. FARPROC lpfn;
  78. #endif
  79.  
  80. /**************
  81. ** EXTERNALS **
  82. **************/
  83. extern ulong mem_array[2][MEM_ARRAY_SIZE];
  84. extern int mem_array_ents;
  85. extern int global_align;
  86.  
  87. /****************************
  88. **   FUNCTION PROTOTYPES   **
  89. ****************************/
  90.  
  91. farvoid *AllocateMemory(unsigned long nbytes,
  92.                 int *errorcode);
  93.  
  94. void FreeMemory(farvoid *mempointer,
  95.                 int *errorcode);
  96.  
  97. void MoveMemory( farvoid *destination,
  98.                 farvoid *source,
  99.                 unsigned long nbytes);
  100.  
  101. #ifdef DOS16MEM
  102. void FarDOSmemmove(farvoid *destination,
  103.                 farvoid *source,
  104.                 unsigned long nbytes);
  105. #endif
  106.  
  107. void InitMemArray(void);
  108.  
  109. int AddMemArray(ulong true_addr, ulong adj_addr);
  110.  
  111. int RemoveMemArray(ulong adj_addr,ulong *true_addr);
  112.  
  113. void ReportError(char *context, int errorcode);
  114.  
  115. void ErrorExit();
  116.  
  117. void CreateFile(char *filename,
  118.                 int *errorcode);
  119.  
  120. int bmOpenFile(char *fname,
  121.                 int *errorcode);
  122.  
  123. void CloseFile(int fhandle,
  124.                 int *errorcode);
  125.  
  126. void readfile(int fhandle,
  127.                 unsigned long offset,
  128.                 unsigned long nbytes,
  129.                 void *buffer,
  130.                 int *errorcode);
  131.  
  132. void writefile(int fhandle,
  133.                 unsigned long offset,
  134.                 unsigned long nbytes,
  135.                 void *buffer,
  136.                 int *errorcode);
  137.  
  138. unsigned long StartStopwatch();
  139.  
  140. unsigned long StopStopwatch(unsigned long startticks);
  141.  
  142. unsigned long TicksToSecs(unsigned long tickamount);
  143.  
  144. double TicksToFracSecs(unsigned long tickamount);
  145.  
  146.