1 /* -*- Mode: C -*- */ 2 /*====================================================================== 3 FILE: icalduration.h 4 CREATOR: eric 26 Jan 2001 5 6 7 $Id: icalduration.h,v 1.5 2008-01-15 23:17:40 dothebart Exp $ 8 $Locker: $ 9 10 (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org> 11 http://www.softwarestudio.org 12 13 This program is free software; you can redistribute it and/or modify 14 it under the terms of either: 15 16 The LGPL as published by the Free Software Foundation, version 17 2.1, available at: http://www.fsf.org/copyleft/lesser.html 18 19 Or: 20 21 The Mozilla Public License Version 1.0. You may obtain a copy of 22 the License at http://www.mozilla.org/MPL/ 23 24 The Original Code is eric. The Initial Developer of the Original 25 Code is Eric Busboom 26 27 28 ======================================================================*/ 29 30 #ifndef ICALDURATION_H 31 #define ICALDURATION_H 32 33 #include "icaltime.h" 34 35 struct icaldurationtype 36 { 37 int is_neg; 38 unsigned int days; 39 unsigned int weeks; 40 unsigned int hours; 41 unsigned int minutes; 42 unsigned int seconds; 43 }; 44 45 struct icaldurationtype icaldurationtype_from_int(int t); 46 struct icaldurationtype icaldurationtype_from_string(const char*); 47 int icaldurationtype_as_int(struct icaldurationtype duration); 48 char* icaldurationtype_as_ical_string(struct icaldurationtype d); 49 char* icaldurationtype_as_ical_string_r(struct icaldurationtype d); 50 struct icaldurationtype icaldurationtype_null_duration(void); 51 struct icaldurationtype icaldurationtype_bad_duration(void); 52 int icaldurationtype_is_null_duration(struct icaldurationtype d); 53 int icaldurationtype_is_bad_duration(struct icaldurationtype d); 54 55 struct icaltimetype icaltime_add(struct icaltimetype t, 56 struct icaldurationtype d); 57 58 struct icaldurationtype icaltime_subtract(struct icaltimetype t1, 59 struct icaltimetype t2); 60 61 #endif /* !ICALDURATION_H */ 62 63 64 65