title.c 566 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <stdio.h>
  2. #include <grass/imagery.h>
  3. int I_get_group_title(const char *group, char *title, int n)
  4. {
  5. FILE *fd;
  6. *title = 0;
  7. G_suppress_warnings(1);
  8. fd = I_fopen_group_file_old(group, "TITLE");
  9. G_suppress_warnings(0);
  10. if (fd != NULL) {
  11. G_getl2(title, n, fd);
  12. fclose(fd);
  13. }
  14. return (fd != NULL);
  15. }
  16. int I_put_group_title(const char *group, const char *title)
  17. {
  18. FILE *fd;
  19. fd = I_fopen_group_file_new(group, "TITLE");
  20. if (fd != NULL) {
  21. fprintf(fd, "%s\n", title);
  22. fclose(fd);
  23. }
  24. return (fd != NULL);
  25. }