Man page - bitshift_63(3)
Packages contains this manual
- g2c_get_drs_template(3)
- sbits(3)
- cmplxpack(3)
- g2_unpack4.c(3)
- g2_info.c(3)
- reduce(3)
- g2c_get_msg(3)
- specpack(3)
- g2intu(3)
- int_power.c(3)
- bytes_to_bms(3)
- g2c_file_io_byte(3)
- dimid(3)
- idrtnum(3)
- g2ccsv.c(3)
- g2c_pngpackd(3)
- g2c_file_io(3)
- decenc_png.c(3)
- g2_miss.c(3)
- file(3)
- g2c_open_index1(3)
- g2_unpack2(3)
- g2int(3)
- pngunpack(3)
- specpack.c(3)
- g2cutil.c(3)
- g2c_rw_section6_metadata(3)
- g2_addgrid(3)
- g2c_next_g2cid(3)
- sec_len(3)
- g2c_inq_dim(3)
- jpcunpack.c(3)
- png_stream(3)
- maplen(3)
- minute(3)
- subcenter(3)
- g2c_inq(3)
- g2_unpack5.c(3)
- g2c_file_io_template(3)
- dec_aec(3)
- griddef(3)
- num_opt(3)
- g2num(3)
- decenc_openjpeg.c(3)
- g2c_file_io_ubyte(3)
- map(3)
- bytes_to_msg(3)
- g1num(3)
- jpcunpack_int(3)
- g2c_aecunpackd(3)
- num_local(3)
- pngpack_int(3)
- read_hdr_rec2(3)
- g2_addfield(3)
- aecpack.c(3)
- section_number(3)
- status(3)
- bytes_to_sec(3)
- g2_addfield.c(3)
- drstemplates.c(3)
- year(3)
- g2c_degrib2(3)
- g2_create.c(3)
- misspack(3)
- version(3)
- enc_aec(3)
- g2c_dec_jpeg2000(3)
- g2c_enc_jpeg2000(3)
- extgridtemplate(3)
- next(3)
- section_offset(3)
- g2c_open(3)
- read_msg_metadata(3)
- num_data_points(3)
- unpacked(3)
- jpcpack(3)
- igdtnum(3)
- g2_gribend(3)
- bytes_in_msg(3)
- g2c_file_io_ulonglong(3)
- discipline(3)
- dim(3)
- g2c_rw_section1_metadata(3)
- g2_create(3)
- free_metadata(3)
- g2c_open_index(3)
- g2c_find_table(3)
- g2_unpack7.c(3)
- g2c_csv_init(3)
- templatesgrid(3)
- g2c_log_section(3)
- g2c_csv_strsep(3)
- main(3)
- g2c_param_all(3)
- data_def(3)
- g2c_log_section1(3)
- aecunpack_int(3)
- g2_getfld(3)
- reduce.c(3)
- pack_gp(3)
- g2c_gbit_int(3)
- extpdstemplate(3)
- g2cio.c(3)
- g2c_inq_prod(3)
- sec1_len(3)
- g2c_file(3)
- g2c_start_index_record_lf(3)
- int_dec_jpeg2000(3)
- g2c_seekmsg(3)
- g2_addlocal(3)
- g2c_set_log_level(3)
- g2cat(3)
- gbits.c(3)
- g2c_get_pds_template(3)
- numoct_opt(3)
- g2c_aecpackd(3)
- simunpack.c(3)
- igdtlen(3)
- grib2.h(3)
- g2c_table(3)
- g2c_jpcunpackf(3)
- num(3)
- expanded(3)
- getgridtemplate(3)
- g2c_file_io_longlong(3)
- gbit(3)
- g2c_rw_section5_metadata(3)
- sig_ref_time(3)
- g2c_find_desc(3)
- g2c_write_index(3)
- month(3)
- g2_unpack1.c(3)
- idrtlen(3)
- g2c_free_tables(3)
- g2_getfld.c(3)
- decenc_aec.c(3)
- g2c_start_index1_record(3)
- fld(3)
- g2cinq.c(3)
- g2c_pngunpackd(3)
- g2c_file_io_uint(3)
- num_fields(3)
- g2cdegrib2.c(3)
- format_level(3)
- gtemplate(3)
- decenc_jpeg2000.c(3)
- g2c_add_file(3)
- f(3)
- source_grid_def(3)
- g2c_compare(3)
- g2_unpack6(3)
- msg(3)
- g2_unpack1(3)
- compack(3)
- g2c_start_index_record(3)
- g2c_file_io_short(3)
- g2c_inq_dim_info(3)
- bmap(3)
- len(3)
- g2c_get_datetime(3)
- g2_unpack4(3)
- master_version(3)
- ndpts(3)
- abbrev(3)
- igdtmpl(3)
- prod_def(3)
- comunpack(3)
- center(3)
- pdstemplates.c(3)
- hton64(3)
- field_num(3)
- simpack.c(3)
- g2_gribend.c(3)
- ipdtnum(3)
- g2c_jpcunpackd(3)
- type(3)
- title(3)
- rdieee(3)
- getdrstemplate(3)
- bytes_to_data(3)
- code(3)
- add_section(3)
- g2c_rw_section3_metadata(3)
- g2c_unpack7_int(3)
- extdrstemplate(3)
- dec_png(3)
- getpoly.c(3)
- specunpack(3)
- entry(3)
- num_messages(3)
- g2c_log_file(3)
- g2c_file_io_int(3)
- mkieee(3)
- cmplxpack.c(3)
- dec_jpeg2000(3)
- g2_addgrid.c(3)
- num_sections(3)
- getpoly(3)
- g2c_dec_png(3)
- g1ver(3)
- ibmap(3)
- sec(3)
- user_flush_data(3)
- g2c_jpcpackd(3)
- jpcpack_int(3)
- template_len(3)
- g2float(3)
- g2c_rw_section4_metadata(3)
- local_version(3)
- indicator(3)
- compack.c(3)
- g2c_get_pds_template_extension(3)
- seekgb(3)
- g2c_get_level_desc(3)
- g2c_enc_png(3)
- gbits(3)
- pngunpack.c(3)
- msg_num(3)
- bytes_to_local(3)
- pngpack.c(3)
- user_read_data(3)
- g2cprod.c(3)
- local(3)
- specunpack.c(3)
- jpcpack.c(3)
- day(3)
- g2c_close(3)
- add_msg(3)
- aecpack(3)
- ngrdpts(3)
- g2cparams.c(3)
- g2_unpack3(3)
- list_opt(3)
- template(3)
- pngpack(3)
- g2c_inq_msg(3)
- g2cid(3)
- mkieee.c(3)
- g2c_aecunpackf(3)
- g2cfile.c(3)
- value(3)
- g2_free.c(3)
- ipdtlen(3)
- g2_free(3)
- g2_info(3)
- g2_addlocal.c(3)
- idsectlen(3)
- g2c_get_prod(3)
- g2c_gbits_int(3)
- simunpack(3)
- int_power(3)
- enc_png(3)
- section1(3)
- idsect(3)
- g2c_strerror(3)
- g2c_pngunpackf(3)
- ntoh64(3)
- templatespds(3)
- g2disc(3)
- coord_list(3)
- idrtmpl(3)
- grib2_int.h(3)
- user_write_data(3)
- rdieee.c(3)
- aecunpack(3)
- g2c_file_io_ushort(3)
- g2_unpack2.c(3)
- hour(3)
- gridtemplates.c(3)
- find_available_g2cid(3)
- interp_list(3)
- getdim(3)
- g2c_param_g2tog1(3)
- getgridindex(3)
- g2c_jpcpackf(3)
- g2_unpack6.c(3)
- comunpack.c(3)
- g2c_find_msg2(3)
- getpdstemplate(3)
- g2c_get_prod_sections(3)
- g2c_degrib2.c(3)
- g2_unpack7(3)
- extlen(3)
- aecunpack.c(3)
- param(3)
- seekgb.c(3)
- g2c_find_desc_str(3)
- misspack.c(3)
- optional(3)
- g2_unpack3.c(3)
- doc(3)
- g2ccompare.c(3)
- g2c_get_grid_template(3)
- g2c_param_g1tog2(3)
- g2c_unpack7(3)
- templatesdrs(3)
- g2c_get_grid_template_extension(3)
- path(3)
- grid_def(3)
- needext(3)
- prev(3)
- sec_info(3)
- ext(3)
- g2c_inq_msg_time(3)
- g2c_aecpackf(3)
- pngunpack_int(3)
- g2c_compare.c(3)
- g2c_param_abbrev(3)
- name(3)
- g2c_find_entry(3)
- sbit(3)
- read_hdr_rec1(3)
- gribfield(3)
- sec_num(3)
- g2cindex.c(3)
- locallen(3)
- sec_id(3)
- pack_gp.c(3)
- g2_miss(3)
- getdim.c(3)
- jpcunpack(3)
- g2_unpack5(3)
- g2c_pngpackf(3)
- read_metadata(3)
- g2c_check_msg(3)
- util.c(3)
- num_coord(3)
- desc(3)
- getpdsindex(3)
- interp_opt(3)
- getdrsindex(3)
- g2c_print_tables(3)
- enc_jpeg2000(3)
- ipdtmpl(3)
- aecpack_int(3)
- g2c_index.c(3)
- simpack(3)
- determine_dims(3)
- ifldnum(3)
apt-get install libg2c-dev
Manual
g2cio.c
NAMESYNOPSIS
Macros
Functions
Detailed Description
Macro Definition Documentation
#define BITSHIFT_15 15
#define BITSHIFT_31 31
#define BITSHIFT_63 63
#define BITSHIFT_7 7
Function Documentation
int g2c_file_io (FILE * f, int write, int g2ctype, void * var)
int g2c_file_io_byte (FILE * f, int write, char * var)
int g2c_file_io_int (FILE * f, int write, int * var)
int g2c_file_io_longlong (FILE * f, int write, long long * var)
int g2c_file_io_short (FILE * f, int write, short * var)
int g2c_file_io_template (FILE * f, int rw_flag, int map, long long int *template_value)
int g2c_file_io_ubyte (FILE * f, int write, unsigned char * var)
int g2c_file_io_uint (FILE * f, int write, unsigned int * var)
int g2c_file_io_ulonglong (FILE * f, int write, unsigned long long * var)
int g2c_file_io_ushort (FILE * f, int write, unsigned short * var)
Author
NAME
g2cio.c - File I/O functions for the g2c library.
SYNOPSIS
#include βgrib2_int.hβ
Macros
#define
BITSHIFT_15
15
15 bits.
#define
BITSHIFT_31
31
31 bits.
#define
BITSHIFT_63
63
63 bits.
#define
BITSHIFT_7
7
7 bits.
Functions
int
g2c_file_io
(FILE *f, int write, int g2ctype, void
*var)
Read or write a big-endian integer type to an open file,
with conversion between native and big-endian format.
int
g2c_file_io_byte
(FILE *f, int write, char *var)
Read or write a big-endian signed byte to an open GRIB2
file, with conversion between native and big-endian format,
and special GRIB2 handling of negative numbers.
int
g2c_file_io_int
(FILE *f, int write, int *var)
Read or write a big-endian 4-byte signed int to an open
GRIB2 file, with conversion between native and big-endian
format, and special GRIB2 handling of negative numbers.
int
g2c_file_io_longlong
(FILE *f, int write, long
long *var)
Read or write a big-endian signed long long to an open GRIB2
file, with conversion between native and big-endian format,
and special GRIB2 handling of negative numbers.
int
g2c_file_io_short
(FILE *f, int write, short
*var)
Read or write a big-endian signed short to an open GRIB2
file, with conversion between native and big-endian format,
and special GRIB2 handling of negative numbers.
int
g2c_file_io_template
(FILE *f, int rw_flag, int
map, long long int *template_value)
Read or write a big-endian 4-byte int or unsigned int from
or to an open file, with conversion between native and
big-endian format, and handling of GRIB negative numbers.
int
g2c_file_io_ubyte
(FILE *f, int write, unsigned
char *var)
Read or write a big-endian unsigned byte to an open GRIB2
file, with conversion between native and big-endian format.
int
g2c_file_io_uint
(FILE *f, int write, unsigned
int *var)
Read or write a big-endian 4-byte unsigned int to an open
GRIB2 file, with conversion between native and big-endian
format.
int
g2c_file_io_ulonglong
(FILE *f, int write,
unsigned long long *var)
Read or write a big-endian unsigned long long to an open
GRIB2 file, with conversion between native and big-endian
format.
int
g2c_file_io_ushort
(FILE *f, int write, unsigned
short *var)
Read or write a big-endian unsigned short to an open GRIB2
file, with conversion between native and big-endian
format.
Detailed Description
File I/O functions for the g2c library.
Author
Ed Hartnett
Date
Nov 11, 2022
Definition in file g2cio.c .
Macro Definition Documentation
#define BITSHIFT_15 15
15 bits.
Definition at line 10 of file g2cio.c .
#define BITSHIFT_31 31
31 bits.
Definition at line 11 of file g2cio.c .
#define BITSHIFT_63 63
63 bits.
Definition at line 12 of file g2cio.c .
#define BITSHIFT_7 7
7 bits.
Definition at line 9 of file g2cio.c .
Function Documentation
int g2c_file_io (FILE * f, int write, int g2ctype, void * var)
Read or write a big-endian integer type to an open file, with conversion between native and big-endian format. GRIB2 handles negative numbers in a special way. Instead of storing two-compliments, like every other programmer and computing organization in the world, GRIB2 flips the first bit, then stores the rest of the int as an unsigned number in the remaining 31 bits. How exciting!
This function takes the excitement out of GRIB2 negative numbers.
Parameters
f
Pointer to the open
FILE.
write
Non-zero if function should write, otherwise
function will read.
g2ctype
The type to be read or written.
var
Pointer to the int to be written, or pointer to the
storage that gets the int read.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett
Date
11/7/22
Definition at line 41 of file g2cio.c .
References BITSHIFT_15 , BITSHIFT_31 , BITSHIFT_63 , BITSHIFT_7 , EIGHT_BYTES , FOUR_BYTES , G2C_BYTE , G2C_EBADTYPE , G2C_EFILE , G2C_EINVAL , G2C_INT , G2C_INT64 , G2C_NOERROR , G2C_SHORT , G2C_UBYTE , G2C_UINT , G2C_UINT64 , G2C_USHORT , hton64 , ntoh64 , ONE_BYTE , and TWO_BYTES .
Referenced by g2c_file_io_byte() , g2c_file_io_int() , g2c_file_io_longlong() , g2c_file_io_short() , g2c_file_io_ubyte() , g2c_file_io_uint() , g2c_file_io_ulonglong() , and g2c_file_io_ushort() .
int g2c_file_io_byte (FILE * f, int write, char * var)
Read or write a big-endian signed byte to an open GRIB2 file, with conversion between native and big-endian format, and special GRIB2 handling of negative numbers.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the byte.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 316 of file g2cio.c .
References G2C_BYTE , and g2c_file_io() .
Referenced by g2c_file_io_template() .
int g2c_file_io_int (FILE * f, int write, int * var)
Read or write a big-endian 4-byte signed int to an open GRIB2 file, with conversion between native and big-endian format, and special GRIB2 handling of negative numbers.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the int.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/7/22
Definition at line 230 of file g2cio.c .
References g2c_file_io() , and G2C_INT .
Referenced by g2c_file_io_template() .
int g2c_file_io_longlong (FILE * f, int write, long long * var)
Read or write a big-endian signed long long to an open GRIB2 file, with conversion between native and big-endian format, and special GRIB2 handling of negative numbers.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the long long.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 359 of file g2cio.c .
References g2c_file_io() , and G2C_INT64 .
int g2c_file_io_short (FILE * f, int write, short * var)
Read or write a big-endian signed short to an open GRIB2 file, with conversion between native and big-endian format, and special GRIB2 handling of negative numbers.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the short.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 273 of file g2cio.c .
References g2c_file_io() , and G2C_SHORT .
Referenced by g2c_file_io_template() , g2c_rw_section1_metadata() , g2c_start_index_record() , and g2c_start_index_record_lf() .
int g2c_file_io_template (FILE * f, int rw_flag, int map, long long int *template_value)
Read or write a big-endian 4-byte int or unsigned int from or to an open file, with conversion between native and big-endian format, and handling of GRIB negative numbers. This is for template values.
With template values, if the map value is negative, then the template value may be negative.
Parameters
f
Pointer to the open
FILE.
rw_flag
Non-zero if function should write, otherwise
function will read.
map
The map value for this template item.
template_value
Pointer to the template value to be
written, or pointer to the storage that gets the templage
value read.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/7/22
Definition at line 408 of file g2cio.c .
References FOUR_BYTES , G2C_EBADTEMPLATE , g2c_file_io_byte() , g2c_file_io_int() , g2c_file_io_short() , g2c_file_io_ubyte() , g2c_file_io_uint() , g2c_file_io_ushort() , G2C_NOERROR , ONE_BYTE , and TWO_BYTES .
Referenced by g2c_rw_section3_metadata() , g2c_rw_section4_metadata() , and g2c_rw_section5_metadata() .
int g2c_file_io_ubyte (FILE * f, int write, unsigned char * var)
Read or write a big-endian unsigned byte to an open GRIB2 file, with conversion between native and big-endian format.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the unsigned byte.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 337 of file g2cio.c .
References g2c_file_io() , and G2C_UBYTE .
Referenced by g2c_file_io_template() , g2c_open_index() , g2c_rw_section1_metadata() , g2c_rw_section3_metadata() , g2c_rw_section6_metadata() , g2c_start_index1_record() , g2c_start_index_record() , g2c_start_index_record_lf() , g2c_write_index() , and read_msg_metadata() .
int g2c_file_io_uint (FILE * f, int write, unsigned int * var)
Read or write a big-endian 4-byte unsigned int to an open GRIB2 file, with conversion between native and big-endian format.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the unsigned int.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/7/22
Definition at line 251 of file g2cio.c .
References g2c_file_io() , and G2C_UINT .
Referenced by g2c_file_io_template() , g2c_open_index() , g2c_rw_section1_metadata() , g2c_rw_section3_metadata() , g2c_rw_section5_metadata() , g2c_start_index1_record() , g2c_start_index_record() , g2c_start_index_record_lf() , g2c_write_index() , and read_msg_metadata() .
int g2c_file_io_ulonglong (FILE * f, int write, unsigned long long * var)
Read or write a big-endian unsigned long long to an open GRIB2 file, with conversion between native and big-endian format.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the unsigned long long.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 380 of file g2cio.c .
References g2c_file_io() , and G2C_UINT64 .
Referenced by g2c_start_index_record() , and g2c_start_index_record_lf() .
int g2c_file_io_ushort (FILE * f, int write, unsigned short * var)
Read or write a big-endian unsigned short to an open GRIB2 file, with conversion between native and big-endian format.
Parameters
f
Pointer to the open
GRIB2 FILE.
write
Non-zero to write, zero to read.
var
Pointer to the unsigned short.
Returns
|
β’ |
:: G2C_NOERROR No error. |
|||
|
β’ |
:: G2C_EINVAL Invalid input. |
|||
|
β’ |
:: G2C_EFILE Error reading/writing file. |
Author
Ed Hartnett 11/13/22
Definition at line 294 of file g2cio.c .
References g2c_file_io() , and G2C_USHORT .
Referenced by g2c_file_io_template() , g2c_rw_section3_metadata() , g2c_rw_section4_metadata() , and g2c_rw_section5_metadata() .
Author
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.