GRASS GIS 7 Programmer's Manual  7.0.5(2016)-r00000
close.c
Go to the documentation of this file.
1 
14 #include <unistd.h>
15 #include <fcntl.h>
16 #include <grass/gis.h>
17 #include <grass/glocale.h>
18 #include "local_proto.h"
19 
33 int Segment_close(SEGMENT *SEG)
34 {
35  if (SEG->open != 1)
36  return -1;
37 
38  Segment_release(SEG);
39  close(SEG->fd);
40  unlink(SEG->fname);
41 
42  SEG->fd = -1;
43  SEG->fname = NULL;
44 
45  return 1;
46 }
int Segment_close(SEGMENT *SEG)
Free memory allocated to segment, delete temp file.
Definition: close.c:33
#define NULL
Definition: ccmath.h:32
int Segment_release(SEGMENT *SEG)
Free memory allocated to segment.