null.c 859 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/types.h>
  4. #include <unistd.h>
  5. #include <grass/raster.h>
  6. #include "raster3d_intern.h"
  7. /*---------------------------------------------------------------------------*/
  8. int Rast3d_is_null_value_num(const void *n, int type)
  9. {
  10. if (type == FCELL_TYPE)
  11. return Rast_is_f_null_value(n);
  12. else
  13. return Rast_is_d_null_value(n);
  14. }
  15. /*---------------------------------------------------------------------------*/
  16. /*!
  17. * \brief
  18. *
  19. * Fills the vector pointed to by <em>c</em> with <em>nofElts</em> NULL-values
  20. * of <em>type</em>.
  21. *
  22. * \param c
  23. * \param nofElts
  24. * \param type
  25. * \return void
  26. */
  27. void Rast3d_set_null_value(void *c, int nofElts, int type)
  28. {
  29. if (type == FCELL_TYPE) {
  30. Rast_set_f_null_value((float *)c, nofElts);
  31. return;
  32. }
  33. Rast_set_d_null_value((double *)c, nofElts);
  34. }