Leaked source code of windows server 2003
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.

92 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1998-2001 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. LKRhash
  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. unsigned m_nHighLoad; // 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; // Kernel mode: paged or non-paged allocs
  48. bool m_fDebugSpew; // Enable global debug spew?
  49. bool m_fRefTrace; // Enable debug spew for WordHash::AddRef?
  50. bool m_fMultiKeys; // Allow multiple identical keys
  51. bool m_fUseLocks; // Must use locks to protect the data
  52. int
  53. ParseIniFile(
  54. LPCSTR pszIniFile);
  55. void
  56. ReadIniFile(
  57. LPCTSTR ptszIniFile);
  58. void
  59. Dump(
  60. LPCTSTR ptszProlog,
  61. LPCTSTR ptszEpilog) const;
  62. };
  63. extern "C"
  64. const TCHAR*
  65. CommaNumber(
  66. int n,
  67. TCHAR* ptszBuff);
  68. int
  69. LKR_TestHashTable(
  70. CIniFileSettings& ifs);
  71. extern "C"
  72. int
  73. NumProcessors();
  74. #endif // __INIFILE_H__