V_clear.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * \file V_clear.c
  3. *
  4. * \brief Screen clearning functions.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *
  20. * \author GRASS GIS Development Team
  21. *
  22. * \date 1999-2006
  23. */
  24. #include <stdio.h>
  25. #include <grass/vask.h>
  26. #define DECIMAL_PLACES -1
  27. /*!
  28. * \brief Zero out prompt and answer arrays.
  29. *
  30. * This routine initializes the screen description information and must
  31. * be called before each new screen layout description.
  32. *
  33. * \return always returns 0
  34. */
  35. void V_clear(void)
  36. {
  37. static const char text[] = "";
  38. int at_answer;
  39. for (at_answer = 0; at_answer < MAX_ANSW; at_answer++)
  40. V__.usr_answ[at_answer].length = 0;
  41. for (at_answer = 0; at_answer < MAX_CONST; at_answer++)
  42. V__.constant[at_answer].length = 0;
  43. for (at_answer = 0; at_answer < MAX_LINE; at_answer++)
  44. V__.page.line[at_answer] = text;
  45. V__.NUM_CONST = 0;
  46. V__.NUM_ANSW = 0;
  47. V__.NUM_LINE = 0;
  48. V_float_accuracy(DECIMAL_PLACES);
  49. sprintf(V__.interrupt_msg, "CANCEL");
  50. }