home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / POPCLIEN.000 / POPCLIEN / pop / popclient.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-01  |  3.2 KB  |  94 lines

  1. /* Copyright 1993,1994 by Carl Harris, Jr.
  2.  * All rights reserved
  3.  *
  4.  * Distribute freely, except: don't remove my name from the source or
  5.  * documentation (don't take credit for my work), mark your changes (don't
  6.  * get me blamed for your possible bugs), don't alter or remove this
  7.  * notice.  May be sold if buildable source is provided to buyer.  No
  8.  * warrantee of any kind, express or implied, is included with this
  9.  * software; use at your own risk, responsibility for damages (if any) to
  10.  * anyone resulting from the use of this software rests entirely with the
  11.  * user.
  12.  *
  13.  * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
  14.  * I'll try to keep a version up to date.  I can be reached as follows:
  15.  * Carl Harris <ceharris@vt.edu>
  16.  */
  17.  
  18.  
  19. /***********************************************************************
  20.   module:       popclient.h
  21.   program:      popclient
  22.   SCCS ID:      @(#)popclient.h    2.3  4/1/94
  23.   programmer:   Carl Harris, ceharris@vt.edu
  24.   date:         29 December 1993
  25.   compiler:     DEC RISC C compiler (Ultrix 4.1)
  26.   environment:  DEC Ultrix 4.3
  27.   description:  global constant, type, and variable definitions.
  28.  ***********************************************************************/
  29.  
  30.  
  31. /* definitions for buffer sizes -- somewhat arbitrary */
  32. #define        POPBUFSIZE    512    /* per RFC 937 */
  33. #define        MSGBUFSIZE    1024       /* size of message read buffer */
  34. #define        HOSTLEN        128    /* max hostname length */
  35. #define        USERIDLEN    32    /* max user-length */
  36. #define        PASSWORDLEN    32      /* max password length */
  37. #define        FOLDERLEN    256     /* max folder name length */
  38.  
  39.  
  40. /* exit code values */
  41. #define        PS_SUCCESS    0    /* successful receipt of messages */
  42. #define        PS_NOMAIL       1    /* no mail available */
  43. #define        PS_SOCKET    2    /* socket I/O woes */
  44. #define        PS_AUTHFAIL    3    /* user authorization failed */
  45. #define        PS_PROTOCOL    4    /* protocol violation */
  46. #define        PS_SYNTAX    5    /* command-line syntax error */
  47. #define        PS_FOLDER    6    /* local folder I/O woes */
  48. #define        PS_ERROR    7    /* some kind of POP3 error condition */
  49. #define        PS_UNDEFINED    9    /* something I hadn't thought of */
  50.  
  51.  
  52. /* output noise level */
  53. #define         O_SILENT    0    /* mute, max squelch, etc. */
  54. #define        O_NORMAL    1    /* user-friendly */
  55. #define        O_VERBOSE    2    /* excessive */
  56.  
  57. /* output folder type, used in options record */
  58. #define        OF_SYSMBOX    1    /* use system default mailbox */
  59. #define        OF_USERMBOX    2    /* use user's specified mailbox */
  60. #define        OF_STDOUT    3    /* use stdout */
  61.  
  62. /* Command-line arguments are passed in this structure type */
  63. struct optrec {
  64.   int versioninfo;
  65.   int keep;
  66.   int verbose;
  67.   int whichpop;
  68.   int silent;
  69.   int foldertype;
  70.   char host [HOSTLEN];
  71.   char loginid [USERIDLEN];
  72.   char userid [USERIDLEN];
  73.   char password [PASSWORDLEN];
  74.   char userfolder [FOLDERLEN];
  75.   char remotefolder [FOLDERLEN];
  76. };
  77.  
  78. /* Controls the detail of status/progress messages written to stderr */
  79. extern int outlevel;     /* see the O_.* constants above */
  80.  
  81. #ifndef NO_PROTO
  82.  
  83. /* prototypes for globally callable functions */
  84. int doPOP2 (struct optrec *options); 
  85. int doPOP3 (struct optrec *options);
  86.  
  87. int openuserfolder (struct optrec *options);
  88. int closeuserfolder (int fd);
  89. int openmailpipe (struct optrec *options);
  90. int closemailpipe (int fd);
  91.  
  92. #endif
  93.  
  94.