free.c 569 B

12345678910111213141516171819202122232425262728293031
  1. #include <stdlib.h>
  2. #include <grass/gis.h>
  3. #include "watershed.h"
  4. int free_input(INPUT * input)
  5. {
  6. if (input->com_line_ram)
  7. G_free(input->com_line_ram);
  8. if (input->com_line_seg)
  9. G_free(input->com_line_seg);
  10. G_free(input->haf_name);
  11. G_free(input->ar_file_name);
  12. G_free(input->accum_name);
  13. return 0;
  14. }
  15. int free_output(OUTPUT * output)
  16. {
  17. int c;
  18. G_free(output->basin_facts);
  19. G_free(output->file_name);
  20. for (c = output->num_maps - 1; c >= 0; c--) {
  21. G_free(output->maps[c].name);
  22. }
  23. G_free(output->maps);
  24. return 0;
  25. }