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.

62 lines
2.7 KiB

  1. #ifndef __FILTER_H__
  2. #define __FILTER_H__
  3. // Based on the filtering type (All or Table) tags in the given body will
  4. // be filtered. What the filter does with the tags will depend on the
  5. // next set of flags. The Disable/Remove Option will determine if the tags
  6. // are removed or diabled by replacing the '<' with and &lt. The last flag
  7. // controls whether or not embedded links like http:// are activated. If
  8. // a link is detected and not put into an <A> tag.
  9. #define FILTERTAGS_FILTERALL 0x00000001
  10. #define FILTERTAGS_FILTERTABLE 0x00000002
  11. #define FILTERTAGS_ENABLELINKS 0x00000100
  12. //+------------------------------------------------------------------------
  13. //
  14. // Member: HTML_FilterTags
  15. //
  16. // Synopsis: This function is used to filter HTML tags from a block of
  17. // text. Based on the flags the filtering routine can be used
  18. // to filter tags out, disable them, and can do a few other
  19. // types of filtering.
  20. //
  21. // Arguments: szContent - This is the block of text that should be
  22. // filtered. The filtering is done in place.
  23. // Therefore depending on the flags, the block
  24. // may grow and there must be enough space in
  25. // the buffer for the expansion.
  26. // dwMaxLen - This is the size of the buffer, and any
  27. // can not exceeed these limits.
  28. // iFilterHow - This controls what filtering process is
  29. // applied to the data.
  30. // pszNewBuffer- This will hold the adress of the dynamic
  31. // buffer if there was a need to allocate one
  32. // dwNewBufferSize - if not 0 and the initial string is not
  33. // large enough to hold the result, a new
  34. // buffer of that size will be allocated
  35. //
  36. //
  37. // Returns: HRESULT
  38. //
  39. // S_OK - means that the data was successfully filtered and
  40. // enough space existed to perform all required
  41. // modifications to the data.
  42. //
  43. // Notes: The grsValidTags table is used to determine which tags
  44. // and attributes are allowed.
  45. //
  46. //-------------------------------------------------------------------------
  47. HRESULT PROJINTERNAL HTML_FilterTagsA(const CHAR *szSrcContent, CHAR *szDestContent, DWORD *pdwMaxLen, int fFilterHow, CHAR** pszNewBuffer = NULL, DWORD dwNewBufferSize = 0);
  48. HRESULT PROJINTERNAL HTML_FilterTagsW(const WCHAR *szSrcContent, WCHAR *szDestContent, DWORD *pdwMaxLen, int fFilterHow, WCHAR** pszNewBuffer = NULL, DWORD dwNewBufferSize = 0);
  49. #ifdef UNICODE
  50. #define HTML_FilterTags HTML_FilterTagsW
  51. #else
  52. #define HTML_FilterTags HTML_FilterTagsA
  53. #endif
  54. #endif // __FILTER_H__