/[libspopc]/objects.c
ViewVC logotype

Diff of /objects.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5 by ben, Thu Oct 8 15:37:49 2009 UTC revision 6 by ben, Sun Apr 18 11:05:58 2010 UTC
# Line 38  Line 38 
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 */
# Line 157  error: Line 157  error:
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;
# Line 183  char* popgethead(popsession* session, in Line 183  char* popgethead(popsession* session, in
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;
# Line 211  char* popgetmsg(popsession* session, int Line 211  char* popgetmsg(popsession* session, int
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 */
# Line 262  int popdelmsg(popsession* session, int i Line 262  int popdelmsg(popsession* session, int i
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;
# Line 322  int popcancel(popsession* session){ Line 322  int popcancel(popsession* session){
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;
# Line 343  void popend(popsession* session){ Line 343  void popend(popsession* session){
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;
# Line 360  int popnum(popsession* session){ Line 360  int popnum(popsession* session){
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;
# Line 385  int poplast(popsession* session){ Line 385  int poplast(popsession* session){
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 */
# Line 393  int popchkmsg(popsession* session, int i Line 393  int popchkmsg(popsession* session, int i
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    

Legend:
Removed from v.5  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26