c-client.h   c-client.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 19 May 2000 * Date: 19 May 2000
* Last Edited: 7 February 2003 * Last Edited: 20 October 2003
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 1988-2003 University of Washington. * Copyright 1988-2003 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
#ifndef __CCLIENT_H /* nobody should include this twice... */ #ifndef __CCLIENT_H /* nobody should include this twice... */
#define __CCLIENT_H #define __CCLIENT_H
#ifdef __cplusplus /* help out people who use C++ compilers */ #ifdef __cplusplus /* help out people who use C++ compilers */
extern "C" { extern "C" {
/* If you use gcc, you may also have to use -fno-operator-names */ /* If you use gcc, you may also have to use -fno-operator-names */
#define private cclientPrivate /* private to c-client */ #define private cclientPrivate /* private to c-client */
#define and cclientAnd /* C99 doesn't realize that ISO 646 is dead */ #define and cclientAnd /* C99 doesn't realize that ISO 646 is dead */
#define or cclientOr #define or cclientOr
#define not cclientNot #define not cclientNot
#endif #endif
#include "mail.h" /* primary interfaces */ #include "mail.h" /* primary interfaces */
#include "osdep.h" /* OS-dependent routines */ #include "osdep.h" /* OS-dependent routines */
#include "misc.h" /* miscellaneous utility routines */
#include "rfc822.h" /* RFC822 and MIME routines */ #include "rfc822.h" /* RFC822 and MIME routines */
#include "smtp.h" /* SMTP sending routines */ #include "smtp.h" /* SMTP sending routines */
#ifdef LOCAL
#undef LOCAL /* just in case */
#endif
#include "nntp.h" /* NNTP sending routines */ #include "nntp.h" /* NNTP sending routines */
#undef LOCAL /* undo driver mischief */ #include "misc.h" /* miscellaneous utility routines */
#ifdef __cplusplus /* undo the C++ mischief */ #ifdef __cplusplus /* undo the C++ mischief */
#undef private #undef private
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
7 lines changed or deleted 2 lines changed or added


 env.h   env.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 1 August 1988 * Date: 1 August 1988
* Last Edited: 20 November 2001 * Last Edited: 27 April 2004
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 2001 University of Washington. * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
/* Function prototypes */ /* Function prototypes */
long pmatch_full (char *s,char *pat,char delim); long pmatch_full (unsigned char *s,unsigned char *pat,unsigned char delim);
long dmatch (char *s,char *pat,char delim); long dmatch (unsigned char *s,unsigned char *pat,unsigned char delim);
void *env_parameters (long function,void *value); void *env_parameters (long function,void *value);
void rfc822_date (char *date); void rfc822_date (char *date);
void rfc822_timezone (char *s,void *t); void rfc822_timezone (char *s,void *t);
void internal_date (char *date); void internal_date (char *date);
long server_input_wait (long seconds); long server_input_wait (long seconds);
void server_init (char *server,char *service,char *sasl, void server_init (char *server,char *service,char *sasl,
void *clkint,void *kodint,void *hupint,void *trmint); void *clkint,void *kodint,void *hupint,void *trmint);
long server_login (char *user,char *pass,char *authuser,int argc,char *argv []); long server_login (char *user,char *pass,char *authuser,int argc,char *argv []);
long authserver_login (char *user,char *authuser,int argc,char *argv[]); long authserver_login (char *user,char *authuser,int argc,char *argv[]);
long anonymous_login (int argc,char *argv[]); long anonymous_login (int argc,char *argv[]);
 End of changes. 3 change blocks. 
4 lines changed or deleted 4 lines changed or added


 imap4r1.h   imap4r1.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 14 October 1988 * Date: 14 October 1988
* Last Edited: 25 June 2003 * Last Edited: 30 October 2003
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 1988-2003 University of Washington. * Copyright 1988-2003 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*
* This original version of this file is
* Copyright 1988 Stanford University
* and was developed in the Symbolic Systems Resources Group of the Knowled
ge
* Systems Laboratory at Stanford University in 1987-88, and was funded by
the
* Biomedical Research Technology Program of the NationalInstitutes of Heal
th
* under grant number RR-00785.
*/ */
/* Parameters */
#define MAXLOGINTRIALS 3 /* maximum number of login trials */
#define IMAPLOOKAHEAD 20 /* envelope lookahead */
#define IMAPUIDLOOKAHEAD 1000 /* UID lookahead */
#define IMAPTCPPORT (long) 143 /* assigned TCP contact port */
#define IMAPSSLPORT (long) 993 /* assigned SSL TCP contact port */
#define MAXCOMMAND 1000 /* RFC 2683 guideline for cmd line l
ength */
/* Parsed reply message from imap_reply */
typedef struct imap_parsed_reply {
char *line; /* original reply string pointer */
char *tag; /* command tag this reply is for */
char *key; /* reply keyword */
char *text; /* subsequent text */
} IMAPPARSEDREPLY;
#define IMAPTMPLEN 16*MAILTMPLEN
/* IMAP4 I/O stream local data */
typedef struct imap_local {
NETSTREAM *netstream; /* TCP I/O stream */
IMAPPARSEDREPLY reply; /* last parsed reply */
MAILSTATUS *stat; /* status to fill in */
unsigned int imap2bis : 1; /* server is IMAP2bis */
unsigned int rfc1176 : 1; /* server is RFC-1176 IMAP2 */
struct {
unsigned int imap4rev1 : 1; /* server is IMAP4rev1 */
unsigned int imap4 : 1; /* server is IMAP4 (RFC 1730) */
unsigned int acl : 1; /* server has ACL (RFC 2086) */
unsigned int quota : 1; /* server has QUOTA (RFC 2087) */
unsigned int litplus : 1; /* server has LITERAL+ (RFC 2088) */
unsigned int idle : 1; /* server has IDLE (RFC 2177) */
unsigned int mbx_ref : 1; /* server has mailbox referrals (RFC 2193) *
/
unsigned int log_ref : 1; /* server has login referrals (RFC 2221) */
unsigned int authanon : 1; /* server has anonymous SASL (RFC 2245) */
unsigned int namespace :1; /* server has NAMESPACE (RFC 2342) */
unsigned int uidplus : 1; /* server has UIDPLUS (RFC 2359) */
unsigned int starttls : 1; /* server has STARTTLS (RFC 2595) */
/* server disallows LOGIN command (RFC 2595)
*/
unsigned int logindisabled : 1;
unsigned int id : 1; /* server has ID (RFC 2971) */
unsigned int children : 1; /* server has CHILDREN (RFC 3398) */
/* server has multi-APPEND */
unsigned int multiappend : 1;
unsigned int unselect : 1; /* server has UNSELECT */
unsigned int sort : 1; /* server has SORT */
unsigned int scan : 1; /* server has SCAN */
/* supported authenticators */
unsigned int auth : MAXAUTHENTICATORS;
THREADER *threader; /* list of threaders */
} cap;
unsigned int uidsearch : 1; /* UID searching */
unsigned int byeseen : 1; /* saw a BYE response */
/* got implicit capabilities */
unsigned int gotcapability : 1;
unsigned int sensitive : 1; /* sensitive data in progress */
unsigned int tlsflag : 1; /* TLS session */
unsigned int notlsflag : 1; /* TLS not used in session */
unsigned int sslflag : 1; /* SSL session */
unsigned int novalidate : 1; /* certificate not validated */
unsigned int filter : 1; /* filter SEARCH/SORT/THREAD results */
unsigned int loser : 1; /* server is a loser */
unsigned short extlevel; /* extension data level supported by server
*/
long authflags; /* required flags for authenticators */
unsigned long sortsize; /* sort return data size */
unsigned long *sortdata; /* sort return data */
NAMESPACE **namespace; /* namespace return data */
THREADNODE *threaddata; /* thread return data */
char *referral; /* last referral */
char *prefix; /* find prefix */
char *user; /* logged-in user */
char *reform; /* reformed sequence */
char tmp[IMAPTMPLEN]; /* temporary buffer */
SEARCHSET *lookahead; /* fetch lookahead */
} IMAPLOCAL;
/* Convenient access to local data */
#define LOCAL ((IMAPLOCAL *) stream->local)
/* Protocol levels */ /* Protocol levels */
/* As of February 11, 2003, it is believed that: /* As of October 15, 2003, it is believed that:
* *
* Version RFC Status Known Implementations * Version RFC Status Known Implementations
* ------- --- ------ --------------------- * ------- --- ------ ---------------------
* IMAP1 none extinct experimental TOPS-20 server * IMAP1 none extinct experimental TOPS-20 server
* IMAP2 1064, 1176 rare TOPS-20, SUMEX, old UW serve * IMAP2 1064 extinct old TOPS-20, SUMEX servers
rs * IMAP2 1176 rare TOPS-20, old UW servers
* IMAP2bis I-D uncommon old UW, Cyrus servers * IMAP2bis expired I-D uncommon old UW, Cyrus servers
* IMAP3 1203 extinct none (never implemented) * IMAP3 1203 extinct none (never implemented)
* IMAP4 1730 rare old UW, Cyrus, Netscape serv ers * IMAP4 1730 rare old UW, Cyrus, Netscape serv ers
* IMAP4rev1 2060, I-D ubiquitous UW, Cyrus, and many others * IMAP4rev1 2060, 3501 ubiquitous UW, Cyrus, and many others
* *
* Most client implementations will only interoperate with an IMAP4rev1 * Most client implementations will only interoperate with an IMAP4rev1
* server. c-client based client implementations can interoperate with IMA P2, * server. c-client based client implementations can interoperate with IMA P2,
* IMAP2bis, IMAP4, and IMAP4rev1 servers, but only if they are very carefu l. * IMAP2bis, IMAP4, and IMAP4rev1 servers, but only if they are very carefu l.
*/ */
/* Server protocol level and capabilities */
typedef struct imap_cap {
unsigned int rfc1176 : 1; /* server is RFC-1176 IMAP2 */
unsigned int imap2bis : 1; /* server is IMAP2bis */
unsigned int imap4 : 1; /* server is IMAP4 (RFC 1730) */
unsigned int imap4rev1 : 1; /* server is IMAP4rev1 */
unsigned int acl : 1; /* server has ACL (RFC 2086) */
unsigned int quota : 1; /* server has QUOTA (RFC 2087) */
unsigned int litplus : 1; /* server has LITERAL+ (RFC 2088) */
unsigned int idle : 1; /* server has IDLE (RFC 2177) */
unsigned int mbx_ref : 1; /* server has mailbox referrals (RFC 2193) *
/
unsigned int log_ref : 1; /* server has login referrals (RFC 2221) */
unsigned int authanon : 1; /* server has anonymous SASL (RFC 2245) */
unsigned int namespace :1; /* server has NAMESPACE (RFC 2342) */
unsigned int uidplus : 1; /* server has UIDPLUS (RFC 2359) */
unsigned int starttls : 1; /* server has STARTTLS (RFC 2595) */
/* server disallows LOGIN command (RFC 2595)
*/
unsigned int logindisabled : 1;
unsigned int id : 1; /* server has ID (RFC 2971) */
unsigned int children : 1; /* server has CHILDREN (RFC 3398) */
unsigned int multiappend : 1; /* server has multi-APPEND (RFC 3502
) ;*/
unsigned int binary : 1; /* server has BINARY (RFC 3516) */
unsigned int unselect : 1; /* server has UNSELECT */
unsigned int sasl_ir : 1; /* server has SASL-IR initial response */
unsigned int sort : 1; /* server has SORT */
unsigned int scan : 1; /* server has SCAN */
unsigned int extlevel; /* extension data level supported by server
*/
/* supported authenticators */
unsigned int auth : MAXAUTHENTICATORS;
THREADER *threader; /* list of threaders */
} IMAPCAP;
/* IMAP4rev1 level or better */ /* IMAP4rev1 level or better */
#define LEVELIMAP4rev1(stream) ((IMAPLOCAL *) stream->local)->cap.imap4rev1 #define LEVELIMAP4rev1(stream) imap_cap (stream)->imap4rev1
#define LEVELSTATUS LEVELIMAP4rev1 #define LEVELSTATUS LEVELIMAP4rev1
/* IMAP4 level or better (not including RFC 1730 design mistakes) */ /* IMAP4 level or better (not including RFC 1730 design mistakes) */
#define LEVELIMAP4(stream) (((IMAPLOCAL *) stream->local)->cap.imap4rev1 || #define LEVELIMAP4(stream) (imap_cap (stream)->imap4rev1 || \
\ imap_cap (stream)->imap4)
((IMAPLOCAL *) stream->local)->cap.imap4)
/* IMAP4 RFC-1730 level */ /* IMAP4 RFC-1730 level */
#define LEVEL1730(stream) ((IMAPLOCAL *) stream->local)->cap.imap4 #define LEVEL1730(stream) imap_cap (stream)->imap4
/* IMAP2bis level or better */ /* IMAP2bis level or better */
#define LEVELIMAP2bis(stream) ((IMAPLOCAL *) stream->local)->imap2bis #define LEVELIMAP2bis(stream) imap_cap (stream)->imap2bis
/* IMAP2 RFC-1176 level or better */ /* IMAP2 RFC-1176 level or better */
#define LEVEL1176(stream) ((IMAPLOCAL *) stream->local)->rfc1176 #define LEVEL1176(stream) imap_cap (stream)->rfc1176
/* IMAP2 RFC-1064 or better */ /* IMAP2 RFC-1064 or better */
#define LEVEL1064(stream) 1 #define LEVEL1064(stream) 1
/* Body structure extension levels */
/* These are in BODYSTRUCTURE order. Note that multipart bodies do not hav
e
* body-fld-md5. This is alright, since all subsequent body structure
* extensions are in both singlepart and multipart bodies. If that ever
* changes, this will have to be split.
*/
#define BODYEXTMD5 1 /* body-fld-md5 */
#define BODYEXTDSP 2 /* body-fld-dsp */
#define BODYEXTLANG 3 /* body-fld-lang */
#define BODYEXTLOC 4 /* body-fld-loc */
/* Has ACL extension */ /* Has ACL extension */
#define LEVELACL(stream) ((IMAPLOCAL *) stream->local)->cap.acl #define LEVELACL(stream) imap_cap (stream)->acl
/* Has QUOTA extension */ /* Has QUOTA extension */
#define LEVELQUOTA(stream) ((IMAPLOCAL *) stream->local)->cap.quota #define LEVELQUOTA(stream) imap_cap (stream)->quota
/* Has LITERALPLUS extension */ /* Has LITERALPLUS extension */
#define LEVELLITERALPLUS(stream) ((IMAPLOCAL *) stream->local)->cap.litplus #define LEVELLITERALPLUS(stream) imap_cap (stream)->litplus
/* Has IDLE extension */ /* Has IDLE extension */
#define LEVELIDLE(stream) ((IMAPLOCAL *) stream->local)->cap.idle #define LEVELIDLE(stream) imap_cap (stream)->idle
/* Has mailbox referrals */ /* Has mailbox referrals */
#define LEVELMBX_REF(stream) ((IMAPLOCAL *) stream->local)->cap.mbx_ref #define LEVELMBX_REF(stream) imap_cap (stream)->mbx_ref
/* Has login referrals */ /* Has login referrals */
#define LEVELLOG_REF(stream) ((IMAPLOCAL *) stream->local)->cap.log_ref #define LEVELLOG_REF(stream) imap_cap (stream)->log_ref
/* Has AUTH=ANONYMOUS extension */
#define LEVELANONYMOUS(stream) imap_cap (stream)->authanon
/* Has NAMESPACE extension */ /* Has NAMESPACE extension */
#define LEVELNAMESPACE(stream) ((IMAPLOCAL *) stream->local)->cap.namespace #define LEVELNAMESPACE(stream) imap_cap (stream)->namespace
/* Has UIDPLUS extension */ /* Has UIDPLUS extension */
#define LEVELUIDPLUS(stream) ((IMAPLOCAL *) stream->local)->cap.uidplus #define LEVELUIDPLUS(stream) imap_cap (stream)->uidplus
/* Has STARTTLS extension */
#define LEVELSTARTTLS(stream) imap_cap (stream)->starttls
/* Has LOGINDISABLED extension */
#define LEVELLOGINDISABLED(stream) imap_cap (stream)->logindisabled
/* Has ID extension */ /* Has ID extension */
#define LEVELID(stream) ((IMAPLOCAL *) stream->local)->cap.id #define LEVELID(stream) imap_cap (stream)->id
/* Has CHILDREN extension */ /* Has CHILDREN extension */
#define LEVELCHILDREN(stream) ((IMAPLOCAL *) stream->local)->cap.children #define LEVELCHILDREN(stream) imap_cap (stream)->children
/* Has MULTIAPPEND extension */ /* Has MULTIAPPEND extension */
#define LEVELMULTIAPPEND(stream) ((IMAPLOCAL *) stream->local)->cap.multiap #define LEVELMULTIAPPEND(stream) imap_cap (stream)->multiappend
pend
/* Has BINARY extension */
#define LEVELBINARY(stream) imap_cap (stream)->binary
/* Has UNSELECT extension */
#define LEVELUNSELECT(stream) imap_cap (stream)->unselect
/* Has SASL initial response extension */
#define LEVELSASLIR(stream) imap_cap (stream)->sasl_ir
/* Has SORT extension */ /* Has SORT extension */
#define LEVELSORT(stream) ((IMAPLOCAL *) stream->local)->cap.sort #define LEVELSORT(stream) imap_cap (stream)->sort
/* Has at least one THREAD extension */ /* Has at least one THREAD extension */
#define LEVELTHREAD(stream) (((IMAPLOCAL *) stream->local)->threader ? T : NIL) #define LEVELTHREAD(stream) ((imap_cap (stream)->threader) ? T : NIL)
/* Has SCAN extension */ /* Has SCAN extension */
#define LEVELSCAN(stream) ((IMAPLOCAL *) stream->local)->cap.scan #define LEVELSCAN(stream) imap_cap (stream)->scan
/* Arguments to imap_send() */ /* Body structure extension levels */
typedef struct imap_argument { /* These are in BODYSTRUCTURE order. Note that multipart bodies do not hav
int type; /* argument type */ e
void *text; /* argument text */ * body-fld-md5. This is alright, since all subsequent body structure
} IMAPARG; * extensions are in both singlepart and multipart bodies. If that ever
* changes, this will have to be split.
*/
/* imap_send() argument types */ #define BODYEXTMD5 1 /* body-fld-md5 */
#define BODYEXTDSP 2 /* body-fld-dsp */
#define BODYEXTLANG 3 /* body-fld-lang */
#define BODYEXTLOC 4 /* body-fld-loc */
#define ATOM 0 /* Function prototypes */
#define NUMBER 1
#define FLAGS 2
#define ASTRING 3
#define LITERAL 4
#define LIST 5
#define SEARCHPROGRAM 6
#define SORTPROGRAM 7
#define BODYTEXT 8
#define BODYPEEK 9
#define BODYCLOSE 10
#define SEQUENCE 11
#define LISTMAILBOX 12
#define MULTIAPPEND 13
#define SNLIST 14
#define MULTIAPPENDREDO 15
/* Append data */ IMAPCAP *imap_cap (MAILSTREAM *stream);
char *imap_host (MAILSTREAM *stream);
long imap_cache (MAILSTREAM *stream,unsigned long msgno,char *seg,
STRINGLIST *stl,SIZEDTEXT *text);
typedef struct append_data { /* Temporary */
append_t af;
void *data;
char *flags;
char *date;
STRING *message;
} APPENDDATA;
/* Function prototypes */
DRIVER *imap_valid (char *name);
void *imap_parameters (long function,void *value);
void imap_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents);
void imap_list (MAILSTREAM *stream,char *ref,char *pat);
void imap_lsub (MAILSTREAM *stream,char *ref,char *pat);
void imap_list_work (MAILSTREAM *stream,char *cmd,char *ref,char *pat,
char *contents);
long imap_subscribe (MAILSTREAM *stream,char *mailbox);
long imap_unsubscribe (MAILSTREAM *stream,char *mailbox);
long imap_create (MAILSTREAM *stream,char *mailbox);
long imap_delete (MAILSTREAM *stream,char *mailbox);
long imap_rename (MAILSTREAM *stream,char *old,char *newname);
long imap_manage (MAILSTREAM *stream,char *mailbox,char *command,char *arg2
);
long imap_status (MAILSTREAM *stream,char *mbx,long flags);
MAILSTREAM *imap_open (MAILSTREAM *stream);
IMAPPARSEDREPLY *imap_rimap (MAILSTREAM *stream,char *service,NETMBX *mb,
char *usr,char *tmp);
long imap_anon (MAILSTREAM *stream,char *tmp);
long imap_auth (MAILSTREAM *stream,NETMBX *mb,char *tmp,char *usr);
long imap_login (MAILSTREAM *stream,NETMBX *mb,char *pwd,char *usr);
void *imap_challenge (void *stream,unsigned long *len);
long imap_response (void *stream,char *s,unsigned long size);
void imap_close (MAILSTREAM *stream,long options);
void imap_fast (MAILSTREAM *stream,char *sequence,long flags);
void imap_flags (MAILSTREAM *stream,char *sequence,long flags);
long imap_overview (MAILSTREAM *stream,overview_t ofn);
ENVELOPE *imap_structure (MAILSTREAM *stream,unsigned long msgno,BODY **bod
y,
long flags);
long imap_msgdata (MAILSTREAM *stream,unsigned long msgno,char *section,
unsigned long first,unsigned long last,STRINGLIST *lines,
long flags);
unsigned long imap_uid (MAILSTREAM *stream,unsigned long msgno);
unsigned long imap_msgno (MAILSTREAM *stream,unsigned long uid);
void imap_flag (MAILSTREAM *stream,char *sequence,char *flag,long flags);
long imap_search (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,long flag
s);
unsigned long *imap_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
SORTPGM *pgm,long flags);
THREADNODE *imap_thread (MAILSTREAM *stream,char *type,char *charset,
SEARCHPGM *spg,long flags);
THREADNODE *imap_thread_work (MAILSTREAM *stream,char *type,char *charset,
SEARCHPGM *spg,long flags);
long imap_ping (MAILSTREAM *stream);
void imap_check (MAILSTREAM *stream);
void imap_expunge (MAILSTREAM *stream);
long imap_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long option
s);
long imap_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
long imap_append_referral (char *mailbox,char *tmp,append_t af,void *data,
char *flags,char *date,STRING *message,
APPENDDATA *map);
IMAPPARSEDREPLY *imap_append_single (MAILSTREAM *stream,char *mailbox,
char *flags,char *date,STRING *message)
;
void imap_gc (MAILSTREAM *stream,long gcflags);
void imap_gc_body (BODY *body);
void imap_capability (MAILSTREAM *stream);
long imap_setacl (MAILSTREAM *stream,char *mailbox,char *id,char *rights); long imap_setacl (MAILSTREAM *stream,char *mailbox,char *id,char *rights);
long imap_deleteacl (MAILSTREAM *stream,char *mailbox,char *id); long imap_deleteacl (MAILSTREAM *stream,char *mailbox,char *id);
long imap_getacl (MAILSTREAM *stream,char *mailbox); long imap_getacl (MAILSTREAM *stream,char *mailbox);
long imap_listrights (MAILSTREAM *stream,char *mailbox,char *id); long imap_listrights (MAILSTREAM *stream,char *mailbox,char *id);
long imap_myrights (MAILSTREAM *stream,char *mailbox); long imap_myrights (MAILSTREAM *stream,char *mailbox);
long imap_acl_work (MAILSTREAM *stream,char *command,IMAPARG *args[]);
long imap_setquota (MAILSTREAM *stream,char *qroot,STRINGLIST *limits); long imap_setquota (MAILSTREAM *stream,char *qroot,STRINGLIST *limits);
long imap_getquota (MAILSTREAM *stream,char *qroot); long imap_getquota (MAILSTREAM *stream,char *qroot);
long imap_getquotaroot (MAILSTREAM *stream,char *mailbox); long imap_getquotaroot (MAILSTREAM *stream,char *mailbox);
IMAPPARSEDREPLY *imap_send (MAILSTREAM *stream,char *cmd,IMAPARG *args[]);
IMAPPARSEDREPLY *imap_sout (MAILSTREAM *stream,char *tag,char *base,char **
s);
long imap_soutr (MAILSTREAM *stream,char *string);
IMAPPARSEDREPLY *imap_send_astring (MAILSTREAM *stream,char *tag,char **s,
SIZEDTEXT *as,long wildok,char *limit);
IMAPPARSEDREPLY *imap_send_literal (MAILSTREAM *stream,char *tag,char **s,
STRING *st);
IMAPPARSEDREPLY *imap_send_spgm (MAILSTREAM *stream,char *tag,char *base,
char **s,SEARCHPGM *pgm,char *limit);
char *imap_send_spgm_trim (char *base,char *s,char *text);
IMAPPARSEDREPLY *imap_send_sset (MAILSTREAM *stream,char *tag,char *base,
char **s,SEARCHSET *set,char *prefix,
char *limit);
IMAPPARSEDREPLY *imap_send_slist (MAILSTREAM *stream,char *tag,char *base,
char **s,char *name,STRINGLIST *list,
char *limit);
void imap_send_sdate (char **s,char *name,unsigned short date);
IMAPPARSEDREPLY *imap_reply (MAILSTREAM *stream,char *tag);
IMAPPARSEDREPLY *imap_parse_reply (MAILSTREAM *stream,char *text);
IMAPPARSEDREPLY *imap_fake (MAILSTREAM *stream,char *tag,char *text);
long imap_OK (MAILSTREAM *stream,IMAPPARSEDREPLY *reply);
void imap_parse_unsolicited (MAILSTREAM *stream,IMAPPARSEDREPLY *reply);
void imap_parse_response (MAILSTREAM *stream,char *text,long errflg,long nt
fy);
NAMESPACE *imap_parse_namespace (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
THREADNODE *imap_parse_thread (MAILSTREAM *stream,char **txtptr);
void imap_parse_header (MAILSTREAM *stream,ENVELOPE **env,SIZEDTEXT *hdr,
STRINGLIST *stl);
void imap_parse_envelope (MAILSTREAM *stream,ENVELOPE **env,char **txtptr,
IMAPPARSEDREPLY *reply);
ADDRESS *imap_parse_adrlist (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
ADDRESS *imap_parse_address (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
void imap_parse_flags (MAILSTREAM *stream,MESSAGECACHE *elt,char **txtptr);
unsigned long imap_parse_user_flag (MAILSTREAM *stream,char *flag);
char *imap_parse_astring (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply,unsigned long *len);
char *imap_parse_string (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply,GETS_DATA *md,
unsigned long *len,long flags);
void imap_parse_body (GETS_DATA *md,char *seg,char **txtptr,
IMAPPARSEDREPLY *reply);
long imap_cache (MAILSTREAM *stream,unsigned long msgno,char *seg,
STRINGLIST *stl,SIZEDTEXT *text);
void imap_parse_body_structure (MAILSTREAM *stream,BODY *body,char **txtptr
,
IMAPPARSEDREPLY *reply);
PARAMETER *imap_parse_body_parameter (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
void imap_parse_disposition (MAILSTREAM *stream,BODY *body,char **txtptr,
IMAPPARSEDREPLY *reply);
STRINGLIST *imap_parse_language (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
STRINGLIST *imap_parse_stringlist (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
void imap_parse_extension (MAILSTREAM *stream,char **txtptr,
IMAPPARSEDREPLY *reply);
void imap_parse_capabilities (MAILSTREAM *stream,char *t);
char *imap_host (MAILSTREAM *stream);
IMAPPARSEDREPLY *imap_fetch (MAILSTREAM *stream,char *sequence,long flags);
char *imap_reform_sequence (MAILSTREAM *stream,char *sequence,long flags);
 End of changes. 35 change blocks. 
229 lines changed or deleted 103 lines changed or added


 mail.h   mail.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 22 November 1989 * Date: 22 November 1989
* Last Edited: 19 August 2003 * Last Edited: 21 June 2004
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 1988-2003 University of Washington. * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
/* Build parameters */ /* Build parameters */
#define CACHEINCREMENT 250 /* cache growth increments */ #define CACHEINCREMENT 250 /* cache growth increments */
#define MAILTMPLEN 1024 /* size of a temporary buffer */ #define MAILTMPLEN 1024 /* size of a temporary buffer */
#define MAXMESSAGESIZE 65000 /* MS-DOS: maximum text buffer size #define MAXMESSAGESIZE 65000 /* MS-DOS: maximum text buffer size
* other: initial text buffer size */ * other: initial text buffer size */
#define MAXUSERFLAG 64 /* maximum length of a user flag */ #define MAXUSERFLAG 64 /* maximum length of a user flag */
#define MAXAUTHENTICATORS 8 /* maximum number of SASL authenticators */ #define MAXAUTHENTICATORS 8 /* maximum number of SASL authenticators */
/* maximum number of messages */ /* maximum number of messages */
#define MAXMESSAGES (unsigned long) 100000000 #define MAXMESSAGES (unsigned long) 100000000
#define MAXLOGINTRIALS 3 /* maximum number of client login attempts * /
/* These can't be changed without changing code */ /* These can't be changed without changing code */
#define NUSERFLAGS 30 /* maximum number of user flags */ #define NUSERFLAGS 30 /* maximum number of user flags */
#define BASEYEAR 1970 /* the year time began on Unix DON'T CHANGE */ #define BASEYEAR 1970 /* the year time began on Unix DON'T CHANGE */
/* default for unqualified addresses */ /* default for unqualified addresses */
#define BADHOST ".MISSING-HOST-NAME." #define BADHOST ".MISSING-HOST-NAME."
/* default for syntax errors in addresses */ /* default for syntax errors in addresses */
#define ERRHOST ".SYNTAX-ERROR." #define ERRHOST ".SYNTAX-ERROR."
skipping to change at line 139 skipping to change at line 140
#define GET_ADVERTISETHEWORLD (long) 215 #define GET_ADVERTISETHEWORLD (long) 215
#define SET_ADVERTISETHEWORLD (long) 216 #define SET_ADVERTISETHEWORLD (long) 216
#define GET_DISABLEAUTOSHAREDNS (long) 217 #define GET_DISABLEAUTOSHAREDNS (long) 217
#define SET_DISABLEAUTOSHAREDNS (long) 218 #define SET_DISABLEAUTOSHAREDNS (long) 218
#define GET_MAILSUBDIR 219 #define GET_MAILSUBDIR 219
#define SET_MAILSUBDIR 220 #define SET_MAILSUBDIR 220
#define GET_DISABLE822TZTEXT 221 #define GET_DISABLE822TZTEXT 221
#define SET_DISABLE822TZTEXT 222 #define SET_DISABLE822TZTEXT 222
#define GET_LIMITEDADVERTISE (long) 223 #define GET_LIMITEDADVERTISE (long) 223
#define SET_LIMITEDADVERTISE (long) 224 #define SET_LIMITEDADVERTISE (long) 224
#define GET_LOGOUTHOOK (long) 225
#define SET_LOGOUTHOOK (long) 226
#define GET_LOGOUTDATA (long) 227
#define SET_LOGOUTDATA (long) 228
/* 3xx: TCP/IP */ /* 3xx: TCP/IP */
#define GET_OPENTIMEOUT (long) 300 #define GET_OPENTIMEOUT (long) 300
#define SET_OPENTIMEOUT (long) 301 #define SET_OPENTIMEOUT (long) 301
#define GET_READTIMEOUT (long) 302 #define GET_READTIMEOUT (long) 302
#define SET_READTIMEOUT (long) 303 #define SET_READTIMEOUT (long) 303
#define GET_WRITETIMEOUT (long) 304 #define GET_WRITETIMEOUT (long) 304
#define SET_WRITETIMEOUT (long) 305 #define SET_WRITETIMEOUT (long) 305
#define GET_CLOSETIMEOUT (long) 306 #define GET_CLOSETIMEOUT (long) 306
#define SET_CLOSETIMEOUT (long) 307 #define SET_CLOSETIMEOUT (long) 307
#define GET_TIMEOUT (long) 308 #define GET_TIMEOUT (long) 308
skipping to change at line 170 skipping to change at line 175
#define GET_SSHCOMMAND (long) 320 #define GET_SSHCOMMAND (long) 320
#define SET_SSHCOMMAND (long) 321 #define SET_SSHCOMMAND (long) 321
#define GET_SSHPATH (long) 322 #define GET_SSHPATH (long) 322
#define SET_SSHPATH (long) 323 #define SET_SSHPATH (long) 323
#define GET_SSLCERTIFICATEQUERY (long) 324 #define GET_SSLCERTIFICATEQUERY (long) 324
#define SET_SSLCERTIFICATEQUERY (long) 325 #define SET_SSLCERTIFICATEQUERY (long) 325
#define GET_SSLFAILURE (long) 326 #define GET_SSLFAILURE (long) 326
#define SET_SSLFAILURE (long) 327 #define SET_SSLFAILURE (long) 327
#define GET_NEWSRCCANONHOST (long) 328 #define GET_NEWSRCCANONHOST (long) 328
#define SET_NEWSRCCANONHOST (long) 329 #define SET_NEWSRCCANONHOST (long) 329
#define GET_KINIT (long) 330
#define SET_KINIT (long) 331
/* 4xx: network drivers */ /* 4xx: network drivers */
#define GET_MAXLOGINTRIALS (long) 400 #define GET_MAXLOGINTRIALS (long) 400
#define SET_MAXLOGINTRIALS (long) 401 #define SET_MAXLOGINTRIALS (long) 401
#define GET_LOOKAHEAD (long) 402 #define GET_LOOKAHEAD (long) 402
#define SET_LOOKAHEAD (long) 403 #define SET_LOOKAHEAD (long) 403
#define GET_IMAPPORT (long) 404 #define GET_IMAPPORT (long) 404
#define SET_IMAPPORT (long) 405 #define SET_IMAPPORT (long) 405
#define GET_PREFETCH (long) 406 #define GET_PREFETCH (long) 406
#define SET_PREFETCH (long) 407 #define SET_PREFETCH (long) 407
#define GET_CLOSEONERROR (long) 408 #define GET_CLOSEONERROR (long) 408
skipping to change at line 219 skipping to change at line 226
#define GET_QUOTA (long) 438 #define GET_QUOTA (long) 438
#define SET_QUOTA (long) 439 #define SET_QUOTA (long) 439
#define GET_QUOTAROOT (long) 440 #define GET_QUOTAROOT (long) 440
#define SET_QUOTAROOT (long) 441 #define SET_QUOTAROOT (long) 441
#define GET_IMAPTRYSSL (long) 442 #define GET_IMAPTRYSSL (long) 442
#define SET_IMAPTRYSSL (long) 443 #define SET_IMAPTRYSSL (long) 443
#define GET_FETCHLOOKAHEAD (long) 444 #define GET_FETCHLOOKAHEAD (long) 444
#define SET_FETCHLOOKAHEAD (long) 445 #define SET_FETCHLOOKAHEAD (long) 445
#define GET_NNTPRANGE (long) 446 #define GET_NNTPRANGE (long) 446
#define SET_NNTPRANGE (long) 447 #define SET_NNTPRANGE (long) 447
#define GET_NNTPHIDEPATH (long) 448
#define SET_NNTPHIDEPATH (long) 449
#define GET_SENDCOMMAND (long) 450
#define SET_SENDCOMMAND (long) 451
#define GET_IDLETIMEOUT (long) 452
#define SET_IDLETIMEOUT (long) 452
/* 5xx: local file drivers */ /* 5xx: local file drivers */
#define GET_MBXPROTECTION (long) 500 #define GET_MBXPROTECTION (long) 500
#define SET_MBXPROTECTION (long) 501 #define SET_MBXPROTECTION (long) 501
#define GET_DIRPROTECTION (long) 502 #define GET_DIRPROTECTION (long) 502
#define SET_DIRPROTECTION (long) 503 #define SET_DIRPROTECTION (long) 503
#define GET_LOCKPROTECTION (long) 504 #define GET_LOCKPROTECTION (long) 504
#define SET_LOCKPROTECTION (long) 505 #define SET_LOCKPROTECTION (long) 505
#define GET_FROMWIDGET (long) 506 #define GET_FROMWIDGET (long) 506
#define SET_FROMWIDGET (long) 507 #define SET_FROMWIDGET (long) 507
#define GET_NEWSACTIVE (long) 508 #define GET_NEWSACTIVE (long) 508
skipping to change at line 286 skipping to change at line 299
#define GET_TRUSTDNS (long) 556 #define GET_TRUSTDNS (long) 556
#define SET_TRUSTDNS (long) 557 #define SET_TRUSTDNS (long) 557
#define GET_SASLUSESPTRNAME (long) 558 #define GET_SASLUSESPTRNAME (long) 558
#define SET_SASLUSESPTRNAME (long) 559 #define SET_SASLUSESPTRNAME (long) 559
#define GET_NETFSSTATBUG (long) 560 #define GET_NETFSSTATBUG (long) 560
#define SET_NETFSSTATBUG (long) 561 #define SET_NETFSSTATBUG (long) 561
#define GET_SNARFMAILBOXNAME (long) 562 #define GET_SNARFMAILBOXNAME (long) 562
#define SET_SNARFMAILBOXNAME (long) 563 #define SET_SNARFMAILBOXNAME (long) 563
#define GET_SNARFINTERVAL (long) 564 #define GET_SNARFINTERVAL (long) 564
#define SET_SNARFINTERVAL (long) 565 #define SET_SNARFINTERVAL (long) 565
#define GET_SNARFPRESERVE (long) 566
#define SET_SNARFPRESERVE (long) 567
/* Driver flags */ /* Driver flags */
#define DR_DISABLE (long) 0x1 /* driver is disabled */ #define DR_DISABLE (long) 0x1 /* driver is disabled */
#define DR_LOCAL (long) 0x2 /* local file driver */ #define DR_LOCAL (long) 0x2 /* local file driver */
#define DR_MAIL (long) 0x4 /* supports mail */ #define DR_MAIL (long) 0x4 /* supports mail */
#define DR_NEWS (long) 0x8 /* supports news */ #define DR_NEWS (long) 0x8 /* supports news */
#define DR_READONLY (long) 0x10 /* driver only allows readonly acces s */ #define DR_READONLY (long) 0x10 /* driver only allows readonly acces s */
#define DR_NOFAST (long) 0x20 /* "fast" data is slow (whole msg fetch) */ #define DR_NOFAST (long) 0x20 /* "fast" data is slow (whole msg fetch) */
#define DR_NAMESPACE (long) 0x40/* driver has a special namespace */ #define DR_NAMESPACE (long) 0x40/* driver has a special namespace */
#define DR_LOWMEM (long) 0x80 /* low amounts of memory available */ #define DR_LOWMEM (long) 0x80 /* low amounts of memory available */
skipping to change at line 322 skipping to change at line 337
#define CH_INIT (long) 10 /* initialize cache */ #define CH_INIT (long) 10 /* initialize cache */
#define CH_SIZE (long) 11 /* (re-)size the cache */ #define CH_SIZE (long) 11 /* (re-)size the cache */
#define CH_MAKEELT (long) 30 /* return elt, make if needed */ #define CH_MAKEELT (long) 30 /* return elt, make if needed */
#define CH_ELT (long) 31 /* return elt if exists */ #define CH_ELT (long) 31 /* return elt if exists */
#define CH_SORTCACHE (long) 35 /* return sortcache entry, make if needed */ #define CH_SORTCACHE (long) 35 /* return sortcache entry, make if needed */
#define CH_FREE (long) 40 /* free space used by elt */ #define CH_FREE (long) 40 /* free space used by elt */
/* free space used by sortcache */ /* free space used by sortcache */
#define CH_FREESORTCACHE (long) 43 #define CH_FREESORTCACHE (long) 43
#define CH_EXPUNGE (long) 45 /* delete elt pointer from list */ #define CH_EXPUNGE (long) 45 /* delete elt pointer from list */
/* Open options */ /* Mailbox open options
* For compatibility with the past, OP_DEBUG must always be 1.
*/
#define OP_DEBUG (long) 0x1 /* debug protocol negotiations */ #define OP_DEBUG (long) 0x1 /* debug protocol negotiations */
#define OP_READONLY (long) 0x2 /* read-only open */ #define OP_READONLY (long) 0x2 /* read-only open */
#define OP_ANONYMOUS (long) 0x4 /* anonymous open of newsgroup */ #define OP_ANONYMOUS (long) 0x4 /* anonymous open of newsgroup */
#define OP_SHORTCACHE (long) 0x8/* short (elt-only) caching */ #define OP_SHORTCACHE (long) 0x8/* short (elt-only) caching */
#define OP_SILENT (long) 0x10 /* don't pass up events (internal use) */ #define OP_SILENT (long) 0x10 /* don't pass up events (internal use) */
#define OP_PROTOTYPE (long) 0x20/* return driver prototype */ #define OP_PROTOTYPE (long) 0x20/* return driver prototype */
#define OP_HALFOPEN (long) 0x40 /* half-open (IMAP connect but no se lect) */ #define OP_HALFOPEN (long) 0x40 /* half-open (IMAP connect but no se lect) */
#define OP_EXPUNGE (long) 0x80 /* silently expunge recycle stream */ #define OP_EXPUNGE (long) 0x80 /* silently expunge recycle stream */
#define OP_SECURE (long) 0x100 /* don't do non-secure authentication */ #define OP_SECURE (long) 0x100 /* don't do non-secure authentication */
#define OP_TRYSSL (long) 0x200 /* try SSL first */ #define OP_TRYSSL (long) 0x200 /* try SSL first */
/* use multiple newsrc files */ /* use multiple newsrc files */
#define OP_MULNEWSRC (long) 0x400 #define OP_MULNEWSRC (long) 0x400
/* reserved for application use */
#define OP_RESERVED (unsigned long) 0xff000000
/* Net open options */ /* Net open options */
/* no error messages */ /* no error messages */
#define NET_SILENT ((unsigned long) 0x80000000) #define NET_SILENT ((unsigned long) 0x80000000)
/* no validation of SSL certificates */ /* no validation of SSL certificates */
#define NET_NOVALIDATECERT ((unsigned long) 0x40000000) #define NET_NOVALIDATECERT ((unsigned long) 0x40000000)
/* no open timeout */ /* no open timeout */
#define NET_NOOPENTIMEOUT ((unsigned long) 0x20000000) #define NET_NOOPENTIMEOUT ((unsigned long) 0x20000000)
/* TLS not SSL */ /* TLS not SSL */
skipping to change at line 367 skipping to change at line 386
#define FT_NOT (long) 0x4 /* NOT flag for header lines fetch */ #define FT_NOT (long) 0x4 /* NOT flag for header lines fetch */
#define FT_INTERNAL (long) 0x8 /* text can be internal strings */ #define FT_INTERNAL (long) 0x8 /* text can be internal strings */
/* IMAP prefetch text when fetching header * / /* IMAP prefetch text when fetching header * /
#define FT_PREFETCHTEXT (long) 0x20 #define FT_PREFETCHTEXT (long) 0x20
#define FT_NOHDRS (long) 0x40 /* suppress fetching extra headers (note tha t #define FT_NOHDRS (long) 0x40 /* suppress fetching extra headers (note tha t
this breaks news handling) */ this breaks news handling) */
#define FT_NEEDENV (long) 0x80 /* (internal use) include envelope */ #define FT_NEEDENV (long) 0x80 /* (internal use) include envelope */
#define FT_NEEDBODY (long) 0x100/* (internal use) include body structure */ #define FT_NEEDBODY (long) 0x100/* (internal use) include body structure */
/* no fetch lookahead */ /* no fetch lookahead */
#define FT_NOLOOKAHEAD (long) 0x200 #define FT_NOLOOKAHEAD (long) 0x200
/* lookahead in header searching */
#define FT_SEARCHLOOKAHEAD (long) 0x400
/* Flagging options */ /* Flagging options */
#define ST_UID (long) 0x1 /* argument is a UID sequence */ #define ST_UID (long) 0x1 /* argument is a UID sequence */
#define ST_SILENT (long) 0x2 /* don't return results */ #define ST_SILENT (long) 0x2 /* don't return results */
#define ST_SET (long) 0x4 /* set vs. clear */ #define ST_SET (long) 0x4 /* set vs. clear */
/* Copy options */ /* Copy options */
#define CP_UID (long) 0x1 /* argument is a UID sequence */ #define CP_UID (long) 0x1 /* argument is a UID sequence */
skipping to change at line 394 skipping to change at line 415
#define SO_FREE (long) 0x8 /* free sort program after finished */ #define SO_FREE (long) 0x8 /* free sort program after finished */
#define SE_NOSERVER (long) 0x10 /* don't do server-based search/sort /thread */ #define SE_NOSERVER (long) 0x10 /* don't do server-based search/sort /thread */
#define SE_RETAIN (long) 0x20 /* retain previous search results */ #define SE_RETAIN (long) 0x20 /* retain previous search results */
#define SO_OVERVIEW (long) 0x40 /* use overviews in searching (NNTP only) */ #define SO_OVERVIEW (long) 0x40 /* use overviews in searching (NNTP only) */
#define SE_NEEDBODY (long) 0x80 /* include body structure in prefetc h */ #define SE_NEEDBODY (long) 0x80 /* include body structure in prefetc h */
#define SE_NOHDRS (long) 0x100 /* suppress prefetching extra headers (note #define SE_NOHDRS (long) 0x100 /* suppress prefetching extra headers (note
that this breaks news handling) */ that this breaks news handling) */
#define SE_NOLOCAL (long) 0x200 /* no local retry (IMAP only) */ #define SE_NOLOCAL (long) 0x200 /* no local retry (IMAP only) */
#define SO_NOSERVER SE_NOSERVER /* compatibility name */ #define SO_NOSERVER SE_NOSERVER /* compatibility name */
#define SE_SILLYOK (long) 0x400 /* allow silly searches */
/* Status options */ /* Status options */
#define SA_MESSAGES (long) 0x1 /* number of messages */ #define SA_MESSAGES (long) 0x1 /* number of messages */
#define SA_RECENT (long) 0x2 /* number of recent messages */ #define SA_RECENT (long) 0x2 /* number of recent messages */
#define SA_UNSEEN (long) 0x4 /* number of unseen messages */ #define SA_UNSEEN (long) 0x4 /* number of unseen messages */
#define SA_UIDNEXT (long) 0x8 /* next UID to be assigned */ #define SA_UIDNEXT (long) 0x8 /* next UID to be assigned */
/* UID validity value */ /* UID validity value */
#define SA_UIDVALIDITY (long) 0x10 #define SA_UIDVALIDITY (long) 0x10
skipping to change at line 483 skipping to change at line 505
#define REFAUTH (long) 1 /* authentication referral -- logged in */ #define REFAUTH (long) 1 /* authentication referral -- logged in */
#define REFSELECT (long) 2 /* select referral */ #define REFSELECT (long) 2 /* select referral */
#define REFCREATE (long) 3 #define REFCREATE (long) 3
#define REFDELETE (long) 4 #define REFDELETE (long) 4
#define REFRENAME (long) 5 #define REFRENAME (long) 5
#define REFSUBSCRIBE (long) 6 #define REFSUBSCRIBE (long) 6
#define REFUNSUBSCRIBE (long) 7 #define REFUNSUBSCRIBE (long) 7
#define REFSTATUS (long) 8 #define REFSTATUS (long) 8
#define REFCOPY (long) 9 #define REFCOPY (long) 9
#define REFAPPEND (long) 10 #define REFAPPEND (long) 10
/* sendcommand_t codes */
/* expunge response deferred */
#define SC_EXPUNGEDEFERRED (long) 1
/* Block notification codes */ /* Block notification codes */
#define BLOCK_NONE 0 /* not blocked */ #define BLOCK_NONE 0 /* not blocked */
#define BLOCK_SENSITIVE 1 /* sensitive code, disallow alarms */ #define BLOCK_SENSITIVE 1 /* sensitive code, disallow alarms */
#define BLOCK_NONSENSITIVE 2 /* non-sensitive code, allow alarms */ #define BLOCK_NONSENSITIVE 2 /* non-sensitive code, allow alarms */
#define BLOCK_DNSLOOKUP 10 /* blocked on DNS lookup */ #define BLOCK_DNSLOOKUP 10 /* blocked on DNS lookup */
#define BLOCK_TCPOPEN 11 /* blocked on TCP open */ #define BLOCK_TCPOPEN 11 /* blocked on TCP open */
#define BLOCK_TCPREAD 12 /* blocked on TCP read */ #define BLOCK_TCPREAD 12 /* blocked on TCP read */
#define BLOCK_TCPWRITE 13 /* blocked on TCP write */ #define BLOCK_TCPWRITE 13 /* blocked on TCP write */
#define BLOCK_TCPCLOSE 14 /* blocked on TCP close */ #define BLOCK_TCPCLOSE 14 /* blocked on TCP close */
skipping to change at line 563 skipping to change at line 590
ADDRESS *next; /* pointer to next address in list */ ADDRESS *next; /* pointer to next address in list */
}; };
/* Message envelope */ /* Message envelope */
typedef struct mail_envelope { typedef struct mail_envelope {
unsigned int incomplete : 1; /* envelope may be incomplete */ unsigned int incomplete : 1; /* envelope may be incomplete */
unsigned int imapenvonly : 1; /* envelope only has IMAP envelope * / unsigned int imapenvonly : 1; /* envelope only has IMAP envelope * /
char *remail; /* remail header if any */ char *remail; /* remail header if any */
ADDRESS *return_path; /* error return address */ ADDRESS *return_path; /* error return address */
char *date; /* message composition date string */ unsigned char *date; /* message composition date string */
ADDRESS *from; /* originator address list */ ADDRESS *from; /* originator address list */
ADDRESS *sender; /* sender address list */ ADDRESS *sender; /* sender address list */
ADDRESS *reply_to; /* reply address list */ ADDRESS *reply_to; /* reply address list */
char *subject; /* message subject string */ char *subject; /* message subject string */
ADDRESS *to; /* primary recipient list */ ADDRESS *to; /* primary recipient list */
ADDRESS *cc; /* secondary recipient list */ ADDRESS *cc; /* secondary recipient list */
ADDRESS *bcc; /* blind secondary recipient list */ ADDRESS *bcc; /* blind secondary recipient list */
char *in_reply_to; /* replied message ID */ char *in_reply_to; /* replied message ID */
char *message_id; /* message ID */ char *message_id; /* message ID */
char *newsgroups; /* USENET newsgroups */ char *newsgroups; /* USENET newsgroups */
skipping to change at line 936 skipping to change at line 963
unsigned int secure : 1; /* stream secure flag */ unsigned int secure : 1; /* stream secure flag */
unsigned int tryssl : 1; /* stream tryssl flag */ unsigned int tryssl : 1; /* stream tryssl flag */
unsigned int mulnewsrc : 1; /* stream use multiple newsrc files */ unsigned int mulnewsrc : 1; /* stream use multiple newsrc files */
unsigned int perm_seen : 1; /* permanent Seen flag */ unsigned int perm_seen : 1; /* permanent Seen flag */
unsigned int perm_deleted : 1;/* permanent Deleted flag */ unsigned int perm_deleted : 1;/* permanent Deleted flag */
unsigned int perm_flagged : 1;/* permanent Flagged flag */ unsigned int perm_flagged : 1;/* permanent Flagged flag */
unsigned int perm_answered :1;/* permanent Answered flag */ unsigned int perm_answered :1;/* permanent Answered flag */
unsigned int perm_draft : 1; /* permanent Draft flag */ unsigned int perm_draft : 1; /* permanent Draft flag */
unsigned int kwd_create : 1; /* can create new keywords */ unsigned int kwd_create : 1; /* can create new keywords */
unsigned int uid_nosticky : 1;/* UIDs are not preserved */ unsigned int uid_nosticky : 1;/* UIDs are not preserved */
unsigned int unhealthy : 1; /* unhealthy protocol negotiations */
unsigned long perm_user_flags;/* mask of permanent user flags */ unsigned long perm_user_flags;/* mask of permanent user flags */
unsigned long gensym; /* generated tag */ unsigned long gensym; /* generated tag */
unsigned long nmsgs; /* # of associated msgs */ unsigned long nmsgs; /* # of associated msgs */
unsigned long recent; /* # of recent msgs */ unsigned long recent; /* # of recent msgs */
unsigned long uid_validity; /* UID validity sequence */ unsigned long uid_validity; /* UID validity sequence */
unsigned long uid_last; /* last assigned UID */ unsigned long uid_last; /* last assigned UID */
char *user_flags[NUSERFLAGS]; /* pointers to user flags in bit ord er */ char *user_flags[NUSERFLAGS]; /* pointers to user flags in bit ord er */
unsigned long cachesize; /* size of message cache */ unsigned long cachesize; /* size of message cache */
MESSAGECACHE **cache; /* message cache array */ MESSAGECACHE **cache; /* message cache array */
SORTCACHE **sc; /* sort cache array */ SORTCACHE **sc; /* sort cache array */
skipping to change at line 1048 skipping to change at line 1076
/* Mail delivery I/O stream */ /* Mail delivery I/O stream */
typedef struct send_stream { typedef struct send_stream {
NETSTREAM *netstream; /* network I/O stream */ NETSTREAM *netstream; /* network I/O stream */
char *host; /* SMTP service host */ char *host; /* SMTP service host */
char *reply; /* last reply string */ char *reply; /* last reply string */
long replycode; /* last reply code */ long replycode; /* last reply code */
unsigned int debug : 1; /* stream debug flag */ unsigned int debug : 1; /* stream debug flag */
unsigned int sensitive : 1; /* sensitive data in progress */ unsigned int sensitive : 1; /* sensitive data in progress */
unsigned int loser : 1; /* server is a loser */ unsigned int loser : 1; /* server is a loser */
unsigned int saslcancel : 1; /* SASL cancelled by protocol */
union { /* protocol specific */ union { /* protocol specific */
struct { /* SMTP specific */ struct { /* SMTP specific */
unsigned int ok : 1; /* supports ESMTP */ unsigned int ok : 1; /* supports ESMTP */
struct { /* service extensions */ struct { /* service extensions */
unsigned int send : 1; /* supports SEND */ unsigned int send : 1; /* supports SEND */
unsigned int soml : 1; /* supports SOML */ unsigned int soml : 1; /* supports SOML */
unsigned int saml : 1; /* supports SAML */ unsigned int saml : 1; /* supports SAML */
unsigned int expn : 1; /* supports EXPN */ unsigned int expn : 1; /* supports EXPN */
unsigned int help : 1; /* supports HELP */ unsigned int help : 1; /* supports HELP */
unsigned int turn : 1; /* supports TURN */ unsigned int turn : 1; /* supports TURN */
skipping to change at line 1133 skipping to change at line 1162
typedef long (*authclient_t) (authchallenge_t challenger, typedef long (*authclient_t) (authchallenge_t challenger,
authrespond_t responder,char *service,NETMBX * mb, authrespond_t responder,char *service,NETMBX * mb,
void *s,unsigned long *trial,char *user); void *s,unsigned long *trial,char *user);
typedef char *(*authresponse_t) (void *challenge,unsigned long clen, typedef char *(*authresponse_t) (void *challenge,unsigned long clen,
unsigned long *rlen); unsigned long *rlen);
typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv []); typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv []);
typedef void (*smtpverbose_t) (char *buffer); typedef void (*smtpverbose_t) (char *buffer);
typedef void (*imapenvelope_t) (MAILSTREAM *stream,unsigned long msgno, typedef void (*imapenvelope_t) (MAILSTREAM *stream,unsigned long msgno,
ENVELOPE *env); ENVELOPE *env);
typedef char *(*imapreferral_t) (MAILSTREAM *stream,char *url,long code); typedef char *(*imapreferral_t) (MAILSTREAM *stream,char *url,long code);
typedef void (*overview_t) (MAILSTREAM *stream,unsigned long uid,OVERVIEW * typedef void (*overview_t) (MAILSTREAM *stream,unsigned long uid,OVERVIEW *
ov); ov,
unsigned long msgno);
typedef unsigned long *(*sorter_t) (MAILSTREAM *stream,char *charset, typedef unsigned long *(*sorter_t) (MAILSTREAM *stream,char *charset,
SEARCHPGM *spg,SORTPGM *pgm,long flags); SEARCHPGM *spg,SORTPGM *pgm,long flags);
typedef void (*parseline_t) (ENVELOPE *env,char *hdr,char *data,char *host) ; typedef void (*parseline_t) (ENVELOPE *env,char *hdr,char *data,char *host) ;
typedef ADDRESS *(*parsephrase_t) (char *phrase,char *end,char *host); typedef ADDRESS *(*parsephrase_t) (char *phrase,char *end,char *host);
typedef void *(*blocknotify_t) (int reason,void *data); typedef void *(*blocknotify_t) (int reason,void *data);
typedef long (*kinit_t) (char *host,char *reason);
typedef void (*getacl_t) (MAILSTREAM *stream,char *mailbox,ACLLIST *acl); typedef void (*getacl_t) (MAILSTREAM *stream,char *mailbox,ACLLIST *acl);
typedef void (*listrights_t) (MAILSTREAM *stream,char *mailbox,char *id, typedef void (*listrights_t) (MAILSTREAM *stream,char *mailbox,char *id,
char *alwaysrights,STRINGLIST *possiblerights) ; char *alwaysrights,STRINGLIST *possiblerights) ;
typedef void (*myrights_t) (MAILSTREAM *stream,char *mailbox,char *rights); typedef void (*myrights_t) (MAILSTREAM *stream,char *mailbox,char *rights);
typedef void (*quota_t) (MAILSTREAM *stream,char *qroot,QUOTALIST *qlist); typedef void (*quota_t) (MAILSTREAM *stream,char *qroot,QUOTALIST *qlist);
typedef void (*quotaroot_t) (MAILSTREAM *stream,char *mbx,STRINGLIST *qroot ); typedef void (*quotaroot_t) (MAILSTREAM *stream,char *mbx,STRINGLIST *qroot );
typedef void (*sortresults_t) (MAILSTREAM *stream,unsigned long *list, typedef void (*sortresults_t) (MAILSTREAM *stream,unsigned long *list,
unsigned long size); unsigned long size);
typedef void (*sendcommand_t) (MAILSTREAM *stream,char *cmd,long flags);
typedef char *(*newsrcquery_t) (MAILSTREAM *stream,char *mulname,char *name ); typedef char *(*newsrcquery_t) (MAILSTREAM *stream,char *mulname,char *name );
typedef char *(*userprompt_t) (void); typedef char *(*userprompt_t) (void);
typedef long (*append_t) (MAILSTREAM *stream,void *data,char **flags, typedef long (*append_t) (MAILSTREAM *stream,void *data,char **flags,
char **date,STRING **message); char **date,STRING **message);
typedef void (*freeeltsparep_t) (void **sparep); typedef void (*freeeltsparep_t) (void **sparep);
typedef void (*freeenvelopesparep_t) (void **sparep); typedef void (*freeenvelopesparep_t) (void **sparep);
typedef void (*freebodysparep_t) (void **sparep); typedef void (*freebodysparep_t) (void **sparep);
typedef void (*freestreamsparep_t) (void **sparep); typedef void (*freestreamsparep_t) (void **sparep);
typedef void *(*sslstart_t) (void *stream,char *host,unsigned long flags); typedef void *(*sslstart_t) (void *stream,char *host,unsigned long flags);
typedef long (*sslcertificatequery_t) (char *reason,char *host,char *cert); typedef long (*sslcertificatequery_t) (char *reason,char *host,char *cert);
typedef void (*sslfailure_t) (char *host,char *reason,unsigned long flags); typedef void (*sslfailure_t) (char *host,char *reason,unsigned long flags);
typedef void (*logouthook_t) (void *data);
/* Globals */ /* Globals */
extern char *body_types[]; /* defined body type strings */ extern char *body_types[]; /* defined body type strings */
extern char *body_encodings[]; /* defined body encoding strings */ extern char *body_encodings[]; /* defined body encoding strings */
extern const char *days[]; /* day name strings */ extern const char *days[]; /* day name strings */
extern const char *months[]; /* month name strings */ extern const char *months[]; /* month name strings */
/* Threading */ /* Threading */
/* Thread node */ /* Thread node */
skipping to change at line 1417 skipping to change at line 1449
long mail_status (MAILSTREAM *stream,char *mbx,long flags); long mail_status (MAILSTREAM *stream,char *mbx,long flags);
long mail_status_default (MAILSTREAM *stream,char *mbx,long flags); long mail_status_default (MAILSTREAM *stream,char *mbx,long flags);
MAILSTREAM *mail_open (MAILSTREAM *oldstream,char *name,long options); MAILSTREAM *mail_open (MAILSTREAM *oldstream,char *name,long options);
MAILSTREAM *mail_close_full (MAILSTREAM *stream,long options); MAILSTREAM *mail_close_full (MAILSTREAM *stream,long options);
MAILHANDLE *mail_makehandle (MAILSTREAM *stream); MAILHANDLE *mail_makehandle (MAILSTREAM *stream);
void mail_free_handle (MAILHANDLE **handle); void mail_free_handle (MAILHANDLE **handle);
MAILSTREAM *mail_stream (MAILHANDLE *handle); MAILSTREAM *mail_stream (MAILHANDLE *handle);
void mail_fetch_fast (MAILSTREAM *stream,char *sequence,long flags); void mail_fetch_fast (MAILSTREAM *stream,char *sequence,long flags);
void mail_fetch_flags (MAILSTREAM *stream,char *sequence,long flags); void mail_fetch_flags (MAILSTREAM *stream,char *sequence,long flags);
void mail_fetch_overview (MAILSTREAM *stream,char *sequence,overview_t ofn) ; void mail_fetch_overview (MAILSTREAM *stream,char *sequence,overview_t ofn) ;
void mail_fetch_overview_sequence (MAILSTREAM *stream,char *sequence,
overview_t ofn);
void mail_fetch_overview_default (MAILSTREAM *stream,overview_t ofn);
ENVELOPE *mail_fetch_structure (MAILSTREAM *stream,unsigned long msgno, ENVELOPE *mail_fetch_structure (MAILSTREAM *stream,unsigned long msgno,
BODY **body,long flags); BODY **body,long flags);
char *mail_fetch_message (MAILSTREAM *stream,unsigned long msgno, char *mail_fetch_message (MAILSTREAM *stream,unsigned long msgno,
unsigned long *len,long flags); unsigned long *len,long flags);
char *mail_fetch_header (MAILSTREAM *stream,unsigned long msgno,char *secti on, char *mail_fetch_header (MAILSTREAM *stream,unsigned long msgno,char *secti on,
STRINGLIST *lines,unsigned long *len,long flags); STRINGLIST *lines,unsigned long *len,long flags);
char *mail_fetch_text (MAILSTREAM *stream,unsigned long msgno,char *section , char *mail_fetch_text (MAILSTREAM *stream,unsigned long msgno,char *section ,
unsigned long *len,long flags); unsigned long *len,long flags);
char *mail_fetch_mime (MAILSTREAM *stream,unsigned long msgno,char *section , char *mail_fetch_mime (MAILSTREAM *stream,unsigned long msgno,char *section ,
unsigned long *len,long flags); unsigned long *len,long flags);
skipping to change at line 1461 skipping to change at line 1496
void mail_expunge (MAILSTREAM *stream); void mail_expunge (MAILSTREAM *stream);
long mail_copy_full (MAILSTREAM *stream,char *sequence,char *mailbox, long mail_copy_full (MAILSTREAM *stream,char *sequence,char *mailbox,
long options); long options);
long mail_append_full (MAILSTREAM *stream,char *mailbox,char *flags,char *d ate, long mail_append_full (MAILSTREAM *stream,char *mailbox,char *flags,char *d ate,
STRING *message); STRING *message);
long mail_append_multiple (MAILSTREAM *stream,char *mailbox,append_t af, long mail_append_multiple (MAILSTREAM *stream,char *mailbox,append_t af,
void *data); void *data);
void mail_gc (MAILSTREAM *stream,long gcflags); void mail_gc (MAILSTREAM *stream,long gcflags);
void mail_gc_msg (MESSAGE *msg,long gcflags); void mail_gc_msg (MESSAGE *msg,long gcflags);
void mail_gc_body (BODY *body); void mail_gc_body (BODY *body);
BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,char *section); BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,
unsigned char *section);
char *mail_date (char *string,MESSAGECACHE *elt); char *mail_date (char *string,MESSAGECACHE *elt);
char *mail_cdate (char *string,MESSAGECACHE *elt); char *mail_cdate (char *string,MESSAGECACHE *elt);
long mail_parse_date (MESSAGECACHE *elt,char *string); long mail_parse_date (MESSAGECACHE *elt,unsigned char *string);
void mail_exists (MAILSTREAM *stream,unsigned long nmsgs); void mail_exists (MAILSTREAM *stream,unsigned long nmsgs);
void mail_recent (MAILSTREAM *stream,unsigned long recent); void mail_recent (MAILSTREAM *stream,unsigned long recent);
void mail_expunged (MAILSTREAM *stream,unsigned long msgno); void mail_expunged (MAILSTREAM *stream,unsigned long msgno);
void mail_lock (MAILSTREAM *stream); void mail_lock (MAILSTREAM *stream);
void mail_unlock (MAILSTREAM *stream); void mail_unlock (MAILSTREAM *stream);
void mail_debug (MAILSTREAM *stream); void mail_debug (MAILSTREAM *stream);
void mail_nodebug (MAILSTREAM *stream); void mail_nodebug (MAILSTREAM *stream);
void mail_dlog (char *string,long flag); void mail_dlog (char *string,long flag);
long mail_match_lines (STRINGLIST *lines,STRINGLIST *msglines,long flags); long mail_match_lines (STRINGLIST *lines,STRINGLIST *msglines,long flags);
unsigned long mail_filter (char *text,unsigned long len,STRINGLIST *lines, unsigned long mail_filter (char *text,unsigned long len,STRINGLIST *lines,
skipping to change at line 1517 skipping to change at line 1553
THREADNODE *mail_thread (MAILSTREAM *stream,char *type,char *charset, THREADNODE *mail_thread (MAILSTREAM *stream,char *type,char *charset,
SEARCHPGM *spg,long flags); SEARCHPGM *spg,long flags);
THREADNODE *mail_thread_msgs (MAILSTREAM *stream,char *type,char *charset, THREADNODE *mail_thread_msgs (MAILSTREAM *stream,char *type,char *charset,
SEARCHPGM *spg,long flags,sorter_t sorter); SEARCHPGM *spg,long flags,sorter_t sorter);
THREADNODE *mail_thread_orderedsubject (MAILSTREAM *stream,char *charset, THREADNODE *mail_thread_orderedsubject (MAILSTREAM *stream,char *charset,
SEARCHPGM *spg,long flags, SEARCHPGM *spg,long flags,
sorter_t sorter); sorter_t sorter);
THREADNODE *mail_thread_references (MAILSTREAM *stream,char *charset, THREADNODE *mail_thread_references (MAILSTREAM *stream,char *charset,
SEARCHPGM *spg,long flags, SEARCHPGM *spg,long flags,
sorter_t sorter); sorter_t sorter);
void mail_thread_loadcache (MAILSTREAM *stream,unsigned long uid,OVERVIEW * void mail_thread_loadcache (MAILSTREAM *stream,unsigned long uid,OVERVIEW *
ov); ov,
unsigned long msgno);
char *mail_thread_parse_msgid (char *s,char **ss); char *mail_thread_parse_msgid (char *s,char **ss);
STRINGLIST *mail_thread_parse_references (char *s,long flag); STRINGLIST *mail_thread_parse_references (char *s,long flag);
long mail_thread_check_child (container_t mother,container_t daughter); long mail_thread_check_child (container_t mother,container_t daughter);
container_t mail_thread_prune_dummy (container_t msg,container_t ane); container_t mail_thread_prune_dummy (container_t msg,container_t ane);
container_t mail_thread_prune_dummy_work (container_t msg,container_t ane); container_t mail_thread_prune_dummy_work (container_t msg,container_t ane);
THREADNODE *mail_thread_c2node (MAILSTREAM *stream,container_t con,long fla gs); THREADNODE *mail_thread_c2node (MAILSTREAM *stream,container_t con,long fla gs);
THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc); THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc);
int mail_thread_compare_date (const void *a1,const void *a2); int mail_thread_compare_date (const void *a1,const void *a2);
long mail_sequence (MAILSTREAM *stream,char *sequence); long mail_sequence (MAILSTREAM *stream,unsigned char *sequence);
long mail_uid_sequence (MAILSTREAM *stream,char *sequence); long mail_uid_sequence (MAILSTREAM *stream,unsigned char *sequence);
long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf); long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf);
long mail_usable_network_stream (MAILSTREAM *stream,char *name); long mail_usable_network_stream (MAILSTREAM *stream,char *name);
MESSAGECACHE *mail_new_cache_elt (unsigned long msgno); MESSAGECACHE *mail_new_cache_elt (unsigned long msgno);
ENVELOPE *mail_newenvelope (void); ENVELOPE *mail_newenvelope (void);
ADDRESS *mail_newaddr (void); ADDRESS *mail_newaddr (void);
BODY *mail_newbody (void); BODY *mail_newbody (void);
BODY *mail_initbody (BODY *body); BODY *mail_initbody (BODY *body);
PARAMETER *mail_newbody_parameter (void); PARAMETER *mail_newbody_parameter (void);
PART *mail_newbody_part (void); PART *mail_newbody_part (void);
MESSAGE *mail_newmsg (void); MESSAGE *mail_newmsg (void);
 End of changes. 24 change blocks. 
13 lines changed or deleted 50 lines changed or added


 misc.h   misc.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 5 July 1988 * Date: 5 July 1988
* Last Edited: 16 October 2001 * Last Edited: 27 April 2004
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 2001 University of Washington. * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
* *
* This original version of this file is * This original version of this file is
* Copyright 1988 Stanford University * Copyright 1988 Stanford University
* and was developed in the Symbolic Systems Resources Group of the Knowled ge * and was developed in the Symbolic Systems Resources Group of the Knowled ge
* Systems Laboratory at Stanford University in 1987-88, and was funded by the * Systems Laboratory at Stanford University in 1987-88, and was funded by the
* Biomedical Research Technology Program of the NationalInstitutes of Heal th * Biomedical Research Technology Program of the NationalInstitutes of Heal th
* under grant number RR-00785. * under grant number RR-00785.
*/ */
skipping to change at line 71 skipping to change at line 71
#define min Min #define min Min
#define max Max #define max Max
/* Compatibility definitions */ /* Compatibility definitions */
#define pmatch(s,pat) \ #define pmatch(s,pat) \
pmatch_full (s,pat,NIL) pmatch_full (s,pat,NIL)
/* Function prototypes */ /* Function prototypes */
char *ucase (char *string); unsigned char *ucase (unsigned char *string);
char *lcase (char *string); unsigned char *lcase (unsigned char *string);
char *cpystr (const char *string); char *cpystr (const char *string);
char *cpytxt (SIZEDTEXT *dst,char *text,unsigned long size); char *cpytxt (SIZEDTEXT *dst,char *text,unsigned long size);
char *textcpy (SIZEDTEXT *dst,SIZEDTEXT *src); char *textcpy (SIZEDTEXT *dst,SIZEDTEXT *src);
char *textcpystring (SIZEDTEXT *text,STRING *bs); char *textcpystring (SIZEDTEXT *text,STRING *bs);
char *textcpyoffstring (SIZEDTEXT *text,STRING *bs,unsigned long offset, char *textcpyoffstring (SIZEDTEXT *text,STRING *bs,unsigned long offset,
unsigned long size); unsigned long size);
unsigned long find_rightmost_bit (unsigned long *valptr); unsigned long find_rightmost_bit (unsigned long *valptr);
long min (long i,long j); long min (long i,long j);
long max (long i,long j); long max (long i,long j);
long search (unsigned char *base,long basec,unsigned char *pat,long patc); long search (unsigned char *base,long basec,unsigned char *pat,long patc);
HASHTAB *hash_create (size_t size); HASHTAB *hash_create (size_t size);
void hash_destroy (HASHTAB **hashtab); void hash_destroy (HASHTAB **hashtab);
void hash_reset (HASHTAB *hashtab); void hash_reset (HASHTAB *hashtab);
unsigned long hash_index (HASHTAB *hashtab,char *key); unsigned long hash_index (HASHTAB *hashtab,char *key);
void **hash_lookup (HASHTAB *hashtab,char *key); void **hash_lookup (HASHTAB *hashtab,char *key);
HASHENT *hash_add (HASHTAB *hashtab,char *key,void *data,long extra); HASHENT *hash_add (HASHTAB *hashtab,char *key,void *data,long extra);
void **hash_lookup_and_add (HASHTAB *hashtab,char *key,void *data,long extr a); void **hash_lookup_and_add (HASHTAB *hashtab,char *key,void *data,long extr a);
int compare_ulong (unsigned long l1,unsigned long l2); int compare_ulong (unsigned long l1,unsigned long l2);
int compare_cstring (char *s1,char *s2); int compare_cstring (unsigned char *s1,unsigned char *s2);
int compare_csizedtext (char *s1,SIZEDTEXT *s2); int compare_csizedtext (unsigned char *s1,SIZEDTEXT *s2);
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 newsrc.h   newsrc.h 
skipping to change at line 33 skipping to change at line 33
long newsrc_error (char *fmt,char *text,long errflg); long newsrc_error (char *fmt,char *text,long errflg);
long newsrc_write_error (char *name,FILE *f1,FILE *f2); long newsrc_write_error (char *name,FILE *f1,FILE *f2);
FILE *newsrc_create (MAILSTREAM *stream,int notify); FILE *newsrc_create (MAILSTREAM *stream,int notify);
long newsrc_newstate (FILE *f,char *group,char state,char *nl); long newsrc_newstate (FILE *f,char *group,char state,char *nl);
long newsrc_newmessages (FILE *f,MAILSTREAM *stream,char *nl); long newsrc_newmessages (FILE *f,MAILSTREAM *stream,char *nl);
void newsrc_lsub (MAILSTREAM *stream,char *pattern); void newsrc_lsub (MAILSTREAM *stream,char *pattern);
long newsrc_update (MAILSTREAM *stream,char *group,char state); long newsrc_update (MAILSTREAM *stream,char *group,char state);
long newsrc_read (char *group,MAILSTREAM *stream); long newsrc_read (char *group,MAILSTREAM *stream);
long newsrc_write (char *group,MAILSTREAM *stream); long newsrc_write (char *group,MAILSTREAM *stream);
char *newsrc_state (MAILSTREAM *stream,char *group); char *newsrc_state (MAILSTREAM *stream,char *group);
void newsrc_check_uid (char *state,unsigned long uid,unsigned long *recent, void newsrc_check_uid (unsigned char *state,unsigned long uid,
unsigned long *unseen); unsigned long *recent,unsigned long *unseen);
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 nl.h   nl.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 1 August 1988 * Date: 1 August 1988
* Last Edited: 24 October 2000 * Last Edited: 27 April 2004
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 2000 University of Washington. * Copyright 2004 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
/* Function prototypes */ /* Function prototypes */
unsigned long strcrlfcpy (char **dst,unsigned long *dstl,char *src, unsigned long strcrlfcpy (unsigned char **dst,unsigned long *dstl,
unsigned long srcl); unsigned char *src,unsigned long srcl);
unsigned long strcrlflen (STRING *s); unsigned long strcrlflen (STRING *s);
 End of changes. 3 change blocks. 
4 lines changed or deleted 4 lines changed or added


 nntp.h   nntp.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 10 February 1992 * Date: 10 February 1992
* Last Edited: 2 June 2003 * Last Edited: 22 October 2003
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 1988-2003 University of Washington. * Copyright 1988-2003 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
/* Constants */ /* Constants (should be in nntp.c) */
#define MAXLOGINTRIALS 3 /* maximum number of login trials */
#define NNTPTCPPORT (long) 119 /* assigned TCP contact port */ #define NNTPTCPPORT (long) 119 /* assigned TCP contact port */
#define NNTPSSLPORT (long) 563 /* assigned(?) SSL TCP contact port */
#define NNTPGREET (long) 200 /* NNTP successful greeting */
#define NNTPGREETNOPOST (long) 201
#define NNTPEXTOK (long) 202 /* NNTP extensions OK */
#define NNTPGOK (long) 211 /* NNTP group selection OK */
#define NNTPGLIST (long) 215 /* NNTP group list being returned */
#define NNTPARTICLE (long) 220 /* NNTP article file */
#define NNTPHEAD (long) 221 /* NNTP header text */
#define NNTPBODY (long) 222 /* NNTP body text */
#define NNTPOVER (long) 224 /* NNTP overview text */
#define NNTPOK (long) 240 /* NNTP OK code */
#define NNTPSASLED (long) 250 /* NNTP successful SASL authentication */
#define NNTPAUTHED (long) 281 /* NNTP successful authentication */
#define NNTPREADY (long) 340 /* NNTP ready for data */
#define NNTPCHALLENGE (long) 351/* NNTP challenge, want response */
#define NNTPWANTAUTH (long) 380 /* NNTP authentication needed */
#define NNTPWANTPASS (long) 381 /* NNTP password needed */
#define NNTPTLSSTART (long) 382 /* NNTP continue with TLS negotiatio
n */
#define NNTPSOFTFATAL (long) 400/* NNTP soft fatal code */
#define NNTPWANTAUTH2 (long) 480/* NNTP authentication needed (alternate) *
/
#define NNTPBADCMD (long) 500 /* NNTP unrecognized command */
/* NNTP I/O stream local data */
typedef struct nntp_local { /* NNTP open options
SENDSTREAM *nntpstream; /* NNTP stream for I/O */ * For compatibility with the past, NOP_DEBUG must always be 1.
unsigned int dirty : 1; /* disk copy of .newsrc needs updating */ */
unsigned int tlsflag : 1; /* TLS session */
unsigned int notlsflag : 1; /* TLS not used in session */
unsigned int sslflag : 1; /* SSL session */
unsigned int novalidate : 1; /* certificate not validated */
unsigned int xover : 1; /* supports XOVER */
unsigned int xhdr : 1; /* supports XHDR */
char *name; /* remote newsgroup name */
char *user; /* mailbox user */
char *newsrc; /* newsrc file */
char *over_fmt; /* overview format */
unsigned long msgno; /* current text message number */
FILE *txt; /* current text */
unsigned long txtsize; /* current text size */
} NNTPLOCAL;
/* Convenient access to local data */
#define LOCAL ((NNTPLOCAL *) stream->local)
/* Convenient access to protocol-specific data */
#define NNTP stream->protocol.nntp
/* Convenient access to extensions */ #define NOP_DEBUG (long) 0x1 /* debug protocol negotiations */
#define NOP_READONLY (long) 0x2 /* read-only open */
#define NOP_TRYSSL (long) 0x4 /* try SSL first */
/* reserved for application use */
#define NOP_RESERVED (unsigned long) 0xff000000
#define EXTENSION LOCAL->nntpstream->protocol.nntp.ext
/* Compatibility support names */ /* Compatibility support names */
#define nntp_open(hostlist,options) \ #define nntp_open(hostlist,options) \
nntp_open_full (NIL,hostlist,"nntp",NNTPTCPPORT,options) nntp_open_full (NIL,hostlist,"nntp",NIL,options)
/* Function prototypes */ /* Function prototypes */
DRIVER *nntp_valid (char *name);
DRIVER *nntp_isvalid (char *name,char *mbx);
void *nntp_parameters (long function,void *value);
void nntp_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents);
void nntp_list (MAILSTREAM *stream,char *ref,char *pat);
void nntp_lsub (MAILSTREAM *stream,char *ref,char *pat);
long nntp_canonicalize (char *ref,char *pat,char *pattern,char *wildmat);
long nntp_subscribe (MAILSTREAM *stream,char *mailbox);
long nntp_unsubscribe (MAILSTREAM *stream,char *mailbox);
long nntp_create (MAILSTREAM *stream,char *mailbox);
long nntp_delete (MAILSTREAM *stream,char *mailbox);
long nntp_rename (MAILSTREAM *stream,char *old,char *newname);
long nntp_status (MAILSTREAM *stream,char *mbx,long flags);
long nntp_getmap (MAILSTREAM *stream,char *name,
unsigned long first,unsigned long last,
unsigned long rnmsgs,unsigned long nmsgs,char *tmp);
MAILSTREAM *nntp_mopen (MAILSTREAM *stream);
void nntp_mclose (MAILSTREAM *stream,long options);
void nntp_fetchfast (MAILSTREAM *stream,char *sequence,long flags);
void nntp_flags (MAILSTREAM *stream,char *sequence,long flags);
long nntp_overview (MAILSTREAM *stream,overview_t ofn);
long nntp_parse_overview (OVERVIEW *ov,char *text,MESSAGECACHE *elt);
long nntp_over (MAILSTREAM *stream,char *sequence);
char *nntp_header (MAILSTREAM *stream,unsigned long msgno,unsigned long *si
ze,
long flags);
long nntp_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flag
s);
FILE *nntp_article (MAILSTREAM *stream,char *msgid,unsigned long *size,
unsigned long *hsiz);
void nntp_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt);
long nntp_search (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,long flag
s);
long nntp_search_msg (MAILSTREAM *stream,unsigned long msgno,SEARCHPGM *pgm
,
OVERVIEW *ov);
unsigned long *nntp_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
SORTPGM *pgm,long flags);
SORTCACHE **nntp_sort_loadcache (MAILSTREAM *stream,SORTPGM *pgm,
unsigned long start,unsigned long last,
long flags);
THREADNODE *nntp_thread (MAILSTREAM *stream,char *type,char *charset,
SEARCHPGM *spg,long flags);
long nntp_ping (MAILSTREAM *stream);
void nntp_check (MAILSTREAM *stream);
void nntp_expunge (MAILSTREAM *stream);
long nntp_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long option
s);
long nntp_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
SENDSTREAM *nntp_open_full (NETDRIVER *dv,char **hostlist,char *service, SENDSTREAM *nntp_open_full (NETDRIVER *dv,char **hostlist,char *service,
unsigned long port,long options); unsigned long port,long options);
SENDSTREAM *nntp_greet (SENDSTREAM *stream,long options);
long nntp_extensions (SENDSTREAM *stream,long flags);
SENDSTREAM *nntp_close (SENDSTREAM *stream); SENDSTREAM *nntp_close (SENDSTREAM *stream);
long nntp_mail (SENDSTREAM *stream,ENVELOPE *msg,BODY *body); long nntp_mail (SENDSTREAM *stream,ENVELOPE *msg,BODY *body);
long nntp_send (SENDSTREAM *stream,char *command,char *args);
long nntp_send_work (SENDSTREAM *stream,char *command,char *args);
long nntp_send_auth (SENDSTREAM *stream);
long nntp_send_auth_work (SENDSTREAM *stream,NETMBX *mb,char *pwd);
void *nntp_challenge (void *s,unsigned long *len);
long nntp_response (void *s,char *response,unsigned long size);
long nntp_reply (SENDSTREAM *stream);
long nntp_fake (SENDSTREAM *stream,char *text);
long nntp_soutr (void *stream,char *s);
 End of changes. 11 change blocks. 
108 lines changed or deleted 11 lines changed or added


 smtp.h   smtp.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 27 July 1988 * Date: 27 July 1988
* Last Edited: 11 September 2002 * Last Edited: 22 October 2003
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 2002 University of Washington. * Copyright 2003 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
* *
* This original version of this file is * This original version of this file is
* Copyright 1988 Stanford University * Copyright 1988 Stanford University
* and was developed in the Symbolic Systems Resources Group of the Knowled ge * and was developed in the Symbolic Systems Resources Group of the Knowled ge
* Systems Laboratory at Stanford University in 1987-88, and was funded by the * Systems Laboratory at Stanford University in 1987-88, and was funded by the
* Biomedical Research Technology Program of the NationalInstitutes of Heal th * Biomedical Research Technology Program of the NationalInstitutes of Heal th
* under grant number RR-00785. * under grant number RR-00785.
*/ */
/* Constants */ /* Constants (should be in smtp.c) */
#define MAXLOGINTRIALS 3 /* maximum number of login trials */
#define SMTPTCPPORT (long) 25 /* assigned TCP contact port */ #define SMTPTCPPORT (long) 25 /* assigned TCP contact port */
#define SMTPSSLPORT (long) 465 /* former assigned SSL TCP contact port */
#define SMTPGREET (long) 220 /* SMTP successful greeting */
#define SMTPAUTHED (long) 235 /* SMTP successful authentication */
#define SMTPOK (long) 250 /* SMTP OK code */
#define SMTPAUTHREADY (long) 334/* SMTP ready for authentication */
#define SMTPREADY (long) 354 /* SMTP ready for data */
#define SMTPSOFTFATAL (long) 421/* SMTP soft fatal code */
#define SMTPWANTAUTH (long) 505 /* SMTP authentication needed */
#define SMTPWANTAUTH2 (long) 530/* SMTP authentication needed */
#define SMTPHARDERROR (long) 554/* SMTP miscellaneous hard failure */
/* SMTP open options */ /* SMTP open options
* For compatibility with the past, SOP_DEBUG must always be 1.
*/
#define SOP_DEBUG (long) 1 /* debug protocol negotiations */ #define SOP_DEBUG (long) 1 /* debug protocol negotiations */
#define SOP_DSN (long) 2 /* DSN requested */ #define SOP_DSN (long) 2 /* DSN requested */
/* DSN notification, none set mean NEVER */ /* DSN notification, none set mean NEVER */
#define SOP_DSN_NOTIFY_FAILURE (long) 4 #define SOP_DSN_NOTIFY_FAILURE (long) 4
#define SOP_DSN_NOTIFY_DELAY (long) 8 #define SOP_DSN_NOTIFY_DELAY (long) 8
#define SOP_DSN_NOTIFY_SUCCESS (long) 16 #define SOP_DSN_NOTIFY_SUCCESS (long) 16
/* DSN return full msg vs. header */ /* DSN return full msg vs. header */
#define SOP_DSN_RETURN_FULL (long) 32 #define SOP_DSN_RETURN_FULL (long) 32
#define SOP_8BITMIME (long) 64 /* 8-bit MIME requested */ #define SOP_8BITMIME (long) 64 /* 8-bit MIME requested */
#define SOP_SECURE (long) 256 /* don't do non-secure authentication */ #define SOP_SECURE (long) 256 /* don't do non-secure authentication */
#define SOP_TRYSSL (long) 512 /* try SSL first */ #define SOP_TRYSSL (long) 512 /* try SSL first */
#define SOP_TRYALT SOP_TRYSSL /* old name */ #define SOP_TRYALT SOP_TRYSSL /* old name */
/* reserved for application use */
/* Convenient access to protocol-specific data */ #define SOP_RESERVED (unsigned long) 0xff000000
#define ESMTP stream->protocol.esmtp
/* Compatibility support names */ /* Compatibility support names */
#define smtp_open(hostlist,options) \ #define smtp_open(hostlist,options) \
smtp_open_full (NIL,hostlist,"smtp",SMTPTCPPORT,options) smtp_open_full (NIL,hostlist,"smtp",NIL,options)
/* Function prototypes */ /* Function prototypes */
void *smtp_parameters (long function,void *value); void *smtp_parameters (long function,void *value);
SENDSTREAM *smtp_open_full (NETDRIVER *dv,char **hostlist,char *service, SENDSTREAM *smtp_open_full (NETDRIVER *dv,char **hostlist,char *service,
unsigned long port,long options); unsigned long port,long options);
void *smtp_challenge (void *s,unsigned long *len);
long smtp_response (void *s,char *response,unsigned long size);
long smtp_auth (SENDSTREAM *stream,NETMBX *mb,char *tmp);
SENDSTREAM *smtp_close (SENDSTREAM *stream); SENDSTREAM *smtp_close (SENDSTREAM *stream);
long smtp_mail (SENDSTREAM *stream,char *type,ENVELOPE *msg,BODY *body); long smtp_mail (SENDSTREAM *stream,char *type,ENVELOPE *msg,BODY *body);
void smtp_debug (SENDSTREAM *stream); void smtp_debug (SENDSTREAM *stream);
void smtp_nodebug (SENDSTREAM *stream); void smtp_nodebug (SENDSTREAM *stream);
long smtp_rcpt (SENDSTREAM *stream,ADDRESS *adr,long *error);
long smtp_send (SENDSTREAM *stream,char *command,char *args);
long smtp_reply (SENDSTREAM *stream);
long smtp_ehlo (SENDSTREAM *stream,char *host,NETMBX *mb);
long smtp_fake (SENDSTREAM *stream,long code,char *text);
long smtp_soutr (void *stream,char *s);
 End of changes. 11 change blocks. 
23 lines changed or deleted 10 lines changed or added


 utf8.h   utf8.h 
skipping to change at line 13 skipping to change at line 13
* *
* Author: Mark Crispin * Author: Mark Crispin
* Networks and Distributed Computing * Networks and Distributed Computing
* Computing & Communications * Computing & Communications
* University of Washington * University of Washington
* Administration Building, AG-44 * Administration Building, AG-44
* Seattle, WA 98195 * Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU * Internet: MRC@CAC.Washington.EDU
* *
* Date: 11 June 1997 * Date: 11 June 1997
* Last Edited: 10 July 2002 * Last Edited: 3 June 2004
* *
* The IMAP toolkit provided in this Distribution is * The IMAP toolkit provided in this Distribution is
* Copyright 2002 University of Washington. * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called * The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution. * CPYRIGHT, included with this Distribution.
*/ */
/* UTF-8 size and conversion routines from UCS-2 values. This will need to /* UTF-8 size and conversion routines from UCS-2 values. This will need to
* be changed if UTF-16 data (surrogate pairs) are ever an issue. * be changed if UTF-16 data (surrogate pairs) are ever an issue.
*/ */
#define UTF8_SIZE(c) ((c & 0xff80) ? ((c & 0xf800) ? 3 : 2) : 1) #define UTF8_SIZE(c) ((c & 0xff80) ? ((c & 0xf800) ? 3 : 2) : 1)
#define UTF8_PUT(b,c) { \ #define UTF8_PUT(b,c) { \
if (c & 0xff80) { /* non-ASCII? */ \ if (c & 0xff80) { /* non-ASCII? */ \
if (c & 0xf800) { /* three byte code */ \ if (c & 0xf800) { /* three byte code */ \
*b++ = 0xe0 | (c >> 12); \ *b++ = 0xe0 | (c >> 12); \
*b++ = 0x80 | ((c >> 6) & 0x3f); \ *b++ = 0x80 | ((c >> 6) & 0x3f); \
} \ } \
else *b++ = 0xc0 | ((c >> 6) & 0x3f); \ else *b++ = 0xc0 | ((c >> 6) & 0x3f); \
*b++ = 0x80 | (c & 0x3f); \ *b++ = 0x80 | (c & 0x3f); \
} \ } \
else *b++ = c; \ else *b++ = c; \
} }
/* utf8_get() error returns */
#define U8G_BADCONT 0x80000001 /* continuation when not in progress */
#define U8G_INCMPLT 0x80000002 /* incomplete UTF-8 character */
#define U8G_NOTUTF8 0x80000003 /* not a valid UTF-8 octet */
#define U8G_ENDSTRG 0x80000004 /* end of string */
/* ISO-2022 engine states */ /* ISO-2022 engine states */
#define I2S_CHAR 0 /* character */ #define I2S_CHAR 0 /* character */
#define I2S_ESC 1 /* previous character was ESC */ #define I2S_ESC 1 /* previous character was ESC */
#define I2S_MUL 2 /* previous character was multi-byte code */ #define I2S_MUL 2 /* previous character was multi-byte code */
#define I2S_INT 3 /* previous character was intermediate */ #define I2S_INT 3 /* previous character was intermediate */
/* ISO-2022 Gn selections */ /* ISO-2022 Gn selections */
#define I2C_G0 0 /* G0 */ #define I2C_G0 0 /* G0 */
skipping to change at line 351 skipping to change at line 358
unsigned int max_ku : 8; /* maximum row */ unsigned int max_ku : 8; /* maximum row */
unsigned int max_ten : 8; /* maximum column */ unsigned int max_ten : 8; /* maximum column */
void *tab; /* conversion table */ void *tab; /* conversion table */
}; };
/* Charset types */ /* Charset types */
#define CT_ASCII 1 /* 7-bit ASCII no table */ #define CT_ASCII 1 /* 7-bit ASCII no table */
#define CT_UCS2 2 /* 2 byte 16-bit Unicode no table */ #define CT_UCS2 2 /* 2 byte 16-bit Unicode no table */
#define CT_UCS4 3 /* 4 byte 32-bit Unicode no table */ #define CT_UCS4 3 /* 4 byte 32-bit Unicode no table */
#define CT_1BYTE0 10 /* 1 byte no table */ #define CT_1BYTE0 10 /* 1 byte ISO 8859-1 no table */
#define CT_1BYTE 11 /* 1 byte ASCII + table 0x80-0xff */ #define CT_1BYTE 11 /* 1 byte ASCII + table 0x80-0xff */
#define CT_1BYTE8 12 /* 1 byte table 0x00 - 0xff */ #define CT_1BYTE8 12 /* 1 byte table 0x00 - 0xff */
#define CT_EUC 100 /* 2 byte ASCII + utf8_eucparam base/CS2/CS3 */ #define CT_EUC 100 /* 2 byte ASCII + utf8_eucparam base/CS2/CS3 */
#define CT_DBYTE 101 /* 2 byte ASCII + utf8_eucparam */ #define CT_DBYTE 101 /* 2 byte ASCII + utf8_eucparam */
#define CT_DBYTE2 102 /* 2 byte ASCII + utf8_eucparam plane1/2 */ #define CT_DBYTE2 102 /* 2 byte ASCII + utf8_eucparam plane1/2 */
#define CT_UTF16 1000 /* 2 byte UTF-16 encoded Unicode no table */ #define CT_UTF16 1000 /* 2 byte UTF-16 encoded Unicode no table */
#define CT_UTF8 1001 /* variable UTF-8 encoded Unicode no table * / #define CT_UTF8 1001 /* variable UTF-8 encoded Unicode no table * /
#define CT_UTF7 1002 /* variable UTF-7 encoded Unicode no table * / #define CT_UTF7 1002 /* variable UTF-7 encoded Unicode no table * /
#define CT_2022 10000 /* variable ISO-2022 encoded no table*/ #define CT_2022 10000 /* variable ISO-2022 encoded no table*/
#define CT_SJIS 10001 /* 2 byte Shift-JIS encoded JIS no table */ #define CT_SJIS 10001 /* 2 byte Shift-JIS encoded JIS no table */
skipping to change at line 373 skipping to change at line 380
/* UTF-7 engine states */ /* UTF-7 engine states */
#define U7_ASCII 0 /* ASCII character */ #define U7_ASCII 0 /* ASCII character */
#define U7_PLUS 1 /* plus seen */ #define U7_PLUS 1 /* plus seen */
#define U7_UNICODE 2 /* Unicode characters */ #define U7_UNICODE 2 /* Unicode characters */
#define U7_MINUS 3 /* absorbed minus seen */ #define U7_MINUS 3 /* absorbed minus seen */
/* Function prototypes */ /* Function prototypes */
CHARSET *utf8_charset (char *charset); CHARSET *utf8_charset (char *charset);
long utf8_text (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret,long flags); long utf8_text (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret,long flags);
unsigned short *utf8_rmap (char *charset);
long utf8_cstext (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret,
unsigned short errch);
unsigned long utf8_get (unsigned char **s,unsigned long *i);
long utf8_cstocstext (SIZEDTEXT *text,char *sc,SIZEDTEXT *ret,char *dc,
unsigned short errch);
void utf8_text_1byte0 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_1byte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab); void utf8_text_1byte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_1byte8 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab); void utf8_text_1byte8 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_euc (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab); void utf8_text_euc (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_dbyte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab); void utf8_text_dbyte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_dbyte2 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab); void utf8_text_dbyte2 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab);
void utf8_text_sjis (SIZEDTEXT *text,SIZEDTEXT *ret); void utf8_text_sjis (SIZEDTEXT *text,SIZEDTEXT *ret);
void utf8_text_2022 (SIZEDTEXT *text,SIZEDTEXT *ret); void utf8_text_2022 (SIZEDTEXT *text,SIZEDTEXT *ret);
void utf8_text_utf7 (SIZEDTEXT *text,SIZEDTEXT *ret); void utf8_text_utf7 (SIZEDTEXT *text,SIZEDTEXT *ret);
void utf8_searchpgm (SEARCHPGM *pgm,char *charset); void utf8_searchpgm (SEARCHPGM *pgm,char *charset);
void utf8_stringlist (STRINGLIST *st,char *charset); void utf8_stringlist (STRINGLIST *st,char *charset);
 End of changes. 5 change blocks. 
3 lines changed or deleted 17 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/