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.

54 lines
1.3 KiB

  1. //
  2. // atoms.h: Atom handling
  3. //
  4. //
  5. #ifndef __ATOMS_H__
  6. #define __ATOMS_H__
  7. ///////////////////////////////////////////////////// DEFINES
  8. // Atom Table
  9. //
  10. // We have our own atoms for two reasons:
  11. //
  12. // 1) Gives us greater flexibility for partial string searches,
  13. // in-place string replacements, and table resize
  14. // 2) We don't know yet if Windows' local atom tables are sharable
  15. // in separate instances in Win32.
  16. //
  17. BOOL PUBLIC Atom_Init (void);
  18. void PUBLIC Atom_Term (void);
  19. int PUBLIC Atom_Add (LPCTSTR psz);
  20. UINT PUBLIC Atom_AddRef(int atom);
  21. void PUBLIC Atom_Delete (int atom);
  22. BOOL PUBLIC Atom_Replace (int atom, LPCTSTR pszNew);
  23. int PUBLIC Atom_Find (LPCTSTR psz);
  24. LPCTSTR PUBLIC Atom_GetName (int atom);
  25. BOOL PUBLIC Atom_IsPartialMatch(int atom1, int atom2);
  26. BOOL PUBLIC Atom_Translate(int atomOld, int atomNew);
  27. #define Atom_IsChildOf(atom1, atom2) Atom_IsPartialMatch(atom1, atom2)
  28. #define Atom_IsParentOf(atom1, atom2) Atom_IsPartialMatch(atom2, atom1)
  29. #define ATOM_ERR (-1)
  30. #define Atom_IsValid(atom) (ATOM_ERR != (atom) && 0 != (atom))
  31. #ifdef DEBUG
  32. void PUBLIC Atom_ValidateFn(int atom);
  33. void PUBLIC Atom_DumpAll();
  34. #define VALIDATE_ATOM(atom) Atom_ValidateFn(atom)
  35. #else // DEBUG
  36. #define VALIDATE_ATOM(atom)
  37. #endif // DEBUG
  38. #endif // __ATOMS_H__