GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
title.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <grass/imagery.h>
3 
4 
5 int I_get_group_title(const char *group, char *title, int n)
6 {
7  FILE *fd;
8 
9  *title = 0;
11  fd = I_fopen_group_file_old(group, "TITLE");
13  if (fd != NULL) {
14  G_getl2(title, n, fd);
15  fclose(fd);
16  }
17 
18  return (fd != NULL);
19 }
20 
21 
22 int I_put_group_title(const char *group, const char *title)
23 {
24  FILE *fd;
25 
26  fd = I_fopen_group_file_new(group, "TITLE");
27  if (fd != NULL) {
28  fprintf(fd, "%s\n", title);
29  fclose(fd);
30  }
31 
32  return (fd != NULL);
33 }
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
Definition: getl.c:64
FILE * I_fopen_group_file_old(const char *, const char *)
Open group file for reading.
Definition: fopen.c:105
int I_get_group_title(const char *group, char *title, int n)
Definition: title.c:5
#define NULL
Definition: ccmath.h:32
void int G_suppress_warnings(int)
Suppress printing a warning message to stderr.
Definition: gis/error.c:223
FILE * I_fopen_group_file_new(const char *, const char *)
Definition: fopen.c:70
int I_put_group_title(const char *group, const char *title)
Definition: title.c:22