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