#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "G.h"
Go to the source code of this file.
Defines | |
#define | FORMAT_FILE "f_format" |
#define | NULL_FILE "null" |
Functions | |
int | G_close_cell (int fd) |
close a raster file | |
int | G_unopen_cell (int fd) |
unopen a raster file | |
int | G__write_fp_format (int fd) |
#define FORMAT_FILE "f_format" |
Definition at line 37 of file closecell.c.
Referenced by G__check_fp_type(), and G__write_fp_format().
#define NULL_FILE "null" |
Definition at line 38 of file closecell.c.
int G__write_fp_format | ( | int | fd | ) |
Definition at line 397 of file closecell.c.
References FORMAT_FILE, G__file_name(), G__make_mapset_element(), G_create_key_value(), G_free_key_value(), G_set_key_value(), G_warning(), G_write_key_value_file(), fileinfo::map_type, fileinfo::mapset, fileinfo::name, fileinfo::open_mode, and OPEN_NEW_COMPRESSED.
int G_close_cell | ( | int | fd | ) |
close a raster file
The raster file opened on file descriptor fd is closed. Memory allocated for raster processing is freed. If open for writing, skeletal support files for the new raster file are created as well. Note. If a module wants to explicitly write support files (e.g., a specific color table) for a raster file it creates, it must do so after the raster file is closed. Otherwise the close will overwrite the support files. See Raster_Map_Layer_Support_Routines for routines which write raster support files.
fd |
.tmp
file into the fcell
element, create an empty file in the cell
directory; write the floating-point range file; write a default quantization file quantization file is set here to round fp numbers (this is a default for now). create an empty category file, with max cat = max value (for backwards compatibility). Move the .tmp
NULL-value bitmap file to the cell_misc
directory.
Definition at line 77 of file closecell.c.
References fileinfo::open_mode, and OPEN_OLD.
Referenced by G_set_window(), and G_suppress_masking().
int G_unopen_cell | ( | int | fd | ) |
unopen a raster file
The raster file opened on file descriptor fd is closed. Memory allocated for raster processing is freed. If open for writing, the raster file is not created and the temporary file created when the raster file was opened is removed (see Creating_and_Opening_New_Raster_Files). This routine is useful when errors are detected and it is desired to not create the new raster file. While it is true that the raster file will not be created if the module exits without closing the file, the temporary file will not be removed at module exit. GRASS database management will eventually remove the temporary file, but the file can be quite large and will take up disk space until GRASS does remove it. Use this routine as a courtesy to the user.
fd |
Definition at line 110 of file closecell.c.
References fileinfo::open_mode, and OPEN_OLD.
Referenced by G__check_for_auto_masking().