summaryrefslogtreecommitdiff
path: root/fltrimpl.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
commitb21162cf8e06f40baa1f58be6a8c17435cebc34d (patch)
tree8b045309c238226c32a563b1df6b9c30a2f0e0b3 /fltrimpl.h
downloadcryptopp-b21162cf8e06f40baa1f58be6a8c17435cebc34d.tar.gz
Initial revision
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@2 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'fltrimpl.h')
-rw-r--r--fltrimpl.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/fltrimpl.h b/fltrimpl.h
new file mode 100644
index 0000000..6c37bfa
--- /dev/null
+++ b/fltrimpl.h
@@ -0,0 +1,40 @@
+#ifndef CRYPTOPP_FLTRIMPL_H
+#define CRYPTOPP_FLTRIMPL_H
+
+#define FILTER_BEGIN \
+ switch (m_continueAt) \
+ { \
+ case 0: \
+ m_inputPosition = 0;
+
+#define FILTER_END_NO_MESSAGE_END_NO_RETURN \
+ break; \
+ default: \
+ assert(false); \
+ }
+
+#define FILTER_END_NO_MESSAGE_END \
+ FILTER_END_NO_MESSAGE_END_NO_RETURN \
+ return 0;
+
+#define FILTER_END \
+ case -1: \
+ if (Output(-1, NULL, 0, messageEnd, blocking)) \
+ return 1; \
+ FILTER_END_NO_MESSAGE_END
+
+#define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \
+ {\
+ case site: \
+ statement; \
+ if (Output(site, output, length, messageEnd, blocking)) \
+ return STDMAX(1U, (unsigned int)length-m_inputPosition);\
+ }
+
+#define FILTER_OUTPUT(site, output, length, messageEnd) \
+ FILTER_OUTPUT2(site, 0, output, length, messageEnd)
+
+#define FILTER_OUTPUT_BYTE(site, output) \
+ FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0)
+
+#endif