Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name :
  4. HashTest.h
  5. Abstract:
  6. Test harness for LKRhash
  7. Author:
  8. George V. Reilly (GeorgeRe) 06-Jan-1998
  9. Environment:
  10. Win32 - User Mode
  11. Project:
  12. Internet Information Server RunTime Library
  13. Revision History:
  14. --*/
  15. #ifndef __INIFILE_H__
  16. #define __INIFILE_H__
  17. #ifndef _MAX_PATH
  18. # define _MAX_PATH 260
  19. #endif
  20. class CIniFileSettings
  21. {
  22. public:
  23. TCHAR m_tszIniFile[_MAX_PATH]; // the .ini file
  24. TCHAR m_tszDataFile[_MAX_PATH]; // where string data table lives
  25. int m_nMaxKeys; // maximum number of keys
  26. double m_dblHighLoad; // maximum load of table (avg. bucket length)
  27. DWORD m_nInitSize; // initsize (1 => "small", 2 => "medium",
  28. // 3 => "large", other => exact)
  29. int m_nSubTables; // num subtables (0 => heuristic)
  30. int m_nLookupFreq; // lookup frequency
  31. int m_nMinThreads; // min threads
  32. int m_nMaxThreads; // max threads
  33. int m_nRounds; // num rounds
  34. int m_nSeed; // random seed
  35. bool m_fCaseInsensitive; // case-insensitive
  36. bool m_fMemCmp; // memcmp or strcmp
  37. int m_nLastChars; // num last chars (0 => all chars)
  38. WORD m_wTableSpin; // table lock spin count (0 => no spinning on
  39. // MP machines)
  40. WORD m_wBucketSpin; // bucket lock spin count (0 => no MP spinning)
  41. double m_dblSpinAdjFctr; // spin adjustment factor
  42. bool m_fTestIterators; // run test_iterators?
  43. int m_nInsertIfNotFound;// test WriteLock, if(!FindKey) InsertRec, WUL?
  44. // if IINF > 0, do this with probability 1/IINF
  45. int m_nFindKeyCopy; // search for a COPY of the key?
  46. // if FKC > 0, do this probability 1/FKC
  47. bool m_fNonPagedAllocs;
  48. bool m_fRefTrace;
  49. int
  50. ParseIniFile(
  51. LPCSTR pszIniFile);
  52. void
  53. ReadIniFile(
  54. LPCTSTR ptszIniFile);
  55. void
  56. Dump(
  57. LPCTSTR ptszProlog,
  58. LPCTSTR ptszEpilog) const;
  59. };
  60. extern "C"
  61. const TCHAR*
  62. CommaNumber(
  63. int n,
  64. TCHAR* ptszBuff);
  65. int
  66. LKR_TestHashTable(
  67. CIniFileSettings& ifs);
  68. extern "C"
  69. int
  70. NumProcessors();
  71. #endif // __INIFILE_H__