2 ===================================================================
3 RCS file: /cvs/gnome/evolution/acinclude.m4,v
4 retrieving revision 1.9
5 diff -u -r1.9 acinclude.m4
6 --- acinclude.m4 12 Jun 2006 12:52:02 -0000 1.9
7 +++ acinclude.m4 17 Nov 2006 07:29:48 -0000
9 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
10 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
14 +# Adds --with-pisock and determines the verion of the pisock
17 +AC_SUBST(PISOCK_CFLAGS)
18 +AC_SUBST(PISOCK_LIBS)
20 +AC_DEFUN([PILOT_LINK_HOOK],[
22 + [ --with-pisock Specify prefix for pisock files],[
23 + if test x$withval = xyes; then
24 + dnl Note that an empty true branch is not valid sh syntax.
25 + ifelse([$1], [], :, [$1])
27 + PISOCK_CFLAGS="-I$withval/include"
28 + incdir="$withval/include"
29 + PISOCK_LIBS="-L$withval/lib -lpisock -lpisync"
30 + AC_MSG_CHECKING("for existance of $withval/lib/libpisock.so")
31 + if test -r $withval/lib/libpisock.so; then
34 + AC_MSG_ERROR([Unable to find libpisock. Try http://www.pilot-link.org.])
39 + if test x$PISOCK_CFLAGS = x; then
40 + AC_CHECK_HEADER(pi-version.h, [incdir="/usr/include"], [
41 + AC_CHECK_HEADER(libpisock/pi-version.h, [PISOCK_CFLAGS="-I/usr/include/libpisock"
42 + piversion_include="libpisock/pi-version.h"
43 + incdir="/usr/include/libpisock"
45 + AC_CHECK_HEADER($prefix/include/pi-version.h, [PISOCK_CFLAGS="-I$prefix/include/libpisock"
46 + piversion_include="$prefix/include/pi-version.h"
47 + if test x$PISOCK_LIBDIR = x; then
48 + incdir="$prefix/include"
49 + PISOCK_LIBS="-L$prefix/lib -lpisock -lpisync"
51 + AC_MSG_ERROR([Unable to find pi-version.h]))
56 + if test "x$PISOCK_LIBS" = "x"; then
57 + AC_CHECK_LIB(pisock, pi_accept, [ PISOCK_LIBS="-lpisock -lpisync"],
58 + [ AC_MSG_ERROR([Unable to find libpisock. Try http://www.pilot-link.org.]) ])
61 + AC_ARG_ENABLE(pilotlinktest,
62 + [ --enable-pilotlinktest Test for correct version of pilot-link],
63 + [testplversion=$enableval],
64 + [ testplversion=yes ]
67 + if test x$piversion_include = x; then
68 + piversion_include="pi-version.h"
71 + pi_major=`cat $incdir/pi-version.h|grep '#define PILOT_LINK_VERSION'|sed 's/#define PILOT_LINK_VERSION \([[0-9]]*\)/\1/'`
72 + pi_minor=`cat $incdir/pi-version.h|grep '#define PILOT_LINK_MAJOR'|sed 's/#define PILOT_LINK_MAJOR \([[0-9]]*\)/\1/'`
73 + pi_micro=`cat $incdir/pi-version.h|grep '#define PILOT_LINK_MINOR'|sed 's/#define PILOT_LINK_MINOR \([[0-9]]*\)/\1/'`
74 + pi_patch=`cat $incdir/pi-version.h|grep '#define PILOT_LINK_PATCH'|sed 's/#define PILOT_LINK_PATCH \"\(.*\)\"/\1/'`
76 + PILOT_LINK_MAJOR="$pi_major"
77 + PILOT_LINK_MINOR="$pi_minor"
78 + PILOT_LINK_MICRO="$pi_micro"
79 + PILOT_LINK_PATCH="$pi_patch"
80 + PILOT_LINK_VERSION="$pi_major.$pi_minor.$pi_micro$pi_patch"
82 + if test x$testplversion = xyes; then
83 + AC_MSG_CHECKING([for pilot-link version >= $1])
84 + pl_ma=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
85 + pl_mi=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
86 + pl_mc=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
87 + CFLAGS_save="$CFLAGS"
88 + CFLAGS="$CFLAGS $PISOCK_CFLAGS"
91 + #include <$piversion_include>
92 + int main(int argc,char *argv[]) {
93 + if (PILOT_LINK_VERSION == $pl_ma) {
94 + if (PILOT_LINK_MAJOR == $pl_mi) {
95 + if (PILOT_LINK_MINOR >= $pl_mc) {
98 + } else if (PILOT_LINK_MAJOR > $pl_mi) {
101 + } else if (PILOT_LINK_VERSION > $pl_ma) {
107 + [AC_MSG_RESULT([yes (found $PILOT_LINK_VERSION)])],
108 + [AC_MSG_ERROR([pilot-link >= $1 required])],
109 + [AC_MSG_WARN([No action taken for crosscompile])]
111 + CFLAGS="$CFLAGS_save"
114 + unset piversion_include
125 +AC_DEFUN([PILOT_LINK_CHECK],[
126 + PILOT_LINK_HOOK($1,[],nofailure)
129 ===================================================================
130 RCS file: /cvs/gnome/evolution/configure.in,v
131 retrieving revision 1.920
132 diff -u -r1.920 configure.in
133 --- configure.in 14 Nov 2006 17:45:52 -0000 1.920
134 +++ configure.in 17 Nov 2006 07:29:48 -0000
138 AM_CONDITIONAL(ENABLE_PILOT_CONDUITS, test "x$enable_pilot_conduits" = "xyes")
139 -if test x$enable_pilot_conduits = xyes; then
141 +dnl ******************************
142 +dnl If pilot conduits are enabled, check version of pilot-link
143 +dnl ******************************
144 + if test x$enable_pilot_conduits = xyes; then
147 + PILOT_LINK_CHECK(0.11.4)
148 + AC_SUBST(PILOT_LINK_MAJOR)
149 + AC_SUBST(PILOT_LINK_MINOR)
150 + AC_SUBST(PILOT_LINK_MICRO)
151 + AC_SUBST(PILOT_LINK_PATCH)
152 + AC_SUBST(PILOT_LINK_VERSION)
154 + if test $PILOT_LINK_MINOR -ge 12; then
155 + AC_DEFINE(PILOT_LINK_0_12,,[Building against pilot-link 0.12.0 or greater])
160 Index: addressbook/conduit/address-conduit.c
161 ===================================================================
162 RCS file: /cvs/gnome/evolution/addressbook/conduit/address-conduit.c,v
163 retrieving revision 1.88
164 diff -u -r1.88 address-conduit.c
165 --- addressbook/conduit/address-conduit.c 6 Dec 2005 08:43:37 -0000 1.88
166 +++ addressbook/conduit/address-conduit.c 17 Nov 2006 07:29:48 -0000
169 static char buff[ 4096 ];
171 +#ifdef PILOT_LINK_0_12
172 + pi_buffer_t * buffer;
175 if (remote == NULL) {
176 sprintf (buff, "[NULL]");
180 memset (&addr, 0, sizeof (struct Address));
181 +#ifdef PILOT_LINK_0_12
182 + buffer = pi_buffer_new(DLP_BUF_SIZE);
183 + if(buffer == NULL){
184 + sprintf (buff, "[NULL]");
187 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
188 + sprintf (buff, "[NULL]");
191 + unpack_Address (&addr, buffer, address_v1);
192 + pi_buffer_free(buffer);
194 unpack_Address (&addr, remote->record, remote->length);
197 g_snprintf (buff, 4096, "['%s' '%s' '%s']",
198 addr.entry[entryLastname] ?
202 static char record[0xffff];
203 +#ifdef PILOT_LINK_0_12
204 + pi_buffer_t * buffer;
207 g_assert (local->addr != NULL );
210 p.secret = local->local.secret;
212 /* Generate pilot record structure */
214 +#ifdef PILOT_LINK_0_12
215 + buffer = pi_buffer_new(DLP_BUF_SIZE);
216 + if(buffer == NULL){
217 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
221 + pack_Address (local->addr, buffer, address_v1);
223 + p.record = g_new0(unsigned char, buffer->used);
224 + p.length = buffer->used;
225 + memcpy(p.record, buffer->data, buffer->used);
227 + pi_buffer_free(buffer);
230 p.length = pack_Address (local->addr, p.record, 0xffff);
236 @@ -834,16 +870,34 @@
238 if (local->local.ID != 0) {
240 - char record[0xffff];
242 +#ifdef PILOT_LINK_0_12
243 + pi_buffer_t * record;
244 + record = pi_buffer_new(DLP_BUF_SIZE);
245 + if(record == NULL){
246 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
250 + char record[0xffff];
253 if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
254 ctxt->dbi->db_handle,
255 +#ifdef PILOT_LINK_0_12
256 + local->local.ID, record,
257 + NULL, NULL, &cat) > 0) {
259 local->local.ID, &record,
260 NULL, NULL, NULL, &cat) > 0) {
262 local->local.category = cat;
263 memset (&addr, 0, sizeof (struct Address));
264 +#ifdef PILOT_LINK_0_12
265 + unpack_Address (&addr, record, address_v1);
267 unpack_Address (&addr, record, 0xffff);
269 for (i = 0; i < 5; i++) {
270 if (addr.entry[entryPhone1 + i])
271 local->addr->entry[entryPhone1 + i] =
274 free_Address (&addr);
276 +#ifdef PILOT_LINK_0_12
277 + pi_buffer_free (record);
281 local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_GIVEN_NAME));
282 @@ -1019,11 +1076,27 @@
283 EContactField next_mail, next_home, next_work, next_fax;
284 EContactField next_other, next_main, next_pager, next_mobile;
287 +#ifdef PILOT_LINK_0_12
288 + pi_buffer_t * buffer;
290 g_return_val_if_fail(remote!=NULL,NULL);
291 memset (&address, 0, sizeof (struct Address));
292 - unpack_Address (&address, remote->record, remote->length);
293 +#ifdef PILOT_LINK_0_12
294 + buffer = pi_buffer_new(DLP_BUF_SIZE);
295 + if(buffer == NULL){
296 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
300 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
301 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
304 + unpack_Address (&address, buffer, address_v1);
305 + pi_buffer_free(buffer);
307 + unpack_Address (&address, remote->record, remote->length);
309 if (in_contact == NULL)
310 contact = e_contact_new ();
312 @@ -1217,6 +1290,9 @@
315 gint num_records, add_records = 0, mod_records = 0, del_records = 0;
316 +#ifdef PILOT_LINK_0_12
317 + pi_buffer_t *buffer;
320 abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
322 @@ -1302,10 +1378,19 @@
323 gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
324 gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
326 +#ifdef PILOT_LINK_0_12
327 + buffer = pi_buffer_new(DLP_BUF_SIZE);
328 + if(buffer == NULL){
329 + return pi_set_error(dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
332 + len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
333 + DLP_BUF_SIZE, buffer);
335 buf = (unsigned char*)g_malloc (0xffff);
336 len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
337 (unsigned char *)buf, 0xffff);
341 WARN (_("Could not read pilot's Address application block"));
342 WARN ("dlp_ReadAppBlock(...) = %d", len);
343 @@ -1313,9 +1398,13 @@
344 _("Could not read pilot's Address application block"));
347 +#ifdef PILOT_LINK_0_12
348 + unpack_AddressAppInfo (&(ctxt->ai), buffer->data, len);
349 + pi_buffer_free (buffer);
351 unpack_AddressAppInfo (&(ctxt->ai), buf, len);
355 check_for_slow_setting (conduit, ctxt);
356 if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
357 || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot)
358 Index: calendar/conduits/calendar/calendar-conduit.c
359 ===================================================================
360 RCS file: /cvs/gnome/evolution/calendar/conduits/calendar/calendar-conduit.c,v
361 retrieving revision 1.132
362 diff -u -r1.132 calendar-conduit.c
363 --- calendar/conduits/calendar/calendar-conduit.c 23 Dec 2005 04:39:34 -0000 1.132
364 +++ calendar/conduits/calendar/calendar-conduit.c 17 Nov 2006 07:29:48 -0000
367 static char buff[ 4096 ];
368 struct Appointment appt;
369 +#ifdef PILOT_LINK_0_12
370 + pi_buffer_t * buffer;
373 if (remote == NULL) {
374 sprintf (buff, "[NULL]");
378 memset (&appt, 0, sizeof (struct Appointment));
379 +#ifdef PILOT_LINK_0_12
380 + buffer = pi_buffer_new(DLP_BUF_SIZE);
381 + if(buffer == NULL){
382 + sprintf (buff, "[NULL]");
385 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
386 + sprintf (buff, "[NULL]");
390 + unpack_Appointment (&appt, buffer, datebook_v1);
391 + pi_buffer_free(buffer);
393 unpack_Appointment (&appt, remote->record, remote->length);
396 g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
397 mktime (&appt.begin),
402 static char record[0xffff];
403 +#ifdef PILOT_LINK_0_12
404 + pi_buffer_t * buffer;
407 g_assert (local->comp != NULL);
408 g_assert (local->appt != NULL );
410 p.secret = local->local.secret;
412 /* Generate pilot record structure */
413 +#ifdef PILOT_LINK_0_12
414 + buffer = pi_buffer_new(DLP_BUF_SIZE);
415 + if(buffer == NULL){
416 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
420 + pack_Appointment (local->appt, buffer, datebook_v1);
421 + p.record = g_new0(unsigned char, buffer->used);
422 + p.length = buffer->used;
423 + memcpy(p.record, buffer->data, buffer->used);
425 + pi_buffer_free(buffer);
428 p.length = pack_Appointment (local->appt, p.record, 0xffff);
434 @@ -867,22 +901,44 @@
435 * we don't overwrite them
437 if (local->local.ID != 0) {
439 +#ifdef PILOT_LINK_0_12
440 + struct Appointment appt;
441 + pi_buffer_t * record;
443 + record = pi_buffer_new(DLP_BUF_SIZE);
444 + if(record == NULL){
445 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
449 struct Appointment appt;
454 if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
455 ctxt->dbi->db_handle,
456 +#ifdef PILOT_LINK_0_12
457 + local->local.ID, record,
458 + NULL, NULL, &cat) > 0) {
460 local->local.ID, &record,
461 NULL, NULL, NULL, &cat) > 0) {
463 local->local.category = cat;
464 memset (&appt, 0, sizeof (struct Appointment));
465 +#ifdef PILOT_LINK_0_12
466 + unpack_Appointment (&appt, record, datebook_v1);
468 unpack_Appointment (&appt, record, 0xffff);
470 local->appt->alarm = appt.alarm;
471 local->appt->advance = appt.advance;
472 local->appt->advanceUnits = appt.advanceUnits;
473 free_Appointment (&appt);
475 +#ifdef PILOT_LINK_0_12
476 + pi_buffer_free (record);
480 /* STOP: don't replace these with g_strdup, since free_Appointment
481 @@ -1140,12 +1196,28 @@
486 +#ifdef PILOT_LINK_0_12
487 + pi_buffer_t * buffer;
489 g_return_val_if_fail (remote != NULL, NULL);
491 +#ifdef PILOT_LINK_0_12
492 + buffer = pi_buffer_new(DLP_BUF_SIZE);
493 + if(buffer == NULL){
497 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
501 + unpack_Appointment (&appt, buffer, datebook_v1);
502 + pi_buffer_free(buffer);
505 memset (&appt, 0, sizeof (struct Appointment));
506 unpack_Appointment (&appt, remote->record, remote->length);
509 if (in_comp == NULL) {
510 comp = e_cal_component_new ();
511 e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
512 @@ -1413,7 +1485,9 @@
513 char *filename, *change_id;
514 icalcomponent *icalcomp;
515 gint num_records, add_records = 0, mod_records = 0, del_records = 0;
517 +#ifdef PILOT_LINK_0_12
518 + pi_buffer_t * buffer;
520 abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
522 LOG (g_message ( "---------------------------------------------------------\n" ));
523 @@ -1521,10 +1595,21 @@
524 gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
525 gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
527 +#ifdef PILOT_LINK_0_12
528 + buffer = pi_buffer_new(DLP_BUF_SIZE);
529 + if(buffer == NULL){
530 + pi_set_error(dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
534 + len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
538 buf = (unsigned char*)g_malloc (0xffff);
539 len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
540 (unsigned char *)buf, 0xffff);
544 WARN (_("Could not read pilot's Calendar application block"));
545 WARN ("dlp_ReadAppBlock(...) = %d", len);
546 @@ -1532,6 +1617,11 @@
547 _("Could not read pilot's Calendar application block"));
550 +#ifdef PILOT_LINK_0_12
551 + buf = g_new0 (unsigned char,buffer->used);
552 + memcpy(buf, buffer->data, buffer->used);
553 + pi_buffer_free(buffer);
555 unpack_AppointmentAppInfo (&(ctxt->ai), buf, len);
558 Index: calendar/conduits/todo/todo-conduit.c
559 ===================================================================
560 RCS file: /cvs/gnome/evolution/calendar/conduits/todo/todo-conduit.c,v
561 retrieving revision 1.98
562 diff -u -r1.98 todo-conduit.c
563 --- calendar/conduits/todo/todo-conduit.c 13 May 2006 07:58:02 -0000 1.98
564 +++ calendar/conduits/todo/todo-conduit.c 17 Nov 2006 07:29:48 -0000
565 @@ -402,15 +402,30 @@
567 static char buff[ 4096 ];
570 +#ifdef PILOT_LINK_0_12
571 + pi_buffer_t * buffer;
573 if (remote == NULL) {
574 sprintf (buff, "[NULL]");
578 memset (&todo, 0, sizeof (struct ToDo));
579 +#ifdef PILOT_LINK_0_12
580 + buffer = pi_buffer_new(DLP_BUF_SIZE);
581 + if(buffer == NULL){
582 + sprintf (buff, "[NULL]");
585 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
586 + sprintf (buff, "[NULL]");
589 + unpack_ToDo (&todo, buffer, todo_v1);
590 + pi_buffer_free(buffer);
592 unpack_ToDo (&todo, remote->record, remote->length);
595 g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s' %d]",
599 EToDoConduitContext *ctxt)
602 +#ifdef PILOT_LINK_0_12
603 + pi_buffer_t * buffer;
605 static char record[0xffff];
608 g_assert (local->comp != NULL);
609 g_assert (local->todo != NULL );
610 @@ -607,10 +626,24 @@
611 p.archived = local->local.archived;
612 p.secret = local->local.secret;
614 - /* Generate pilot record structure */
615 + /* Generate pilot record structure */
616 +#ifdef PILOT_LINK_0_12
617 + buffer = pi_buffer_new(DLP_BUF_SIZE);
618 + if(buffer == NULL){
619 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
623 + pack_ToDo (local->todo, buffer, todo_v1);
624 + p.record = g_new0(unsigned char, buffer->used);
625 + p.length = buffer->used;
626 + memcpy(p.record, buffer->data, buffer->used);
628 + pi_buffer_free(buffer);
631 p.length = pack_ToDo (local->todo, p.record, 0xffff);
637 @@ -696,15 +729,32 @@
639 /* Don't overwrite the category */
640 if (local->local.ID != 0) {
641 - char record[0xffff];
643 +#ifdef PILOT_LINK_0_12
644 + pi_buffer_t * record;
645 + record = pi_buffer_new(DLP_BUF_SIZE);
646 + if(record == NULL){
647 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
651 + char record[0xffff];
654 if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
655 ctxt->dbi->db_handle,
656 +#ifdef PILOT_LINK_0_12
657 + local->local.ID, record,
658 + NULL, NULL, &cat) > 0) {
660 local->local.ID, &record,
661 NULL, NULL, NULL, &cat) > 0) {
663 local->local.category = cat;
665 +#ifdef PILOT_LINK_0_12
666 + pi_buffer_free(record);
671 @@ -860,11 +910,28 @@
675 +#ifdef PILOT_LINK_0_12
676 + pi_buffer_t * buffer;
679 g_return_val_if_fail (remote != NULL, NULL);
681 +#ifdef PILOT_LINK_0_12
682 + buffer = pi_buffer_new(DLP_BUF_SIZE);
683 + if(buffer == NULL){
687 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
691 + unpack_ToDo (&todo, buffer, todo_v1);
692 + pi_buffer_free(buffer);
694 memset (&todo, 0, sizeof (struct ToDo));
695 unpack_ToDo (&todo, remote->record, remote->length);
698 utc_zone = icaltimezone_get_utc_timezone ();
699 now = icaltime_from_timet_with_zone (time (NULL), FALSE,
700 @@ -1018,6 +1085,9 @@
701 char *filename, *change_id;
702 icalcomponent *icalcomp;
703 gint num_records, add_records = 0, mod_records = 0, del_records = 0;
704 +#ifdef PILOT_LINK_0_12
705 + pi_buffer_t * buffer;
708 abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
710 @@ -1104,10 +1174,20 @@
711 g_message("num_records: %d\nadd_records: %d\nmod_records: %d\ndel_records: %d\n",
712 num_records, add_records, mod_records, del_records);
714 +#ifdef PILOT_LINK_0_12
715 + buffer = pi_buffer_new(DLP_BUF_SIZE);
716 + if(buffer == NULL){
717 + pi_set_error(dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
720 + len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
724 buf = (unsigned char*)g_malloc (0xffff);
725 len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
726 (unsigned char *)buf, 0xffff);
730 WARN (_("Could not read pilot's ToDo application block"));
731 WARN ("dlp_ReadAppBlock(...) = %d", len);
732 @@ -1115,6 +1195,12 @@
733 _("Could not read pilot's ToDo application block"));
737 +#ifdef PILOT_LINK_0_12
738 + buf = g_new0 (unsigned char,buffer->used);
739 + memcpy(buf, buffer->data,buffer->used);
740 + pi_buffer_free(buffer);
742 unpack_ToDoAppInfo (&(ctxt->ai), buf, len);
745 Index: calendar/conduits/memo/memo-conduit.c
746 ===================================================================
747 RCS file: /cvs/gnome/evolution/calendar/conduits/memo/memo-conduit.c,v
748 retrieving revision 1.1
749 diff -u -r1.1 memo-conduit.c
750 --- calendar/conduits/memo/memo-conduit.c 19 Oct 2005 11:39:35 -0000 1.1
751 +++ calendar/conduits/memo/memo-conduit.c 17 Nov 2006 07:29:48 -0000
754 static char buff[ 64 ];
756 +#ifdef PILOT_LINK_0_12
757 + pi_buffer_t *buffer;
760 if (remote == NULL) {
761 sprintf (buff, "[NULL]");
765 memset (&memo, 0, sizeof (struct Memo));
766 - unpack_Memo (&memo, remote->record, remote->length);
767 +#ifdef PILOT_LINK_0_12
768 + buffer = pi_buffer_new(DLP_BUF_SIZE);
769 + if(buffer == NULL){
770 + sprintf (buff, "[NULL]");
773 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
774 + sprintf (buff, "[NULL]");
777 + unpack_Memo (&memo, buffer, memo_v1);
779 + pi_buffer_free(buffer);
781 + unpack_Memo (&memo, remote->record, remote->length);
783 g_snprintf (buff, 64, "['%s']",
789 static char record[0xffff];
790 +#ifdef PILOT_LINK_0_12
791 + pi_buffer_t * buffer;
794 g_assert (local->comp != NULL);
795 g_assert (local->memo != NULL );
797 p.secret = local->local.secret;
799 /* Generate pilot record structure */
800 +#ifdef PILOT_LINK_0_12
801 + buffer = pi_buffer_new(DLP_BUF_SIZE);
802 + if(buffer == NULL){
803 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
807 + pack_Memo (local->memo, buffer, memo_v1);
808 + p.record = g_new0(unsigned char, buffer->used);
809 + p.length = buffer->used;
810 + memcpy(p.record, buffer->data, buffer->used);
812 + pi_buffer_free(buffer);
815 p.length = pack_Memo (local->memo, p.record, 0xffff);
821 @@ -568,16 +602,41 @@
823 /* Don't overwrite the category */
824 if (local->local.ID != 0) {
825 +#ifdef PILOT_LINK_0_12
827 + pi_buffer_t * record;
833 +#ifdef PILOT_LINK_0_12
834 + record = pi_buffer_new(DLP_BUF_SIZE);
835 + if(record == NULL){
836 + pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
841 LOG(fprintf(stderr, "local_record_from_comp: calling dlp_ReadRecordById\n"));
842 if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
843 ctxt->dbi->db_handle,
844 +#ifdef PILOT_LINK_0_12
845 + local->local.ID, record,
846 + NULL, NULL, &cat) > 0) {
847 + local->local.category = cat;
848 + memset (&memo, 0, sizeof (struct Memo));
849 + unpack_Memo (&memo, record, memo_v1);
850 + local->memo->text = strdup (memo.text);
853 + pi_buffer_free (record);
855 local->local.ID, &record,
856 NULL, NULL, NULL, &cat) > 0) {
857 local->local.category = cat;
861 LOG(fprintf(stderr, "local_record_from_comp: done calling dlp_ReadRecordById\n"));
864 @@ -704,11 +763,27 @@
865 char *txt, *txt2, *txt3;
869 +#ifdef PILOT_LINK_0_12
870 + pi_buffer_t * buffer;
872 g_return_val_if_fail (remote != NULL, NULL);
874 +#ifdef PILOT_LINK_0_12
875 + buffer = pi_buffer_new(DLP_BUF_SIZE);
876 + if(buffer == NULL){
880 + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){
884 + unpack_Memo (&memo, buffer, memo_v1);
885 + pi_buffer_free(buffer);
887 memset (&memo, 0, sizeof (struct Memo));
888 unpack_Memo (&memo, remote->record, remote->length);
891 utc_zone = icaltimezone_get_utc_timezone ();
892 now = icaltime_from_timet_with_zone (time (NULL), FALSE,
894 char *filename, *change_id;
895 icalcomponent *icalcomp;
896 gint num_records, add_records = 0, mod_records = 0, del_records = 0;
897 +#ifdef PILOT_LINK_0_12
898 + pi_buffer_t * buffer;
901 abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
903 @@ -929,10 +1007,21 @@
904 g_message("num_records: %d\nadd_records: %d\nmod_records: %d\ndel_records: %d\n",
905 num_records, add_records, mod_records, del_records);
907 +#ifdef PILOT_LINK_0_12
908 + buffer = pi_buffer_new(DLP_BUF_SIZE);
909 + if(buffer == NULL){
910 + pi_set_error(dbi->pilot_socket, PI_ERR_GENERIC_MEMORY);
914 + len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
918 buf = (unsigned char*)g_malloc (0xffff);
919 len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
920 (unsigned char *)buf, 0xffff);
924 WARN (_("Could not read pilot's Memo application block"));
925 WARN ("dlp_ReadAppBlock(...) = %d", len);
926 @@ -940,7 +1029,15 @@
927 _("Could not read pilot's Memo application block"));
930 +#ifdef PILOT_LINK_0_12
931 + buf = g_new0 (unsigned char,buffer->used);
932 + memcpy(buf, buffer->data, buffer->used);
933 + unpack_MemoAppInfo (&(ctxt->ai), buf, len);
934 + pi_buffer_free(buffer);
936 unpack_MemoAppInfo (&(ctxt->ai), buf, len);
941 lastDesktopUniqueID = 128;