Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:03

0001 #ifndef CRYPTOPP_FLTRIMPL_H
0002 #define CRYPTOPP_FLTRIMPL_H
0003 
0004 #define FILTER_BEGIN    \
0005     switch (m_continueAt)   \
0006     {   \
0007     case 0: \
0008         m_inputPosition = 0;
0009 
0010 #define FILTER_END_NO_MESSAGE_END_NO_RETURN \
0011         break;  \
0012     default:    \
0013         CRYPTOPP_ASSERT(false); \
0014     }
0015 
0016 #define FILTER_END_NO_MESSAGE_END   \
0017     FILTER_END_NO_MESSAGE_END_NO_RETURN \
0018     return 0;
0019 
0020 /*

0021 #define FILTER_END  \

0022     case -1:    \

0023         if (messageEnd && Output(-1, NULLPTR, 0, messageEnd, blocking)) \

0024             return 1;   \

0025     FILTER_END_NO_MESSAGE_END

0026 */
0027 
0028 #define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel)    \
0029     {\
0030     case site:  \
0031     (void) statement;   \
0032     if (Output(site, output, length, messageEnd, blocking, channel))    \
0033         return STDMAX(size_t(1), length-m_inputPosition);\
0034     }
0035 
0036 #define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \
0037     FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL)
0038 
0039 #define FILTER_OUTPUT(site, output, length, messageEnd) \
0040     FILTER_OUTPUT2(site, 0, output, length, messageEnd)
0041 
0042 #define FILTER_OUTPUT_BYTE(site, output)    \
0043     FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0)
0044 
0045 #define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd)  \
0046     {\
0047     /* fall through */ \
0048     case site:  \
0049     (void) statement;   \
0050     if (OutputModifiable(site, output, length, messageEnd, blocking))   \
0051         return STDMAX(size_t(1), length-m_inputPosition);\
0052     }
0053 
0054 #define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd)  \
0055     FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd)
0056 
0057 #define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable)    \
0058     {\
0059     /* fall through */ \
0060     case site:  \
0061     (void) statement;   \
0062     if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \
0063         return STDMAX(size_t(1), length-m_inputPosition);\
0064     }
0065 
0066 #define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable)    \
0067     FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable)
0068 
0069 #endif