aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar.c')
-rw-r--r--calendar/gui/calendar.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index b67f875fdc..30e4e0168c 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -72,7 +72,7 @@ add_object_alarms (iCalObject *obj, time_t start, time_t end, void *closure)
#define max(a,b) ((a > b) ? a : b)
-void
+static void
ical_object_try_alarms (iCalObject *obj)
{
int ao, po, od, mo;
@@ -169,7 +169,7 @@ calendar_destroy (Calendar *cal)
g_free (cal);
}
-char *
+static char *
ice (time_t t)
{
static char buffer [100];
@@ -323,6 +323,34 @@ calendar_load (Calendar *cal, char *fname)
return NULL;
}
+/*
+ * calendar_load_from_memory:
+ * @cal: calendar on which we load the information
+ * @buffer: A buffer that contains a vCalendar file
+ *
+ * Loads the information from the vCalendar information in @buffer
+ * into the Calendar
+ */
+char *
+calendar_load_from_memory (Calendar *cal, const char *buffer)
+{
+ VObject *vcal;
+
+ g_return_val_if_fail (buffer != NULL, NULL);
+
+ cal->filename = g_strdup ("memory-based-calendar");
+ vcal = Parse_MIME (buffer, strlen (buffer));
+ if (!vcal)
+ return "Could not load the calendar";
+
+ cal->file_time = time (NULL);
+ calendar_load_from_vobject (cal, vcal);
+ cleanVObject (vcal);
+ cleanStrTbl ();
+
+ return NULL;
+}
+
static VObject *
vcalendar_create_from_calendar (Calendar *cal)
{