home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / SAMPLES / SORTDEMO / SORTDEMO.H_ / SORTDEMO.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  1.7 KB  |  70 lines

  1. // sortdemo.h : Declares the class interfaces for the Sort Demo frame window.
  2. //
  3.  
  4. #ifndef __SORTDEMO_H__
  5. #define __SORTDEMO_H__
  6.  
  7. #define NUMBARS 45
  8.  
  9. typedef struct _COLOR
  10. {
  11.     short nBlue;
  12.     short nGreen;
  13.     short nRed;
  14. } COLOR;
  15.  
  16. typedef struct _BAR
  17. {
  18.     char len;
  19.     COLOR clr;
  20. } BAR;
  21.  
  22. typedef struct _TIMESTRUCT
  23. {   float   time;
  24.     int swaps;
  25.     int compares;
  26.     BOOL    done;
  27. }TIMESTRUCT;
  28.  
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // function prototypes
  32.  
  33. int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
  34. BOOL InitApplication(HANDLE);
  35. BOOL InitInstance(HANDLE, int);
  36. long FAR PASCAL __export MainWndProc(HWND, UINT, UINT, LONG);
  37. BOOL FAR PASCAL __export About(HWND, unsigned, WORD, LONG);
  38. BOOL FAR PASCAL __export Stats(HWND, unsigned, WORD, LONG);
  39. BOOL FAR PASCAL __export Pause(HWND, unsigned, WORD, LONG);
  40.  
  41. void RenderBars(HWND hWnd);
  42. void DrawBarChart();
  43. void DrawTime();
  44. void Sleep( clock_t wait );
  45. void Beep( int frequency, int duration );
  46. void DrawBar( int Row );
  47. void InitBars( void  );             // Bar functions
  48. void Swaps( BAR *one, BAR *two );
  49. void SwapBars( int iRow1, int iRow2 );
  50. void InsertionSort( void );
  51. void BubbleSort( void  );
  52. void HeapSort( void  );
  53. void PercolateUp( int iMaxLevel );
  54. void PercolateDown( int iMaxLevel );
  55. void ExchangeSort( void  );
  56. void ShellSort( void  );
  57. void QuickSort( int iLow, int iHigh );
  58. COLOR SetNewColors();
  59. void InitStats(TIMESTRUCT *tm);
  60. void InitPrevRandom(HWND hWnd);
  61. void InitSort(HWND hWnd);
  62. void EndSort(HWND hWnd);
  63.  
  64.  
  65. #define GetRandom( min, max ) ((rand() % (int)(((max) + 1) - (min))) + (min))
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68.  
  69. #endif // __SORTDEMO_H__
  70.