mail-parse.el 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ;;; mail-parse.el --- Interface functions for parsing mail
  2. ;; Copyright (C) 1998-2012 Free Software Foundation, Inc.
  3. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
  4. ;; This file is part of GNU Emacs.
  5. ;; GNU Emacs is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; GNU Emacs is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;; This file contains wrapper functions for a wide range of mail
  17. ;; parsing functions. The idea is that there are low-level libraries
  18. ;; that implement according to various specs (RFC2231, DRUMS, USEFOR),
  19. ;; but that programmers that want to parse some header (say,
  20. ;; Content-Type) will want to use the latest spec.
  21. ;;
  22. ;; So while each low-level library (rfc2231.el, for instance) decodes
  23. ;; faithfully according to that (proposed) standard, this library is
  24. ;; the interface library. If some later RFC supersedes RFC2231, one
  25. ;; would just have to write a new low-level library, adjust the
  26. ;; aliases in this library, and the users and programmers won't notice
  27. ;; any changes.
  28. ;;; Code:
  29. (require 'mail-prsvr)
  30. (require 'ietf-drums)
  31. (require 'rfc2231)
  32. (require 'rfc2047)
  33. (require 'rfc2045)
  34. (defalias 'mail-header-parse-content-type 'rfc2231-parse-qp-string)
  35. (defalias 'mail-header-parse-content-disposition 'rfc2231-parse-qp-string)
  36. (defalias 'mail-content-type-get 'rfc2231-get-value)
  37. (defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter)
  38. (defalias 'mail-header-remove-comments 'ietf-drums-remove-comments)
  39. (defalias 'mail-header-remove-whitespace 'ietf-drums-remove-whitespace)
  40. (defalias 'mail-header-strip 'ietf-drums-strip)
  41. (defalias 'mail-header-get-comment 'ietf-drums-get-comment)
  42. (defalias 'mail-header-parse-address 'ietf-drums-parse-address)
  43. (defalias 'mail-header-parse-addresses 'ietf-drums-parse-addresses)
  44. (defalias 'mail-header-parse-date 'ietf-drums-parse-date)
  45. (defalias 'mail-narrow-to-head 'ietf-drums-narrow-to-header)
  46. (defalias 'mail-quote-string 'ietf-drums-quote-string)
  47. (defalias 'mail-header-make-address 'ietf-drums-make-address)
  48. (defalias 'mail-header-fold-field 'rfc2047-fold-field)
  49. (defalias 'mail-header-unfold-field 'rfc2047-unfold-field)
  50. (defalias 'mail-header-narrow-to-field 'rfc2047-narrow-to-field)
  51. (defalias 'mail-header-field-value 'rfc2047-field-value)
  52. (defalias 'mail-encode-encoded-word-region 'rfc2047-encode-region)
  53. (defalias 'mail-encode-encoded-word-buffer 'rfc2047-encode-message-header)
  54. (defalias 'mail-encode-encoded-word-string 'rfc2047-encode-string)
  55. (defalias 'mail-decode-encoded-word-region 'rfc2047-decode-region)
  56. (defalias 'mail-decode-encoded-word-string 'rfc2047-decode-string)
  57. (defalias 'mail-decode-encoded-address-region 'rfc2047-decode-address-region)
  58. (defalias 'mail-decode-encoded-address-string 'rfc2047-decode-address-string)
  59. (provide 'mail-parse)
  60. ;;; mail-parse.el ends here