Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
4.2 KiB

  1. /*
  2. * Copyright (c) 1983, 1995 Eric P. Allman
  3. * Copyright (c) 1988, 1993
  4. * The Regents of the University of California. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. All advertising materials mentioning features or use of this software
  15. * must display the following acknowledgement:
  16. * This product includes software developed by the University of
  17. * California, Berkeley and its contributors.
  18. * 4. Neither the name of the University nor the names of its contributors
  19. * may be used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  23. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  26. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. */
  34. BOOL IsHeader(char *Line);
  35. BOOL ChompHeader(char * line, DWORD& HeaderFlags, char** pValueBuf = NULL);
  36. BOOL UnfoldHeader(char *pszHeader, char **ppszUnfolded);
  37. void FreeUnfoldedHeader(char *pszHeader);
  38. /* bits for h_flags and hi_flags */
  39. # define H_EOH 0x00000001 /* this field terminates header */
  40. # define H_RCPT 0x00000002 /* contains recipient addresses */
  41. # define H_DEFAULT 0x00000004 /* if another value is found, drop this */
  42. # define H_RESENT 0x00000008 /* this address is a "Resent-..." address */
  43. # define H_DATE 0x00000010 /* check h_mflags against m_flags */
  44. # define H_ACHECK 0x00000020 /* ditto, but always (not just default) */
  45. # define H_MID 0x00000040 /* force this field, even if default */
  46. # define H_TRACE 0x00000080 /* this field contains trace information */
  47. # define H_FROM 0x00000100 /* this is a from-type field */
  48. # define H_VALID 0x00000200 /* this field has a validated value */
  49. # define H_RECEIPTTO 0x00000400 /* this field has return receipt info */
  50. # define H_ERRORSTO 0x00000800 /* this field has error address info */
  51. # define H_CTE 0x00001000 /* this field is a content-transfer-encoding */
  52. # define H_CTYPE 0x00002000 /* this is a content-type field */
  53. # define H_STRIPVAL 0x00004000 /* strip value from header (Bcc:) */
  54. # define H_SECURITY 0x00008000 /* security field*/
  55. # define H_RETURNPATH 0x00010000 /* return path field*/
  56. //
  57. // 11/04/98 -- pgopi. Added header for subject
  58. //
  59. # define H_SUBJECT 0x00020000 /* subject field */
  60. /* X-Headers */
  61. # define H_X_SENDER 0x40000000 /* X-Sender field*/
  62. # define H_X_RECEIVER 0x80000000 /* X-Receiver field*/
  63. // 10/15/98 - MikeSwa Added X-Fields for Msgs supersede functionality
  64. # define H_X_MSGGUID 0x20000000 /* X-MsgGuid field */
  65. # define H_X_SUPERSEDES_MSGGUID 0x10000000 /* X-SupersedesMsgGuid */
  66. //
  67. // 12/18/98 -- pgopi. Added X-OriginalArrivalTime
  68. //
  69. #define H_X_ORIGINAL_ARRIVAL_TIME 0x01000000 /* X-OriginalArrivalTime */
  70. typedef struct _HEADERVAL_
  71. {
  72. char * m_Field;
  73. char * m_Value;
  74. LIST_ENTRY m_Entry;
  75. }HEADERVAL, *HEADERVALPTR;