/*
 * STRUCT: SE_DRM_FIELD_STRUCTURE
 *
 *   Used in SE_DRM_TYPE_STRUCTURE to provide meta-data (the name, length,
 *   offset, etc.) about a field within a C struct. (Also used in
 *   SE_CLASS_STRUCTURE to provide meta-data about a class' fields.)  This
 *   meta-data is available for all the C 'typedefs' defined in the SEDRIS
 *   DRM. The list of SEDRIS C 'typedefs' is defined by the SE_DRM_TYPE_ENUM
 *   enumeration, and the function to obtain the meta-data for any of those
 *   'typedefs' is SE_GetDRMTypeStructure().
 *
 *   name_ptr - name of field, e.g. "string_length" is the name of the 2nd
 *              member of the SE_STRING type
 *
 *   offset - offset (in bytes). Within an SE_CLASS_STRUCTURE, offset is
 *            measured from the beginning of the class' fields, while within
 *            an SE_DRM_TYPE_STRUCTURE, it is measured from the beginning of
 *            the type definition.
 *
 *   size -  size (in bytes) of field
 *
 *   field_modifier - whether, when the field was declared within the typedef,
 *      it was modified by a pointer or an array symbol next to the field name.
 *      The answer can be:
 *        a 1-dimensional array
 *        a 2-dimensional array
 *        a pointer
 *        a union (unions are special - they count as modifiers)
 *        just a plain field (a field with no modifications)
 *
 *   underlying_drm_type - specifies the field's underlying type, unless this
 *                         is a union field (in which case it is
 *                         SE_NULL_DRM_TYPE). Note that this is stored as
 *                         an SE_INT32 rather than an SE_DRM_TYPE_ENUM,
 *                         to allow its use for more than one version of
 *                         the DRM at a time (backward/forward compatibility).
 *
 *   first_dimension - if this field is an array, size of 1st dimension
 *                     otherwise 0
 *
 *   second_dimension - if this field is a 2D array, size of 2nd dimension
 *                      otherwise 0
 *
 *   union_member_count - if this field is a union, # members; otherwise 0
 *
 *   union_members - if this field is a union, array of members of the union;
 *                   otherwise NULL
 *
 * EXAMPLES:
 * EDCS_CC_ID tag, the first field of BASE_CLASSIFICATION_DATA, would have
 *        name_ptr            = "tag";
 *        offset              = offsetof(SE_BASE_CLASSIFICATION_DATA, tag);
 *        size                = sizeof(EDCS_CC_ID);
 *        field_modifier      = SE_PLAIN;
 *        underlying_drm_type = (SE_INT32)EDCS_CC_ID_DRM_TYPE;
 *        first_dimension     = 0;
 *        second_dimension    = 0;
 *        union_member_count  = 0;
 *        union_members       = NULL;
 *
 * float64 mat[3][3], the first field of SE_MATRIX_3X3_TYPE,  would have
 *        name_ptr            = "mat";
 *        offset              = offsetof(SE_MATRIX_3X3_TYPE, mat);
 *        size                = sizeof(float64[3][3]);
 *        field_modifier      = SE_2D_ARRAY;
 *        underlying_drm_type = (SE_INT32)SE_FLOAT64_DRM_TYPE;
 *        first_dimension     = 3;
 *        second_dimension    = 3;
 *        union_member_count  = 0;
 *        union_members       = NULL;
 *
 * char *string_value, the first field of SE_STRING, would have
 *        name_ptr            = "string_value";
 *        offset              = offsetof(SE_STRING, string_value);
 *        size                = sizeof(char *);
 *        field_modifier      = SE_POINTER;
 *        underlying_drm_type = (SE_INT32)SE_CHAR_DRM_TYPE;
 *        first_dimension     = 0;
 *        second_dimension    = 0;
 *        union_member_count  = 0;
 *        union_members       = NULL;
 *
 * union u in SE_COLOR_DATA
 *        name_ptr            = "u";
 *        offset              = offsetof(SE_COLOR_DATA,u);
 *        size                = MAX(sizeof(SE_CMY_DATA),
 *                                  MAX(sizeof(HSV_DATA), sizeof(RGB_DATA));
 *        field_modifier      = SE_UNION;
 *        underlying_drm_type = (SE_INT32)SE_NULL_DRM_TYPE;
 *        first_dimension     = 0;
 *        second_dimension    = 0;
 *        union_member_count  = 3;
 *
 *        union_members[0].name_ptr       = "cmy";
 *        union_members[0].offset         = 0; // from beginning of union
 *        union_members[0].size           = sizeof(SE_CMY_DATA);
 *        union_members[0].field_modifier    = SE_PLAIN_FIELD;
 *        union_members[0].underlying_drm_type =(SE_INT32)SE_CMY_DATA_DRM_TYPE;
 *        union_members[0].first_dimension   = 0;
 *        union_members[0].second_dimension  = 0;
 *        union_members[0].union_member_count = 0;
 *        union_members[0].union_members     = NULL;
 *
 *        union_members[1].name_ptr       = "hsv";
 *        union_members[1].offset         = 0; // from beginning of union
 *        union_members[1].size           = sizeof(SE_HSV_DATA);
 *        union_members[1].field_modifier    = SE_PLAIN_FIELD;
 *        union_members[1].underlying_drm_type =(SE_INT32)SE_HSV_DATA_DRM_TYPE;
 *        union_members[1].first_dimension   = 0;
 *        union_members[1].second_dimension  = 0;
 *        union_members[1].union_member_count = 0;
 *        union_members[1].union_members     = NULL;
 *
 *        union_members[2].name_ptr       = "rgb";
 *        union_members[2].offset         = 0; // from beginning of union
 *        union_members[2].size           = sizeof(SE_RGB_DATA);
 *        union_members[2].field_modifier    = SE_PLAIN_FIELD;
 *        union_members[2].underlying_drm_type =(SE_INT32)SE_RGB_DATA_DRM_TYPE;
 *        union_members[2].first_dimension   = 0;
 *        union_members[2].second_dimension  = 0;
 *        union_members[2].union_member_count = 0;
 *        union_members[2].union_members     = NULL;
 */
typedef structse_drm_field_structure
{
const char *name_ptr;
SE_UINT16 offset;
SE_UINT16 size;
SE_FIELD_MODIFIER_ENUM field_modifier;
SE_INT32 underlying_drm_type;
SE_UINT16 first_dimension; (notes)
SE_UINT16 second_dimension; (notes)
/*
* apply to unions
*/
SE_UINT16 union_member_count;
const struct se_drm_field_structure *union_members;
} SE_DRM_FIELD_STRUCTURE;


Field Notes

first_dimension

 applies to 1d and 2d arrays

second_dimension

 applies to 2d arrays
Prev: SE_DISPLAY_STYLE_ENUM. Next: SE_DRM_STATUS_CODE_ENUM. Up:Index