|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|
Vector library - file management (lower level functions) More...
#include <string.h>#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <grass/vector.h>#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
| off_t | dig_ftell (struct gvfile *file) |
| Get struct gvfile position. | |
| int | dig_fseek (struct gvfile *file, off_t offset, int whence) |
| Set struct gvfile position. | |
| void | dig_rewind (struct gvfile *file) |
| Rewind file position. | |
| int | dig_fflush (struct gvfile *file) |
| Flush struct gvfile. | |
| size_t | dig_fread (void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
| Read struct gvfile. | |
| size_t | dig_fwrite (const void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
| Write struct gvfile. | |
| void | dig_file_init (struct gvfile *file) |
| Initialize gvfile structure. | |
| int | dig_file_load (struct gvfile *file) |
| Load opened struct gvfile to memory. | |
| void | dig_file_free (struct gvfile *file) |
| Free struct gvfile. | |
Vector library - file management (lower level functions)
Vector library - portability (lower level functions)
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.
Lower level functions for reading/writing/manipulating vectors.
(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.
Flush struct gvfile.
| file | pointer to struct gvfile structure |
Definition at line 104 of file file.c.
References file.
Referenced by dig_Wr_spidx(), dig_write_plus_file(), V1_delete_line_nat(), and V1_restore_line_nat().
Free struct gvfile.
| file | pointer to struct gvfile structure |
Definition at line 268 of file file.c.
References file, and G_free().
Referenced by V1_close_nat().
Initialize gvfile structure.
| [in,out] | file | pointer to gvfile structure |
Definition at line 171 of file file.c.
References file, and G_zero().
Referenced by V1_open_new_nat(), V1_open_old_nat(), Vect_cidx_open(), Vect_cidx_save(), Vect_open_fidx(), Vect_open_sidx(), Vect_open_topo(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
Load opened struct gvfile to memory.
Warning: position in file is set to the beginning.
| file | pointer to struct gvfile structure |
Definition at line 188 of file file.c.
References _, AMI_STREAM< T >::AMI_STREAM(), file, G_debug(), G_free(), G_fseek(), G_getenv_nofatal(), G_malloc, G_strcasecmp(), G_warning(), GV_MEMORY_ALWAYS, GV_MEMORY_AUTO, GV_MEMORY_NEVER, and NULL.
Referenced by V1_open_old_nat().
Read struct gvfile.
| [out] | ptr | data buffer |
| size | buffer size | |
| nmemb | number of members | |
| file | pointer to struct gvfile structure |
Definition at line 124 of file file.c.
References file.
Referenced by dig__fread_port_C(), dig__fread_port_D(), dig__fread_port_F(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), and dig__fread_port_S().
Set struct gvfile position.
Start positions:
| file | pointer to struct gvfile structure |
| offset | offset position |
| whence | start position |
Definition at line 60 of file file.c.
References file, and G_fseek().
Referenced by dig__read_head(), dig__write_head(), dig_load_plus(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), rtree_search(), V1_delete_line_nat(), V1_restore_line_nat(), V1_rewind_nat(), and Vect_coor_info().
Get struct gvfile position.
| file | pointer to struct gvfile structure |
Definition at line 36 of file file.c.
References file, and G_ftell().
Referenced by dig__write_head(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_areas(), dig_write_cidx(), dig_write_cidx_head(), dig_write_isles(), dig_write_lines(), dig_write_nodes(), V1_read_next_line_nat(), and Vect_coor_info().
Write struct gvfile.
| ptr | data buffer | |
| size | buffer size | |
| nmemb | number of members | |
| [out] | file | pointer to struct gvfile structure |
Definition at line 156 of file file.c.
References _, file, and 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(), dig__fwrite_port_O(), and dig__fwrite_port_S().
Rewind file position.
| file | pointer to gvfile structure |
Definition at line 87 of file file.c.
References file.
Referenced by dig_Rd_Plus_head(), dig_Rd_spidx(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_cidx(), dig_write_cidx_head(), and dig_write_plus_file().