(substring str e)
))))
+
+;;; @ Content-Type
+;;;
+
(defun mime-parse-Content-Type (string)
"Parse STRING as field-body of Content-Type field.
Return value is
(cons (intern type) (cons (intern subtype) (nreverse dest)))
)))
+(defun mime-read-Content-Type ()
+ "Read field-body of Content-Type field from current-buffer,
+and return parsed it. Format of return value is as same as
+`mime-parse-Content-Type'."
+ (let ((str (std11-field-body "Content-Type")))
+ (if str
+ (mime-parse-Content-Type str)
+ )))
+
+(defsubst mime-content-type-primary-type (content-type)
+ "Return primary-type of CONTENT-TYPE."
+ (car content-type))
+
+(defsubst mime-content-type-subtype (content-type)
+ "Return primary-type of CONTENT-TYPE."
+ (cadr content-type))
+
+(defsubst mime-content-type-parameters (content-type)
+ "Return primary-type of CONTENT-TYPE."
+ (cddr content-type))
+
+
+;;; @ Content-Disposition
+;;;
(defconst mime-disposition-type-regexp mime-token-regexp)
(cons ctype (nreverse dest))
)))
-
-;;; @ field reader
-;;;
-
-(defun mime-read-Content-Type ()
- "Read field-body of Content-Type field from current-buffer,
-and return parsed it. Format of return value is as same as
-`mime-parse-Content-Type'."
- (let ((str (std11-field-body "Content-Type")))
+(defun mime/Content-Disposition ()
+ "Read field-body of Content-Disposition field from current-buffer,
+and return parsed it. [mime-parse.el]"
+ (let ((str (std11-field-body "Content-Disposition")))
(if str
- (mime-parse-Content-Type str)
+ (mime-parse-Content-Disposition str)
)))
+
+;;; @ Content-Transfer-Encoding
+;;;
+
(defun mime/Content-Transfer-Encoding (&optional default-encoding)
"Read field-body of Content-Transfer-Encoding field from
current-buffer, and return it.
default-encoding)
))
-(defun mime/Content-Disposition ()
- "Read field-body of Content-Disposition field from current-buffer,
-and return parsed it. [mime-parse.el]"
- (let ((str (std11-field-body "Content-Disposition")))
- (if str
- (mime-parse-Content-Disposition str)
- )))
-
;;; @ message parser
;;;
field. Its format must be as same as return value of
mime-{parse|read}-Content-Type."
(setq default-ctl (or (mime-read-Content-Type) default-ctl))
- (let ((primtype (car default-ctl))
- (subtype (car (cdr default-ctl)))
- (params (cdr (cdr default-ctl)))
- (encoding (or (mime/Content-Transfer-Encoding) default-encoding))
- )
+ (let ((primtype (mime-content-type-primary-type default-ctl))
+ (subtype (mime-content-type-subtype default-ctl))
+ (params (mime-content-type-parameters default-ctl))
+ (encoding (or (mime/Content-Transfer-Encoding) default-encoding)))
(let ((boundary (assoc "boundary" params)))
(cond (boundary
(setq boundary (std11-strip-quoted-string (cdr boundary)))