GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
segment/release.c
Go to the documentation of this file.
1 
15 #include <stdlib.h>
16 #include <grass/segment.h>
17 
18 
35 int segment_release(SEGMENT * SEG)
36 {
37  int i;
38 
39  if (SEG->open != 1)
40  return -1;
41 
42  for (i = 0; i < SEG->nseg; i++)
43  free(SEG->scb[i].buf);
44  free(SEG->scb);
45 
46  SEG->open = 0;
47 
48  return 1;
49 }
void free(void *)
int segment_release(SEGMENT *SEG)
Free memory allocated to segment.