pop.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* pop.h: Header file for the "pop.c" client POP3 protocol.
  2. Copyright (C) 1991, 1993, 2001-2012 Free Software Foundation, Inc.
  3. Author: Jonathan Kamens <jik@security.ov.com>
  4. This file is part of GNU Emacs.
  5. GNU Emacs is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. GNU Emacs is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
  15. #include <stdio.h>
  16. #define GETLINE_MIN 1024 /* the getline buffer starts out this */
  17. /* size */
  18. #define GETLINE_INCR 1024 /* the getline buffer is grown by this */
  19. /* size when it needs to grow */
  20. extern char pop_error[];
  21. extern int pop_debug;
  22. struct _popserver
  23. {
  24. int file, data;
  25. char *buffer;
  26. int buffer_size, buffer_index;
  27. int in_multi;
  28. int trash_started;
  29. };
  30. typedef struct _popserver *popserver;
  31. /*
  32. * Valid flags for the pop_open function.
  33. */
  34. #define POP_NO_KERBEROS (1<<0)
  35. #define POP_NO_HESIOD (1<<1)
  36. #define POP_NO_GETPASS (1<<2)
  37. extern popserver pop_open (char *host, char *username, char *password,
  38. int flags);
  39. extern int pop_stat (popserver server, int *count, int *size);
  40. extern int pop_list (popserver server, int message, int **IDs,
  41. int **size);
  42. extern int pop_retrieve (popserver server, int message, int markfrom,
  43. char **);
  44. extern int pop_retrieve_first (popserver server, int message,
  45. char **response);
  46. extern int pop_retrieve_next (popserver server, char **line);
  47. extern int pop_retrieve_flush (popserver server);
  48. extern int pop_top_first (popserver server, int message, int lines,
  49. char **response);
  50. extern int pop_top_next (popserver server, char **line);
  51. extern int pop_top_flush (popserver server);
  52. extern int pop_multi_first (popserver server, const char *command,
  53. char **response);
  54. extern int pop_multi_next (popserver server, char **line);
  55. extern int pop_multi_flush (popserver server);
  56. extern int pop_delete (popserver server, int message);
  57. extern int pop_noop (popserver server);
  58. extern int pop_last (popserver server);
  59. extern int pop_reset (popserver server);
  60. extern int pop_quit (popserver server);
  61. extern void pop_close (popserver);