NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
nummtb.c
Go to the documentation of this file.
1 
6 #include "bufrlib.h"
7 #include "mstabs.h"
8 
43 void nummtb( f77int *idn, char *tab, f77int *ipt )
44 {
45  f77int *pifxyn, *pbs, nmt;
46 
47  char adn[7], errstr[129];
48 
49  if ( *idn >= ifxy( "300000", 6 ) ) {
50  *tab = 'D';
51  pifxyn = &MSTABS_BASE(idfxyn)[0];
52  nmt = MSTABS_BASE(nmtd);
53  }
54  else {
55  *tab = 'B';
56  pifxyn = &MSTABS_BASE(ibfxyn)[0];
57  nmt = MSTABS_BASE(nmtb);
58  }
59 
60  pbs = ( f77int * ) bsearch( idn, pifxyn, ( size_t ) nmt, sizeof( f77int ),
61  ( int (*) ( const void *, const void * ) ) cmpia );
62  if ( pbs == NULL ) {
63  cadn30( idn, adn, sizeof( adn ) );
64  adn[6] = '\0';
65  sprintf( errstr, "BUFRLIB: NUMMTB - COULD NOT FIND DESCRIPTOR "
66  "%s IN MASTER TABLE %c", adn, *tab );
67  bort( errstr, ( f77int ) strlen( errstr ) );
68  }
69  *ipt = pbs - pifxyn;
70 
71  return;
72 }
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
void nummtb(f77int *idn, char *tab, f77int *ipt)
C C SUBPROGRAM: NUMMTB C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE SEARCHES ...
Definition: nummtb.c:43
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
subroutine cadn30(IDN, ADN)
GIVEN THE BIT-WISE REPRESENTATION OF THE FXY VALUE FOR A DESCRIPTOR, THIS ROUTINE CALLS FUNCTION ADN3...
Definition: cadn30.f:29
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
Define signatures and declare variables for internal storage of master Table B and Table D entries...
int cmpia(const void *pf1, const void *pf2)
C C SUBPROGRAM: CMPIA C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE DEFINES A ...
Definition: cmpia.c:41