NCEPLIBS-bufr  12.1.0
cread.c File Reference

C language interface for reading or writing BUFR messages. More...

#include "bufrlib.h"
#include "cread.h"

Go to the source code of this file.

Functions

void backbufr (int nfile)
 Backspace a BUFR file by one BUFR message. More...
 
void cewind (int nfile)
 Rewind a BUFR file back to its beginning. More...
 
void closfb (int nfile)
 Close a previously opened BUFR file. More...
 
int crdbufr (int nfile, int *bufr, int mxwrd)
 Read the next message from a BUFR file that was previously opened for reading. More...
 
void cwrbufr (int nfile, int *bufr, int nwrd)
 Write a BUFR message into a file that was previously opened for writing. More...
 
void openab (int nfile, char *ufile)
 Open a new file for appending BUFR messages. More...
 
void openrb (int nfile, char *ufile)
 Open a new file for reading BUFR messages. More...
 
void openwb (int nfile, char *ufile)
 Open a new file for writing BUFR messages. More...
 

Detailed Description

C language interface for reading or writing BUFR messages.

This interface is used internally by many of the Fortran language file-reading/writing subroutines and message-reading/writing subroutines within the NCEPLIBS-bufr software, in order to use C to directly read/write BUFR messages from/to files.

This in turn eliminates the need for IEEE Fortran control words within files, though such control words can still be included when writing BUFR messages to files (if desired) via a previous call to subroutine setblock().

Author
J. Woollen
Date
2012-09-15

Definition in file cread.c.

Function Documentation

◆ backbufr()

void backbufr ( int  nfile)

Backspace a BUFR file by one BUFR message.

Parameters
nfile- File ID.
Author
J. Woollen
Date
2012-09-15

Definition at line 68 of file cread.c.

References lstpos, and pb.

◆ cewind()

void cewind ( int  nfile)

Rewind a BUFR file back to its beginning.

Parameters
nfile- File ID.
Author
J. Woollen
Date
2012-09-15

Definition at line 80 of file cread.c.

References pb.

◆ closfb()

void closfb ( int  nfile)

Close a previously opened BUFR file.

Parameters
nfile- File ID.
Author
J. Woollen
Date
2012-09-15

Definition at line 92 of file cread.c.

References pb.

◆ crdbufr()

int crdbufr ( int  nfile,
int *  bufr,
int  mxwrd 
)

Read the next message from a BUFR file that was previously opened for reading.

Parameters
nfile- File ID.
bufr- BUFR message.
mxwrd- Number of elements in bufr array; used by the function to ensure that it doesn't overflow the array.
Returns
  • 0 normal return.
  • -1 end-of-file encountered while reading.
  • -2 I/O error encountered while reading.
  • -3 overflow of bufr array.
Author
J. Woollen
Date
2012-09-15

Definition at line 114 of file cread.c.

References iupbs01_f(), lstpos, and pb.

◆ cwrbufr()

void cwrbufr ( int  nfile,
int *  bufr,
int  nwrd 
)

Write a BUFR message into a file that was previously opened for writing.

Parameters
nfile- File ID.
bufr- BUFR message.
nwrd- Size (in integers) of bufr.
Author
J. Woollen
Date
2012-09-15

Definition at line 199 of file cread.c.

References pb.

◆ openab()

void openab ( int  nfile,
char *  ufile 
)

Open a new file for appending BUFR messages.

Parameters
nfile- File ID.
ufile- [path/]name of file to be opened.
Author
J. Woollen
Date
2012-09-15

Definition at line 56 of file cread.c.

References pb.

◆ openrb()

void openrb ( int  nfile,
char *  ufile 
)

Open a new file for reading BUFR messages.

Parameters
nfile- File ID.
ufile- [path/]name of file to be opened.
Author
J. Woollen
Date
2012-09-15

Definition at line 30 of file cread.c.

References pb.

◆ openwb()

void openwb ( int  nfile,
char *  ufile 
)

Open a new file for writing BUFR messages.

Parameters
nfile- File ID.
ufile- [path/]name of file to be opened.
Author
J. Woollen
Date
2012-09-15

Definition at line 43 of file cread.c.

References pb.