NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
rbytes.c
Go to the documentation of this file.
1 
6 #include "bufrlib.h"
7 #include "cobfl.h"
8 
38 f77int rbytes( char *bmg, f77int *mxmb, f77int isloc, f77int newbytes )
39 {
40  short iret;
41 
42  if ( ( isloc + newbytes ) > *mxmb ) {
43  iret = 1;
44  }
45  else if ( fread( &bmg[isloc], 1, newbytes, pbf[0] ) != newbytes ) {
46  iret = ( feof(pbf[0]) ? -1 : -2 );
47  }
48  else {
49  iret = 0;
50  }
51 
52  return (f77int) iret;
53 }
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
FILE * pbf[2]
File pointers.
Define signatures and declare variables for reading or writing BUFR messages via a C language interfa...
f77int rbytes(char *, f77int *, f77int, f77int)
This function reads a specified number of bytes from the system file that was opened via the most rec...
Definition: rbytes.c:38