GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73577
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 I_get_group_title(const char *group, char *title, int n)
Definition: title.c:5
#define NULL
Definition: ccmath.h:32
fd
Definition: d/range.c:69
int G_suppress_warnings(int flag)
Suppress printing a warning message to stderr.
Definition: gis/error.c:223
int G_getl2(char *buf, int n, FILE *fd)
Gets a line of text from a file of any pedigree.
Definition: getl.c:64
FILE * I_fopen_group_file_old(const char *group, const char *file)
Definition: fopen.c:43
fclose(fd)
FILE * I_fopen_group_file_new(const char *group, const char *file)
Definition: fopen.c:17
int I_put_group_title(const char *group, const char *title)
Definition: title.c:22