Crypto++

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

fltrimpl.h

    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 /*
    00021 #define FILTER_END  \
    00022     case -1:    \
    00023         if (messageEnd && Output(-1, NULL, 0, messageEnd, blocking))    \
    00024             return 1;   \
    00025     FILTER_END_NO_MESSAGE_END
    00026 */
    00027
    00028 #define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel)    \
    00029     {\
    00030     case site:  \
    00031     statement;  \
    00032     if (Output(site, output, length, messageEnd, blocking, channel))    \
    00033         return STDMAX(size_t(1), length-m_inputPosition);\
    00034     }
    00035
    00036 #define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \
    00037     FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL)
    00038
    00039 #define FILTER_OUTPUT(site, output, length, messageEnd) \
    00040     FILTER_OUTPUT2(site, 0, output, length, messageEnd)
    00041
    00042 #define FILTER_OUTPUT_BYTE(site, output)    \
    00043     FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0)
    00044
    00045 #define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd)  \
    00046     {\
    00047     case site:  \
    00048     statement;  \
    00049     if (OutputModifiable(site, output, length, messageEnd, blocking))   \
    00050         return STDMAX(size_t(1), length-m_inputPosition);\
    00051     }
    00052
    00053 #define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd)  \
    00054     FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd)
    00055
    00056 #define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable)    \
    00057     {\
    00058     case site:  \
    00059     statement;  \
    00060     if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \
    00061         return STDMAX(size_t(1), length-m_inputPosition);\
    00062     }
    00063
    00064 #define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable)    \
    00065     FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable)
    00066
    00067 #endif