home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / pine3.07 / c-client / tenex.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-29  |  4.3 KB  |  142 lines

  1. /*
  2.  * Program:    Tenex mail routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    22 May 1990
  13.  * Last Edited:    21 April 1992
  14.  *
  15.  * Copyright 1992 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Build parameters */
  37.  
  38.  
  39. /* Command bits from tenex_getflags(), must correspond to mailbox bit values */
  40.  
  41. #define fSEEN 1
  42. #define fDELETED 2
  43. #define fFLAGGED 4
  44. #define fANSWERED 8
  45.  
  46.  
  47. /* TENEX per-message cache information */
  48.  
  49. typedef struct file_cache {
  50.   unsigned long internal;    /* pointer to internal header */
  51.   unsigned long header;        /* pointer to RFC 822 header */
  52.   unsigned long headersize;    /* size of RFC 822 header */
  53.   unsigned long body;        /* pointer to message body */
  54.   unsigned long bodysize;    /* size of message body */
  55.   unsigned long date;        /* integer representation of date */
  56. } FILECACHE;
  57.  
  58.  
  59. /* TENEX I/O stream local data */
  60.  
  61. typedef struct tenex_local {
  62.   char *host;            /* local host name */
  63.   unsigned int inbox : 1;    /* if this is an INBOX or not */
  64.   int fd;            /* file descriptor for I/O */
  65.   off_t filesize;        /* file size parsed */
  66.   unsigned long cachesize;    /* size of local cache */
  67.   FILECACHE **msgs;        /* pointers to message-specific information */
  68.   char *text;            /* mailbox text buffer */
  69.   unsigned long textsize;    /* size of mailbox text buffer */
  70.   unsigned long textend;    /* end of text in mailbox text buffer */
  71.   char *buf;            /* temporary buffer */
  72.   unsigned long buflen;        /* current size of temporary buffer */
  73. } TENEXLOCAL;
  74.  
  75.  
  76. /* Convenient access to local data */
  77.  
  78. #define LOCAL ((TENEXLOCAL *) stream->local)
  79.  
  80. /* Function prototypes */
  81.  
  82. DRIVER *tenex_valid  ();
  83. int tenex_isvalid  ();
  84. void tenex_find  ();
  85. void tenex_find_bboards  ();
  86. MAILSTREAM *tenex_open  ();
  87. void tenex_close  ();
  88. void tenex_fetchfast  ();
  89. void tenex_fetchflags  ();
  90. ENVELOPE *tenex_fetchenvelope  ();
  91. char *tenex_fetchheader  ();
  92. char *tenex_fetchtext  ();
  93. char *tenex_fetchbody  ();
  94. void tenex_setflag  ();
  95. void tenex_clearflag  ();
  96. void tenex_search  ();
  97. long tenex_ping  ();
  98. void tenex_check  ();
  99. void tenex_expunge  ();
  100. long tenex_copy  ();
  101. long tenex_move  ();
  102. void tenex_gc  ();
  103.  
  104. char *tenex_file  ();
  105. int tenex_getflags  ();
  106. int tenex_parse  ();
  107. int tenex_copy_messages  ();
  108. MESSAGECACHE *tenex_elt  ();
  109. void tenex_update_status  ();
  110. char tenex_search_all  ();
  111. char tenex_search_answered  ();
  112. char tenex_search_deleted  ();
  113. char tenex_search_flagged  ();
  114. char tenex_search_keyword  ();
  115. char tenex_search_new  ();
  116. char tenex_search_old  ();
  117. char tenex_search_recent  ();
  118. char tenex_search_seen  ();
  119. char tenex_search_unanswered  ();
  120. char tenex_search_undeleted  ();
  121. char tenex_search_unflagged  ();
  122. char tenex_search_unkeyword  ();
  123. char tenex_search_unseen  ();
  124. char tenex_search_before  ();
  125. char tenex_search_on  ();
  126. char tenex_search_since  ();
  127. char tenex_search_body  ();
  128. char tenex_search_subject  ();
  129. char tenex_search_text  ();
  130. char tenex_search_bcc  ();
  131. char tenex_search_cc  ();
  132. char tenex_search_from  ();
  133. char tenex_search_to  ();
  134.  
  135. typedef char (*search_t)  ();
  136. search_t tenex_search_date  ();
  137. long tenex_date  ();
  138. search_t tenex_search_flag  ();
  139. search_t tenex_search_string  ();
  140.  
  141. char *bezerk_snarf  ();
  142.