diff f-demime/defs.h @ 0:7e0d08176f32

f-demime starting code
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 06 May 2023 06:14:03 +0000
parents
children 612c4d0df768
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/f-demime/defs.h	Sat May 06 06:14:03 2023 +0000
@@ -0,0 +1,31 @@
+/*
+ * This header file holds miscellaneous definitions for f-demime,
+ * including various limits.
+ */
+
+enum msg_state {
+	MSG_STATE_UNDEF,	/* before From line */
+	MSG_STATE_HEADER,	/* message or body part header */
+	MSG_STATE_BODY_PASS,	/* body pass-through state */
+	MSG_STATE_PTEXT_B64,	/* text/plain decoding from base64 */
+	MSG_STATE_PTEXT_QP,	/* text/plain decoding from quoted-printable */
+	MSG_STATE_BLOB_B64,	/* blob extraction from base64 */
+	MSG_STATE_B64_TO_QP,	/* base64 to quoted-printable conversion */
+};
+
+enum msg_hdr_state {
+	HDR_STATE_BEGIN,	/* beginning of entity header */
+	HDR_STATE_GOTSOME,	/* got some header line(s), regular */
+	HDR_STATE_CONT_TYPE,	/* after Content-Type: header */
+	HDR_STATE_CONT_TE,	/* after Content-Transfer-Encoding: header */
+	HDR_STATE_ERROR		/* errored state */
+};
+
+#define	LINE_BUF_SIZE	1024
+#define	HDR_BUF_SIZE	2048
+
+#define	MAX_MP_BOUNDARY	70	/* not counting the hyphens */
+#define	MAX_MP_NESTING	8
+
+#define	OUTPUT_LINE_MAX	320
+#define	QP_MAX_LINE	76