NCEPLIBS-bufr 11.7.1
cmpstia1.c
Go to the documentation of this file.
1
5#include "bufrlib.h"
6#include "cfe.h"
7
34int cmpstia1( const void *pe1, const void *pe2 )
35{
36 struct code_flag_entry *mype1 = ( struct code_flag_entry * ) pe1;
37 struct code_flag_entry *mype2 = ( struct code_flag_entry * ) pe2;
38
39 if ( mype1->iffxyn == mype2->iffxyn ) {
40 if ( mype1->ifval == mype2->ifval ) {
41 if ( mype1->iffxynd == mype2->iffxynd ) {
42 if ( mype1->ifvald == mype2->ifvald ) return 0;
43 return ( mype1->ifvald < mype2->ifvald ? -1 : 1 );
44 }
45 else {
46 return ( mype1->iffxynd < mype2->iffxynd ? -1 : 1 );
47 }
48 }
49 else {
50 return ( mype1->ifval < mype2->ifval ? -1 : 1 );
51 }
52 }
53 else {
54 return ( mype1->iffxyn < mype2->iffxyn ? -1 : 1 );
55 }
56}
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
Define signatures and declare variables for internal storage of master Code/Flag table entries.
f77int iffxynd
Bit-wise representation of FXY number upon which this entry is dependent, if any.
Definition: cfe.h:54
f77int ifval
Code figure or bit number.
Definition: cfe.h:52
f77int ifvald
Code figure or bit number upon which this entry is dependent, if any.
Definition: cfe.h:55
f77int iffxyn
Bit-wise representation of FXY number to which this entry belongs.
Definition: cfe.h:51
This structure contains array and variable declarations used to store a master Code/Flag table entry.
Definition: cfe.h:33
int cmpstia1(const void *pe1, const void *pe2)
This function defines a comparison between two entries within the internal memory structure for stora...
Definition: cmpstia1.c:34