(Authors): New section.
[elisp/semi.git] / mime-parse.el
index a7f3c05..ea75f65 100644 (file)
@@ -45,6 +45,9 @@ which are string or symbol."
 (defsubst regexp-* (regexp)
   (concat regexp "*"))
 
+(defsubst regexp-or (&rest args)
+  (concat "\\(" (mapconcat (function identity) args "\\|") "\\)"))
+
 (defconst rfc822/quoted-pair-regexp "\\\\.")
 (defconst rfc822/qtext-regexp
   (concat "[^" (char-list-to-string std11-non-qtext-char-list) "]"))
@@ -172,12 +175,8 @@ and return parsed it. [mime-parse.el]"
 (defsubst mime-entity-children (entity-info)      (aref entity-info 7))
 
 (defsubst mime-entity-type/subtype (entity-info)
-  (let ((type (mime-entity-media-type entity-info)))
-    (if type
-       (let ((subtype (mime-entity-media-subtype entity-info)))
-         (if subtype
-             (format "%s/%s" type subtype)
-           (symbol-name type))))))
+  (mime-type/subtype-string (mime-entity-media-type entity-info)
+                           (mime-entity-media-subtype entity-info)))
 
 (defun mime-parse-multipart (boundary primtype subtype params encoding rcnum)
   (goto-char (point-min))
@@ -270,6 +269,14 @@ mime-{parse|read}-Content-Type."
       )))
 
 
+;;; @ utilities
+;;;
+
+(defsubst mime-root-entity-p (entity)
+  "Return t if ENTITY is root-entity (message)."
+  (null (mime-entity-node-id entity)))
+
+
 ;;; @ end
 ;;;