GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
open_misc.c File Reference
#include <grass/config.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for open_misc.c:

Go to the source code of this file.

Functions

int G_open_new_misc (const char *dir, const char *element, const char *name)
 open a new database file More...
 
int G_open_old_misc (const char *dir, const char *element, const char *name, const char *mapset)
 open a database file for reading More...
 
int G_open_update_misc (const char *dir, const char *element, const char *name)
 open a database file for update More...
 
FILE * G_fopen_new_misc (const char *dir, const char *element, const char *name)
 open a new database file More...
 
FILE * G_fopen_old_misc (const char *dir, const char *element, const char *name, const char *mapset)
 open a database file for reading More...
 
FILE * G_fopen_append_misc (const char *dir, const char *element, const char *name)
 
FILE * G_fopen_modify_misc (const char *dir, const char *element, const char *name)
 

Function Documentation

FILE* G_fopen_append_misc ( const char *  dir,
const char *  element,
const char *  name 
)

Definition at line 212 of file open_misc.c.

References fd, and G_mapset().

Referenced by I_fopen_group_file_append(), and I_fopen_subgroup_file_append().

FILE* G_fopen_modify_misc ( const char *  dir,
const char *  element,
const char *  name 
)

Definition at line 225 of file open_misc.c.

References fd, and G_mapset().

FILE* G_fopen_new_misc ( const char *  dir,
const char *  element,
const char *  name 
)

open a new database file

The database file name under the element in the current mapset is created and opened for writing (but not reading). The UNIX fopen( ) routine, with "w" write mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the fopen( ) is returned.

Parameters
element
name
Returns
FILE *

Definition at line 172 of file open_misc.c.

References fd, and G_mapset().

Referenced by G__quant_export(), G__raster_misc_write_line(), G_write_range(), I_fopen_group_file_new(), I_fopen_signature_file_new(), I_fopen_sigset_file_new(), and I_fopen_subgroup_file_new().

FILE* G_fopen_old_misc ( const char *  dir,
const char *  element,
const char *  name,
const char *  mapset 
)

open a database file for reading

The database file name under the element in the specified mapset is opened for reading (but not for writing). The UNIX fopen( ) routine, with "r" read mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file descriptor from the fopen( ) is returned.

Parameters
element
name
mapset
Returns
FILE *

Definition at line 200 of file open_misc.c.

References fd.

Referenced by G__quant_import(), G__raster_misc_read_line(), G_get_gdal_link(), G_is_reclassed_to(), G_read_histogram(), G_read_range(), I_fopen_group_file_old(), I_fopen_signature_file_old(), I_fopen_sigset_file_old(), and I_fopen_subgroup_file_old().

int G_open_new_misc ( const char *  dir,
const char *  element,
const char *  name 
)

open a new database file

The database file name under the element in the current mapset is created and opened for writing (but not reading). The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open( ) is returned.

Parameters
element
name
Returns
int

Definition at line 103 of file open_misc.c.

References G_mapset().

int G_open_old_misc ( const char *  dir,
const char *  element,
const char *  name,
const char *  mapset 
)

open a database file for reading

The database file name under the element in the specified mapset is opened for reading (but not for writing). The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file descriptor from the open( ) is returned.

Parameters
element
name
mapset
Returns
int

Definition at line 124 of file open_misc.c.

Referenced by G_read_fp_range().

int G_open_update_misc ( const char *  dir,
const char *  element,
const char *  name 
)

open a database file for update

The database file name under the element in the current mapset is opened for reading and writing. The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open( ) is returned.

Parameters
element
name
Returns
int

Definition at line 145 of file open_misc.c.

References fd, and G_mapset().