[libpst-commits] r75 - trunk

Chris Halls halls at alioth.debian.org
Fri Jan 5 17:29:05 CET 2007


Author: halls
Date: 2007-01-05 17:29:04 +0100 (Fri, 05 Jan 2007)
New Revision: 75

Modified:
   trunk/ChangeLog
   trunk/libpst.c
   trunk/libpst.h
Log:
Add new fields to appointment for recurring events (SourceForge #304198)


Index: trunk/libpst.h
===================================================================
--- trunk/libpst.h	(revision 74)
+++ trunk/libpst.h	(revision 75)
@@ -114,6 +114,13 @@
 #define PST_APP_LABEL_ANNIVERSARY 9 // Anniversary
 #define PST_APP_LABEL_PHONE_CALL  10// Phone Call
 
+// define type of reccuring event
+#define PST_APP_RECUR_NONE        0
+#define PST_APP_RECUR_DAILY       1
+#define PST_APP_RECUR_WEEKLY      2
+#define PST_APP_RECUR_MONTHLY     3
+#define PST_APP_RECUR_YEARLY      4
+
 typedef struct _pst_misc_6_struct {
   int32_t i1;
   int32_t i2;
@@ -370,12 +377,19 @@
 typedef struct _pst_item_appointment {
   FILETIME *end;
   char *location;
+  int32_t alarm;
   FILETIME *reminder;
+  int32_t alarm_minutes;
+  char *alarm_filename;
   FILETIME *start;
   char *timezonestring;
   int32_t showas;
   int32_t label;
   int32_t all_day;
+  char *recurrence;
+  int32_t recurrence_type;
+  FILETIME *recurrence_start;
+  FILETIME *recurrence_end;
 } pst_item_appointment;
 
 typedef struct _pst_item {
Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	(revision 74)
+++ trunk/ChangeLog	(revision 75)
@@ -1,10 +1,13 @@
 LibPST svn snapshot
 ===============================
 
+    * Add new fields to appointment for recurring events
+	  (SourceForge #304198)
 	* Map IPM.Task items to PST_TYPE_TASK.
 	* lspst: Add usage mesage and option parsing using getopt
 	  (SourceForge #304199)
     * lspst: Fix invalid free calls
+
 --
 
 LibPST 0.5.2 (29 December 2006)
Index: trunk/libpst.c
===================================================================
--- trunk/libpst.c	(revision 74)
+++ trunk/libpst.c	(revision 75)
@@ -3132,6 +3132,18 @@
 	LIST_COPY(item->appointment->location, (char*));
 	DEBUG_EMAIL(("%s\n", item->appointment->location));
 	break;
+      case 0x820d: // Appointment start
+	DEBUG_EMAIL(("Appointment Date Start - "));
+	MALLOC_APPOINTMENT(item);
+	LIST_COPY(item->appointment->start, (FILETIME*));
+	DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->start)));
+	break;
+      case 0x820e: // Appointment end
+	DEBUG_EMAIL(("Appointment Date End - "));
+	MALLOC_APPOINTMENT(item);
+	LIST_COPY(item->appointment->end, (FILETIME*));
+	DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->end)));
+	break;
       case 0x8214: // Label for an appointment
 	DEBUG_EMAIL(("Label for appointment - "));
 	MALLOC_APPOINTMENT(item);
@@ -3173,32 +3185,84 @@
 	  item->appointment->all_day = 0;
 	}
 	break;
+      case 0x8231: // Recurrence type
+	// 1: Daily
+	// 2: Weekly
+	// 3: Monthly
+	// 4: Yearly
+	DEBUG_EMAIL(("Appointment reccurs - "));
+	MALLOC_APPOINTMENT(item);
+	memcpy(&(item->appointment->recurrence_type), list->items[x]->data, sizeof(item->appointment->recurrence_type));
+	LE32_CPU(item->appointment->recurrence_type);
+	switch (item->appointment->recurrence_type) {
+		case PST_APP_RECUR_DAILY:
+			DEBUG_EMAIL(("Daily\n")); break;
+		case PST_APP_RECUR_WEEKLY:
+			DEBUG_EMAIL(("Weekly\n")); break;
+		case PST_APP_RECUR_MONTHLY:
+			DEBUG_EMAIL(("Monthly\n")); break;
+		case PST_APP_RECUR_YEARLY:
+			DEBUG_EMAIL(("Yearly\n")); break;
+		default:
+			DEBUG_EMAIL(("Unknown Value: %d\n", item->appointment->recurrence_type)); break;
+	}
+	break;
+      case 0x8232: // Recurrence description
+	DEBUG_EMAIL(("Appointment recurrence description - "));
+	MALLOC_APPOINTMENT(item);
+	LIST_COPY(item->appointment->recurrence, (char*));
+	DEBUG_EMAIL(("%s\n", item->appointment->recurrence));
+	break;
       case 0x8234: // TimeZone as String
 	DEBUG_EMAIL(("TimeZone of times - "));
 	MALLOC_APPOINTMENT(item);
 	LIST_COPY(item->appointment->timezonestring, (char*));
 	DEBUG_EMAIL(("%s\n", item->appointment->timezonestring));
 	break;
-      case 0x8235: // Appointment start time
-	DEBUG_EMAIL(("Appointment Start Time - "));
+      case 0x8235: // Recurrence start date
+	DEBUG_EMAIL(("Recurrence Start Date - "));
 	MALLOC_APPOINTMENT(item);
-	LIST_COPY(item->appointment->start, (FILETIME*));
-	DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)item->appointment->start)));
+	LIST_COPY(item->appointment->recurrence_start, (FILETIME*));
+	DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->recurrence_start)));
 	break;
-      case 0x8236: // Appointment end time
-	DEBUG_EMAIL(("Appointment End Time - "));
+      case 0x8236: // Recurrence end date
+	DEBUG_EMAIL(("Recurrence End Date - "));
 	MALLOC_APPOINTMENT(item);
-	LIST_COPY(item->appointment->end, (FILETIME*));
-	DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)item->appointment->start)));
+	LIST_COPY(item->appointment->recurrence_end, (FILETIME*));
+	DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->recurrence_end)));
 	break;
-      case 0x8516: // Journal time start
-	DEBUG_EMAIL(("Duplicate Time Start - "));
+      case 0x8501: // Reminder minutes before appointment start
+	DEBUG_EMAIL(("Alarm minutes - "));
+	MALLOC_APPOINTMENT(item);
+	memcpy(&(item->appointment->alarm_minutes), list->items[x]->data, sizeof(item->appointment->alarm_minutes));
+	LE32_CPU(item->appointment->alarm_minutes);
+	DEBUG_EMAIL(("%i\n", item->appointment->alarm_minutes));
+	break;
+      case 0x8503: // Reminder alarm
+	DEBUG_EMAIL(("Reminder alarm - "));
+	MALLOC_APPOINTMENT(item);
+	if (*(int16_t*)list->items[x]->data != 0) {
+	  DEBUG_EMAIL(("True\n"));
+	  item->appointment->alarm = 1;
+	} else {
+	  DEBUG_EMAIL(("False\n"));
+	  item->appointment->alarm = 0;
+	}
+	break;
+      case 0x8516:
+	DEBUG_EMAIL(("Appointment Start Date 3 - "));
 	DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data)));
 	break;
-      case 0x8517: // Journal time end
-	DEBUG_EMAIL(("Duplicate Time End - "));
+      case 0x8517:
+	DEBUG_EMAIL(("Appointment End Date 3 - "));
 	DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data)));
 	break;
+      case 0x851f: // Play reminder sound filename
+	DEBUG_EMAIL(("Appointment reminder sound filename - "));
+	MALLOC_APPOINTMENT(item);
+	LIST_COPY(item->appointment->alarm_filename, (char*));
+	DEBUG_EMAIL(("%s\n", item->appointment->alarm_filename));
+	break;
       case 0x8530: // Followup
 	DEBUG_EMAIL(("Followup String - "));
 	MALLOC_CONTACT(item);
@@ -3681,9 +3745,13 @@
     if (item->appointment) {
       SAFE_FREE(item->appointment->location);
       SAFE_FREE(item->appointment->reminder);
+      SAFE_FREE(item->appointment->alarm_filename);
       SAFE_FREE(item->appointment->start);
       SAFE_FREE(item->appointment->end);
       SAFE_FREE(item->appointment->timezonestring);
+      SAFE_FREE(item->appointment->recurrence);
+      SAFE_FREE(item->appointment->recurrence_start);
+      SAFE_FREE(item->appointment->recurrence_end);
       free(item->appointment);
     }
     SAFE_FREE(item->ascii_type);



More information about the libpst-commits mailing list