libical

A simple ical library.
git clone git://r-36.net/libical
Log | Files | Refs | README | LICENSE

icaltest.c (517B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #include <unistd.h>
      7 #include <stdio.h>
      8 #include <stdlib.h>
      9 #include <sys/types.h>
     10 #include <sys/stat.h>
     11 #include <fcntl.h>
     12 
     13 #include "ind.h"
     14 #include "ical.h"
     15 
     16 int
     17 main(int argc, char *argv[])
     18 {
     19 	int fd;
     20 	vitems_t *items;
     21 
     22 	if (argc < 2) {
     23 		fprintf(stderr, "usage: %s file.ics\n", argv[0]);
     24 		return 1;
     25 	}
     26 
     27 	fd = open(argv[1], O_RDONLY);
     28 	items = vitems_read(fd);
     29 	if (items == NULL)
     30 		die("vitems_read failed\n");
     31 
     32 	vitems_print(items);
     33 
     34 	vitems_free(items);
     35 
     36 	return 0;
     37 }
     38