00001 /* -------------------------------------------------------------------------------------- 00002 * Copyright (C) 2004 Dallas Semiconductor Corporation, All Rights Reserved. 00003 * 00004 * Permission is hereby granted, free of charge, to any person obtaining a 00005 * copy of this software and associated documentation files (the "Software"), 00006 * to deal in the Software without restriction, including without limitation 00007 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00008 * and/or sell copies of the Software, and to permit persons to whom the 00009 * Software is furnished to do so, subject to the following conditions: 00010 * 00011 * The above copyright notice and this permission notice shall be included 00012 * in all copies or substantial portions of the Software. 00013 * 00014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00015 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00016 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00017 * IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES 00018 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00019 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00020 * OTHER DEALINGS IN THE SOFTWARE. 00021 * 00022 * Except as contained in this notice, the name of Dallas Semiconductor 00023 * shall not be used except as stated in the Dallas Semiconductor 00024 * Branding Policy. 00025 */ 00026 00027 #ifndef __tini400_pop3_ 00028 #define __tini400_pop3_ 00029 00047 #define MAX_LINE_SIZE 1024 00048 00053 #define POP3_VERSION 2 00054 00058 #define POP3_MAXATTACHMENTSIZE 5 00059 00063 #define POP3_MAXUSERHEADERSIZE 20 00064 00070 #define POP3_INSUFFICIENT_MEMORY -1 00071 00075 #define POP3_RECEIVEMAIL_ERROR -5 00076 00080 #define POP3_INVALID_MAILNUMBER -6 00081 00089 #define POP3_SOCKET_ERROR -7 00090 00094 #define POP3_INVALID_USER_PASSWORD -10 00095 00100 #define POP3_LIBRARY_IS_NOT_CONFIGURED -11 00101 00109 #define POP3_NOT_CONNECTED -12 00110 00114 #define POP3_FILE_ERROR -13 00115 00119 #define POP3_STATUS_SUCCESS 0 00120 00124 typedef struct _mailheader 00125 { 00126 char *from_id; 00127 char *sendername; 00128 char *to_id; 00129 char *recipientname; 00130 char *subject; 00131 char *reply_to_id; 00132 char *cc_id; 00133 char *bcc_id; 00134 char *errors_to_id; 00135 char *date; 00136 } mailheader; 00137 00141 typedef struct _userheader 00142 { 00143 char *headernamelist[POP3_MAXUSERHEADERSIZE]; 00144 char *headervaluelist[POP3_MAXUSERHEADERSIZE]; 00145 } userheader; 00146 00150 typedef struct _mail 00151 { 00152 struct _mailheader mailhdr; 00153 struct _userheader userhdr; 00154 char *msg; 00155 char *attachmentlist[POP3_MAXATTACHMENTSIZE]; 00156 } mail; 00157 00161 typedef struct _maillist 00162 { 00163 int numberofmails; 00164 int *mailnumberlist; 00165 int *mailsizelist; 00166 } maillist; 00167 00171 typedef struct _pop3_session 00172 { 00173 unsigned int handle; 00174 char *user; 00175 char *pass; 00176 int status; 00177 int (*pop3_authentication)(); 00178 } pop3_session; 00179 00185 unsigned int pop3_version(void); 00186 00193 void pop3_init(void); 00194 00207 void pop3_setuserheaderlist(struct _userheader *pusrhdr); 00208 00232 int pop3_login(long pop3_host, char *username, char *pwd); 00233 00254 int pop3_deletemail(int mailnumber); 00255 00275 int pop3_getmailboxstate(int *numberofmails, long *total_size); 00276 00304 struct _mail *pop3_receivemail(int mailnumber, int *status); 00305 00321 struct _maillist *pop3_getmaillist(int *status); 00322 00337 int pop3_logout(void); 00338 00360 void pop3_registerauthcallback(int (*funpt)()); 00361 00362 #endif 00363
| Copyright 2004 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |