From: Michael L. <le...@us...> - 2006-04-23 12:19:41
|
Update of /cvsroot/libetpan/libetpan/src/low-level/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2780 Modified Files: annotatemore.c annotatemore.h Log Message: Changed mailimap_annotatemore_getannotation's result from clist of (struct mailimap_extension_data *) to clist of (struct mailimap_annotatemore_annotate_data *) Index: annotatemore.c =================================================================== RCS file: /cvsroot/libetpan/libetpan/src/low-level/imap/annotatemore.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- annotatemore.c 21 Apr 2006 08:22:58 -0000 1.2 +++ annotatemore.c 23 Apr 2006 12:19:37 -0000 1.3 @@ -65,6 +65,8 @@ clist ** result) { struct mailimap_response * response; + struct mailimap_extension_data * ext_data; + clistiter * cur; int r; int error_code; @@ -94,7 +96,29 @@ if (r != MAILIMAP_NO_ERROR) return r; - * result = session->imap_response_info->rsp_extension_list; + * result = clist_new(); + if (* result == NULL) + return MAILIMAP_ERROR_MEMORY; + + /* copy all annotate_data to the result-list */ + for (cur = clist_begin(session->imap_response_info->rsp_extension_list); + cur != NULL; cur = clist_next(cur)) { + ext_data = (struct mailimap_extension_data *) clist_content(cur); + if ( + ext_data->extension->extension_id == MAILIMAP_EXTENSION_ANNOTATEMORE && + ext_data->type == MAILIMAP_ANNOTATEMORE_TYPE_ANNOTATE_DATA) { + r = clist_append((* result), ext_data->data); + if (r != 0) + return MAILIMAP_ERROR_MEMORY; + + ext_data->data = NULL; + ext_data->type = -1; + } + } + + clist_foreach(session->imap_response_info->rsp_extension_list, + (clist_func) mailimap_extension_data_free, NULL); + clist_free(session->imap_response_info->rsp_extension_list); session->imap_response_info->rsp_extension_list = NULL; error_code = response->rsp_resp_done->rsp_data.rsp_tagged->rsp_cond_state->rsp_type; Index: annotatemore.h =================================================================== RCS file: /cvsroot/libetpan/libetpan/src/low-level/imap/annotatemore.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- annotatemore.h 21 Apr 2006 08:22:58 -0000 1.2 +++ annotatemore.h 23 Apr 2006 12:19:37 -0000 1.3 @@ -53,7 +53,7 @@ empty string implies server annotation @param entries entry specifier with possible wildcards @param attribs attribute specifier with possible wildcards - @param result This will store a clist of (struct mailimap_extension_data *) + @param result This will store a clist of (struct mailimap_annotate_data *) in (* result) @return the return code is one of MAILIMAP_ERROR_XXX or |