Gentoo Archives: gentoo-commits

From: "Gunnar Wrobel (wrobel)" <wrobel@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-libs/c-client/files: c-client-2006k_KOLAB_Annotations.patch c-client-2006k_GENTOO_Makefile.patch c-client-2004g_KOLAB_Annotations.patch c-client-2006k_GENTOO_amd64-so-fix.patch
Date: Fri, 22 Feb 2008 07:18:22
Message-Id: E1JSSAj-0001gx-VN@stork.gentoo.org
1 wrobel 08/02/22 07:18:17
2
3 Added: c-client-2006k_KOLAB_Annotations.patch
4 c-client-2006k_GENTOO_Makefile.patch
5 c-client-2004g_KOLAB_Annotations.patch
6 c-client-2006k_GENTOO_amd64-so-fix.patch
7 Log:
8 Added c-client-2004g-r1 and c-client-2006k, both with support for the Kolab
9 groupware server.
10 (Portage version: 2.1.4_rc7)
11
12 Revision Changes Path
13 1.1 net-libs/c-client/files/c-client-2006k_KOLAB_Annotations.patch
14
15 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_KOLAB_Annotations.patch?rev=1.1&view=markup
16 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_KOLAB_Annotations.patch?rev=1.1&content-type=text/plain
17
18 Index: c-client-2006k_KOLAB_Annotations.patch
19 ===================================================================
20 Provides get/set ANNOTATIONS support to the c-client library. [Version: 2006k]
21
22 diff -r 217555555c77 src/c-client/imap4r1.c
23 --- a/src/c-client/imap4r1.c Thu Feb 21 17:37:37 2008 +0100
24 +++ b/src/c-client/imap4r1.c Thu Feb 21 17:38:15 2008 +0100
25 @@ -135,7 +135,8 @@ typedef struct imap_argument {
26 #define MULTIAPPEND 13
27 #define SNLIST 14
28 #define MULTIAPPENDREDO 15
29 -
30 +#define QLIST 16
31 +#define QSTRING 17
32
33 /* Append data */
34
35 @@ -205,12 +206,15 @@ void imap_gc_body (BODY *body);
36 void imap_gc_body (BODY *body);
37 void imap_capability (MAILSTREAM *stream);
38 long imap_acl_work (MAILSTREAM *stream,char *command,IMAPARG *args[]);
39 +long imap_annotation_work (MAILSTREAM *stream,char *command,IMAPARG *args[]);
40
41 IMAPPARSEDREPLY *imap_send (MAILSTREAM *stream,char *cmd,IMAPARG *args[]);
42 IMAPPARSEDREPLY *imap_sout (MAILSTREAM *stream,char *tag,char *base,char **s);
43 long imap_soutr (MAILSTREAM *stream,char *string);
44 IMAPPARSEDREPLY *imap_send_astring (MAILSTREAM *stream,char *tag,char **s,
45 SIZEDTEXT *as,long wildok,char *limit);
46 +IMAPPARSEDREPLY *imap_send_qstring (MAILSTREAM *stream,char *tag,char **s,
47 + SIZEDTEXT *as,char *limit);
48 IMAPPARSEDREPLY *imap_send_literal (MAILSTREAM *stream,char *tag,char **s,
49 STRING *st);
50 IMAPPARSEDREPLY *imap_send_spgm (MAILSTREAM *stream,char *tag,char *base,
51 @@ -2753,6 +2757,84 @@ long imap_getacl (MAILSTREAM *stream,cha
52 args[0] = &ambx; args[1] = NIL;
53 return imap_acl_work (stream,"GETACL",args);
54 }
55 +
56 +/* IMAP set annotation
57 + * Accepts: mail stream
58 + * annotation struct
59 + * Returns: T on success, NIL on failure
60 + */
61 +
62 +long imap_setannotation (MAILSTREAM *stream,ANNOTATION *annotation)
63 +{
64 + IMAPARG *args[4],ambx,apth,aval;
65 + long ret;
66 +
67 + ambx.type = ASTRING;
68 + ambx.text = (void *) annotation->mbox;
69 + args[0] = &ambx;
70 +
71 + apth.type = QSTRING;
72 + apth.text = (void *) annotation->entry;
73 + args[1] = &apth;
74 +
75 + STRINGLIST *st,*l;
76 + ANNOTATION_VALUES *v;
77 +
78 + l = st = mail_newstringlist();
79 + v = annotation->values;
80 + while(v){
81 + l->text.size = strlen((char *) (l->text.data = (unsigned char*)cpystr(v->attr)));
82 + l->next = mail_newstringlist();
83 + l = l->next;
84 + l->text.size = strlen((char *) (l->text.data = (unsigned char*)cpystr(v->value)));
85 + if(v->next){
86 + l->next = mail_newstringlist();
87 + l = l->next;
88 + }
89 + v = v->next;
90 + }
91 +
92 + aval.type = QLIST;
93 + aval.text = (void *)st;
94 + args[2] = &aval;
95 + args[3] = NIL;
96 +
97 + ret = imap_annotation_work(stream, "SETANNOTATION",args);
98 + mail_free_stringlist(&st);
99 + return ret;
100 +}
101 +
102 +
103 +
104 +/* IMAP get annotation
105 + * Accepts: mail stream
106 + * mailbox name
107 + * annotation entry list
108 + * annotation attribute list
109 + * Returns: T on success with data returned via callback, NIL on failure
110 + */
111 +
112 +long imap_getannotation (MAILSTREAM *stream,char *mailbox,STRINGLIST *entries, STRINGLIST *attributes)
113 +{
114 + IMAPARG *args[4],ambx,apth,aattr;
115 + long ret;
116 + ambx.type = ASTRING;
117 + ambx.text = (void*) mailbox;
118 + args[0] = &ambx;
119 +
120 +
121 + apth.type = QLIST;
122 + apth.text = (void*) entries;
123 + args[1] = &apth;
124 +
125 + aattr.type = QLIST;
126 + aattr.text = (void*) attributes;
127 + args[2] = &aattr;
128 +
129 + args[3] = NIL;
130 + ret = imap_annotation_work(stream, "GETANNOTATION",args);
131 + return ret;
132 +}
133
134 /* IMAP list rights
135 * Accepts: mail stream
136 @@ -2805,6 +2887,16 @@ long imap_acl_work (MAILSTREAM *stream,c
137 else mm_log ("ACL not available on this IMAP server",ERROR);
138 return ret;
139 }
140 + long imap_annotation_work(MAILSTREAM *stream, char *command,IMAPARG *args[])
141 +{
142 + long ret = NIL;
143 + IMAPPARSEDREPLY *reply;
144 + if (imap_OK (stream,reply = imap_send (stream,command,args)))
145 + ret = LONGT;
146 + else mm_log (reply->text,ERROR);
147 + return ret;
148 +}
149 +
150
151 /* IMAP set quota
152 * Accepts: mail stream
153 @@ -2937,6 +3029,11 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
154 if (reply = imap_send_astring (stream,tag,&s,&st,NIL,CMDBASE+MAXCOMMAND))
155 return reply;
156 break;
157 + case QSTRING: /* atom or string, must be literal? */
158 + st.size = strlen ((char *) (st.data = (unsigned char *) arg->text));
159 + if (reply = imap_send_qstring (stream,tag,&s,&st,CMDBASE+MAXCOMMAND))
160 + return reply;
161 + break;
162 case LITERAL: /* literal, as a stringstruct */
163 if (reply = imap_send_literal (stream,tag,&s,arg->text)) return reply;
164 break;
165 @@ -2947,6 +3044,18 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
166 do { /* for each list item */
167 *s++ = c; /* write prefix character */
168 if (reply = imap_send_astring (stream,tag,&s,&list->text,NIL,
169 + CMDBASE+MAXCOMMAND)) return reply;
170 + c = ' '; /* prefix character for subsequent strings */
171 + }
172 + while (list = list->next);
173 + *s++ = ')'; /* close list */
174 + break;
175 + case QLIST: /* list of strings */
176 + list = (STRINGLIST *) arg->text;
177 + c = '('; /* open paren */
178 + do { /* for each list item */
179 + *s++ = c; /* write prefix character */
180 + if (reply = imap_send_qstring (stream,tag,&s,&list->text,
181 CMDBASE+MAXCOMMAND)) return reply;
182 c = ' '; /* prefix character for subsequent strings */
183 }
184 @@ -3119,6 +3228,32 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
185 reply = imap_sout (stream,tag,CMDBASE,&s);
186 mail_unlock (stream); /* unlock stream */
187 return reply;
188 +}
189 +
190 +/* IMAP send quoted-string
191 + * Accepts: MAIL stream
192 + * reply tag
193 + * pointer to current position pointer of output bigbuf
194 + * atom-string to output
195 + * maximum to write as atom or qstring
196 + * Returns: error reply or NIL if success
197 + */
198 +
199 +IMAPPARSEDREPLY *imap_send_qstring (MAILSTREAM *stream,char *tag,char **s,
200 + SIZEDTEXT *as,char *limit)
201 +{
202 + unsigned long j;
203 + char c;
204 + STRING st;
205 + /* in case needed */
206 + INIT (&st,mail_string,(void *) as->data,as->size);
207 + /* always write literal if no space */
208 + if ((*s + as->size) > limit) return imap_send_literal (stream,tag,s,&st);
209 +
210 + *(*s)++ = '"'; /* write open quote */
211 + for (j = 0; j < as->size; j++) *(*s)++ = as->data[j];
212 + *(*s)++ = '"'; /* write close quote */
213 + return NIL;
214 }
215
216 /* IMAP send atom-string
217 @@ -4049,6 +4184,50 @@ void imap_parse_unsolicited (MAILSTREAM
218 }
219 }
220
221 + else if (!strcmp (reply->key,"ANNOTATION") && (s = reply->text)){
222 + char * mbox;
223 + /* response looks like ANNOTATION "mailbox" "entry" ("attr" "value" ["attr" "value"]) ["entry" ("attr "value" ["attr" "value"] )]*/
224 + getannotation_t an = (getannotation_t) mail_parameters (NIL,GET_ANNOTATION,NIL);
225 +
226 + mbox = imap_parse_astring (stream, &s, reply,NIL);
227 +
228 + while(*s){
229 + ANNOTATION * al = mail_newannotation();
230 + al->mbox = cpystr(mbox);
231 + t = imap_parse_astring (stream, &s, reply,NIL);
232 + al->entry = t;
233 + STRINGLIST *strlist;
234 + if (s){while (*s == ' ')s++;}
235 +
236 + strlist = imap_parse_stringlist(stream, &s,reply);
237 +
238 + ANNOTATION_VALUES *vlIter, *vlBegin;
239 + vlIter = vlBegin = NIL;
240 + if (strlist) {
241 + while(strlist){
242 + if(vlIter){
243 + vlIter->next = mail_newannotationvalue();
244 + vlIter = vlIter->next;
245 + }else{
246 + vlIter = mail_newannotationvalue();
247 + vlBegin = vlIter;
248 + }
249 + if ( strlist->text.size )
250 + vlIter->attr = cpystr (strlist->text.data);
251 + strlist = strlist->next;
252 + if(!strlist) continue;
253 + if ( strlist->text.size )
254 + vlIter->value = cpystr (strlist->text.data);
255 + strlist = strlist->next;
256 + }
257 + }
258 + al->values = vlBegin;
259 + if (an)
260 + (*an) (stream,al);
261 + mail_free_annotation(&al);
262 + }
263 + fs_give ((void **)&mbox);
264 + }
265 else if (!strcmp (reply->key,"ACL") && (s = reply->text) &&
266 (t = imap_parse_astring (stream,&s,reply,NIL))) {
267 getacl_t ar = (getacl_t) mail_parameters (NIL,GET_ACL,NIL);
268 diff -r 217555555c77 src/c-client/imap4r1.h
269 --- a/src/c-client/imap4r1.h Thu Feb 21 17:37:37 2008 +0100
270 +++ b/src/c-client/imap4r1.h Thu Feb 21 17:38:15 2008 +0100
271 @@ -279,3 +279,5 @@ long imap_setquota (MAILSTREAM *stream,c
272 long imap_setquota (MAILSTREAM *stream,char *qroot,STRINGLIST *limits);
273 long imap_getquota (MAILSTREAM *stream,char *qroot);
274 long imap_getquotaroot (MAILSTREAM *stream,char *mailbox);
275 +long imap_getannotation (MAILSTREAM *stream,char *mailbox,STRINGLIST *entries,STRINGLIST *attributes);
276 +long imap_setannotation (MAILSTREAM *stream,ANNOTATION *annotation);
277 diff -r 217555555c77 src/c-client/mail.c
278 --- a/src/c-client/mail.c Thu Feb 21 17:37:37 2008 +0100
279 +++ b/src/c-client/mail.c Thu Feb 21 17:38:15 2008 +0100
280 @@ -69,6 +69,7 @@ static newsrcquery_t mailnewsrcquery = N
281 static newsrcquery_t mailnewsrcquery = NIL;
282 /* ACL results callback */
283 static getacl_t mailaclresults = NIL;
284 +static getannotation_t mailannotationresults = NIL;
285 /* list rights results callback */
286 static listrights_t maillistrightsresults = NIL;
287 /* my rights results callback */
288 @@ -598,6 +599,11 @@ void *mail_parameters (MAILSTREAM *strea
289 ret = (void *) (debugsensitive ? VOIDT : NIL);
290 break;
291
292 + case SET_ANNOTATION:
293 + mailannotationresults = (getannotation_t) value;
294 + case GET_ANNOTATION:
295 + ret = (void *) mailannotationresults;
296 + break;
297 case SET_ACL:
298 mailaclresults = (getacl_t) value;
299 case GET_ACL:
300 @@ -5701,7 +5707,15 @@ ACLLIST *mail_newacllist (void)
301 return (ACLLIST *) memset (fs_get (sizeof (ACLLIST)),0,sizeof (ACLLIST));
302 }
303
304 -
305 +ANNOTATION *mail_newannotation (void)
306 +{
307 + return (ANNOTATION *) memset (fs_get (sizeof (ANNOTATION)),0,sizeof(ANNOTATION));
308 +}
309 +
310 +ANNOTATION_VALUES *mail_newannotationvalue (void)
311 +{
312 + return (ANNOTATION_VALUES *) memset (fs_get (sizeof (ANNOTATION_VALUES)),0,sizeof(ANNOTATION_VALUES));
313 +}
314 /* Mail instantiate new quotalist
315 * Returns: new quotalist
316 */
317 @@ -6024,6 +6038,25 @@ void mail_free_acllist (ACLLIST **al)
318 }
319 }
320
321 +static void mail_free_annotation_values(ANNOTATION_VALUES **val)
322 +{
323 + if (*val) {
324 + if ((*val)->attr) fs_give ((void**) &(*val)->attr);
325 + if ((*val)->value) fs_give ((void**) &(*val)->value);
326 + mail_free_annotation_values (&(*val)->next);
327 + fs_give ((void **) val);
328 + }
329 +}
330 +void mail_free_annotation(ANNOTATION **al)
331 +{
332 + if (*al) {
333 + if((*al)->mbox) fs_give ((void**) &(*al)->mbox);
334 + if((*al)->entry) fs_give ((void**) &(*al)->entry);
335 + if((*al)->values)
336 + mail_free_annotation_values(&(*al)->values);
337 + fs_give ((void **) al);
338 + }
339 +}
340
341 /* Mail garbage collect quotalist
342 * Accepts: pointer to quotalist pointer
343 diff -r 217555555c77 src/c-client/mail.h
344 --- a/src/c-client/mail.h Thu Feb 21 17:37:37 2008 +0100
345 +++ b/src/c-client/mail.h Thu Feb 21 17:38:15 2008 +0100
346 @@ -351,6 +351,8 @@
347 #define SET_SCANCONTENTS (long) 573
348 #define GET_MHALLOWINBOX (long) 574
349 #define SET_MHALLOWINBOX (long) 575
350 +#define GET_ANNOTATION (long) 576
351 +#define SET_ANNOTATION (long) 577
352
353 /* Driver flags */
354
355 @@ -1043,6 +1045,24 @@ ACLLIST {
356 char *identifier; /* authentication identifier */
357 char *rights; /* access rights */
358 ACLLIST *next;
359 +};
360 +
361 +/* ANNOTATION Response */
362 +
363 +#define ANNOTATION_VALUES struct annotation_value_list
364 +
365 +ANNOTATION_VALUES {
366 + char *attr;
367 + char *value;
368 + ANNOTATION_VALUES *next;
369 +};
370 +
371 +#define ANNOTATION struct annotation
372 +
373 +ANNOTATION {
374 + char *mbox;
375 + char *entry;
376 + ANNOTATION_VALUES * values;
377 };
378
379 /* Quota resource list */
380 @@ -1353,6 +1373,7 @@ typedef void (*logouthook_t) (void *data
381 typedef void (*logouthook_t) (void *data);
382 typedef char *(*sslclientcert_t) (void);
383 typedef char *(*sslclientkey_t) (void);
384 +typedef void (*getannotation_t) (MAILSTREAM *stream,ANNOTATION* annot);
385
386 /* Globals */
387
388 @@ -1771,7 +1792,10 @@ SORTPGM *mail_newsortpgm (void);
389 SORTPGM *mail_newsortpgm (void);
390 THREADNODE *mail_newthreadnode (SORTCACHE *sc);
391 ACLLIST *mail_newacllist (void);
392 +ANNOTATION* mail_newannotation(void);
393 +ANNOTATION_VALUES* mail_newannotationvalue(void);
394 QUOTALIST *mail_newquotalist (void);
395 +void mail_free_annotation(ANNOTATION **a);
396 void mail_free_body (BODY **body);
397 void mail_free_body_data (BODY *body);
398 void mail_free_body_parameter (PARAMETER **parameter);
399 diff -r 217555555c77 src/mtest/mtest.c
400 --- a/src/mtest/mtest.c Thu Feb 21 17:37:37 2008 +0100
401 +++ b/src/mtest/mtest.c Thu Feb 21 17:38:15 2008 +0100
402 @@ -145,6 +145,8 @@ int main ()
403 #endif
404 return NIL;
405 }
406 +
407 +void mm_annotation (MAILSTREAM *stream, ANNOTATION *a);
408
409 /* MM command loop
410 * Accepts: MAIL stream
411 @@ -195,6 +197,28 @@ void mm (MAILSTREAM *stream,long debug)
412 mail_setflag (stream,arg,"\\DELETED");
413 else puts ("?Bad message number");
414 break;
415 + case 'A':
416 + {
417 + char parms[MAILTMPLEN];
418 + prompt("Annotation: ",parms);
419 + if (parms) {
420 + mail_parameters(stream,SET_ANNOTATION,mm_annotation);
421 + STRINGLIST *entries = mail_newstringlist();
422 + STRINGLIST *cur = entries;
423 + cur->text.size = strlen((char *) (cur->text.data = (unsigned char*)cpystr (parms)));
424 + cur->next = NIL;
425 +
426 + STRINGLIST *attributes = mail_newstringlist();
427 + cur = attributes;
428 + cur->text.size = strlen((char *) (cur->text.data = (unsigned char*)cpystr ("*")));
429 + cur->next = NIL;
430 +
431 + imap_getannotation(stream,"INBOX",entries,attributes);
432 + mail_free_stringlist(&entries);
433 + mail_free_stringlist(&attributes);
434 + }
435 + }
436 + break;
437 case 'E': /* Expunge command */
438 mail_expunge (stream);
439 last = 0;
440 @@ -347,7 +371,7 @@ void mm (MAILSTREAM *stream,long debug)
441 case '?': /* ? command */
442 puts ("Body, Check, Delete, Expunge, Find, GC, Headers, Literal,");
443 puts (" MailboxStatus, New Mailbox, Overview, Ping, Quit, Send, Type,");
444 - puts ("Undelete, Xit, +, -, or <RETURN> for next message");
445 + puts ("Undelete, Xit,Annotation, +, -, or <RETURN> for next message");
446 break;
447 default: /* bogus command */
448 printf ("?Unrecognized command: %s\n",cmd);
449 @@ -600,6 +624,18 @@ void prompt (char *msg,char *txt)
450
451 /* Interfaces to C-client */
452
453 +void mm_annotation (MAILSTREAM *stream, ANNOTATION *a)
454 +{
455 + if(a){
456 + fprintf(stderr,"mailbox: %s\nentry: %s\n",a->mbox,a->entry);
457 + ANNOTATION_VALUES * v = a->values;
458 + while(v){
459 + fprintf(stderr,"attr: %s, value: %s\n",v->attr,v->value);
460 + v = v->next;
461 + }
462 + }
463 +}
464 +
465
466 void mm_searched (MAILSTREAM *stream,unsigned long number)
467 {
468
469
470
471 1.1 net-libs/c-client/files/c-client-2006k_GENTOO_Makefile.patch
472
473 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_GENTOO_Makefile.patch?rev=1.1&view=markup
474 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_GENTOO_Makefile.patch?rev=1.1&content-type=text/plain
475
476 Index: c-client-2006k_GENTOO_Makefile.patch
477 ===================================================================
478 Fix the Makefile for building on Gentoo.
479
480 diff -r b15554ece4d6 Makefile
481 --- a/Makefile Thu Feb 21 17:49:39 2008 +0100
482 +++ b/Makefile Thu Feb 21 18:51:31 2008 +0100
483 @@ -295,7 +295,7 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA
484
485 # Make the IMAP Toolkit
486
487 -all: c-client SPECIALS rebuild bundled
488 +all: c-client SPECIALS rebuild
489
490 c-client:
491 @echo Not processed yet. In a first-time build, you must specify
492 @@ -665,16 +665,9 @@ an ua:
493 $(TOOLS)/$@ "$(LN)" src/ansilib c-client
494 $(TOOLS)/$@ "$(LN)" src/charset c-client
495 $(TOOLS)/$@ "$(LN)" src/osdep/$(SYSTEM) c-client
496 - $(TOOLS)/$@ "$(LN)" src/mtest mtest
497 - $(TOOLS)/$@ "$(LN)" src/ipopd ipopd
498 - $(TOOLS)/$@ "$(LN)" src/imapd imapd
499 - $(TOOLS)/$@ "$(LN)" src/mailutil mailutil
500 - $(TOOLS)/$@ "$(LN)" src/mlock mlock
501 - $(TOOLS)/$@ "$(LN)" src/dmail dmail
502 - $(TOOLS)/$@ "$(LN)" src/tmail tmail
503 $(LN) $(TOOLS)/$@ .
504
505 -build: OSTYPE rebuild rebuildclean bundled
506 +build: OSTYPE rebuild rebuildclean
507
508 OSTYPE:
509 @$(MAKE) ip$(IP)
510 @@ -690,8 +683,6 @@ OSTYPE:
511 echo $(BUILDTYPE) > OSTYPE
512 $(TOUCH) rebuild
513
514 -rebuild:
515 - @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)'
516 @echo Rebuilding c-client for `$(CAT) OSTYPE`...
517 @$(TOUCH) SPECIALS
518 $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \
519 @@ -700,28 +691,6 @@ rebuildclean:
520 rebuildclean:
521 $(SH) -c '$(RM) rebuild || true'
522
523 -bundled:
524 - @echo Building bundled tools...
525 - $(CD) mtest;$(MAKE)
526 - $(CD) ipopd;$(MAKE)
527 - $(CD) imapd;$(MAKE)
528 - $(CD) mailutil;$(MAKE)
529 - @$(SH) -c '(test -f /usr/include/sysexits.h ) || make sysexitwarn'
530 - $(CD) mlock;$(MAKE) || true
531 - $(CD) dmail;$(MAKE) || true
532 - $(CD) tmail;$(MAKE) || true
533 -
534 -
535 -sysexitwarn:
536 - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
537 - @echo + Hmm...it does not look like /usr/include/sysexits.h exists.
538 - @echo + Either your system is too ancient to have the sysexits.h
539 - @echo + include, or your C compiler gets it from some other location
540 - @echo + than /usr/include. If your system is too old to have the
541 - @echo + sysexits.h include, you will not be able to build the
542 - @echo + following programs.
543 - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
544 -
545 clean:
546 @echo Removing old processed sources and binaries...
547 $(SH) -c '$(RM) an ua OSTYPE SPECIALS c-client mtest imapd ipopd mailutil mlock dmail tmail || true'
548
549
550
551 1.1 net-libs/c-client/files/c-client-2004g_KOLAB_Annotations.patch
552
553 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2004g_KOLAB_Annotations.patch?rev=1.1&view=markup
554 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2004g_KOLAB_Annotations.patch?rev=1.1&content-type=text/plain
555
556 Index: c-client-2004g_KOLAB_Annotations.patch
557 ===================================================================
558 Provides get/set ANNOTATIONS support to the c-client library. [Version: 2004g]
559
560 diff -r b9fd2c61d881 src/c-client/imap4r1.c
561 --- a/src/c-client/imap4r1.c Sat Sep 29 08:56:35 2007 +0200
562 +++ b/src/c-client/imap4r1.c Sat Sep 29 10:40:13 2007 +0200
563 @@ -125,7 +125,8 @@ typedef struct imap_argument {
564 #define MULTIAPPEND 13
565 #define SNLIST 14
566 #define MULTIAPPENDREDO 15
567 -
568 +#define QLIST 16
569 +#define QSTRING 17
570
571 /* Append data */
572
573 @@ -195,12 +196,15 @@ void imap_gc_body (BODY *body);
574 void imap_gc_body (BODY *body);
575 void imap_capability (MAILSTREAM *stream);
576 long imap_acl_work (MAILSTREAM *stream,char *command,IMAPARG *args[]);
577 +long imap_annotation_work (MAILSTREAM *stream,char *command,IMAPARG *args[]);
578
579 IMAPPARSEDREPLY *imap_send (MAILSTREAM *stream,char *cmd,IMAPARG *args[]);
580 IMAPPARSEDREPLY *imap_sout (MAILSTREAM *stream,char *tag,char *base,char **s);
581 long imap_soutr (MAILSTREAM *stream,char *string);
582 IMAPPARSEDREPLY *imap_send_astring (MAILSTREAM *stream,char *tag,char **s,
583 SIZEDTEXT *as,long wildok,char *limit);
584 +IMAPPARSEDREPLY *imap_send_qstring (MAILSTREAM *stream,char *tag,char **s,
585 + SIZEDTEXT *as,char *limit);
586 IMAPPARSEDREPLY *imap_send_literal (MAILSTREAM *stream,char *tag,char **s,
587 STRING *st);
588 IMAPPARSEDREPLY *imap_send_spgm (MAILSTREAM *stream,char *tag,char *base,
589 @@ -2679,6 +2683,84 @@ long imap_getacl (MAILSTREAM *stream,cha
590 args[0] = &ambx; args[1] = NIL;
591 return imap_acl_work (stream,"GETACL",args);
592 }
593 +
594 +/* IMAP set annotation
595 + * Accepts: mail stream
596 + * annotation struct
597 + * Returns: T on success, NIL on failure
598 + */
599 +
600 +long imap_setannotation (MAILSTREAM *stream,ANNOTATION *annotation)
601 +{
602 + IMAPARG *args[4],ambx,apth,aval;
603 + long ret;
604 +
605 + ambx.type = ASTRING;
606 + ambx.text = (void *) annotation->mbox;
607 + args[0] = &ambx;
608 +
609 + apth.type = QSTRING;
610 + apth.text = (void *) annotation->entry;
611 + args[1] = &apth;
612 +
613 + STRINGLIST *st,*l;
614 + ANNOTATION_VALUES *v;
615 +
616 + l = st = mail_newstringlist();
617 + v = annotation->values;
618 + while(v){
619 + l->text.size = strlen((char *) (l->text.data = (unsigned char*)cpystr(v->attr)));
620 + l->next = mail_newstringlist();
621 + l = l->next;
622 + l->text.size = strlen((char *) (l->text.data = (unsigned char*)cpystr(v->value)));
623 + if(v->next){
624 + l->next = mail_newstringlist();
625 + l = l->next;
626 + }
627 + v = v->next;
628 + }
629 +
630 + aval.type = QLIST;
631 + aval.text = (void *)st;
632 + args[2] = &aval;
633 + args[3] = NIL;
634 +
635 + ret = imap_annotation_work(stream, "SETANNOTATION",args);
636 + mail_free_stringlist(&st);
637 + return ret;
638 +}
639 +
640 +
641 +
642 +/* IMAP get annotation
643 + * Accepts: mail stream
644 + * mailbox name
645 + * annotation entry list
646 + * annotation attribute list
647 + * Returns: T on success with data returned via callback, NIL on failure
648 + */
649 +
650 +long imap_getannotation (MAILSTREAM *stream,char *mailbox,STRINGLIST *entries, STRINGLIST *attributes)
651 +{
652 + IMAPARG *args[4],ambx,apth,aattr;
653 + long ret;
654 + ambx.type = ASTRING;
655 + ambx.text = (void*) mailbox;
656 + args[0] = &ambx;
657 +
658 +
659 + apth.type = QLIST;
660 + apth.text = (void*) entries;
661 + args[1] = &apth;
662 +
663 + aattr.type = QLIST;
664 + aattr.text = (void*) attributes;
665 + args[2] = &aattr;
666 +
667 + args[3] = NIL;
668 + ret = imap_annotation_work(stream, "GETANNOTATION",args);
669 + return ret;
670 +}
671
672 /* IMAP list rights
673 * Accepts: mail stream
674 @@ -2731,6 +2813,16 @@ long imap_acl_work (MAILSTREAM *stream,c
675 else mm_log ("ACL not available on this IMAP server",ERROR);
676 return ret;
677 }
678 + long imap_annotation_work(MAILSTREAM *stream, char *command,IMAPARG *args[])
679 +{
680 + long ret = NIL;
681 + IMAPPARSEDREPLY *reply;
682 + if (imap_OK (stream,reply = imap_send (stream,command,args)))
683 + ret = LONGT;
684 + else mm_log (reply->text,ERROR);
685 + return ret;
686 +}
687 +
688
689 /* IMAP set quota
690 * Accepts: mail stream
691 @@ -2863,6 +2955,11 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
692 if (reply = imap_send_astring (stream,tag,&s,&st,NIL,CMDBASE+MAXCOMMAND))
693 return reply;
694 break;
695 + case QSTRING: /* atom or string, must be literal? */
696 + st.size = strlen ((char *) (st.data = (unsigned char *) arg->text));
697 + if (reply = imap_send_qstring (stream,tag,&s,&st,CMDBASE+MAXCOMMAND))
698 + return reply;
699 + break;
700 case LITERAL: /* literal, as a stringstruct */
701 if (reply = imap_send_literal (stream,tag,&s,arg->text)) return reply;
702 break;
703 @@ -2873,6 +2970,18 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
704 do { /* for each list item */
705 *s++ = c; /* write prefix character */
706 if (reply = imap_send_astring (stream,tag,&s,&list->text,NIL,
707 + CMDBASE+MAXCOMMAND)) return reply;
708 + c = ' '; /* prefix character for subsequent strings */
709 + }
710 + while (list = list->next);
711 + *s++ = ')'; /* close list */
712 + break;
713 + case QLIST: /* list of strings */
714 + list = (STRINGLIST *) arg->text;
715 + c = '('; /* open paren */
716 + do { /* for each list item */
717 + *s++ = c; /* write prefix character */
718 + if (reply = imap_send_qstring (stream,tag,&s,&list->text,
719 CMDBASE+MAXCOMMAND)) return reply;
720 c = ' '; /* prefix character for subsequent strings */
721 }
722 @@ -3045,6 +3154,32 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *
723 reply = imap_sout (stream,tag,CMDBASE,&s);
724 mail_unlock (stream); /* unlock stream */
725 return reply;
726 +}
727 +
728 +/* IMAP send quoted-string
729 + * Accepts: MAIL stream
730 + * reply tag
731 + * pointer to current position pointer of output bigbuf
732 + * atom-string to output
733 + * maximum to write as atom or qstring
734 + * Returns: error reply or NIL if success
735 + */
736 +
737 +IMAPPARSEDREPLY *imap_send_qstring (MAILSTREAM *stream,char *tag,char **s,
738 + SIZEDTEXT *as,char *limit)
739 +{
740 + unsigned long j;
741 + char c;
742 + STRING st;
743 + /* in case needed */
744 + INIT (&st,mail_string,(void *) as->data,as->size);
745 + /* always write literal if no space */
746 + if ((*s + as->size) > limit) return imap_send_literal (stream,tag,s,&st);
747 +
748 + *(*s)++ = '"'; /* write open quote */
749 + for (j = 0; j < as->size; j++) *(*s)++ = as->data[j];
750 + *(*s)++ = '"'; /* write close quote */
751 + return NIL;
752 }
753
754 /* IMAP send atom-string
755 @@ -3948,6 +4083,50 @@ void imap_parse_unsolicited (MAILSTREAM
756 }
757 }
758
759 + else if (!strcmp (reply->key,"ANNOTATION") && (s = reply->text)){
760 + char * mbox;
761 + /* response looks like ANNOTATION "mailbox" "entry" ("attr" "value" ["attr" "value"]) ["entry" ("attr "value" ["attr" "value"] )]*/
762 + getannotation_t an = (getannotation_t) mail_parameters (NIL,GET_ANNOTATION,NIL);
763 +
764 + mbox = imap_parse_astring (stream, &s, reply,NIL);
765 +
766 + while(*s){
767 + ANNOTATION * al = mail_newannotation();
768 + al->mbox = cpystr(mbox);
769 + t = imap_parse_astring (stream, &s, reply,NIL);
770 + al->entry = t;
771 + STRINGLIST *strlist;
772 + if (s){while (*s == ' ')s++;}
773 +
774 + strlist = imap_parse_stringlist(stream, &s,reply);
775 +
776 + ANNOTATION_VALUES *vlIter, *vlBegin;
777 + vlIter = vlBegin = NIL;
778 + if (strlist) {
779 + while(strlist){
780 + if(vlIter){
781 + vlIter->next = mail_newannotationvalue();
782 + vlIter = vlIter->next;
783 + }else{
784 + vlIter = mail_newannotationvalue();
785 + vlBegin = vlIter;
786 + }
787 + if ( strlist->text.size )
788 + vlIter->attr = cpystr (strlist->text.data);
789 + strlist = strlist->next;
790 + if(!strlist) continue;
791 + if ( strlist->text.size )
792 + vlIter->value = cpystr (strlist->text.data);
793 + strlist = strlist->next;
794 + }
795 + }
796 + al->values = vlBegin;
797 + if (an)
798 + (*an) (stream,al);
799 + mail_free_annotation(&al);
800 + }
801 + fs_give ((void **)&mbox);
802 + }
803 else if (!strcmp (reply->key,"ACL") && (s = reply->text) &&
804 (t = imap_parse_astring (stream,&s,reply,NIL))) {
805 getacl_t ar = (getacl_t) mail_parameters (NIL,GET_ACL,NIL);
806 diff -r b9fd2c61d881 src/c-client/imap4r1.h
807 --- a/src/c-client/imap4r1.h Sat Sep 29 08:56:35 2007 +0200
808 +++ b/src/c-client/imap4r1.h Sat Sep 29 10:40:13 2007 +0200
809 @@ -232,3 +232,5 @@ long imap_setquota (MAILSTREAM *stream,c
810 long imap_setquota (MAILSTREAM *stream,char *qroot,STRINGLIST *limits);
811 long imap_getquota (MAILSTREAM *stream,char *qroot);
812 long imap_getquotaroot (MAILSTREAM *stream,char *mailbox);
813 +long imap_getannotation (MAILSTREAM *stream,char *mailbox,STRINGLIST *entries,STRINGLIST *attributes);
814 +long imap_setannotation (MAILSTREAM *stream,ANNOTATION *annotation);
815 diff -r b9fd2c61d881 src/c-client/mail.c
816 --- a/src/c-client/mail.c Sat Sep 29 08:56:35 2007 +0200
817 +++ b/src/c-client/mail.c Sat Sep 29 10:40:13 2007 +0200
818 @@ -60,6 +60,7 @@ static newsrcquery_t mailnewsrcquery = N
819 static newsrcquery_t mailnewsrcquery = NIL;
820 /* ACL results callback */
821 static getacl_t mailaclresults = NIL;
822 +static getannotation_t mailannotationresults = NIL;
823 /* list rights results callback */
824 static listrights_t maillistrightsresults = NIL;
825 /* my rights results callback */
826 @@ -516,6 +517,11 @@ void *mail_parameters (MAILSTREAM *strea
827 ret = (void *) (debugsensitive ? VOIDT : NIL);
828 break;
829
830 + case SET_ANNOTATION:
831 + mailannotationresults = (getannotation_t) value;
832 + case GET_ANNOTATION:
833 + ret = (void *) mailannotationresults;
834 + break;
835 case SET_ACL:
836 mailaclresults = (getacl_t) value;
837 case GET_ACL:
838 @@ -5489,7 +5495,15 @@ ACLLIST *mail_newacllist (void)
839 return (ACLLIST *) memset (fs_get (sizeof (ACLLIST)),0,sizeof (ACLLIST));
840 }
841
842 -
843 +ANNOTATION *mail_newannotation (void)
844 +{
845 + return (ANNOTATION *) memset (fs_get (sizeof (ANNOTATION)),0,sizeof(ANNOTATION));
846 +}
847 +
848 +ANNOTATION_VALUES *mail_newannotationvalue (void)
849 +{
850 + return (ANNOTATION_VALUES *) memset (fs_get (sizeof (ANNOTATION_VALUES)),0,sizeof(ANNOTATION_VALUES));
851 +}
852 /* Mail instantiate new quotalist
853 * Returns: new quotalist
854 */
855 @@ -5812,6 +5826,25 @@ void mail_free_acllist (ACLLIST **al)
856 }
857 }
858
859 +static void mail_free_annotation_values(ANNOTATION_VALUES **val)
860 +{
861 + if (*val) {
862 + if ((*val)->attr) fs_give ((void**) &(*val)->attr);
863 + if ((*val)->value) fs_give ((void**) &(*val)->value);
864 + mail_free_annotation_values (&(*val)->next);
865 + fs_give ((void **) val);
866 + }
867 +}
868 +void mail_free_annotation(ANNOTATION **al)
869 +{
870 + if (*al) {
871 + if((*al)->mbox) fs_give ((void**) &(*al)->mbox);
872 + if((*al)->entry) fs_give ((void**) &(*al)->entry);
873 + if((*al)->values)
874 + mail_free_annotation_values(&(*al)->values);
875 + fs_give ((void **) al);
876 + }
877 +}
878
879 /* Mail garbage collect quotalist
880 * Accepts: pointer to quotalist pointer
881 diff -r b9fd2c61d881 src/c-client/mail.h
882 --- a/src/c-client/mail.h Sat Sep 29 08:56:35 2007 +0200
883 +++ b/src/c-client/mail.h Sat Sep 29 10:40:13 2007 +0200
884 @@ -311,6 +311,8 @@
885 #define SET_SNARFPRESERVE (long) 567
886 #define GET_INBOXPATH (long) 568
887 #define SET_INBOXPATH (long) 569
888 +#define GET_ANNOTATION (long) 570
889 +#define SET_ANNOTATION (long) 571
890
891 /* Driver flags */
892
893 @@ -976,6 +978,24 @@ ACLLIST {
894 char *identifier; /* authentication identifier */
895 char *rights; /* access rights */
896 ACLLIST *next;
897 +};
898 +
899 +/* ANNOTATION Response */
900 +
901 +#define ANNOTATION_VALUES struct annotation_value_list
902 +
903 +ANNOTATION_VALUES {
904 + char *attr;
905 + char *value;
906 + ANNOTATION_VALUES *next;
907 +};
908 +
909 +#define ANNOTATION struct annotation
910 +
911 +ANNOTATION {
912 + char *mbox;
913 + char *entry;
914 + ANNOTATION_VALUES * values;
915 };
916
917 /* Quota resource list */
918 @@ -1262,6 +1282,7 @@ typedef long (*sslcertificatequery_t) (c
919 typedef long (*sslcertificatequery_t) (char *reason,char *host,char *cert);
920 typedef void (*sslfailure_t) (char *host,char *reason,unsigned long flags);
921 typedef void (*logouthook_t) (void *data);
922 +typedef void (*getannotation_t) (MAILSTREAM *stream,ANNOTATION* annot);
923
924 /* Globals */
925
926 @@ -1671,7 +1692,10 @@ SORTPGM *mail_newsortpgm (void);
927 SORTPGM *mail_newsortpgm (void);
928 THREADNODE *mail_newthreadnode (SORTCACHE *sc);
929 ACLLIST *mail_newacllist (void);
930 +ANNOTATION* mail_newannotation(void);
931 +ANNOTATION_VALUES* mail_newannotationvalue(void);
932 QUOTALIST *mail_newquotalist (void);
933 +void mail_free_annotation(ANNOTATION **a);
934 void mail_free_body (BODY **body);
935 void mail_free_body_data (BODY *body);
936 void mail_free_body_parameter (PARAMETER **parameter);
937 diff -r b9fd2c61d881 src/mtest/mtest.c
938 --- a/src/mtest/mtest.c Sat Sep 29 08:56:35 2007 +0200
939 +++ b/src/mtest/mtest.c Sat Sep 29 10:40:13 2007 +0200
940 @@ -137,6 +137,8 @@ int main ()
941 #endif
942 return NIL;
943 }
944 +
945 +void mm_annotation (MAILSTREAM *stream, ANNOTATION *a);
946
947 /* MM command loop
948 * Accepts: MAIL stream
949 @@ -187,6 +189,28 @@ void mm (MAILSTREAM *stream,long debug)
950 mail_setflag (stream,arg,"\\DELETED");
951 else puts ("?Bad message number");
952 break;
953 + case 'A':
954 + {
955 + char parms[MAILTMPLEN];
956 + prompt("Annotation: ",parms);
957 + if (parms) {
958 + mail_parameters(stream,SET_ANNOTATION,mm_annotation);
959 + STRINGLIST *entries = mail_newstringlist();
960 + STRINGLIST *cur = entries;
961 + cur->text.size = strlen((char *) (cur->text.data = (unsigned char*)cpystr (parms)));
962 + cur->next = NIL;
963 +
964 + STRINGLIST *attributes = mail_newstringlist();
965 + cur = attributes;
966 + cur->text.size = strlen((char *) (cur->text.data = (unsigned char*)cpystr ("*")));
967 + cur->next = NIL;
968 +
969 + imap_getannotation(stream,"INBOX",entries,attributes);
970 + mail_free_stringlist(&entries);
971 + mail_free_stringlist(&attributes);
972 + }
973 + }
974 + break;
975 case 'E': /* Expunge command */
976 mail_expunge (stream);
977 last = 0;
978 @@ -339,7 +363,7 @@ void mm (MAILSTREAM *stream,long debug)
979 case '?': /* ? command */
980 puts ("Body, Check, Delete, Expunge, Find, GC, Headers, Literal,");
981 puts (" MailboxStatus, New Mailbox, Overview, Ping, Quit, Send, Type,");
982 - puts ("Undelete, Xit, +, -, or <RETURN> for next message");
983 + puts ("Undelete, Xit,Annotation, +, -, or <RETURN> for next message");
984 break;
985 default: /* bogus command */
986 printf ("?Unrecognized command: %s\n",cmd);
987 @@ -587,6 +611,18 @@ void prompt (char *msg,char *txt)
988
989 /* Interfaces to C-client */
990
991 +void mm_annotation (MAILSTREAM *stream, ANNOTATION *a)
992 +{
993 + if(a){
994 + fprintf(stderr,"mailbox: %s\nentry: %s\n",a->mbox,a->entry);
995 + ANNOTATION_VALUES * v = a->values;
996 + while(v){
997 + fprintf(stderr,"attr: %s, value: %s\n",v->attr,v->value);
998 + v = v->next;
999 + }
1000 + }
1001 +}
1002 +
1003
1004 void mm_searched (MAILSTREAM *stream,unsigned long number)
1005 {
1006
1007
1008
1009 1.1 net-libs/c-client/files/c-client-2006k_GENTOO_amd64-so-fix.patch
1010
1011 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_GENTOO_amd64-so-fix.patch?rev=1.1&view=markup
1012 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/c-client/files/c-client-2006k_GENTOO_amd64-so-fix.patch?rev=1.1&content-type=text/plain
1013
1014 Index: c-client-2006k_GENTOO_amd64-so-fix.patch
1015 ===================================================================
1016 diff -r 7c3e6c6ef2ba src/osdep/unix/Makefile
1017 --- a/src/osdep/unix/Makefile Thu Feb 21 18:51:32 2008 +0100
1018 +++ b/src/osdep/unix/Makefile Thu Feb 21 18:53:15 2008 +0100
1019 @@ -962,6 +962,9 @@ onceenv:
1020 -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" > OSCFLAGS
1021 echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
1022 echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
1023 + echo "`$(CAT) CCTYPE` `$(CAT) CFLAGS` `$(CAT) OSFLAGS` -shared \
1024 + -Wl,-soname,libc-client.so.1 -o libc-client.so.1.0.0 $(BINARIES)" \
1025 + >> ARCHIVE
1026 echo $(OS) > OSTYPE
1027 ./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
1028 ./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
1029
1030
1031
1032 --
1033 gentoo-commits@l.g.o mailing list