home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pine / c-client / nntpclient.h < prev    next >
C/C++ Source or Header  |  1994-01-09  |  4KB  |  138 lines

  1. /*
  2.  * Program:    Network News Transfer Protocol (NNTP) client 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:    5 January 1993
  13.  * Last Edited:    11 February 1993
  14.  *
  15.  * Copyright 1993 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 notices appear in all copies and that both the
  20.  * above copyright notices 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
  30.  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN
  32.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Constants */
  37.  
  38. #define NNTPGOK (long) 211    /* NNTP group selection OK */
  39. #define NNTPGLIST (long) 215    /* NNTP group list being returned */
  40. #define NNTPHEAD (long) 221    /* NNTP header text */
  41. #define NNTPBODY (long) 222    /* NNTP body text */
  42.  
  43.  
  44. /* Command bits from nntp_getflags() */
  45.  
  46. #define fSEEN 1
  47. #define fDELETED 2
  48. #define fFLAGGED 4
  49. #define fANSWERED 8
  50.  
  51.  
  52. /* NNTP I/O stream local data */
  53.  
  54. typedef struct nntp_local {
  55.   SMTPSTREAM *nntpstream;    /* NNTP stream for I/O */
  56.   unsigned int dirty : 1;    /* disk copy of .newsrc needs updating */
  57.   char *host;            /* local host name */
  58.   char *name;            /* local bboard name */
  59.   char *buf;            /* temporary buffer */
  60.   unsigned long buflen;        /* current size of temporary buffer */
  61.   unsigned long *number;    /* news message numbers */
  62.   char **header;        /* message headers */
  63.   char **body;            /* message bodies */
  64.   char *seen;            /* local seen status */
  65. } NNTPLOCAL;
  66.  
  67.  
  68. /* Convenient access to local data */
  69.  
  70. #define LOCAL ((NNTPLOCAL *) stream->local)
  71.  
  72. /* Function prototypes */
  73.  
  74. DRIVER *nntp_valid  ();
  75. void *nntp_parameters  ();
  76. void nntp_find  ();
  77. void nntp_find_bboards  ();
  78. void nntp_find_all  ();
  79. void nntp_find_all_bboards  ();
  80. long nntp_subscribe  ();
  81. long nntp_unsubscribe  ();
  82. long nntp_subscribe_bboard  ();
  83. long nntp_unsubscribe_bboard  ();
  84. long nntp_create  ();
  85. long nntp_delete  ();
  86. long nntp_rename  ();
  87. MAILSTREAM *nntp_mopen  ();
  88. void nntp_close  ();
  89. void nntp_fetchfast  ();
  90. void nntp_fetchflags  ();
  91. ENVELOPE *nntp_fetchstructure  ();
  92. char *nntp_fetchheader  ();
  93. char *nntp_fetchtext  ();
  94. char *nntp_fetchtext_work  ();
  95. char *nntp_fetchbody  ();
  96. char *nntp_slurp  ();
  97. void nntp_setflag  ();
  98. void nntp_clearflag  ();
  99. void nntp_search  ();
  100. long nntp_ping  ();
  101. void nntp_check  ();
  102. void nntp_expunge  ();
  103. long nntp_copy  ();
  104. long nntp_move  ();
  105. long nntp_append  ();
  106. void nntp_gc  ();
  107.  
  108. short nntp_getflags  ();
  109. char nntp_search_all  ();
  110. char nntp_search_answered  ();
  111. char nntp_search_deleted  ();
  112. char nntp_search_flagged  ();
  113. char nntp_search_keyword  ();
  114. char nntp_search_new  ();
  115. char nntp_search_old  ();
  116. char nntp_search_recent  ();
  117. char nntp_search_seen  ();
  118. char nntp_search_unanswered  ();
  119. char nntp_search_undeleted  ();
  120. char nntp_search_unflagged  ();
  121. char nntp_search_unkeyword  ();
  122. char nntp_search_unseen  ();
  123. char nntp_search_before  ();
  124. char nntp_search_on  ();
  125. char nntp_search_since  ();
  126. unsigned long nntp_msgdate  ();
  127. char nntp_search_body  ();
  128. char nntp_search_subject  ();
  129. char nntp_search_text  ();
  130. char nntp_search_bcc  ();
  131. char nntp_search_cc  ();
  132. char nntp_search_from  ();
  133. char nntp_search_to  ();
  134. typedef char (*search_t)  ();
  135. search_t nntp_search_date  ();
  136. search_t nntp_search_flag  ();
  137. search_t nntp_search_string  ();
  138.