same.c 560 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 1995. Bill Brown <brown@gis.uiuc.edu> & Michael Shapiro
  3. *
  4. * This program is free software under the GPL (>=v2)
  5. * Read the file GPL.TXT coming with GRASS for details.
  6. */
  7. #include <string.h>
  8. #include <grass/datetime.h>
  9. /*!
  10. * \brief
  11. *
  12. * Returns:
  13. * 1 if 'src' is exactly the same as 'dst'
  14. * 0 if they differ
  15. *
  16. * \param src
  17. * \param dst
  18. * \return int
  19. */
  20. int datetime_is_same(const DateTime * src, const DateTime * dst)
  21. {
  22. /* WARNING: doesn't allow for padding */
  23. return memcmp(src, dst, sizeof(DateTime)) == 0;
  24. }