home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / imap-3.0 / ANSI / c-client / rfc822.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-13  |  5.0 KB  |  117 lines

  1. /*
  2.  * Program:    RFC-822 routines (originally from SMTP)
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    27 July 1988
  13.  * Last Edited:    13 September 1992
  14.  *
  15.  * Sponsorship:    The original version of this work was developed in the
  16.  *        Symbolic Systems Resources Group of the Knowledge Systems
  17.  *        Laboratory at Stanford University in 1987-88, and was funded
  18.  *        by the Biomedical Research Technology Program of the National
  19.  *        Institutes of Health under grant number RR-00785.
  20.  *
  21.  * Original version Copyright 1988 by The Leland Stanford Junior University.
  22.  * Copyright 1992 by the University of Washington.
  23.  *
  24.  *  Permission to use, copy, modify, and distribute this software and its
  25.  * documentation for any purpose and without fee is hereby granted, provided
  26.  * that the above copyright notices appear in all copies and that both the
  27.  * above copyright notices and this permission notice appear in supporting
  28.  * documentation, and that the name of the University of Washington or The
  29.  * Leland Stanford Junior University not be used in advertising or publicity
  30.  * pertaining to distribution of the software without specific, written prior
  31.  * permission.  This software is made available "as is", and
  32.  * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
  33.  * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
  34.  * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  35.  * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
  36.  * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
  37.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  38.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  39.  * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
  40.  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  41.  *
  42.  */
  43.  
  44. /* Coddle certain compilers' 6-character symbol limitation */
  45.  
  46. #ifdef __COMPILER_KCC__
  47. #define rfc822_header rheadr
  48. #define rfc822_address_line radl
  49. #define rfc822_header_line rhdl
  50. #define rfc822_write_address rwaddr
  51. #define rfc822_address raddr
  52. #define rfc822_cat rcat
  53. #define rfc822_write_body_header rwbhdr
  54. #define rfc822_default_subtype rdfsty
  55. #define rfc822_parse_msg rpmsg
  56. #define rfc822_parse_content rpcont
  57. #define rfc822_parse_content_header rpcnth
  58. #define rfc822_parse_adrlist rpadrl
  59. #define rfc822_parse_address rpaddr
  60. #define rfc822_parse_routeaddr rpradr
  61. #define rfc822_parse_addrspec rpaspc
  62. #define rfc822_parse_phrase rpphra
  63. #define rfc822_parse_word rpword
  64. #define rfc822_cpy rcpy
  65. #define rfc822_quote rquot
  66. #define rfc822_cpy_adr rcpyad
  67. #define rfc822_skipws rskpws
  68. #define rfc822_contents rcntnt
  69. #define rfc822_output routpt
  70. #define rfc822_encode_body renbdy
  71. #define rfc822_base64 rbas64
  72. #define rfc822_binary rbinry
  73. #define rfc822_qprint rqprnt
  74. #define rfc822_8bit r8bit
  75. #endif
  76.  
  77. /* Function prototypes */
  78.  
  79. void rfc822_header (char *header,ENVELOPE *env,BODY *body);
  80. void rfc822_address_line (char **header,char *type,ENVELOPE *env,ADDRESS *adr);
  81. void rfc822_header_line (char **header,char *type,ENVELOPE *env,char *text);
  82. void rfc822_write_address (char *dest,ADDRESS *adr);
  83. void rfc822_address (char *dest,ADDRESS *adr);
  84. void rfc822_cat (char *dest,char *src,const char *specials);
  85. void rfc822_write_body_header (char **header,BODY *body);
  86. char *rfc822_default_subtype (unsigned short type);
  87. void rfc822_parse_msg (ENVELOPE **en,BODY **bdy,char *s,unsigned long i,
  88.                STRING *bs,char *host,char *tmp);
  89. void rfc822_parse_content (BODY *body,STRING *bs,char *h,char *t);
  90. void rfc822_parse_content_header (BODY *body,char *name,char *s);
  91. void rfc822_parse_adrlist (ADDRESS **lst,char *string,char *host);
  92. ADDRESS *rfc822_parse_address (char **string,char *defaulthost);
  93. ADDRESS *rfc822_parse_routeaddr (char *string,char **ret,char *defaulthost);
  94. ADDRESS *rfc822_parse_addrspec (char *string,char **ret,char *defaulthost);
  95. char *rfc822_parse_phrase (char *string);
  96. char *rfc822_parse_word (char *string,const char *delimiters);
  97. char *rfc822_cpy (char *src);
  98. char *rfc822_quote (char *src);
  99. ADDRESS *rfc822_cpy_adr (ADDRESS *adr);
  100. void rfc822_skipws (char **s);
  101. char *rfc822_contents (char **dst,unsigned long *dstl,unsigned long *len,
  102.                char *src,unsigned long srcl,unsigned short encoding);
  103.  
  104. #ifndef TCPSTREAM
  105. #define TCPSTREAM void
  106. #endif
  107. typedef long (*soutr_t) (TCPSTREAM *stream,char *string);
  108. long rfc822_output (char *t,ENVELOPE *env,BODY *body,soutr_t f,TCPSTREAM *s);
  109. void rfc822_encode_body (ENVELOPE *env,BODY *body);
  110. long rfc822_output_body (BODY *body,soutr_t f,TCPSTREAM *s);
  111. void *rfc822_base64 (unsigned char *src,unsigned long srcl,unsigned long *len);
  112. unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len);
  113. unsigned char *rfc822_qprint (unsigned char *src,unsigned long srcl,
  114.                   unsigned long *len);
  115. unsigned char *rfc822_8bit (unsigned char *src,unsigned long srcl,
  116.                 unsigned long *len);
  117.