00001 #ifndef CRYPTOPP_FLTRIMPL_H 00002 #define CRYPTOPP_FLTRIMPL_H 00003 00004 #define FILTER_BEGIN \ 00005 switch (m_continueAt) \ 00006 { \ 00007 case 0: \ 00008 m_inputPosition = 0; 00009 00010 #define FILTER_END_NO_MESSAGE_END_NO_RETURN \ 00011 break; \ 00012 default: \ 00013 assert(false); \ 00014 } 00015 00016 #define FILTER_END_NO_MESSAGE_END \ 00017 FILTER_END_NO_MESSAGE_END_NO_RETURN \ 00018 return 0; 00019 00020 #define FILTER_END \ 00021 case -1: \ 00022 if (Output(-1, NULL, 0, messageEnd, blocking)) \ 00023 return 1; \ 00024 FILTER_END_NO_MESSAGE_END 00025 00026 #define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \ 00027 {\ 00028 case site: \ 00029 statement; \ 00030 if (Output(site, output, length, messageEnd, blocking)) \ 00031 return STDMAX(1U, (unsigned int)length-m_inputPosition);\ 00032 } 00033 00034 #define FILTER_OUTPUT(site, output, length, messageEnd) \ 00035 FILTER_OUTPUT2(site, 0, output, length, messageEnd) 00036 00037 #define FILTER_OUTPUT_BYTE(site, output) \ 00038 FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0) 00039 00040 #endif