aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorCraig Small <csmall@src.gnome.org>1998-01-13 12:47:15 +0800
committerCraig Small <csmall@src.gnome.org>1998-01-13 12:47:15 +0800
commit50024475d9f65308fcff65d5c68c3bdc95ef4dd1 (patch)
treed855433cd1f12dec1357f7e45895e3c44f5c56ec /calendar
parent2485eae90d07f5d649729e6bd02d15ae1b38006d (diff)
downloadgsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar.gz
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar.bz2
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar.lz
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar.xz
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.tar.zst
gsoc2013-evolution-50024475d9f65308fcff65d5c68c3bdc95ef4dd1.zip
updated lexerGNOME_0_12
svn path=/trunk/; revision=3
Diffstat (limited to 'calendar')
-rw-r--r--calendar/lexer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/calendar/lexer.c b/calendar/lexer.c
index 264808a75d..98e4212f06 100644
--- a/calendar/lexer.c
+++ b/calendar/lexer.c
@@ -3,12 +3,14 @@
*/
#include <stdio.h>
#include <glib.h>
+#include "cal_struct.h"
#define opener "["
#define closer "]"
#define VersionMajor 2
+GList *eventlist;
int skip_chars(FILE *fp, char *terminator)
{
@@ -121,13 +123,16 @@ int parse_appointment(FILE *fp, char keyword[])
{
char buf[50];
int x,y,c;
+ struct event *ptr;
+ ptr = (struct event*)alloc(sizeof(struct event));
if (strcmp(keyword, "Start") == 0) {
if ( ! skip_whitespace(fp) || ! get_number(fp, &x) ) {
g_error("Unable to get start time");
return FALSE;
}
- g_print ("Appointment start = %d\n", x);
+ g_print ("Appointment start = %02d:%02d\n", x/60, x % 60);
+ sprintf(ptr->start.time, "%d", x);
return TRUE;
}
@@ -137,6 +142,7 @@ int parse_appointment(FILE *fp, char keyword[])
return FALSE;
}
g_print ("Appointment length = %d\n", x);
+ sprintf(ptr->end.time, "%d", x);
return TRUE;
}
@@ -383,6 +389,7 @@ void parse_ical_file(char const *file)
int main(int argc, char *argv[])
{
+ eventlist = g_list_alloc();
parse_ical_file("/home/csmall/.calendar");
return 0;
}