NCEPLIBS-bufr  12.0.0
stseq.c File Reference

Store information about a standard Table D descriptor within internal DX BUFR tables. More...

#include "bufrlib.h"
#include "mstabs.h"

Go to the source code of this file.

Functions

int cmpia (const void *pf1, const void *pf2)
 Define a comparison between two integers. More...
 
void nummtb (int *idn, char *tab, int *ipt)
 Search for an entry in the BUFR master table. More...
 
void stseq (int lun, int *irepct, int idn, char *nemo, char *cseq, int *cdesc, int ncdesc)
 Store information about a standard Table D descriptor within internal DX BUFR tables. More...
 

Detailed Description

Store information about a standard Table D descriptor within internal DX BUFR tables.

Author
J. Ator
Date
2009-03-23

Definition in file stseq.c.

Function Documentation

◆ cmpia()

int cmpia ( const void *  pf1,
const void *  pf2 
)

Define a comparison between two integers.

This routine defines a comparison between two integers for use by the binary search function bsearch.

Parameters
pf1- first integer to be compared.
pf2- second integer to be compared.
Returns
  • -1 PF1 is less than PF2
  • 0 PF1 is equal to PF2
  • 1 PF1 is greater than PF2
Author
J. Ator
Date
2009-03-23

Definition at line 28 of file stseq.c.

Referenced by nummtb().

◆ nummtb()

void nummtb ( int *  idn,
char *  tab,
int *  ipt 
)

Search for an entry in the BUFR master table.

This routine searches for an entry corresponding to idn in the bufr master table (either 'B' or 'D', depending on the value of idn). The search uses binary search logic, so all of the entries in the table must be sorted in ascending order (by FXY number) in order for this routine to work properly.

Parameters
idn- WMO bit-wise representation of FXY number to be searched for.
tab- table in which idn was found ('B' or 'D').
ipt- index of entry for idn in master table tab.
Author
J. Ator
Date
2009-03-23

Definition at line 54 of file stseq.c.

References bort_f(), cadn30_f(), cmpia(), FXY_STR_LEN, ibfxyn_c, idfxyn_c, ifxy_f(), MIN_FXY_TABLED, nmtb_c, and nmtd_c.

Referenced by stseq().

◆ stseq()

void stseq ( int  lun,
int *  irepct,
int  idn,
char *  nemo,
char *  cseq,
int *  cdesc,
int  ncdesc 
)

Store information about a standard Table D descriptor within internal DX BUFR tables.

Given the bit-wise (integer) representation of a WMO-standard Table D descriptor, this subroutine uses the master BUFR tables to store all of the necessary information for that descriptor within the internal DX BUFR tables. Any child descriptors which are themselves Table D descriptors are automatically resolved via a recursive call to this same subroutine.

Parameters
lun- File ID.
irepct- Replication sequence counter for the current master table; used internally to keep track of which sequence names have already been defined, and thereby avoid contention within the internal DX BUFR Table D.
idn- WMO bit-wise representation of FXY value for WMO-standard Table D descriptor
nemo- Mnemonic corresponding to idn.
cseq- Description corresponding to idn.
cdesc- Array of WMO-standard child descriptors equivalent to idn.
ncdesc- Number of WMO-standard child descriptors in cdesc.
Author
J. Ator
Date
2009-03-23

Definition at line 111 of file stseq.c.

References bort_f(), cadn30_f(), cbbw_c, cbelem_c, cbmnem_c, cbscl_c, cbsref_c, cbunit_c, cdmnem_c, cdseq_c, elemdx_f(), FXY_STR_LEN, icvidx(), idefxy_c, ifxy_f(), igetntbi_f(), igetprm_f(), igettdi_f(), imrkopr_f(), MAX_FXY_TABLEB, MIN_FXY_REPL, MIN_FXY_TABLED, MXNAF, ndelem_c, NEMO_STR_LEN, nemtab_f(), nummtb(), numtbd_f(), pktdd_f(), stntbi_f(), and strnum_f().