show_elem.c 705 B

12345678910111213141516171819202122232425262728293031323334
  1. /*!
  2. \file lib/manage/show_elem.c
  3. \brief Manage Library - Show elements
  4. (C) 2001-2011 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Original author CERL
  8. */
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include "manage_local_proto.h"
  12. /*!
  13. \brief Print element name/desc to stdout
  14. */
  15. void M_show_elements(void)
  16. {
  17. int n;
  18. unsigned int len;
  19. len = 0;
  20. for (n = 0; n < nlist; n++)
  21. if (strlen(list[n].alias) > len)
  22. len = strlen(list[n].alias);
  23. for (n = 0; n < nlist; n++)
  24. fprintf(stdout, " %-*s (%s)\n", len, list[n].alias, list[n].text);
  25. }