NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
srchtbf.c File Reference

Search for a specified master Code/Flag table entry. More...

#include "bufrlib.h"
#include "cfe.h"

Go to the source code of this file.

Functions

void srchtbf (f77int *ifxyi, f77int *ivali, f77int *ifxyd, f77int *mxfxyd, f77int *ivald, char *meaning, f77int *mxmng, f77int *lnmng, f77int *iret)
 This subroutine searches for a specified FXY number and associated value (code figure or bit number) within the internal memory structure for storage of master Code/Flag table entries, and if found returns the associated meaning as a character string. More...
 

Detailed Description

Search for a specified master Code/Flag table entry.

Definition in file srchtbf.c.

Function Documentation

void srchtbf ( f77int *  ifxyi,
f77int *  ivali,
f77int *  ifxyd,
f77int *  mxfxyd,
f77int *  ivald,
char *  meaning,
f77int *  mxmng,
f77int *  lnmng,
f77int *  iret 
)

This subroutine searches for a specified FXY number and associated value (code figure or bit number) within the internal memory structure for storage of master Code/Flag table entries, and if found returns the associated meaning as a character string.

The search may optionally include a specified second FXY number and associated value upon which the first FXY number and its associated value depend, for example when the meaning of an originating sub-center value depends on the identity of the originating center for which the sub-center in question is a member.

Author
J. Ator
Date
2018-01-11
Parameters
[in]ifxyi- f77int*: Bitwise representation of FXY number to search for
[in]ivali- f77int*: Value (code figure or bit number) associated with ifxyi
[in,out]ifxyd- f77int*:
  • On input, ifxyd[0] is set to the bitwise representation of the FXY number upon which ifxyi and ivali depend, or else set to (-1) if ifxyi and ivali do not depend on the value associated with any other FXY number
  • On output, if the initial search of the master Code/Flag table was unsuccessful, and if ifxyd[0] and ivald were both set to (-1) on input, and if a second search of the table determines that the meaning of ifxyi and ivali indeed depends on one or more other FXY numbers, then the bitwise representations of those FXY numbers are returned within the first iret elements of ifxyd
[in]ivald- f77int*: Value (code figure or bit number) associated with the FXY number in ifxyd[0]; set to (-1) whenever ifxyd[0] is also set to (-1)
[in]mxfxyd- f77int*: Dimensioned size (in f77ints) of ifxyd; used by the subroutine to ensure that it doesn't overflow the ifxyd array
[in]mxmng- f77int*: Dimensioned size (in bytes) of meaning string; used by the subroutine to ensure that it doesn't overflow the meaning string
[out]meaning- char*: Meaning corresponding to ifxyi and ivali (and to ifxyd[0] and ivald, if specified on input)
[out]lnmng- f77int*: Length (in bytes) of string returned in CMEANG
[out]iret- f77int*: return code
  • 0 = meaning found and stored in meaning string
  • -1 = meaning not found
  • >0 = meaning not found, and ifxyd[0] and ivald were both set to (-1) on input, and the meaning of ifxyi and ivali depends on the the value associated with one of the FXY numbers whose bitwise representation is stored in the first iret elements of ifxyd

Program history log:

  • 2018-01-11 J. Ator – Original author

Definition at line 72 of file srchtbf.c.

References cfe, cmpstia1(), cmpstia2(), code_flag_entry::iffxyn, code_flag_entry::iffxynd, code_flag_entry::ifmeaning, code_flag_entry::ifval, code_flag_entry::ifvald, and nmtf.

Referenced by getcfmng(), and ufdump().