// Copyright Statement: Paul Stuyvesant for PCS Training Ltd permits others to // copy, distribute, display, and perform the work. In return, licensees must // give the original author credit. No finanial charge may be made for any // derivitive use of these macros. // Set up our own setkey macros - allows us to cut // down parameters to 7. The advantage of consistently using // these macros is that they are less prone to programmer errors // than the original df_setkey() functions. #define DF_CONST_KEY(A, B, C, D, E, F, G ) \ df_setkey(A, B, C, D, E, \ 0, \ F, G, \ DF_CONST) #define DF_MASK_KEY(A, B, C, D, E, F, G) \ df_setkey(A, B, C, D, E, \ 0, \ F, G, \ DF_MASK) #define DF_CHAR_KEY(A, B, C, D, E, F, G) \ df_setkey(A, B, C, D, E, F, \ 0, \ G , \ DF_CHAR) // EXAMPLE CODE USING CONST AND MASK // This Example is using the previously defined // macros and allows us to only worry about 7 // parameters and the name of the macro indicates // the type of parameter being used to set the key DF_CONST_KEY(pKeys, 1, offsetof(tr01k40, grctkey), member_size(tr01k40, grctkey), DF_EQ, GRCTK40, DF_UPORG); if(ptr != NULL) { DF_MASK_KEY(pKeys, 2, offsetof(tr01k40, grctind), member_size(tr01k40, grctind), DF_O, 0X21, DF_NOORG); }