new API.
Showing
1 changed file
with
8 additions
and
13 deletions
... | @@ -80,7 +80,7 @@ default timeout to be ten minutes, many servers have shorter idle period, care s | ... | @@ -80,7 +80,7 @@ default timeout to be ten minutes, many servers have shorter idle period, care s |
80 | @code{mu_pop3_connect()}, two built-ins authentications are provided @code{mu_pop3_apop ()} or | 80 | @code{mu_pop3_connect()}, two built-ins authentications are provided @code{mu_pop3_apop ()} or |
81 | @code{mu_pop3_user()}/@code{mu_pop3_pass()}. The @code{mu_pop3_stat()} and @code{mu_pop3_list ()} functions can be use to | 81 | @code{mu_pop3_user()}/@code{mu_pop3_pass()}. The @code{mu_pop3_stat()} and @code{mu_pop3_list ()} functions can be use to |
82 | get the number and size of messages. The functions @code{mu_pop3_list_all()}, @code{mu_pop3_uidl_all ()} and | 82 | get the number and size of messages. The functions @code{mu_pop3_list_all()}, @code{mu_pop3_uidl_all ()} and |
83 | @code{mu_pop3_capa()} save the information in a @code{list_t}. Downloading of messages is done | 83 | @code{mu_pop3_capa()} save the information in an @code{iterator_t}. Downloading of messages is done |
84 | via a two methods @code{mu_pop3_retr()} or @code{mu_pop3_top()}; | 84 | via a two methods @code{mu_pop3_retr()} or @code{mu_pop3_top()}; |
85 | @strong{Caution: Some Internet Service Providers do not permit to leave mail on server and the message will be | 85 | @strong{Caution: Some Internet Service Providers do not permit to leave mail on server and the message will be |
86 | deleted once downloaded}. | 86 | deleted once downloaded}. |
... | @@ -225,9 +225,10 @@ Errors: | ... | @@ -225,9 +225,10 @@ Errors: |
225 | 225 | ||
226 | @cindex POP3 CAPA | 226 | @cindex POP3 CAPA |
227 | 227 | ||
228 | @deftypefun int mu_pop3_capa (mu_pop3_t @var{pop3}) | 228 | @deftypefun int mu_pop3_capa (mu_pop3_t @var{pop3}, iterator_t *@var{iterator}) |
229 | 229 | ||
230 | The CAPA command is send to the sever and the list of capabilities is retrieve by calling @code{mu_pop3_capa_iterate()}. | 230 | The CAPA command is send to the server and the list of capabilities is retrieve by going through |
231 | the iterator, when done the user should call @code{iterator_destroy()}. | ||
231 | 232 | ||
232 | Errors: | 233 | Errors: |
233 | @table @code | 234 | @table @code |
... | @@ -402,9 +403,9 @@ Errors: | ... | @@ -402,9 +403,9 @@ Errors: |
402 | @end table | 403 | @end table |
403 | @end deftypefun | 404 | @end deftypefun |
404 | 405 | ||
405 | @deftypefun int mu_pop3_uidl_all (mu_pop3_t @var{pop3}, list_t *@var{list}) | 406 | @deftypefun int mu_pop3_uidl_all (mu_pop3_t @var{pop3}, iterator_t *@var{iterator}) |
406 | 407 | ||
407 | A UIDL command is executed. The call should iterate through the @code{list} to fetch the response. | 408 | A UIDL command is executed. The call should iterate through the @code{iterator} to fetch the response. |
408 | 409 | ||
409 | Errors: | 410 | Errors: |
410 | @table @code | 411 | @table @code |
... | @@ -421,17 +422,12 @@ Errors: | ... | @@ -421,17 +422,12 @@ Errors: |
421 | 422 | ||
422 | void print_uidl (mu_pop3_t pop3) | 423 | void print_uidl (mu_pop3_t pop3) |
423 | @{ | 424 | @{ |
424 | list_t list; | 425 | iterator_t itr; |
425 | status = mu_pop3_uidl_all (pop3, &list); | 426 | status = mu_pop3_uidl_all (pop3, &itr); |
426 | if (status == 0) | 427 | if (status == 0) |
427 | @{ | 428 | @{ |
428 | iterator_t itr; | ||
429 | int rc; | 429 | int rc; |
430 | 430 | ||
431 | rc = iterator_create (&itr, list); | ||
432 | if (rc) | ||
433 | lperror ("iterator_create", rc); | ||
434 | |||
435 | for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) | 431 | for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) |
436 | @{ | 432 | @{ |
437 | char *text; | 433 | char *text; |
... | @@ -442,7 +438,6 @@ void print_uidl (mu_pop3_t pop3) | ... | @@ -442,7 +438,6 @@ void print_uidl (mu_pop3_t pop3) |
442 | printf ("%s\n", text); | 438 | printf ("%s\n", text); |
443 | @} | 439 | @} |
444 | iterator_destroy (&itr); | 440 | iterator_destroy (&itr); |
445 | list_destroy(&list); | ||
446 | @} | 441 | @} |
447 | 442 | ||
448 | @} | 443 | @} | ... | ... |
-
Please register or sign in to post a comment