Move `mime-message-structure' from mime-parse.el to mime-def.el.
[elisp/flim.git] / mime-def.el
index 15f66e4..0babafb 100644 (file)
   (cdr (assoc parameter (mime-content-type-parameters content-type))))
 
 
+(defsubst mime-type/subtype-string (type &optional subtype)
+  "Return type/subtype string from TYPE and SUBTYPE."
+  (if type
+      (if subtype
+         (format "%s/%s" type subtype)
+       (format "%s" type))))
+
+
 ;;; @ Content-Disposition
 ;;;
 
   (mime-content-disposition-parameter content-disposition "filename"))
 
 
-;;; @ MIME-entity
+;;; @ MIME entity
 ;;;
 
 (defsubst make-mime-entity (buffer
                            (mime-entity-media-subtype entity-info)))
 
 
-;;; @ utility
+;;; @ message structure
 ;;;
 
-(defsubst mime-type/subtype-string (type &optional subtype)
-  "Return type/subtype string from TYPE and SUBTYPE."
-  (if type
-      (if subtype
-         (format "%s/%s" type subtype)
-       (format "%s" type))))
+(defvar mime-message-structure nil
+  "Information about structure of message.
+Please use reference function `mime-entity-SLOT' to get value of SLOT.
+
+Following is a list of slots of the structure:
+
+buffer                 buffer includes this entity (buffer).
+node-id                        node-id (list of integers)
+header-start           minimum point of header in raw-buffer
+header-end             maximum point of header in raw-buffer
+body-start             minimum point of body in raw-buffer
+body-end               maximum point of body in raw-buffer
+content-type           content-type (content-type)
+content-disposition    content-disposition (content-disposition)
+encoding               Content-Transfer-Encoding (string or nil)
+children               entities included in this entity (list of entity)
+
+If an entity includes other entities in its body, such as multipart or
+message/rfc822, `mime-entity' structures of them are included in
+`children', so the `mime-entity' structure become a tree.")
+
+(make-variable-buffer-local 'mime-message-structure)
 
 
 ;;; @ end