NCEPLIBS-bufr 11.7.1
rbytes.c
Go to the documentation of this file.
1
6#include "bufrlib.h"
7#include "cobfl.h"
8
40f77int rbytes( char *bmg, f77int *mxmb, f77int isloc, f77int newbytes )
41{
42 short iret;
43
44 if ( ( isloc + newbytes ) > *mxmb ) {
45 iret = 1;
46 }
47 else if ( fread( &bmg[isloc], 1, newbytes, pbf[0] ) != newbytes ) {
48 iret = ( feof(pbf[0]) ? -1 : -2 );
49 }
50 else {
51 iret = 0;
52 }
53
54 return (f77int) iret;
55}
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
Define signatures and declare variables for reading or writing BUFR messages via a C language interfa...
FILE * pbf[2]
File pointers.
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 rec...
Definition: rbytes.c:40