GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
pngdriver/Graph_close.c
Go to the documentation of this file.
1
/*
2
* Close down the graphics processing. This gets called only at driver
3
* termination time.
4
*/
5
6
#ifndef __MINGW32__
7
#include <unistd.h>
8
#include <fcntl.h>
9
#include <sys/types.h>
10
#include <sys/stat.h>
11
#include <sys/mman.h>
12
#endif
13
14
#include <grass/gis.h>
15
#include "
pngdriver.h
"
16
17
static
void
unmap_file(
void
)
18
{
19
#ifndef __MINGW32__
20
size_t
size =
HEADER_SIZE
+
width
*
height
*
sizeof
(
unsigned
int);
21
void
*ptr = (
char
*)
grid
-
HEADER_SIZE
;
22
23
if
(!
mapped
)
24
return
;
25
26
munmap(ptr, size);
27
28
mapped
= 0;
29
#endif
30
}
31
32
void
PNG_Graph_close
(
void
)
33
{
34
write_image
();
35
36
if
(
mapped
)
37
unmap_file();
38
else
39
G_free
(
grid
);
40
}
lib
pngdriver
Graph_close.c
Generated on Sun Mar 16 2014 05:07:45 for GRASS Programmer's Manual by
1.8.1.2