NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
cwbmg.c
Go to the documentation of this file.
1 
5 #include "bufrlib.h"
6 #include "cobfl.h"
7 
35 void cwbmg( char *bmg, f77int *nmb, f77int *iret )
36 {
37  char errstr[129];
38 
39 /*
40 ** Make sure that a file is open for writing.
41 */
42  if ( pbf[1] == NULL ) {
43  sprintf( errstr, "BUFRLIB: CWBMG - NO FILE IS OPEN FOR WRITING" );
44  bort( errstr, ( f77int ) strlen( errstr ) );
45  }
46 /*
47 ** Write the BUFR message to the file.
48 */
49  *iret = ( ( fwrite( bmg, 1, *nmb, pbf[1] ) == *nmb ) ? 0 : -1 );
50 
51  return;
52 }
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...
void cwbmg(char *, f77int *, f77int *)
This subroutine writes a BUFR message to the system file that was opened via the most recent call to ...
Definition: cwbmg.c:35
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22