NCEPLIBS-bufr
11.5.0
|
Define signatures and declare variables for internal storage of master Code/Flag table entries. More...
Go to the source code of this file.
Data Structures | |
struct | code_flag_entry |
This structure contains array and variable declarations used to store a master Code/Flag table entry. More... | |
Macros | |
#define | MAX_MEANING_LEN 150 |
Functions | |
int | cmpstia1 (const void *, const void *) |
This function defines a comparison between two entries within the internal memory structure for storage of master Code/Flag table entries. More... | |
int | cmpstia2 (const void *, const void *) |
This function defines a comparison between two entries within the internal memory structure for storage of master Code/Flag table entries. More... | |
void | dlloctbf (void) |
This subroutine frees any memory that was dynamically allocated during a previous call to subroutine inittbf(). More... | |
void | inittbf (void) |
This subroutine initializes the internal memory structure for storage of master Code/Flag table entries, including dynamically allocating space for this structure if needed. More... | |
void | sorttbf (void) |
This subroutine sorts the entries within the internal memory structure for storage of master Code/Flag table entries, in preparation for future searches using subroutine srchtbf(). More... | |
void | srchtbf (f77int *, f77int *, f77int *, f77int *, f77int *, char *, f77int *, f77int *, f77int *) |
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... | |
void | strtbfe (f77int *, f77int *, char *, f77int *, f77int *, f77int *) |
This subroutine adds a new entry to the internal memory structure for storage of master Code/Flag table entries. More... | |
Variables | |
struct code_flag_entry * | cfe |
Master Code/Flag table entries. More... | |
f77int | mxmtbf |
Maximum number of master Code/Flag table entries, counting across all individual Code/Flag tables, and counting each defined code figure (within each individual Code table) or defined bit number (within each individual Flag table) as a separate entry. More... | |
f77int | nmtf |
Number of stored master Code/Flag table entries in cfe, up to a maximum of MXMTBF. More... | |
Define signatures and declare variables for internal storage of master Code/Flag table entries.
Definition in file cfe.h.
struct code_flag_entry |
This structure contains array and variable declarations used to store a master Code/Flag table entry.
int cmpstia1 | ( | const void * | pe1, |
const void * | pe2 | ||
) |
This function defines a comparison between two entries within the internal memory structure for storage of master Code/Flag table entries.
The comparison is used by the intrinsic C functions qsort and bsearch, and it differs from the the comparison in function cmpstia2() because it compares all of the iffxyn, ifval, iffxynd and ifvald components of the structure, whereas cmpstia2() only compares the iffxyn and ifval components.
[in] | pe1 | - struct code_flag_entry*: First master Code/Flag table entry |
[in] | pe2 | - struct code_flag_entry*: Second master Code/Flag table entry |
Program history log:
Definition at line 32 of file cmpstia1.c.
References code_flag_entry::iffxyn, code_flag_entry::iffxynd, code_flag_entry::ifval, and code_flag_entry::ifvald.
int cmpstia2 | ( | const void * | pe1, |
const void * | pe2 | ||
) |
This function defines a comparison between two entries within the internal memory structure for storage of master Code/Flag table entries.
The comparison is used by the intrinsic C function bsearch, and it differs from the the comparison in function cmpstia1() because it only compares the iffxyn and ifval components of the structure, whereas cmpstia1() compares all of the iffxyn, ifval, iffxynd and ifvald components of the structure.
[in] | pe1 | - struct code_flag_entry*: First master Code/Flag table entry |
[in] | pe2 | - struct code_flag_entry*: Second master Code/Flag table entry |
Program history log:
Definition at line 32 of file cmpstia2.c.
References code_flag_entry::iffxyn, and code_flag_entry::ifval.
Referenced by srchtbf().
void dlloctbf | ( | void | ) |
This subroutine frees any memory that was dynamically allocated during a previous call to subroutine inittbf().
Program history log:
Definition at line 18 of file dlloctbf.c.
References cfe.
Referenced by exitbufr().
void inittbf | ( | void | ) |
This subroutine initializes the internal memory structure for storage of master Code/Flag table entries, including dynamically allocating space for this structure if needed.
Program history log:
Definition at line 20 of file inittbf.c.
References bort(), cfe, igetprm(), mxmtbf, and nmtf.
Referenced by rdmtbf().
void sorttbf | ( | void | ) |
This subroutine sorts the entries within the internal memory structure for storage of master Code/Flag table entries, in preparation for future searches using subroutine srchtbf().
Program history log:
Definition at line 18 of file sorttbf.c.
References cfe, cmpstia1(), and nmtf.
Referenced by rdmtbf().
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.
[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*:
|
[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
|
Program history log:
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().
void strtbfe | ( | f77int * | ifxyn, |
f77int * | ival, | ||
char * | meaning, | ||
f77int * | lmeaning, | ||
f77int * | idfxy, | ||
f77int * | idval | ||
) |
This subroutine adds a new entry to the internal memory structure for storage of master Code/Flag table entries.
[in] | ifxyn | - f77int*: Bitwise representation of FXY number for which ival is a defined code or flag table entry |
[in] | ival | - f77int*: Code figure or bit number |
[in] | meaning | - char*: Meaning associated with ifxyn and ival |
[in] | lmeaning | - f77int*: Length (in bytes) of meaning |
[in] | idfxy | - f77int*: Bitwise representation of FXY number upon which ifxyn and ival depend (if any), or else set to a value of (-1) |
[in] | idval | - f77int*: Code figure or bit number associated with idfxy and upon which ifxyn and ival depend (if any), or else set to (-1) whenever idfxy is also set to (-1) |
Program history log:
Definition at line 31 of file strtbfe.c.
References bort(), cfe, code_flag_entry::iffxyn, code_flag_entry::iffxynd, code_flag_entry::ifmeaning, code_flag_entry::ifval, code_flag_entry::ifvald, mxmtbf, and nmtf.
Referenced by sntbfe().
cfe |
Master Code/Flag table entries.
Referenced by dlloctbf(), inittbf(), sorttbf(), srchtbf(), and strtbfe().
mxmtbf |