calc.h 947 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef GRASS_CALC_H
  2. #define GRASS_CALC_H
  3. #include <grass/gis.h>
  4. #include <grass/raster.h>
  5. typedef int func_t(int argc, const int *argt, void **args);
  6. typedef int args_t(int argc, int *argt);
  7. enum {
  8. E_ARG_LO = 1,
  9. E_ARG_HI = 2,
  10. E_ARG_TYPE = 3,
  11. E_RES_TYPE = 4,
  12. E_INV_TYPE = 5,
  13. E_ARG_NUM = 6,
  14. E_WTF = 99
  15. };
  16. typedef struct func_desc
  17. {
  18. const char *name;
  19. args_t *check_args;
  20. func_t *func;
  21. } func_desc;
  22. #define IS_NULL_C(x) (Rast_is_c_null_value((x)))
  23. #define IS_NULL_F(x) (Rast_is_f_null_value((x)))
  24. #define IS_NULL_D(x) (Rast_is_d_null_value((x)))
  25. #define SET_NULL_C(x) (Rast_set_c_null_value((x),1))
  26. #define SET_NULL_F(x) (Rast_set_f_null_value((x),1))
  27. #define SET_NULL_D(x) (Rast_set_d_null_value((x),1))
  28. extern volatile int floating_point_exception;
  29. extern volatile int floating_point_exception_occurred;
  30. extern int columns;
  31. extern func_desc calc_func_descs[];
  32. #include <grass/defs/calc.h>
  33. #endif