libical

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

ical.h (1133B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #ifndef __ICAL_H__
      7 #define __ICAL_H__
      8 
      9 typedef struct vitemprop_t vitemprop_t;
     10 struct vitemprop_t {
     11 	vitemprop_t *next;
     12 	vitemprop_t *prev;
     13 
     14 	char *name;
     15 	char *params;
     16 	char *value;
     17 };
     18 
     19 typedef struct vitem_t vitem_t;
     20 struct vitem_t {
     21 	vitem_t *next;
     22 	vitem_t *prev;
     23 
     24 	char *type;
     25 
     26 	vitemprop_t *props;
     27 	vitemprop_t *lastp;
     28 	int nprops;
     29 };
     30 
     31 typedef struct vitems_t vitems_t;
     32 struct vitems_t {
     33 	vitem_t *first;
     34 	vitem_t *last;
     35 	int nitems;
     36 
     37 	vitemprop_t *headers;
     38 	vitemprop_t *lasth;
     39 	int nheaders;
     40 };
     41 
     42 vitemprop_t *vitemprop_new(void);
     43 void vitemprop_free(vitemprop_t *prop);
     44 void vitemprop_print(vitemprop_t *prop);
     45 
     46 vitem_t *vitem_new(void);
     47 void vitem_free(vitem_t *item);
     48 void vitem_addprop(vitem_t *item, vitemprop_t *prop);
     49 void vitem_print(vitem_t *item);
     50 
     51 vitems_t *vitems_new(void);
     52 void vitems_free(vitems_t *vitems);
     53 void vitems_addhdr(vitems_t *items, vitemprop_t *hdr);
     54 void vitems_additem(vitems_t *items, vitem_t *item);
     55 void vitems_print(vitems_t *items);
     56 
     57 vitems_t *vitems_read(int fd);
     58 
     59 #define forlist(first, elem) for (elem = first;\
     60 		elem; elem = elem->next)
     61 
     62 #endif
     63