summaryrefslogtreecommitdiff
path: root/pith/mailpart.h
diff options
context:
space:
mode:
Diffstat (limited to 'pith/mailpart.h')
-rw-r--r--pith/mailpart.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/pith/mailpart.h b/pith/mailpart.h
new file mode 100644
index 00000000..e7038086
--- /dev/null
+++ b/pith/mailpart.h
@@ -0,0 +1,51 @@
+/*
+ * $Id: mailpart.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
+ *
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ * Copyright 2013 Eduardo Chappa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+#ifndef PITH_MAILPART_INCLUDED
+#define PITH_MAILPART_INCLUDED
+
+
+#include "../pith/atttype.h"
+#include "../pith/state.h"
+
+
+#define MIME_MSG(t,s) ((t) == TYPEMESSAGE && (s) && !strucmp((s),"rfc822"))
+
+#define MIME_DGST(t,s) ((t) == TYPEMULTIPART && (s) && !strucmp((s),"digest"))
+
+/* Is this a message attachment? */
+#define MIME_VCARD(t,s) ((((t) == TYPETEXT || (t) == TYPEAPPLICATION) \
+ && (s) && !strucmp((s),"DIRECTORY")) \
+ || ((t) == TYPETEXT \
+ && (s) && !strucmp((s),"X-VCARD")))
+
+/* Is this a multipart signed? */
+#define MIME_MULT_SIGNED(t,s) ((t) == TYPEMULTIPART && (s) && !strucmp((s),"signed"))
+
+
+#define MIME_MSG_A(a) MIME_MSG((a)->body->type, (a)->body->subtype)
+
+/* Is this a digest attachment? */
+#define MIME_DGST_A(a) MIME_DGST((a)->body->type, (a)->body->subtype)
+
+/* Is this a vCard attachment? */
+#define MIME_VCARD_A(a) MIME_VCARD((a)->body->type, (a)->body->subtype)
+
+
+/* exported protoypes */
+
+
+#endif /* PITH_MAILPART_INCLUDED */