GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
Go to the source code of this file.
Functions | |
void | port_init (void) |
Initialize Port_info structures. More... | |
int | dig__fread_port_D (double *buf, size_t cnt, struct gvfile *fp) |
Read doubles from the Portable Vector Format. More... | |
int | dig__fread_port_F (float *buf, size_t cnt, struct gvfile *fp) |
Read floats from the Portable Vector Format. More... | |
int | dig__fread_port_O (off_t *buf, size_t cnt, struct gvfile *fp, size_t port_off_t_size) |
Read off_ts from the Portable Vector Format. More... | |
int | dig__fread_port_L (long *buf, size_t cnt, struct gvfile *fp) |
Read longs from the Portable Vector Format. More... | |
int | dig__fread_port_I (int *buf, size_t cnt, struct gvfile *fp) |
Read integers from the Portable Vector Format. More... | |
int | dig__fread_port_S (short *buf, size_t cnt, struct gvfile *fp) |
Read shorts from the Portable Vector Format. More... | |
int | dig__fread_port_C (char *buf, size_t cnt, struct gvfile *fp) |
Read chars from the Portable Vector Format. More... | |
int | dig__fread_port_P (plus_t *buf, size_t cnt, struct gvfile *fp) |
Read plus_t from the Portable Vector Format. More... | |
int | dig__fwrite_port_D (const double *buf, size_t cnt, struct gvfile *fp) |
Write doubles to the Portable Vector Format. More... | |
int | dig__fwrite_port_F (const float *buf, size_t cnt, struct gvfile *fp) |
Write floats to the Portable Vector Format. More... | |
int | dig__fwrite_port_O (const off_t *buf, size_t cnt, struct gvfile *fp, size_t port_off_t_size) |
Write off_ts to the Portable Vector Format. More... | |
int | dig__fwrite_port_L (const long *buf, size_t cnt, struct gvfile *fp) |
Write longs to the Portable Vector Format. More... | |
int | dig__fwrite_port_I (const int *buf, size_t cnt, struct gvfile *fp) |
Write integers to the Portable Vector Format. More... | |
int | dig__fwrite_port_S (const short *buf, size_t cnt, struct gvfile *fp) |
Write shorts to the Portable Vector Format. More... | |
int | dig__fwrite_port_P (const plus_t *buf, size_t cnt, struct gvfile *fp) |
Write plus_t to the Portable Vector Format. More... | |
int | dig__fwrite_port_C (const char *buf, size_t cnt, struct gvfile *fp) |
Write chars to the Portable Vector Format. More... | |
void | dig_init_portable (struct Port_info *port, int byte_order) |
Set Port_info structure to byte order of file. More... | |
int | dig_set_cur_port (struct Port_info *port) |
Set current Port_info structure. More... | |
int | dig__byte_order_out (void) |
Get byte order. More... | |
Variables | |
int | nat_dbl |
int | nat_flt |
int | nat_lng |
int | nat_off_t |
int | nat_int |
int | nat_shrt |
int | dbl_order |
int | flt_order |
int | off_t_order |
int | lng_order |
int | int_order |
int | shrt_order |
unsigned char | dbl_cnvrt [sizeof(double)] |
unsigned char | flt_cnvrt [sizeof(float)] |
unsigned char | off_t_cnvrt [sizeof(off_t)] |
unsigned char | lng_cnvrt [sizeof(long)] |
unsigned char | int_cnvrt [sizeof(int)] |
unsigned char | shrt_cnvrt [sizeof(short)] |
struct Port_info * | Cur_Head |
int dig__byte_order_out | ( | void | ) |
Get byte order.
Definition at line 1008 of file portable.c.
References dbl_order, ENDIAN_BIG, and ENDIAN_LITTLE.
Referenced by V1_open_new_nat(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
int dig__fread_port_C | ( | char * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read chars from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to gvfile structure |
Definition at line 511 of file portable.c.
References dig_fread(), and PORT_CHAR.
Referenced by dig__read_head(), dig_Rd_P_line(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), V1_delete_line_nat(), and Vect_open_fidx().
int dig__fread_port_D | ( | double * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read doubles from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 79 of file portable.c.
References Cur_Head, Port_info::dbl_quick, dig_fread(), and PORT_DOUBLE.
Referenced by dig_Rd_P_node(), and dig_Rd_Plus_head().
int dig__fread_port_F | ( | float * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read floats from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 123 of file portable.c.
References Cur_Head, dig_fread(), Port_info::flt_quick, and PORT_FLOAT.
Referenced by dig_Rd_P_node().
int dig__fread_port_I | ( | int * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read integers from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 345 of file portable.c.
References Cur_Head, dig_fread(), Port_info::int_quick, nat_int, and PORT_INT.
Referenced by dig__fread_port_P(), dig_Rd_P_line(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), and Vect_open_fidx().
int dig__fread_port_L | ( | long * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read longs from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 262 of file portable.c.
References Cur_Head, dig_fread(), Port_info::lng_quick, nat_lng, and PORT_LONG.
Referenced by dig__read_head(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), and Vect_open_fidx().
int dig__fread_port_O | ( | off_t * | buf, |
size_t | cnt, | ||
struct gvfile * | fp, | ||
size_t | port_off_t_size | ||
) |
Read off_ts from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile | |
port_off_t_size | offset |
Definition at line 167 of file portable.c.
References Cur_Head, dig_fread(), nat_off_t, and Port_info::off_t_quick.
Referenced by dig__read_head(), dig_Rd_P_line(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), and dig_read_cidx_head().
Read plus_t from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
plus_t is defined as int so we only retype pointer and use int function.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 537 of file portable.c.
References dig__fread_port_I().
Referenced by dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), and dig_Rd_Plus_head().
int dig__fread_port_S | ( | short * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read shorts from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 428 of file portable.c.
References Cur_Head, dig_fread(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.
int dig__fwrite_port_C | ( | const char * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write chars to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 886 of file portable.c.
References dig_fwrite(), and PORT_CHAR.
Referenced by dig__write_head(), dig_Wr_P_line(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), dig_write_cidx_head(), V1_delete_line_nat(), and Vect_save_fidx().
int dig__fwrite_port_D | ( | const double * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write doubles to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 559 of file portable.c.
References Cur_Head, Port_info::dbl_quick, dig_fwrite(), and PORT_DOUBLE.
Referenced by dig_Wr_P_node(), and dig_Wr_Plus_head().
int dig__fwrite_port_F | ( | const float * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write floats to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 597 of file portable.c.
References Cur_Head, dig_fwrite(), Port_info::flt_quick, and PORT_FLOAT.
Referenced by dig_Wr_P_node().
int dig__fwrite_port_I | ( | const int * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write integers to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 758 of file portable.c.
References Cur_Head, dig_fwrite(), Port_info::int_quick, nat_int, and PORT_INT.
Referenced by dig__fwrite_port_P(), dig_Wr_P_line(), dig_Wr_spidx_head(), dig_write_cidx(), dig_write_cidx_head(), and Vect_save_fidx().
int dig__fwrite_port_L | ( | const long * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write longs to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 703 of file portable.c.
References Cur_Head, dig_fwrite(), Port_info::lng_quick, nat_lng, and PORT_LONG.
Referenced by dig__write_head(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), dig_write_cidx_head(), and Vect_save_fidx().
int dig__fwrite_port_O | ( | const off_t * | buf, |
size_t | cnt, | ||
struct gvfile * | fp, | ||
size_t | port_off_t_size | ||
) |
Write off_ts to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
port_off_t_size |
Definition at line 636 of file portable.c.
References Cur_Head, dig_fwrite(), nat_off_t, and Port_info::off_t_quick.
Referenced by dig__write_head(), dig_Wr_P_line(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), and dig_write_cidx_head().
Write plus_t to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 868 of file portable.c.
References dig__fwrite_port_I().
Referenced by dig_Wr_P_area(), dig_Wr_P_isle(), dig_Wr_P_line(), dig_Wr_P_node(), and dig_Wr_Plus_head().
int dig__fwrite_port_S | ( | const short * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write shorts to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 813 of file portable.c.
References Cur_Head, dig_fwrite(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.
void dig_init_portable | ( | struct Port_info * | port, |
int | byte_order | ||
) |
Set Port_info structure to byte order of file.
port | pointer to Port_info structure |
byte_order | ENDIAN_BIG or ENDIAN_LITTLE |
Definition at line 900 of file portable.c.
References Port_info::byte_order, Port_info::dbl_cnvrt, dbl_cnvrt, dbl_order, Port_info::dbl_quick, ENDIAN_BIG, FALSE, Port_info::flt_cnvrt, flt_cnvrt, flt_order, Port_info::flt_quick, Port_info::int_cnvrt, int_cnvrt, int_order, Port_info::int_quick, Port_info::lng_cnvrt, lng_cnvrt, lng_order, Port_info::lng_quick, nat_off_t, Port_info::off_t_cnvrt, off_t_cnvrt, off_t_order, Port_info::off_t_quick, PORT_DOUBLE, PORT_FLOAT, port_init(), PORT_INT, PORT_LONG, PORT_SHORT, Port_info::shrt_cnvrt, shrt_cnvrt, shrt_order, Port_info::shrt_quick, and TRUE.
Referenced by dig__read_head(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), V1_open_new_nat(), Vect_open_fidx(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
int dig_set_cur_port | ( | struct Port_info * | port | ) |
Set current Port_info structure.
port | pointer to Port_info structure |
Definition at line 996 of file portable.c.
References Cur_Head.
Referenced by dig__read_head(), dig__write_head(), dig_load_plus(), 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(), dig_write_plus_file(), V1_delete_line_nat(), Vect_open_fidx(), and Vect_save_fidx().
void port_init | ( | void | ) |
Initialize Port_info structures.
Definition at line 185 of file port_init.c.
References dbl_order, G_fatal_error(), LONG_LONG_TEST, LONG_TEST, nat_dbl, nat_flt, nat_int, nat_lng, nat_off_t, nat_shrt, PORT_DOUBLE, PORT_FLOAT, PORT_INT, PORT_LONG, PORT_SHORT, and u_o.
Referenced by dig_init_portable().
struct Port_info* Cur_Head |
Definition at line 45 of file portable.c.
Referenced by dig__fread_port_D(), dig__fread_port_F(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), dig__fread_port_S(), dig__fwrite_port_D(), dig__fwrite_port_F(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig__fwrite_port_S(), and dig_set_cur_port().
|
extern |
Definition at line 125 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 118 of file port_init.c.
Referenced by dig__byte_order_out(), dig_init_portable(), and port_init().
|
extern |
Definition at line 126 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 119 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 129 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 122 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 128 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 121 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 111 of file port_init.c.
Referenced by port_init().
|
extern |
Definition at line 112 of file port_init.c.
Referenced by port_init().
|
extern |
Definition at line 115 of file port_init.c.
Referenced by dig__fread_port_I(), dig__fwrite_port_I(), and port_init().
|
extern |
Definition at line 114 of file port_init.c.
Referenced by dig__fread_port_L(), dig__fwrite_port_L(), and port_init().
|
extern |
Definition at line 113 of file port_init.c.
Referenced by dig__fread_port_O(), dig__fwrite_port_O(), dig_init_portable(), and port_init().
|
extern |
Definition at line 116 of file port_init.c.
Referenced by dig__fread_port_S(), dig__fwrite_port_S(), and port_init().
|
extern |
Definition at line 127 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 120 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 130 of file port_init.c.
Referenced by dig_init_portable().
|
extern |
Definition at line 123 of file port_init.c.
Referenced by dig_init_portable().