GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
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. More... | |
int | dig_fseek (struct gvfile *file, off_t offset, int whence) |
Set struct gvfile position. More... | |
void | dig_rewind (struct gvfile *file) |
Rewind file position. More... | |
int | dig_fflush (struct gvfile *file) |
Flush struct gvfile. More... | |
size_t | dig_fread (void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
Read struct gvfile. More... | |
size_t | dig_fwrite (const void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
Write struct gvfile. More... | |
void | dig_file_init (struct gvfile *file) |
Initialize gvfile structure. More... | |
int | dig_file_load (struct gvfile *file) |
Load opened struct gvfile to memory. More... | |
void | dig_file_free (struct gvfile *file) |
Free struct gvfile. More... | |
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.
int dig_fflush | ( | struct gvfile * | file | ) |
Flush struct gvfile.
file | pointer to struct gvfile structure |
Definition at line 104 of file file.c.
References file.
Referenced by dig_write_plus_file(), and V1_delete_line_nat().
void dig_file_free | ( | struct gvfile * | file | ) |
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().
void dig_file_init | ( | struct gvfile * | file | ) |
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_open_fidx(), Vect_open_topo(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
int dig_file_load | ( | struct gvfile * | file | ) |
size_t dig_fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
struct gvfile * | file | ||
) |
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().
int dig_fseek | ( | struct gvfile * | file, |
off_t | offset, | ||
int | whence | ||
) |
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(), V1_delete_line_nat(), V1_rewind_nat(), and Vect_coor_info().
off_t dig_ftell | ( | struct gvfile * | file | ) |
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_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().
size_t dig_fwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
struct gvfile * | file | ||
) |
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().
void dig_rewind | ( | struct gvfile * | file | ) |
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().