38 |
* high-level methods for a simple mua * |
* high-level methods for a simple mua * |
39 |
***************************************/ |
***************************************/ |
40 |
|
|
41 |
char* popbegin(const char* servername, const char* user, const char* pass, popsession** sp){ |
DLLIMPORT char* popbegin(const char* servername, const char* user, const char* pass, popsession** sp){ |
42 |
/* prepares, connect and get lists of messages stored on pop server */ |
/* prepares, connect and get lists of messages stored on pop server */ |
43 |
/* you must give a valid servername, user and pass */ |
/* you must give a valid servername, user and pass */ |
44 |
/* returns an error message if a problem occurs, else NULL */ |
/* returns an error message if a problem occurs, else NULL */ |
157 |
return (err); |
return (err); |
158 |
} |
} |
159 |
|
|
160 |
char* popgethead(popsession* session, int id){ |
DLLIMPORT char* popgethead(popsession* session, int id){ |
161 |
/* returns the header of a message id between 1 and last or NULL if bad id or error */ |
/* returns the header of a message id between 1 and last or NULL if bad id or error */ |
162 |
char* resp; |
char* resp; |
163 |
char* msg; |
char* msg; |
183 |
return(msg); |
return(msg); |
184 |
} |
} |
185 |
|
|
186 |
char* popgetmsg(popsession* session, int id){ |
DLLIMPORT char* popgetmsg(popsession* session, int id){ |
187 |
/* returns a message id between 1 to last or NULL if bad id or error */ |
/* returns a message id between 1 to last or NULL if bad id or error */ |
188 |
char* resp=NULL; |
char* resp=NULL; |
189 |
char* msg=NULL; |
char* msg=NULL; |
211 |
return(msg); |
return(msg); |
212 |
} |
} |
213 |
|
|
214 |
int popdelmsg(popsession* session, int id){ |
DLLIMPORT int popdelmsg(popsession* session, int id){ |
215 |
/* deletes a message 'id' on pop server */ |
/* deletes a message 'id' on pop server */ |
216 |
/* returns -1 if no deletion (server error), 0 else */ |
/* returns -1 if no deletion (server error), 0 else */ |
217 |
/* sets session->sync to 0 if last id unsync-ed , 1 if OK */ |
/* sets session->sync to 0 if last id unsync-ed , 1 if OK */ |
262 |
return 0; |
return 0; |
263 |
} |
} |
264 |
|
|
265 |
int popcancel(popsession* session){ |
DLLIMPORT int popcancel(popsession* session){ |
266 |
/* cancel all previous deletions on pop server */ |
/* cancel all previous deletions on pop server */ |
267 |
/* returns -1 if server error, 0 else */ |
/* returns -1 if server error, 0 else */ |
268 |
char* resp; |
char* resp; |
322 |
return 0; |
return 0; |
323 |
} |
} |
324 |
|
|
325 |
void popend(popsession* session){ |
DLLIMPORT void popend(popsession* session){ |
326 |
/* quit and destroys pop session */ |
/* quit and destroys pop session */ |
327 |
int i; |
int i; |
328 |
char* resp; |
char* resp; |
343 |
return; |
return; |
344 |
} |
} |
345 |
|
|
346 |
int popnum(popsession* session){ |
DLLIMPORT int popnum(popsession* session){ |
347 |
/* returns the number of current (non-deleted) messages */ |
/* returns the number of current (non-deleted) messages */ |
348 |
char* r=NULL; |
char* r=NULL; |
349 |
int n; |
int n; |
360 |
return(n); |
return(n); |
361 |
} |
} |
362 |
|
|
363 |
int poplast(popsession* session){ |
DLLIMPORT int poplast(popsession* session){ |
364 |
/* return the id of the last downloadable (non-deleted) message */ |
/* return the id of the last downloadable (non-deleted) message */ |
365 |
/* thanks to Francesco Gennai <francesco.gennai@isti.cnr.it> */ |
/* thanks to Francesco Gennai <francesco.gennai@isti.cnr.it> */ |
366 |
int i=0; |
int i=0; |
385 |
return(i); |
return(i); |
386 |
} |
} |
387 |
|
|
388 |
int popchkmsg(popsession* session, int id) { |
DLLIMPORT int popchkmsg(popsession* session, int id) { |
389 |
/* check if the message 'id' is accessible in the current session */ |
/* check if the message 'id' is accessible in the current session */ |
390 |
/* thanks to Francesco Gennai <francesco.gennai@isti.cnr.it> */ |
/* thanks to Francesco Gennai <francesco.gennai@isti.cnr.it> */ |
391 |
if (popmsguid(session, id)) return 1; /* anything but 0 */ |
if (popmsguid(session, id)) return 1; /* anything but 0 */ |
393 |
} |
} |
394 |
|
|
395 |
/* re-synchronize the session object from the server */ |
/* re-synchronize the session object from the server */ |
396 |
int popsync(popsession* session) { |
DLLIMPORT int popsync(popsession* session) { |
397 |
char* resp; |
char* resp; |
398 |
int ret; |
int ret; |
399 |
|
|