Back to index

lightning-sunbird  0.9+nobinonly
Functions
findobj.c File Reference
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "ical.h"
#include "icalss.h"

Go to the source code of this file.

Functions

void usage (char *arg0)
int main (int c, char *argv[])

Function Documentation

int main ( int  c,
char *  argv[] 
)

Definition at line 41 of file findobj.c.

                             {

    icalcalendar *cal;
    icaldirset *booked;
    icalcomponent *itr;

    if(c < 2 || c > 3){
       usage(argv[0]);
       exit(1);
    }

    cal = icalcalendar_new(argv[1]);

    if(cal == 0){
       fprintf(stderr,"%s: error in opening calendar \"%s\": %s. errno is \"%s\"\n",
              argv[0],argv[1],icalerror_strerror(icalerrno),
              strerror(errno));
    }

    booked = icalcalendar_get_booked(cal);

    itr = icaldirset_fetch(booked,argv[2]);


    if(itr != 0){
       printf("%s",icalcomponent_as_ical_string(itr));
    }

    return 0;
}

Here is the call graph for this function:

void usage ( char *  arg0)

Definition at line 37 of file findobj.c.

                       {
    printf("usage: %s calendar-dir uid\n",arg0);
}