NetBurner 3.5.0
PDF Version
 
pop3.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
15#ifndef _POP3_H_
16#define _POP3_H_
17
18#include <nettypes.h>
19
20// #define POP3_DEBUG ( 1 ) // Library debug switch
21
22#ifdef POP3_DEBUG
23#define POP3_DEBUG_IPRINTF(...) \
24 { \
25 iprintf("%s:%d", __FUNCTION__, __LINE__); \
26 iprintf(__VA_ARGS__); \
27 iprintf("\r\n"); \
28 }
29#else /* #ifdef POP3_DEBUG */
30#define POP3_DEBUG_IPRINTF(...) ((void)0)
31#endif /* #ifdef POP3_DEBUG */
32
37#define POP_OK (0)
38#define POP_TIMEOUT (-1)
39#define POP_PASSWORDERROR (-2)
40#define POP_CONNECTFAIL (-3)
41#define POP_COMMANDFAIL (-4)
42#define POP_BADSESSION (-5)
43#define POP_NETWORKERROR (-6)
44#define POP_BUFFER_FULL (-7)
56int POPGetResultCode(int fd, uint32_t timeout);
57
71int POP3_InitializeSession(IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR Password, uint32_t timeout);
72
81int POP3_CloseSession(int session);
82
94int POP3_StatCmd(int session, uint32_t *num_messages, uint32_t *total_bytes, uint32_t timeout);
95
107int POP3_ListCmd(int session, uint32_t message_number, uint32_t *total_bytes, uint32_t timeout);
108
121int POP3_DeleteCmd(int session, uint32_t message_number, uint32_t timeout);
122
141int POP3_RetrieveMessage(int session,
142 uint32_t message_number,
143 char *buffer,
144 char **subject_ptr,
145 char **body_ptr,
146 int max_bufferlen,
147 uint32_t timeout);
148
157PCSTR GetPOPErrorString(int err);
158
159#endif /* #ifndef _POP3_H_ */
160
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
int POP3_ListCmd(int session, uint32_t message_number, uint32_t *total_bytes, uint32_t timeout)
Get the size of a message on the server.
int POP3_InitializeSession(IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR Password, uint32_t timeout)
Create a connection to the POP3 server and log in.
int POP3_StatCmd(int session, uint32_t *num_messages, uint32_t *total_bytes, uint32_t timeout)
Returns the status of the mailstore on the POP3 server.
int POP3_RetrieveMessage(int session, uint32_t message_number, char *buffer, char **subject_ptr, char **body_ptr, int max_bufferlen, uint32_t timeout)
Retrieve a message from the server.
int POPGetResultCode(int fd, uint32_t timeout)
Returns the result code of the previous POP3 operation.
int POP3_CloseSession(int session)
Close a POP3 session.
PCSTR GetPOPErrorString(int err)
Returns the error text for an error code.
int POP3_DeleteCmd(int session, uint32_t message_number, uint32_t timeout)
Delete a pending message on the server.
NetBurner IPADDR4 Class. See the IPADDR4 Class page for complete documentation.