home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 350.lha / DiskSpeed_v3.0 / DiskSpeedWindow.h < prev    next >
C/C++ Source or Header  |  1990-02-25  |  5KB  |  173 lines

  1. /*
  2.  *                          DiskSpeed v3.0
  3.  *                                by
  4.  *                           Michael Sinz
  5.  *
  6.  *             Copyright (c) 1989 by MKSoft Development
  7.  *
  8.  *            MKSoft Development
  9.  *            163 Appledore Drive
  10.  *            Downingtown, PA 19335
  11.  *
  12.  * Yes, this is yet another disk speed testing program, but with a few
  13.  * differences.  It was designed to give the most accurate results of the
  14.  * true disk performance in the system.  For this reason many of
  15.  * DiskSpeed's results may look either lower or higher than current disk
  16.  * performance tests.
  17.  *
  18.  * This program was thrown together in a few hours because I needed more
  19.  * accurate and consistent results for disk performance as seen from the
  20.  * application's standpoint.  This program has now served its purpose and
  21.  * I am now giving it to the rest of the Amiga world to play with as long
  22.  * as all of the files remain together in unmodified form.  (That is, the
  23.  * files DiskSpeed, DiskSpeed.info, DiskSpeed.c, DiskSpeedWindow.c,
  24.  * DiskSpeedWindow.h, MakeBoxes.c, MakeBoxes.h, StandardGadgets.c,
  25.  * StandardGadgets.h, RenderInfo.c, RenderInfo.h, DiskSpeed.doc, and
  26.  * MakeFile)
  27.  *
  28.  * Version 2.0 of this program added a few features and cleaned up the
  29.  * user interface.  I hope you like this...
  30.  *
  31.  * Version 3.0 of this program added the performance stress and cleaned up
  32.  * some parts of the older code.  (Fix to RenderInfo.c)
  33.  *
  34.  ******************************************************************************
  35.  *                                          *
  36.  *    Reading legal mush can turn your brain into guacamole!              *
  37.  *                                          *
  38.  *        So here is some of that legal mush:                  *
  39.  *                                          *
  40.  * Permission is hereby granted to distribute this program's source          *
  41.  * executable, and documentation for non-commercial purposes, so long as the  *
  42.  * copyright notices are not removed from the sources, executable or          *
  43.  * documentation.  This program may not be distributed for a profit without   *
  44.  * the express written consent of the author Michael Sinz.              *
  45.  *                                          *
  46.  * This program is not in the public domain.                      *
  47.  *                                          *
  48.  * Fred Fish is expressly granted permission to distribute this program's     *
  49.  * source and executable as part of the "Fred Fish freely redistributable     *
  50.  * Amiga software library."                              *
  51.  *                                          *
  52.  * Permission is expressly granted for this program and it's source to be     *
  53.  * distributed as part of the Amicus Amiga software disks, and the          *
  54.  * First Amiga User Group's Hot Mix disks.                      *
  55.  *                                          *
  56.  ******************************************************************************
  57.  *
  58.  * My DiskSpeedWindow definitions...
  59.  */
  60.  
  61. #define    GADGET_LOW    1
  62. #define    GADGET_MED    2
  63. #define    GADGET_HIGH    4
  64.  
  65. #define    GADGET_START    5
  66. #define    GADGET_SAVE    6
  67. #define    GADGET_PRINT    7
  68.  
  69. #define    GADGET_STRING    8
  70.  
  71. #define    GADGET_REQ    9
  72.  
  73. #define    GADGET_DMA    10
  74. #define    GADGET_CPU    11
  75.  
  76. #define    NUM_BOXES    12
  77. #define    NUM_TEXT    19
  78. #define    NUM_GADGETS    8
  79. #define    NUM_RESULTS    17
  80.  
  81. #define    RESULTS_512_CREATE    0
  82. #define    RESULTS_512_WRITE    1
  83. #define    RESULTS_512_READ    2
  84.  
  85. #define    RESULTS_4096_CREATE    3
  86. #define    RESULTS_4096_WRITE    4
  87. #define    RESULTS_4096_READ    5
  88.  
  89. #define    RESULTS_32768_CREATE    6
  90. #define    RESULTS_32768_WRITE    7
  91. #define    RESULTS_32768_READ    8
  92.  
  93. #define    RESULTS_262144_CREATE    9
  94. #define    RESULTS_262144_WRITE    10
  95. #define    RESULTS_262144_READ    11
  96.  
  97. #define    RESULTS_CREATE        12
  98. #define    RESULTS_OPEN_CLOSE    13
  99. #define    RESULTS_DIR_SCAN    14
  100. #define    RESULTS_DELETE        15
  101.  
  102. #define    RESULTS_SEEK_READ    16
  103.  
  104. struct MyBox
  105. {
  106. struct    Border    Border;
  107.     SHORT    Vectors[5*2];
  108. };
  109.  
  110. struct MyGadget
  111. {
  112. struct    Gadget        Gadget;
  113. struct    IntuiText    IntuiText;
  114. struct    Border        Borders[4];
  115.     USHORT        Vectors1[16];
  116.     USHORT        Vectors2[16];
  117. };
  118.  
  119. struct MyResult
  120. {
  121. struct    IntuiText    IntuiText;
  122.     char        text[10];
  123. };
  124.  
  125. struct MyWindow
  126. {
  127. struct    Window        *Window;
  128. struct    Gadget        *CloseGadget;
  129. struct    Gadget        *FrontBackGadget;
  130. struct    Gadget        *DragGadget;
  131. struct    timeval        StartTime;
  132. struct    timeval        StopTime;
  133. struct    timerequest    TimeReq;
  134. struct    Gadget        Background;
  135. struct    Image        Image_Background;
  136. struct    Gadget        Detail;
  137. struct    MyBox        Details[NUM_BOXES*2];
  138. struct    IntuiText    TextDetails[NUM_TEXT];
  139. struct    MyGadget    MyGadgets[NUM_GADGETS];
  140. struct    MyResult    MyResults[NUM_RESULTS];
  141. struct    Gadget        DeviceGadget;
  142. struct    StringInfo    DeviceGadgetInfo;
  143.     char        DeviceName[32];
  144. struct    Gadget        CommentGadget;
  145. struct    StringInfo    CommentGadgetInfo;
  146.     char        Comment[80];
  147.  
  148. /* For the requester... */
  149. struct    Requester    Req;
  150. struct    Border        ReqBorders[4];
  151. struct    Gadget        ReqGadget;
  152. struct    IntuiText    ReqIText;
  153.     SHORT        ReqVector1[16];
  154.     SHORT        ReqVector2[16];
  155.  
  156. /* Flag for which type of testing... */
  157.     USHORT        TestFlag;
  158.  
  159. /* Task pointer for the CPU stress task */
  160. struct    Task        *CPUstress;
  161.  
  162. /* Pointer to the User copper list in DMA stress */
  163. struct    UCopList    *DMAstress;
  164. };
  165.  
  166. VOID Write_Results(struct MyWindow *,BPTR);
  167.  
  168. VOID Stress_On(struct MyWindow *);
  169. VOID Stress_Off(struct MyWindow *);
  170.  
  171. struct MyWindow *OpenMyWindow(struct RenderInfo *);
  172. VOID CloseMyWindow(struct MyWindow *);
  173.