NCEPLIBS-bufr  11.5.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 
33 void cwbmg( char *bmg, f77int *nmb, f77int *iret )
34 {
35  char errstr[129];
36 
37 /*
38 ** Make sure that a file is open for writing.
39 */
40  if ( pbf[1] == NULL ) {
41  sprintf( errstr, "BUFRLIB: CWBMG - NO FILE IS OPEN FOR WRITING" );
42  bort( errstr, ( f77int ) strlen( errstr ) );
43  }
44 /*
45 ** Write the BUFR message to the file.
46 */
47  *iret = ( ( fwrite( bmg, 1, *nmb, pbf[1] ) == *nmb ) ? 0 : -1 );
48 
49  return;
50 }
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:33
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23