Counter Strike : Global Offensive Source Code
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.

67 lines
1.9 KiB

  1. #ifndef CRYPTOPP_FLTRIMPL_H
  2. #define CRYPTOPP_FLTRIMPL_H
  3. #define FILTER_BEGIN \
  4. switch (m_continueAt) \
  5. { \
  6. case 0: \
  7. m_inputPosition = 0;
  8. #define FILTER_END_NO_MESSAGE_END_NO_RETURN \
  9. break; \
  10. default: \
  11. assert(false); \
  12. }
  13. #define FILTER_END_NO_MESSAGE_END \
  14. FILTER_END_NO_MESSAGE_END_NO_RETURN \
  15. return 0;
  16. /*
  17. #define FILTER_END \
  18. case -1: \
  19. if (messageEnd && Output(-1, NULL, 0, messageEnd, blocking)) \
  20. return 1; \
  21. FILTER_END_NO_MESSAGE_END
  22. */
  23. #define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel) \
  24. {\
  25. case site: \
  26. statement; \
  27. if (Output(site, output, length, messageEnd, blocking, channel)) \
  28. return STDMAX(size_t(1), length-m_inputPosition);\
  29. }
  30. #define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \
  31. FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL)
  32. #define FILTER_OUTPUT(site, output, length, messageEnd) \
  33. FILTER_OUTPUT2(site, 0, output, length, messageEnd)
  34. #define FILTER_OUTPUT_BYTE(site, output) \
  35. FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0)
  36. #define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd) \
  37. {\
  38. case site: \
  39. statement; \
  40. if (OutputModifiable(site, output, length, messageEnd, blocking)) \
  41. return STDMAX(size_t(1), length-m_inputPosition);\
  42. }
  43. #define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd) \
  44. FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd)
  45. #define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable) \
  46. {\
  47. case site: \
  48. statement; \
  49. if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \
  50. return STDMAX(size_t(1), length-m_inputPosition);\
  51. }
  52. #define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable) \
  53. FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable)
  54. #endif