// 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 your own PKY macros - allows us to cut
// down parameters = 2 if we make some assumptions
// about the position and size
// The only parameters we need are the address of
// key area and the organisation

// These are generic macros and can be used
// with ANY file

#define SET_PKY40(A, B)                        \
df_setkey(A, 1, 2, 1, DF_EQ,                   \
          0, 0X40, B,                          \
          DF_CONST)


#define SET_PKY80(A, B)                        \
df_setkey(A, 1, 2, 1, DF_EQ,                   \
          0, 0X80, B,                          \
          DF_CONST)


// EXAMPLE CODE USING MACRO
// This Example is using the previously defined
// macros and allows us to only worry about 2
// parameters and the name of the macro indicates
// the type of parameter being used to set the key

SET_PKY40(pKeys, DF_UPORG);

if(ptr != NULL)
{
DF_MASK_KEY(pKeys, 2,
          offsetof(tr01k40, grctind),
          member_size(tr01k40, grctind),
          DF_O,
          0X21,
          DF_NOORG);
}


