2 ======================================================================
4 CREATOR: eric 11 February 2000
6 $Id: findobj.c,v 1.3 2008-01-02 20:07:45 dothebart Exp $
9 (C) COPYRIGHT 2000 Eric Busboom
10 http://www.softwarestudio.org
12 The contents of this file are subject to the Mozilla Public License
13 Version 1.0 (the "License"); you may not use this file except in
14 compliance with the License. You may obtain a copy of the License at
15 http://www.mozilla.org/MPL/
17 Software distributed under the License is distributed on an "AS IS"
18 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19 the License for the specific language governing rights and
20 limitations under the License.
22 The Original Code is eric. The Initial Developer of the Original
26 ======================================================================*/
28 #include <stdio.h> /* for printf */
30 #include <string.h> /* For strerror */
32 #include <libical/ical.h>
33 #include <libicalss/icalss.h>
35 /* This program finds an object stored in a calendar */
37 void usage(char* arg0) {
38 printf("usage: %s calendar-dir uid\n",arg0);
41 int main(int c, char *argv[]){
52 cal = icalcalendar_new(argv[1]);
55 fprintf(stderr,"%s: error in opening calendar \"%s\": %s. errno is \"%s\"\n",
56 argv[0],argv[1],icalerror_strerror(icalerrno),
60 booked = icalcalendar_get_booked(cal);
62 itr = icaldirset_fetch(booked,argv[2]);
66 printf("%s",icalcomponent_as_ical_string(itr));