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