📄 internal.txt
字号:
char *mail_fetchtext (MAILSTREAM *stream,unsigned long msgno);char *mail_fetchtext_full (MAILSTREAM *stream,unsigned long msgno, unsigned long *len,long flags); stream stream to fetch on msgno message sequence number len returned length in octets flags option flags This function causes a fetch of the non-header text of thespecified message as a text string and returns that text string. Noattempt is made to segregate individual body parts. If the len argument is non-NIL, it holds a pointer in which thelength of the string in octets is returned. This is useful in caseswhere there may be an embedded null in the string. This function always returns a valid string pointer; if no headerexists or if it can not be fetched (e.g. by a deceased IMAP stream) anempty string is returned. The options for mail_fetchtext_full() are a bit mask with one ormore of the following: FT_UID The msgno argument is a UID FT_PEEK Do not set the \Seen flag if it not already set FT_INTERNAL The return string is in "internal" format, without any attempt to canonicalize to CRLF newlineschar *mail_fetchbody (MAILSTREAM *stream,unsigned long msgno,char *sec, unsigned long *len);char *mail_fetchbody_full (MAILSTREAM *stream,unsigned long msgno,char *sec, unsigned long *len,long flags); stream stream to fetch on msgno message sequence number sec section specifier len returned length in octets flags option flags This function causes a fetch of the particular section of thebody of the specified message as a text string and returns that textstring. The section specification is a string of integers delimited byperiod which index into a body part list as per the IMAP4specification. Body parts are not decoded by this function; seerfc822_base64() and rfc822_quotedprintable(). If the len argument is non-NIL, it holds a pointer in which thelength of the string in octets is returned. This is useful in caseswhere there may be an embedded null in the string. This function may return NIL on error. The options for mail_fetchbody_full() are a bit mask with one ormore of the following: FT_UID The msgno argument is a UID FT_PEEK Do not set the \Seen flag if it not already set FT_INTERNAL The return string is in "internal" format, without any attempt to canonicalize to CRLF newlinesunsigned long mail_uid (MAILSTREAM *stream,unsigned long msgno); stream stream to fetch on msgno message sequence number This function returns the UID for the given message sequencenumber.void mail_fetchfrom (char *s,MAILSTREAM *stream,unsigned long msgno, long length); s destination string stream stream to fetch on msgno message sequence number length maximum field length This function writes a "from" string of the specified length forthe specified message, suitable for display to the user in a menu line,into the string pointed to by s. If the personal name of the first address in the envelope's fromitem is non-NIL, it is used; otherwise a string is created by appendingthe mailbox of the first address, an "@", and the host of the firstaddress. The string is trimmed or padded with trailing spaces asnecessary to make its length match the length argument.void mail_fetchsubject (char *s,MAILSTREAM *stream,unsigned long msgno, long length); s destination string stream stream to fetch on msgno message sequence number length maximum field length This function returns a "subject" string of the specified lengthfor the specified message, suitable for display to the user in a menuline. The envelope's subject item is copied and trimmed as necessaryto make its length be no more what the caller requested. Unlikemail_fetchfrom(), this function can return a string of shorter lengththan what the caller requested.LONGCACHE *mail_lelt (MAILSTREAM *stream,unsigned long msgno);MESSAGECACHE *mail_elt (MAILSTREAM *stream,unsigned long msgno); stream stream to access msgno message sequence number This function returns the cache entry for the specified message.Although it will create a cache entry if it does not already exist,that functionality is for internal use only. This function shouldnever be called without having first called mail_fetchfast() ormail_fetchstructure() on the message first. A cache entry holds the internal date/time, flags, and RFC 822size of a message. It holds other data as well, but that is forinternal use only. mail_lelt() is a variant that returns a `long' cache entry, whichconsists of an cache entry (as a structure, not a pointer), an envelopepointer, and a body pointer. This is used in conjunction with the eltlock count functionality, to allow an application to associate thecached envelope and body of a message with an open window even if themessage is subsequently expunged or if the stream is closed. Unless your application wants to look at cached envelopes andbodies even after the message is expunged or the stream is closed, itshould not use mail_lelt(). Instead, it should use a returned elt frommail_elt() and use the elt->msgsno as the argument tomail_fetchstructure(). BEWARE: the behavior of mail_lelt() is undefined if the stream is open with OP_SHORTCACHE. mail_lelt() is extremely special purpose, and should only be used in sophisticated special purpose applications after discussing its use with the c-client author. If you think you need this function, you are probably mistaken. In almost all cases, you should use mail_elt() and mail_fetchstructure() instead. Message Status Manipulation Functionsvoid mail_setflag (MAILSTREAM *stream,char *sequence,char *flag);void mail_setflag_full (MAILSTREAM *stream,char *sequence,char *flag, long flags); stream stream to use sequence IMAP-format set of message sequence numbers flag IMAP-format flag string flags option flags This function causes a store to add the specified flag to the flagsset for the messages in the specified sequence. If there is anyproblem in setting flags, a message will be passed to the applicationvia the mm_log() facility. The options for mail_setflag_full() are a bit mask with one ormore of the following: ST_UID The sequence argument contains UIDs instead of sequence numbers ST_SILENT Do not update the local cache with the new value of the flags. This is useful to save network bandwidth, at the cost of invalidating the cache.void mail_clearflag (MAILSTREAM *stream,char *sequence,char *flag);void mail_clearflag_full (MAILSTREAM *stream,char *sequence,char *flag, long flags); stream stream to use sequence IMAP-format set of message sequence numbers flag IMAP-format flag string flags option flags This function causes a store to delete the specified flag from theflags set for the messages in the specified sequence. If there is anyproblem in clearing flags, a message will be passed to the applicationvia the mm_log() facility. The options for mail_setflag_full() are a bit mask with one ormore of the following: ST_UID The sequence argument contains UIDs instead of sequence numbers ST_SILENT Do not update the local cache with the new value of the flags. This is useful to save network bandwidth, at the cost of invalidating the cache. Mailbox Searchingvoid mail_search (MAILSTREAM *stream,char *criteria);void mail_search_full (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm, long flags); stream stream to search charset MIME character set to use when searching strings pgm search program flags option flags This function causes a mailbox search, using the given MIMEcharset (NIL means the default, US-ASCII) and the given search program.A search program is a structure that holds the following data:SEARCHSET *msgno; a set of message sequence numbersSEARCHSET *uid; a set of unique identifiersSEARCHOR *or; OR result of two search programsSEARCHPGMLIST *not; AND result of list of NOT'ed search programsSEARCHHEADER *header; message headersSTRINGLIST *bcc; string(s) appear in bcc listSTRINGLIST *body; string(s) appear in message body textSTRINGLIST *cc; string(s) appear in cc listSTRINGLIST *from; string(s) appear in fromSTRINGLIST *keyword; user flag string(s) setSTRINGLIST *unkeyword; user flag strings() not setSTRINGLIST *subject; string(s) appear in subjectSTRINGLIST *text; string(s) appear in message header or bodySTRINGLIST *to; string(s) appear in to listunsigned long larger; larger than this many octetsunsigned long smaller; smaller than this many octes The following dates are in form: ((year - BASEYEAR) << 9) + (month << 5) + dayunsigned short sentbefore; sent before this dateunsigned short senton; sent on this dateunsigned short sentsince; sent since this dateunsigned short before; received before this dateunsigned short on; received on this dateunsigned short since; received since this dateunsigned int answered : 1; message answeredunsigned int unanswered : 1; message not answeredunsigned int deleted : 1; message deletedunsigned int undeleted : 1; message not deletedunsigned int draft : 1; message is a draftunsigned int undraft : 1; message is not a draftunsigned int flagged : 1; message flagged as urgentunsigned int unflagged : 1; message not flagged as urgentunsigned int recent : 1; message recent since last parse of mailboxunsigned int old : 1; message not recent since last parse of mailboxunsigned int seen : 1; message readunsigned int unseen : 1; message not read The following auxillary structures are used by search programs: SEARCHHEADER: header line searchingchar *line; header line field namechar *text; text header lineSEARCHHEADER *next; next SEARCHHEADER in list (AND'ed) SEARCHSET: message number setunsigned long first; first number in setunsigned long last; if non-zero, last number in setSEARCHSET *next; next SEARCHSET in list (AND'ed) SEARCHOR: two search programs, OR'ed togetherSEARCHPGM *first; first programSEARCHPGM *second; second programSEARCHOR *next; next SEARCHOR in list SEARCHPGMLIST: list of search programsSEARCHPGM *pgm; search program (AND'd with others in list)SEARCHPGMLIST *next; next SEARCHPGM in list mail_search(), the older interface, accepts a search criteriaargument as a character string in IMAP2 (RFC-1176) format. Do not tryto use any IMAP4 search criteria with this interface. The application's mm_searched() function is called for eachmessage that matches the search criteria. In addition, after thesearch is completed, the "fast" information (see mail_fetchfast_full()and envelopes of the searched messages are fetched (this is calledpre-fetching). If there is any problem in searching, a message will be passed tothe application via the mm_log() facility. The flags for mail_search_full() are a bit mask with one or moreof the following: SE_UID Return UIDs instead of sequence numbers SE_FREE Return the search program to free storage after finishing SE_NOPREFETCH Don't prefetch searched messages.unsigned long *mail_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, SORTPGM *pgm,long flags); stream stream to sort charset MIME character set to use when sorting strings spg search program pgm sort program flags option flags This function is a variant of mail_search_full(). It accepts anadditional argument, a sort program, which specifies one or more sortrules to be applied to the result. If the searching and sorting aresuccessful, it returns a 0-terminated vector of message sequencenumbers (or UIDs if SE_UID is set). This vector is created out offree storage, and must be freed with fs_give() when finished with it. A sort program is a structure that holds the following data:unsigned int reverse : 1; reverse sorting of this keyshort function; sort rule, one of the following: SORTDATE message Date SORTARRIVAL arrival date SORTFROM mailbox in first From address SORTSUBJECT message Subject SORTTO mailbox in first To address SORTCC mailbox in first cc address SORTSIZE size of message in octetsSORTPGM *next; next sort program to be applied if two or more messages collate identically with this rule The flags for mail_search_full() are a bit mask with one or moreof the following: SE_UID Return UIDs instead of sequence numbers SE_FREE Return the search program to free storage after finishing SE_NOPREFETCH Don't prefetch searched messages. SO_FREE Return the sort program to free storage after finishing Miscellaneous Mailbox and Message Functionslong mail_ping (MAILSTREAM *stre
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -