NCEPLIBS-bufr  11.7.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 converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:42
subroutine cadn30(IDN, ADN)
This subroutine converts an FXY value from its bit-wise (integer) representation to its 6 character r...
Definition: cadn30.f:23
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22
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