icalduration.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*======================================================================
  2. FILE: icalduration.h
  3. CREATOR: eric 26 Jan 2001
  4. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  5. http://www.softwarestudio.org
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of either:
  8. The LGPL as published by the Free Software Foundation, version
  9. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  10. Or:
  11. The Mozilla Public License Version 1.0. You may obtain a copy of
  12. the License at http://www.mozilla.org/MPL/
  13. The Original Code is eric. The Initial Developer of the Original
  14. Code is Eric Busboom
  15. ======================================================================*/
  16. #ifndef ICALDURATION_H
  17. #define ICALDURATION_H
  18. #include "libical_ical_export.h"
  19. #include "icaltime.h"
  20. struct icaldurationtype
  21. {
  22. int is_neg;
  23. unsigned int days;
  24. unsigned int weeks;
  25. unsigned int hours;
  26. unsigned int minutes;
  27. unsigned int seconds;
  28. };
  29. LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_int(int t);
  30. LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_string(const char *);
  31. LIBICAL_ICAL_EXPORT int icaldurationtype_as_int(struct icaldurationtype duration);
  32. LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string(struct icaldurationtype d);
  33. LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string_r(struct icaldurationtype d);
  34. LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_null_duration(void);
  35. LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_bad_duration(void);
  36. LIBICAL_ICAL_EXPORT int icaldurationtype_is_null_duration(struct icaldurationtype d);
  37. LIBICAL_ICAL_EXPORT int icaldurationtype_is_bad_duration(struct icaldurationtype d);
  38. LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_add(struct icaltimetype t,
  39. struct icaldurationtype d);
  40. LIBICAL_ICAL_EXPORT struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
  41. struct icaltimetype t2);
  42. #endif /* !ICALDURATION_H */