⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mail.h

📁 Vovida 社区开源的 SIP 协议源码
💻 H
📖 第 1 页 / 共 4 页
字号:
#define NAMESPACE struct mail_namespaceNAMESPACE {  char *name;			/* name of this namespace */  int delimiter;		/* hierarchy delimiter */  PARAMETER *param;		/* namespace parameters */  NAMESPACE *next;		/* next namespace */};/* Authentication */#define AUTHENTICATOR struct mail_authenticatorAUTHENTICATOR {  long flags;			/* authenticator flags */  char *name;			/* name of this authenticator */  authcheck_t valid;		/* authenticator valid on this system */  authclient_t client;		/* client function that supports it */  authserver_t server;		/* server function that supports it */  AUTHENTICATOR *next;		/* next authenticator */};/* Mail driver dispatch */				/* normal dispatching */#define SAFE_DISPATCH(dtb,ret,dsp,args) \  if (dtb) SAFE_FUNCTION(dtb,ret,(*dtb->dsp),args)#define SAFE_FUNCTION(dtb,ret,func,args) ret = func args;DRIVER {  char *name;			/* driver name */  unsigned long flags;		/* driver flags */  DRIVER *next;			/* next driver */				/* mailbox is valid for us */  DRIVER *(*valid) (char *mailbox);				/* manipulate driver parameters */  void *(*parameters) (long function,void *value);				/* scan mailboxes */  void (*scan) (MAILSTREAM *stream,char *ref,char *pat,char *contents);				/* list mailboxes */  void (*list) (MAILSTREAM *stream,char *ref,char *pat);				/* list subscribed mailboxes */  void (*lsub) (MAILSTREAM *stream,char *ref,char *pat);				/* subscribe to mailbox */  long (*subscribe) (MAILSTREAM *stream,char *mailbox);				/* unsubscribe from mailbox */  long (*unsubscribe) (MAILSTREAM *stream,char *mailbox);				/* create mailbox */  long (*create) (MAILSTREAM *stream,char *mailbox);				/* delete mailbox */  long (*mbxdel) (MAILSTREAM *stream,char *mailbox);				/* rename mailbox */  long (*mbxren) (MAILSTREAM *stream,char *old,char *newname);				/* status of mailbox */  long (*status) (MAILSTREAM *stream,char *mbx,long flags);				/* open mailbox */  MAILSTREAM *(*open) (MAILSTREAM *stream);				/* close mailbox */  void (*close) (MAILSTREAM *stream,long options);				/* fetch message "fast" attributes */  void (*fast) (MAILSTREAM *stream,char *sequence,long flags);				/* fetch message flags */  void (*msgflags) (MAILSTREAM *stream,char *sequence,long flags);				/* fetch message overview */  long (*overview) (MAILSTREAM *stream,char *sequence,overview_t ofn);				/* fetch message envelopes */  ENVELOPE *(*structure) (MAILSTREAM *stream,unsigned long msgno,BODY **body,			  long flags);				/* return RFC-822 header */  char *(*header) (MAILSTREAM *stream,unsigned long msgno,		   unsigned long *length,long flags);				/* return RFC-822 text */  long (*text) (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags);				/* load cache */  long (*msgdata) (MAILSTREAM *stream,unsigned long msgno,char *section,		   unsigned long first,unsigned long last,STRINGLIST *lines,		   long flags);				/* return UID for message */  unsigned long (*uid) (MAILSTREAM *stream,unsigned long msgno);				/* return message number from UID */  unsigned long (*msgno) (MAILSTREAM *stream,unsigned long uid);				/* modify flags */  void (*flag) (MAILSTREAM *stream,char *sequence,char *flag,long flags);				/* per-message modify flags */  void (*flagmsg) (MAILSTREAM *stream,MESSAGECACHE *elt);				/* search for message based on criteria */  void (*search) (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,long flags);				/* sort messages */  unsigned long *(*sort) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,			  SORTPGM *pgm,long flags);				/* thread messages */  THREADNODE *(*thread) (MAILSTREAM *stream,char *type,char *charset,			 SEARCHPGM *spg,long flag);				/* ping mailbox to see if still alive */  long (*ping) (MAILSTREAM *stream);				/* check for new messages */  void (*check) (MAILSTREAM *stream);				/* expunge deleted messages */  void (*expunge) (MAILSTREAM *stream);				/* copy messages to another mailbox */  long (*copy) (MAILSTREAM *stream,char *sequence,char *mailbox,long options);				/* append string message to mailbox */  long (*append) (MAILSTREAM *stream,char *mailbox,append_t af,void *data);				/* garbage collect stream */  void (*gc) (MAILSTREAM *stream,long gcflags);};#include "linkage.h"/* Compatibility support names for old interfaces */#define mail_close(stream) \  mail_close_full (stream,NIL)#define mail_fetchfast(stream,sequence) \  mail_fetch_fast (stream,sequence,NIL)#define mail_fetchfast_full mail_fetch_fast#define mail_fetchflags(stream,sequence) \  mail_fetch_flags (stream,sequence,NIL)#define mail_fetchflags_full mail_fetch_flags#define mail_fetchenvelope(stream,msgno) \  mail_fetch_structure (stream,msgno,NIL,NIL)#define mail_fetchstructure(stream,msgno,body) \  mail_fetch_structure (stream,msgno,body,NIL)#define mail_fetchstructure_full mail_fetch_structure#define mail_fetchheader(stream,msgno) \  mail_fetch_header (stream,msgno,NIL,NIL,NIL,FT_PEEK)#define mail_fetchheader_full(stream,msgno,lines,len,flags) \  mail_fetch_header (stream,msgno,NIL,lines,len,FT_PEEK | (flags))#define mail_fetchtext(stream,msgno) \  mail_fetch_text (stream,msgno,NIL,NIL,NIL)#define mail_fetchtext_full(stream,msgno,length,flags) \  mail_fetch_text (stream,msgno,NIL,length,flags)#define mail_fetchbody(stream,msgno,section,length) \  mail_fetch_body (stream,msgno,section,length,NIL)#define mail_fetchbody_full mail_fetch_body#define mail_setflag(stream,sequence,flag) \  mail_flag (stream,sequence,flag,ST_SET)#define mail_setflag_full(stream,sequence,flag,flags) \  mail_flag (stream,sequence,flag,ST_SET | (flags))#define mail_clearflag(stream,sequence,flag) \  mail_flag (stream,sequence,flag,NIL)#define mail_clearflag_full mail_flag#define mail_search(stream,criteria) \  mail_search_full (stream,NIL,mail_criteria (criteria),SE_FREE);#define mail_copy(stream,sequence,mailbox) \  mail_copy_full (stream,sequence,mailbox,NIL)#define mail_move(stream,sequence,mailbox) \  mail_copy_full (stream,sequence,mailbox,CP_MOVE)#define mail_append(stream,mailbox,message) \  mail_append_full (stream,mailbox,NIL,NIL,message)/* Function prototypes */void mm_searched (MAILSTREAM *stream,unsigned long number);void mm_exists (MAILSTREAM *stream,unsigned long number);void mm_expunged (MAILSTREAM *stream,unsigned long number);void mm_flags (MAILSTREAM *stream,unsigned long number);void mm_notify (MAILSTREAM *stream,char *string,long errflg);void mm_list (MAILSTREAM *stream,int delimiter,char *name,long attributes);void mm_lsub (MAILSTREAM *stream,int delimiter,char *name,long attributes);void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status);void mm_log (char *string,long errflg);void mm_dlog (char *string);void mm_login (NETMBX *mb,char *user,char *pwd,long trial);void mm_critical (MAILSTREAM *stream);void mm_nocritical (MAILSTREAM *stream);long mm_diskerror (MAILSTREAM *stream,long errcode,long serious);void mm_fatal (char *string);void *mm_cache (MAILSTREAM *stream,unsigned long msgno,long op);extern STRINGDRIVER mail_string;void mail_link (DRIVER *driver);void *mail_parameters (MAILSTREAM *stream,long function,void *value);DRIVER *mail_valid (MAILSTREAM *stream,char *mailbox,char *purpose);DRIVER *mail_valid_net (char *name,DRIVER *drv,char *host,char *mailbox);long mail_valid_net_parse (char *name,NETMBX *mb);void mail_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents);void mail_list (MAILSTREAM *stream,char *ref,char *pat);void mail_lsub (MAILSTREAM *stream,char *ref,char *pat);long mail_subscribe (MAILSTREAM *stream,char *mailbox);long mail_unsubscribe (MAILSTREAM *stream,char *mailbox);long mail_create (MAILSTREAM *stream,char *mailbox);long mail_delete (MAILSTREAM *stream,char *mailbox);long mail_rename (MAILSTREAM *stream,char *old,char *newname);long mail_status (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_close_full (MAILSTREAM *stream,long options);MAILHANDLE *mail_makehandle (MAILSTREAM *stream);void mail_free_handle (MAILHANDLE **handle);MAILSTREAM *mail_stream (MAILHANDLE *handle);void mail_fetch_fast (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);ENVELOPE *mail_fetch_structure (MAILSTREAM *stream,unsigned long msgno,				BODY **body,long flags);char *mail_fetch_message (MAILSTREAM *stream,unsigned long msgno,			  unsigned long *len,long flags);char *mail_fetch_header (MAILSTREAM *stream,unsigned long msgno,char *section,			 STRINGLIST *lines,unsigned long *len,long flags);char *mail_fetch_text (MAILSTREAM *stream,unsigned long msgno,char *section,		       unsigned long *len,long flags);char *mail_fetch_mime (MAILSTREAM *stream,unsigned long msgno,char *section,		       unsigned long *len,long flags);char *mail_fetch_body (MAILSTREAM *stream,unsigned long msgno,char *section,		       unsigned long *len,long flags);long mail_partial_text (MAILSTREAM *stream,unsigned long msgno,char *section,			unsigned long first,unsigned long last,long flags);long mail_partial_body (MAILSTREAM *stream,unsigned long msgno,char *section,			unsigned long first,unsigned long last,long flags);char *mail_fetch_text_return (GETS_DATA *md,SIZEDTEXT *t,unsigned long *len);char *mail_fetch_string_return (GETS_DATA *md,STRING *bs,unsigned long i,				unsigned long *len);long mail_read (void *stream,unsigned long size,char *buffer);unsigned long mail_uid (MAILSTREAM *stream,unsigned long msgno);unsigned long mail_msgno (MAILSTREAM *stream,unsigned long uid);void mail_fetchfrom (char *s,MAILSTREAM *stream,unsigned long msgno,		     long length);void mail_fetchsubject (char *s,MAILSTREAM *stream,unsigned long msgno,			long length);MESSAGECACHE *mail_elt (MAILSTREAM *stream,unsigned long msgno);void mail_flag (MAILSTREAM *stream,char *sequence,char *flag,long flags);void mail_search_full (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,		       long flags);void mail_search_default (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,			  long flags);long mail_ping (MAILSTREAM *stream);void mail_check (MAILSTREAM *stream);void mail_expunge (MAILSTREAM *stream);long mail_copy_full (MAILSTREAM *stream,char *sequence,char *mailbox,		     long options);long mail_append_full (MAILSTREAM *stream,char *mailbox,char *flags,char *date,		       STRING *message);long mail_append_multiple (MAILSTREAM *stream,char *mailbox,append_t af,			   void *data);void mail_gc (MAILSTREAM *stream,long gcflags);void mail_gc_msg (MESSAGE *msg,long gcflags);void mail_gc_body (BODY *body);BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,char *section);char *mail_date (char *string,MESSAGECACHE *elt);char *mail_cdate (char *string,MESSAGECACHE *elt);long mail_parse_date (MESSAGECACHE *elt,char *string);void mail_exists (MAILSTREAM *stream,unsigned long nmsgs);void mail_recent (MAILSTREAM *stream,unsigned long recent);void mail_expunged (MAILSTREAM *stream,unsigned long msgno);void mail_lock (MAILSTREAM *stream);void mail_unlock (MAILSTREAM *stream);void mail_debug (MAILSTREAM *stream);void mail_nodebug (MAILSTREAM *stream);long mail_match_lines (STRINGLIST *lines,STRINGLIST *msglines,long flags);unsigned long mail_filter (char *text,unsigned long len,STRINGLIST *lines,			   long flags);long mail_search_msg (MAILSTREAM *stream,unsigned long msgno,char *section,		      SEARCHPGM *pgm);long mail_search_header_text (char *s,STRINGLIST *st);long mail_search_header (SIZEDTEXT *hdr,STRINGLIST *st);long mail_search_text (MAILSTREAM *stream,unsigned long msgno,char *section,		       STRINGLIST *st,long flags);long mail_search_body (MAILSTREAM *stream,unsigned long msgno,BODY *body,		       char *prefix,unsigned long section,long flags);long mail_search_string (SIZEDTEXT *s,char *charset,STRINGLIST **st);long mail_search_keyword (MAILSTREAM *stream,MESSAGECACHE *elt,STRINGLIST *st);long mail_search_addr (ADDRESS *adr,STRINGLIST *st);char *mail_search_gets (readfn_t f,void *stream,unsigned long size,			GETS_DATA *md);SEARCHPGM *mail_criteria (char *criteria);int mail_criteria_date (unsigned short *date);int mail_criteria_string (STRINGLIST **s);unsigned long *mail_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,			  SORTPGM *pgm,long flags);unsigned long *mail_sort_cache (MAILSTREAM *stream,SORTPGM *pgm,SORTCACHE **sc,				long flags);unsigned long *mail_sort_msgs (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,			       SORTPGM *pgm,long flags);SORTCACHE **mail_sort_loadcache (MAILSTREAM *stream,SORTPGM *pgm);unsigned int mail_strip_subject (char *t,char **ret);unsigned int mail_strip_subject_aux (char *t,char **ret);int mail_sort_compare (const void *a1,const void *a2);int mail_compare_ulong (unsigned long l1,unsigned long l2);int mail_compare_cstring (char *s1,char *s2);unsigned long mail_longdate (MESSAGECACHE *elt);THREADNODE *mail_thread (MAILSTREAM *stream,char *type,char *charset,			 SEARCHPGM *spg,long flags);THREADNODE *mail_thread_msgs (MAILSTREAM *stream,char *type,char *charset,			      SEARCHPGM *spg,long flags,sorter_t sorter);THREADNODE *mail_thread_orderedsubject (MAILSTREAM *stream,char *charset,					SEARCHPGM *spg,long flags,					sorter_t sorter);THREADNODE *mail_thread_references (MAILSTREAM *stream,char *charset,				    SEARCHPGM *spg,long flags,				    sorter_t sorter);void mail_thread_loadcache (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov);char *mail_thread_parse_msgid (char *s,char **ss);STRINGLIST *mail_thread_parse_references (char *s,long flag);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_work (container_t msg,container_t ane);THREADNODE *mail_thread_c2node (MAILSTREAM *stream,container_t con,long flags);THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc);int mail_thread_compare_date (const void *a1,const void *a2);long mail_sequence (MAILSTREAM *stream,char *sequence);long mail_uid_sequence (MAILSTREAM *stream,char *sequence);long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf);long mail_usable_network_stream (MAILSTREAM *stream,char *name);MESSAGECACHE *mail_new_cache_elt (unsigned long msgno);ENVELOPE *mail_newenvelope (void);ADDRESS *mail_newaddr (void);BODY *mail_newbody (void);BODY *mail_initbody (BODY *body);PARAMETER *mail_newbody_parameter (void);PART *mail_newbody_part (void);MESSAGE *mail_newmsg (void);STRINGLIST *mail_newstringlist (void);SEARCHPGM *mail_newsearchpgm (void);SEARCHHEADER *mail_newsearchheader (char *line,char *text);SEARCHSET *mail_newsearchset (void);SEARCHOR *mail_newsearchor (void);SEARCHPGMLIST *mail_newsearchpgmlist (void);SORTPGM *mail_newsortpgm (void);THREADNODE *mail_newthreadnode (SORTCACHE *sc);ACLLIST *mail_newacllist (void);QUOTALIST *mail_newquotalist (void);void mail_free_body (BODY **body);void mail_free_body_data (BODY *body);void mail_free_body_parameter (PARAMETER **parameter);void mail_free_body_part (PART **part);void mail_free_cache (MAILSTREAM *stream);void mail_free_elt (MESSAGECACHE **elt);void mail_free_envelope (ENVELOPE **env);void mail_free_address (ADDRESS **address);void mail_free_stringlist (STRINGLIST **string);void mail_free_searchpgm (SEARCHPGM **pgm);void mail_free_searchheader (SEARCHHEADER **hdr);void mail_free_searchset (SEARCHSET **set);void mail_free_searchor (SEARCHOR **orl);void mail_free_searchpgmlist (SEARCHPGMLIST **pgl);void mail_free_namespace (NAMESPACE **n);void mail_free_sortpgm (SORTPGM **pgm);void mail_free_threadnode (THREADNODE **thr);void mail_free_acllist (ACLLIST **al);void mail_free_quotalist (QUOTALIST **ql);void auth_link (AUTHENTICATOR *auth);char *mail_auth (char *mechanism,authresponse_t resp,int argc,char *argv[]);AUTHENTICATOR *mail_lookup_auth (unsigned long i);unsigned int mail_lookup_auth_name (char *mechanism,long flags);NETSTREAM *net_open (NETMBX *mb,NETDRIVER *dv,unsigned long port,		     NETDRIVER *altd,char *alts,unsigned long altp);NETSTREAM *net_open_work (NETDRIVER *dv,char *host,char *service,			  unsigned long port,unsigned long portoverride,			  unsigned long flags);NETSTREAM *net_aopen (NETDRIVER *dv,NETMBX *mb,char *service,char *usrbuf);char *net_getline (NETSTREAM *stream);				/* stream must be void* for use as readfn_t */long net_getbuffer (void *stream,unsigned long size,char *buffer);long net_soutr (NETSTREAM *stream,char *string);long net_sout (NETSTREAM *stream,char *string,unsigned long size);void net_close (NETSTREAM *stream);char *net_host (NETSTREAM *stream);char *net_remotehost (NETSTREAM *stream);unsigned long net_port (NETSTREAM *stream);char *net_localhost (NETSTREAM *stream);long sm_subscribe (char *mailbox);long sm_unsubscribe (char *mailbox);char *sm_read (void **sdb);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -