NCEPLIBS-bufr 11.7.1
inittbf.c
Go to the documentation of this file.
1
5#include "bufrlib.h"
6#define IN_INITTBF
7#include "cfe.h"
8
22void inittbf( void )
23{
24 char brtstr[50] = "BUFRLIB: INITTBF FAILED ALLOCATING CFE";
25
26 /*
27 ** Has array space for the internal memory structure been
28 ** allocated yet?
29 */
30 if ( cfe == NULL ) {
31
32 mxmtbf = igetprm( "MXMTBF", 6 );
33
34 if ( ( cfe = malloc( mxmtbf * sizeof(struct code_flag_entry) ) )
35 == NULL ) {
36 bort( brtstr, ( f77int ) strlen( brtstr ) );
37 }
38 }
39
40 nmtf = 0;
41}
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
Define signatures and declare variables for internal storage of master Code/Flag table entries.
f77int mxmtbf
Maximum number of master Code/Flag table entries, counting across all individual Code/Flag tables,...
f77int nmtf
Number of stored master Code/Flag table entries in cfe, up to a maximum of MXMTBF.
struct code_flag_entry * cfe
Master Code/Flag table entries.
This structure contains array and variable declarations used to store a master Code/Flag table entry.
Definition: cfe.h:33
integer function igetprm(CPRMNM)
This function returns the current value of a parameter used for allocating one or more internal array...
Definition: igetprm.f:84
void inittbf(void)
This subroutine initializes the internal memory structure for storage of master Code/Flag table entri...
Definition: inittbf.c:22