home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / imap / src / c-client / pop3.h < prev    next >
Text File  |  1998-10-15  |  4KB  |  94 lines

  1. /*
  2.  * Program:    Post Office Protocol 3 (POP3) 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:    6 June 1994
  13.  * Last Edited:    13 October 1998
  14.  *
  15.  * Copyright 1998 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. /* POP3 specific definitions */
  37.  
  38. /* Parameters */
  39.  
  40. #define MAXLOGINTRIALS 3    /* maximum number of login trials */
  41. #define POP3TCPPORT (long) 110    /* assigned TCP contact port */
  42.  
  43.  
  44. /* POP3 I/O stream local data */
  45.     
  46. typedef struct pop3_local {
  47.   NETSTREAM *netstream;        /* TCP I/O stream */
  48.   char *response;        /* last server reply */
  49.   char *reply;            /* text of last server reply */
  50.   unsigned long msgno;        /* current text message number */
  51.   unsigned long hdrsize;    /* current text header size */
  52.   FILE *txt;            /* current text */
  53. } POP3LOCAL;
  54.  
  55.  
  56. /* Convenient access to local data */
  57.  
  58. #define LOCAL ((POP3LOCAL *) stream->local)
  59.  
  60. /* Function prototypes */
  61.  
  62. DRIVER *pop3_valid (char *name);
  63. void *pop3_parameters (long function,void *value);
  64. void pop3_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents);
  65. void pop3_list (MAILSTREAM *stream,char *ref,char *pat);
  66. void pop3_lsub (MAILSTREAM *stream,char *ref,char *pat);
  67. long pop3_subscribe (MAILSTREAM *stream,char *mailbox);
  68. long pop3_unsubscribe (MAILSTREAM *stream,char *mailbox);
  69. long pop3_create (MAILSTREAM *stream,char *mailbox);
  70. long pop3_delete (MAILSTREAM *stream,char *mailbox);
  71. long pop3_rename (MAILSTREAM *stream,char *old,char *newname);
  72. long pop3_status (MAILSTREAM *stream,char *mbx,long flags);
  73. MAILSTREAM *pop3_open (MAILSTREAM *stream);
  74. long pop3_auth (MAILSTREAM *stream,NETMBX *mb,char *tmp,char *usr);
  75. void *pop3_challenge (void *stream,unsigned long *len);
  76. long pop3_response (void *stream,char *s,unsigned long size);
  77. void pop3_close (MAILSTREAM *stream,long options);
  78. void pop3_fetchfast (MAILSTREAM *stream,char *sequence,long flags);
  79. char *pop3_header (MAILSTREAM *stream,unsigned long msgno,unsigned long *size,
  80.            long flags);
  81. long pop3_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags);
  82. unsigned long pop3_cache (MAILSTREAM *stream,MESSAGECACHE *elt);
  83. long pop3_ping (MAILSTREAM *stream);
  84. void pop3_check (MAILSTREAM *stream);
  85. void pop3_expunge (MAILSTREAM *stream);
  86. long pop3_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
  87. long pop3_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  88.           STRING *message);
  89.  
  90. long pop3_send_num (MAILSTREAM *stream,char *command,unsigned long n);
  91. long pop3_send (MAILSTREAM *stream,char *command,char *args);
  92. long pop3_reply (MAILSTREAM *stream);
  93. long pop3_fake (MAILSTREAM *stream,char *text);
  94.