GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Vector library (diglib) - file management. More...
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
long | dig_ftell (GVFILE *file) |
Get GVFILE position. More... | |
int | dig_fseek (GVFILE *file, long offset, int whence) |
Set GVFILE position. More... | |
void | dig_rewind (GVFILE *file) |
Rewind GVFILE position. More... | |
int | dig_fflush (GVFILE *file) |
Flush GVFILE. More... | |
size_t | dig_fread (void *ptr, size_t size, size_t nmemb, GVFILE *file) |
Read GVFILE. More... | |
size_t | dig_fwrite (void *ptr, size_t size, size_t nmemb, GVFILE *file) |
Write GVFILE. More... | |
void | dig_file_init (GVFILE *file) |
Initialize GVFILE. More... | |
int | dig_file_load (GVFILE *file) |
Load opened GVFILE to memory. More... | |
void | dig_file_free (GVFILE *file) |
Free GVFILE. More... | |
Vector library (diglib) - file management.
Lower level functions for reading/writing/manipulating vectors.
Note: seems that the time is almost the same for both cases:
(C) 2001-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file file.c.
int dig_fflush | ( | GVFILE * | file | ) |
Flush GVFILE.
file | pointer to GVFILE structure |
Definition at line 102 of file file.c.
Referenced by dig_write_plus_file(), main(), V1__rewrite_line_nat(), V1_delete_line_nat(), and V1_restore_line_nat().
void dig_file_free | ( | GVFILE * | file | ) |
Free GVFILE.
file | pointer to GVFILE structure |
Definition at line 269 of file file.c.
References G_free().
Referenced by V1_close_nat().
void dig_file_init | ( | GVFILE * | file | ) |
Initialize GVFILE.
[out] | file | pointer to GVFILE structure |
Definition at line 168 of file file.c.
References NULL.
Referenced by V1_open_new_nat(), V1_open_old_nat(), V2_close_ogr(), V2_open_old_ogr(), Vect_cidx_open(), Vect_cidx_save(), Vect_open_spatial_index(), Vect_open_topo(), Vect_save_spatial_index(), and Vect_save_topo().
int dig_file_load | ( | GVFILE * | file | ) |
Load opened GVFILE to memory.
Warning: position in file is set to the beginning.
file | pointer to GVFILE structure |
Definition at line 190 of file file.c.
References G__getenv(), G_debug(), G_free(), G_strcasecmp(), G_warning(), tools::mode, NULL, tools::size, and stat.
Referenced by V1_open_old_nat().
size_t dig_fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
GVFILE * | file | ||
) |
Read GVFILE.
[out] | ptr | data buffer |
size | buffer size | |
nmemb | number of members | |
file | pointer to GVFILE structure |
Definition at line 122 of file file.c.
References int.
Referenced by dig__fread_port_C(), dig__fread_port_D(), dig__fread_port_F(), dig__fread_port_I(), dig__fread_port_L(), and dig__fread_port_S().
Set GVFILE position.
Start positions:
file | pointer to GVFILE structure |
offset | offset position |
whence | start position |
Definition at line 60 of file file.c.
Referenced by dig__read_head(), dig__write_head(), dig_load_plus(), dig_Rd_Plus_head(), dig_Rd_spindx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_read_spidx(), main(), V1__rewrite_line_nat(), V1_delete_line_nat(), V1_restore_line_nat(), V1_rewind_nat(), V1_rewrite_line_nat(), V1_write_line_nat(), and Vect_coor_info().
long dig_ftell | ( | GVFILE * | file | ) |
Get GVFILE position.
file | pointer to GVFILE structure |
Definition at line 36 of file file.c.
Referenced by dig__write_head(), dig_Wr_Plus_head(), dig_Wr_spindx_head(), dig_write_areas(), dig_write_cidx(), dig_write_cidx_head(), dig_write_isles(), dig_write_lines(), dig_write_nodes(), dig_write_spidx(), V1_read_next_line_nat(), V1_rewrite_line_nat(), V1_write_line_nat(), and Vect_coor_info().
size_t dig_fwrite | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
GVFILE * | file | ||
) |
Write GVFILE.
ptr | data buffer | |
size | buffer size | |
nmemb | number of members | |
[out] | file | pointer to GVFILE structure |
Definition at line 154 of file file.c.
References G_fatal_error().
Referenced by dig__fwrite_port_C(), dig__fwrite_port_D(), dig__fwrite_port_F(), dig__fwrite_port_I(), dig__fwrite_port_L(), and dig__fwrite_port_S().
void dig_rewind | ( | GVFILE * | file | ) |
Rewind GVFILE position.
file | pointer to GVFILE structure |
Definition at line 85 of file file.c.
Referenced by dig_Rd_Plus_head(), dig_Rd_spindx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_read_spidx(), dig_Wr_Plus_head(), dig_Wr_spindx_head(), dig_write_cidx(), dig_write_cidx_head(), dig_write_plus_file(), and dig_write_spidx().