home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / POP.H < prev    next >
Text File  |  1991-05-31  |  2KB  |  62 lines

  1. /*
  2.             filename --  POP.H
  3.  
  4.             author   --  Mike Stockett, WA7DYX
  5.  
  6.             additional hacking by Allen Gwinn, N5CKP
  7. */
  8.  
  9. #ifndef TRUE
  10. #define TRUE        1
  11. #define FALSE        0
  12. #endif
  13.  
  14. #define BUF_LEN        128
  15.  
  16. #include <fcntl.h>
  17.  
  18. /* ---------------- common server data structures ---------------- */
  19.  
  20. /* POP server control block */
  21.  
  22. struct pop_scb {
  23.     int    socket;        /* socket number for this connection */
  24.     char    state;        /* server state */
  25. #define            LSTN        0
  26. #define            AUTH        1
  27. #define            MBOX        2
  28. #define            ITEM        3
  29. #define               NEXT        4
  30. #define            DONE        5
  31.     char    buf[BUF_LEN],    /* input line buffer */
  32.         count,        /* line buffer length */
  33.         username[64];    /* user/folder name */
  34.     FILE    *wf;        /* work folder file pointer */
  35.     int    folder_len,    /* number of msgs in current folder */
  36.         msg_num;    /* current msg number */
  37.     long    msg_len;    /* length of current msg */
  38.     int    msg_status_size; /* size of the message status array */
  39.     long    curpos,        /* current msg's position in file */
  40.         folder_file_size, /* length of the current folder file, in bytes */
  41.         nextpos;    /* next msg's position in file */
  42.     unsigned int    folder_modified, /*  mail folder contents modified flag */
  43.         *msg_status;    /* message status array pointer */
  44. };
  45.  
  46. #define NULLSCB        (struct pop_scb *)0
  47.  
  48. /* Response messages */
  49.  
  50. static char    count_rsp[]    = "#%d messages in this folder\n",
  51.         error_rsp[]    = "- ERROR: %s\n",
  52.         greeting_msg[] = "+ POP2 %s\n",
  53. /*        length_rsp[]   = "=%ld bytes in this message\n", */
  54.         length_rsp[]   = "=%ld characters in Message #%d\n",
  55.         msg_line[]     = "%s\n",
  56.         no_mail_rsp[]  = "+ No mail, sorry\n",
  57.         no_more_rsp[]  = "=%d No more messages in this folder\n",
  58.         signoff_msg[]  = "+ Bye, thanks for calling\n";
  59.  
  60. /* ------------------------ end of header file ---------------------------- */
  61.  
  62.