datetime.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef GRASS_DATETIMEDEFS_H
  2. #define GRASS_DATETIMEDEFS_H
  3. /* between.c */
  4. int datetime_is_between(int x, int a, int b);
  5. /* change.c */
  6. int datetime_change_from_to(DateTime * dt, int from, int to, int round);
  7. /* copy.c */
  8. void datetime_copy(DateTime * src, const DateTime * dst);
  9. /* diff.c */
  10. int datetime_difference(const DateTime * a, const DateTime * b,
  11. DateTime * result);
  12. /* error.c */
  13. int datetime_error(int code, char *msg);
  14. int datetime_error_code(void);
  15. char *datetime_error_msg(void);
  16. void datetime_clear_error(void);
  17. /* format.c */
  18. int datetime_format(const DateTime * dt, char *buf);
  19. /* incr1.c */
  20. int datetime_increment(DateTime * src, DateTime * incr);
  21. /* incr2.c */
  22. int datetime_is_valid_increment(const DateTime * src, const DateTime * incr);
  23. int datetime_check_increment(const DateTime * src, const DateTime * incr);
  24. /* incr3.c */
  25. int datetime_get_increment_type(const DateTime * dt, int *mode, int *from,
  26. int *to, int *fracsec);
  27. int datetime_set_increment_type(const DateTime * src, DateTime * incr);
  28. /* local.c */
  29. int datetime_get_local_timezone(int *minutes);
  30. void datetime_get_local_time(DateTime * dt);
  31. /* misc.c */
  32. int datetime_days_in_month(int year, int month, int ad);
  33. int datetime_is_leap_year(int year, int ad);
  34. int datetime_days_in_year(int year, int ad);
  35. /* same.c */
  36. int datetime_is_same(const DateTime * src, const DateTime * dst);
  37. /* scan.c */
  38. int datetime_scan(DateTime * dt, const char *buf);
  39. /* sign.c */
  40. int datetime_is_positive(const DateTime * dt);
  41. int datetime_is_negative(const DateTime * dt);
  42. void datetime_set_positive(DateTime * dt);
  43. void datetime_set_negative(DateTime * dt);
  44. void datetime_invert_sign(DateTime * dt);
  45. /* type.c */
  46. int datetime_set_type(DateTime * dt, int mode, int from, int to, int fracsec);
  47. int datetime_get_type(const DateTime * dt, int *mode, int *from, int *to,
  48. int *fracsec);
  49. int datetime_is_valid_type(const DateTime * dt);
  50. int datetime_check_type(const DateTime * dt);
  51. int datetime_in_interval_year_month(int x);
  52. int datetime_in_interval_day_second(int x);
  53. int datetime_is_absolute(const DateTime * dt);
  54. int datetime_is_relative(const DateTime * dt);
  55. /* tz1.c */
  56. int datetime_check_timezone(const DateTime * dt, int minutes);
  57. int datetime_get_timezone(const DateTime * dt, int *minutes);
  58. int datetime_set_timezone(DateTime * dt, int minutes);
  59. int datetime_unset_timezone(DateTime * dt);
  60. int datetime_is_valid_timezone(int minutes);
  61. /* tz2.c */
  62. int datetime_change_timezone(DateTime * dt, int minutes);
  63. int datetime_change_to_utc(DateTime * dt);
  64. void datetime_decompose_timezone(int tz, int *hours, int *minutes);
  65. /* values.c */
  66. int datetime_check_year(const DateTime * dt, int year);
  67. int datetime_check_month(const DateTime * dt, int month);
  68. int datetime_check_day(const DateTime * dt, int day);
  69. int datetime_check_hour(const DateTime * dt, int hour);
  70. int datetime_check_minute(const DateTime * dt, int minute);
  71. int datetime_check_second(const DateTime * dt, double second);
  72. int datetime_check_fracsec(const DateTime * dt, int fracsec);
  73. int datetime_get_year(const DateTime * dt, int *year);
  74. int datetime_set_year(DateTime * dt, int year);
  75. int datetime_get_month(const DateTime * dt, int *month);
  76. int datetime_set_month(DateTime * dt, int month);
  77. int datetime_get_day(const DateTime * dt, int *day);
  78. int datetime_set_day(DateTime * dt, int day);
  79. int datetime_get_hour(const DateTime * dt, int *hour);
  80. int datetime_set_hour(DateTime * dt, int hour);
  81. int datetime_get_minute(const DateTime * dt, int *minute);
  82. int datetime_set_minute(DateTime * dt, int minute);
  83. int datetime_get_second(const DateTime * dt, double *second);
  84. int datetime_set_second(DateTime * dt, double second);
  85. int datetime_get_fracsec(const DateTime * dt, int *fracsec);
  86. int datetime_set_fracsec(DateTime * dt, int fracsec);
  87. #endif /* GRASS_DATETIMEDEFS_H */