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.

22 lines
606 B

  1. #ifndef _HASH_H
  2. #define _HASH_H
  3. #include "tokens.h"
  4. #define HASHSIZE 257 // DO NOT CHANGE!
  5. // this prime has been chosen because
  6. // there is a fast MOD257
  7. // if you use the % operator the thing
  8. // slows down to just about what a binary search is.
  9. #define MOD257(k) ((k) - ((k) & ~255) - ((k) >> 8) ) // MOD 257
  10. #define MOD257_1(k) ((k) & 255) // MOD (257 - 1)
  11. extern BOOL _rtfHashInited;
  12. VOID HashKeyword_Init( );
  13. VOID HashKeyword_Insert ( const KEYWORD *token );
  14. const KEYWORD *HashKeyword_Fetch ( const CHAR *szKeyword );
  15. #endif // _HASH_H