Back to index

lightning-sunbird  0.9+nobinonly
testvcal.c
Go to the documentation of this file.
00001 /* -*- Mode: C -*-
00002   ======================================================================
00003   FILE: vcal.c
00004   CREATOR: eric 26 May 2000
00005   
00006   $Id: testvcal.c,v 1.2 2001/04/02 17:16:47 ebusboom Exp $
00007   $Locker:  $
00008     
00009  (C) COPYRIGHT 2000 Eric Busboom
00010  http://www.softwarestudio.org
00011 
00012  The contents of this file are subject to the Mozilla Public License
00013  Version 1.0 (the "License"); you may not use this file except in
00014  compliance with the License. You may obtain a copy of the License at
00015  http://www.mozilla.org/MPL/
00016  
00017  Software distributed under the License is distributed on an "AS IS"
00018  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00019  the License for the specific language governing rights and
00020  limitations under the License.
00021  
00022  The Original Code is eric. The Initial Developer of the Original
00023  Code is Eric Busboom
00024 
00025 
00026  ======================================================================*/
00027 
00028 #include "icalvcal.h"
00029 #include <stdio.h>
00030 
00031 /* Given a vCal data file as its first argument, this program will
00032    print out an equivalent iCal component. 
00033 
00034    For instance: 
00035 
00036        ./testvcal ../../test-data/user-cal.vcf
00037 
00038 */
00039 
00040 int main(int argc, char* argv[])
00041 {
00042     VObject *vcal = 0;
00043     icalcomponent *comp;
00044     char* file;
00045 
00046     if (argc != 2){
00047         file = "../../test-data/user-cal.vcf";
00048     } else {
00049         file = argv[1];
00050     }
00051 
00052 
00053     vcal = Parse_MIME_FromFileName(file);
00054     
00055     assert(vcal != 0);
00056 
00057     comp = icalvcal_convert(vcal);
00058 
00059     printf("%s\n",icalcomponent_as_ical_string(comp));
00060     
00061     return 0;
00062 }           
00063 
00064