Imported Upstream version 0.48
[platform/upstream/libical.git] / src / test / testvcal.c
1 /* -*- Mode: C -*-
2   ======================================================================
3   FILE: vcal.c
4   CREATOR: eric 26 May 2000
5   
6   $Id: testvcal.c,v 1.4 2008-01-02 20:07:46 dothebart Exp $
7   $Locker:  $
8     
9  (C) COPYRIGHT 2000 Eric Busboom
10  http://www.softwarestudio.org
11
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/
16  
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.
21  
22  The Original Code is eric. The Initial Developer of the Original
23  Code is Eric Busboom
24
25
26  ======================================================================*/
27
28 #include <libicalvcal/icalvcal.h>
29 #include <stdio.h>
30
31 /* Given a vCal data file as its first argument, this program will
32    print out an equivalent iCal component. 
33
34    For instance: 
35
36        ./testvcal ../../test-data/user-cal.vcf
37
38 */
39
40 int main(int argc, char* argv[])
41 {
42     VObject *vcal = 0;
43     icalcomponent *comp;
44     char* file;
45
46     if (argc != 2){
47         file = "../../test-data/user-cal.vcf";
48     } else {
49         file = argv[1];
50     }
51
52
53     vcal = Parse_MIME_FromFileName(file);
54     
55     assert(vcal != 0);
56
57     comp = icalvcal_convert(vcal);
58
59     printf("%s\n",icalcomponent_as_ical_string(comp));
60     
61     return 0;
62 }           
63
64