NCEPLIBS-bufr
11.7.0
|
Define signatures and declare variables for reading or writing BUFR messages via a C language interface. More...
Go to the source code of this file.
Functions | |
void | ccbfl (void) |
This subroutine closes all system files that were opened via previous calls to subroutine cobfl(). More... | |
void | cobfl (char *, char *) |
This subroutine opens a new file for reading or writing BUFR messages via a C language interface. More... | |
void | crbmg (char *, f77int *, f77int *, f77int *) |
This subroutine reads the next BUFR message from the system file that was opened via the most recent call to subroutine cobfl() with io = 'r'. More... | |
void | cwbmg (char *, f77int *, f77int *) |
This subroutine writes a BUFR message to the system file that was opened via the most recent call to subroutine cobfl() with io = 'w'. More... | |
f77int | rbytes (char *, f77int *, f77int, f77int) |
This function reads a specified number of bytes from the system file that was opened via the most recent call to subroutine cobfl() with io = 'r'. More... | |
Variables | |
FILE * | pbf [2] |
File pointers. More... | |
Define signatures and declare variables for reading or writing BUFR messages via a C language interface.
These signatures and variables are used by the C language interface which encompasses subroutines cobfl(), crbmg(), cwbmg(), ccbfl() and rbytes().
Definition in file cobfl.h.
void ccbfl | ( | void | ) |
void cobfl | ( | char * | bfl, |
char * | io | ||
) |
This subroutine opens a new file for reading or writing BUFR messages via a C language interface.
[in] | bfl | – char*: System file to be opened. Inclusion of directory prefixes or other local filesystem notation is allowed, up to 200 total characters. |
[in] | io | – char: Flag indicating how bfl is to be opened:
|
This subroutine is designed to be easily callable from application program written in either C or Fortran. It is functionally equivalent to subroutine openbf(); however, there are some important differences:
Any errors encountered when using this subroutine are automatically logged to standard output, or to an alternate location previously specified via a call to subroutine errwrt().
Program history log:
Date | Programmer | Comments |
---|---|---|
2005-11-29 | J. Ator | Original author |
2021-10-20 | J. Ator | Increase MXFNLEN to 200 characters |
Definition at line 82 of file cobfl.c.
References bort(), pbf, and wrdlen().
Referenced by main().
void crbmg | ( | char * | bmg, |
f77int * | mxmb, | ||
f77int * | nmb, | ||
f77int * | iret | ||
) |
This subroutine reads the next BUFR message from the system file that was opened via the most recent call to subroutine cobfl() with io = 'r'.
[in] | mxmb | – f77int*: Dimensioned size (in bytes) of bmg; used by the subroutine to ensure that it doesn't overflow the bmg array |
[out] | bmg | – char*: BUFR message |
[out] | nmb | – f77int*: Size (in bytes) of BUFR message in bmg |
[out] | iret | – f77int*: return code
|
This subroutine is designed to be easily callable from application program written in either C or Fortran.
The file from which messages are to be read must have already been opened for reading via a previous call to subroutine cobfl() with io = 'r'.
Any messages read that were encoded according to BUFR edition 0 or BUFR edition 1 are automatically converted to BUFR edition 2 before being returned by this subroutine.
Program history log:
Date | Programmer | Comments |
---|---|---|
2005-11-29 | J. Ator | Original author |
Definition at line 48 of file crbmg.c.
References bort(), gets1loc(), ichkstr(), ipkm(), iupbs01(), iupm(), pbf, and rbytes().
Referenced by fdebufr().
void cwbmg | ( | char * | bmg, |
f77int * | nmb, | ||
f77int * | iret | ||
) |
This subroutine writes a BUFR message to the system file that was opened via the most recent call to subroutine cobfl() with io = 'w'.
[in] | bmg | – char*: BUFR message to be written |
[in] | nmb | – f77int*: Size (in bytes) of BUFR message in bmg |
[out] | iret | – f77int*: return code
|
This subroutine is designed to be easily callable from application program written in either C or Fortran.
The file to which the message is to be written must have already been opened for writing via a previous call to subroutine cobfl() with io = 'w'.
Program history log:
Date | Programmer | Comments |
---|---|---|
2005-11-29 | J. Ator | Original author |
f77int rbytes | ( | char * | bmg, |
f77int * | mxmb, | ||
f77int | isloc, | ||
f77int | newbytes | ||
) |
This function reads a specified number of bytes from the system file that was opened via the most recent call to subroutine cobfl() with io = 'r'.
[in] | mxmb | – f77int*: Dimensioned size (in bytes) of bmg; used by the function to ensure that it doesn't overflow the bmg array |
[in] | isloc | – f77int: Starting byte within bmg into which to read the next newbytes bytes |
[in] | newbytes | – f77int: Number of bytes to read from system file most recently opened for input/reading via subroutine cobfl() |
[out] | bmg | – char*: Array containing the newbytes bytes that were read, beginning at byte number isloc |
Program history log:
Date | Programmer | Comments |
---|---|---|
2005-11-29 | J. Ator | Original author |
Definition at line 40 of file rbytes.c.
References pbf.
Referenced by crbmg().