Optim Data Privacy Providers  11.7.0
 All Data Structures Files Functions Variables Macros Groups Pages
Structure Members
DP_INIT_OP_DEF Struct Reference

#include <ODPPCmnAPI.h>

Collaboration diagram for DP_INIT_OP_DEF:
Collaboration graph

Structure Members

struct DP_INIT_OP_DEFpNext
 
char cEyeCatcher [4]
 
short sStructVer
 
short sStructLen
 
unsigned short usParameterID
 
int iValueSubType
 
int iValueBufBytes
 
unsigned int uiVal
 
DPPRM_VAL_WC_SSpWC
 
DPPRM_VAL_MC_SSpMC
 
void * pUserVal
 

Structure Description

Structure Member Documentation

struct DP_INIT_OP_DEF* pNext
  • Use:
    This member is used to point to the next parameter.
  • Description:
    This is a pointer to the next element in the chain of DP_INIT_OP_DEF structures. Each parameter is represented by a DP_INIT_OP_DEF structure instance and multiple parameters must be chained together using this member.

    Example:
    DP_SVC_DEF SvcDef; //Service Definition structure
    DP_INIT_OP_DEF *pOprDef = NULL, *pTmpOprDef = NULL; //DP_INIT_OP_DEF structure pointers
    memset(&SvcDef, 0, sizeof(DP_SVC_DEF)); //Clear the Service Definition
    //first parameter
    pTmpOprDef = (DP_INIT_OP_DEF *) malloc(sizeof(DP_INIT_OP_DEF)); //Allocate memory for the first parameter
    if(NULL == pTmpOprDef) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for first parameter");
    goto CleanSvcDef;
    }
    memset(pTmpOprDef, 0, sizeof(DP_INIT_OP_DEF)); //Clear the allocated memory for the parameter
    pTmpOprDef->usParameterID = ODPP_OPR_SWITCH_NA; //Mandatory Switch parameter. No value is required for this parameter
    pTmpOprDef->iValueSubType = PARAM_VAL_NONE; //To indicate that current parameter does not hold any value
    pOprDef = pTmpOprDef; //pOprDef is set to point to the first parameter
    //second parameter
    pTmpOprDef->pNext = (DP_INIT_OP_DEF *) malloc(sizeof(DP_INIT_OP_DEF)); //Allocate memory for the second parameter
    if(NULL == pTmpOprDef->pNext) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for second parameter");
    goto CleanSvcDef;
    }
    pTmpOprDef = pTmpOprDef->pNext; //pTmpOprDef points to the second parameter
    memset(pTmpOprDef, 0, sizeof(DP_INIT_OP_DEF)); //Clear the allocated memory for the parameter
    pTmpOprDef->usParameterID = ODPP_OPR_METHOD; //This parameter is used to specify the Method to choose during masking
    pTmpOprDef->iValueSubType = PARAM_VAL_NUM //To indicate that current parameter will hold numeric value
    pTmpOprDef->PV.uiVal = ODPP_METHOD_MASK; //Generates a consistently masked output
    //third parameter
    pTmpOprDef->pNext = (DP_INIT_OP_DEF *) malloc(sizeof(DP_INIT_OP_DEF)); //Allocate memory for the third parameter
    if(NULL == pTmpOprDef->pNext) //Check if memory was allocated successfully
    {
    printf("Failed to allocate memory for third parameter");
    goto CleanSvcDef;
    }
    pTmpOprDef = pTmpOprDef->pNext; //pTmpOprDef points to the third parameter
    memset(pTmpOprDef, 0, sizeof(DP_INIT_OP_DEF)); //Clear the allocated memory for the parameter
    pTmpOprDef->usParameterID = ODPP_OPR_SOURCE_COLINDEX; //This parameter is used to specify the source column index
    pTmpOprDef->iValueSubType = PARAM_VAL_NUM //To indicate that current parameter will hold numeric value
    pTmpOprDef->PV.uiVal = 0; //The first column is the source
    SvcDef.pOperands = pOprDef; //Copy pointer to the first DP_INIT_OP_DEF structure to the Service Definition
    SvcDef.sOprCount = 3; //Set the parameter count to 3 since three parameters are being supplied
    //free the allocated memory if an error occurred
    CleanSvcDef:
    while(NULL != pOprDef)
    {
    pTmpOprDef = pOprDef->pNext;
    if(NULL != pOprDef)
    {
    free(pOprDef);
    }
    pOprDef = pTmpOprDef;
    }

    [Alternate method of sending multiple parameters]
    ODPP also provides an alternate method of sending multiple parameters as an ARRAY. The user can declare an array of DP_INIT_OP_DEF structures where each element will represent a single parameter. When using this method it is mandatory to set member #sOprCount of parent structure DP_SVC_DEF equal to the number of elements in the DP_INIT_OP_DEF array.

    Example:
    DP_SVC_DEF SvcDef; //Service Definition structure
    DP_INIT_OP_DEF Operands[OPERANDS_MAX_SIZE]; //Array of DP_INIT_OP_DEF structures. Assume OPERANDS_MAX_SIZE is 3
    memset(&SvcDef, 0, sizeof(DP_SVC_DEF)); //Clear the Service Definition
    memset(Operands, 0, OPERANDS_MAX_SIZE * sizeof(DP_INIT_OP_DEF)); //Clear the parameter area
    Operands[0].usParameterID = ODPP_OPR_SWITCH_NA; //Mandatory Switch parameter. No value is required for this parameter
    Operands[0].iValueSubType = PARAM_VAL_NONE //To indicate that current parameter does not hold any value
    Operands[1].usParameterID = ODPP_OPR_METHOD; //This parameter is used to specify the Method to choose during masking
    Operands[1].iValueSubType = PARAM_VAL_NUM //To indicate that current parameter will hold numeric value
    Operands[1].PV.uiVal = ODPP_METHOD_MASK; //Generates a consistently masked output
    Operands[2].usParameterID = ODPP_OPR_SOURCE_COLINDEX; //This parameter is used to specify the source column index
    Operands[2].iValueSubType = PARAM_VAL_NUM //To indicate that current parameter will hold numeric value
    Operands[2].PV.uiVal = 0; //The first column is the source
    SvcDef.pOperands = &Operands[0]; //Copy pointer to the first DP_INIT_OP_DEF structure to the Service Definition
    SvcDef.sOprCount = 3; //Set the parameter count to 3 since three parameters are being supplied
  • Optional:
    N/A
char cEyeCatcher[4]
  • Use:
    For Internal use only.
  • Description:
    This is commonly used as structure identifier, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructVer
  • Use:
    For Internal use only.
  • Description:
    This is commonly used to hold structure version, specially helpful during debugging, and is set using INITIALIZE_ODPP_STRUCT_PTR to Initialize the structure instance.
  • Optional:
    N/A
short sStructLen
  • Use:
    [FOR FUTURE USE]
  • Description:
    [FOR FUTURE USE]
  • Optional:
    [FOR FUTURE USE]
unsigned short usParameterID
  • Use:
    This member is used to specify an initialization parameter.
  • Description:
    This is an unsigned 2 byte integer used to specify an initialization parameter. This must be set to a valid Service Provider parameter. Some parameters are common to one or more data privacy Service Providers while some are specific to a particular Service Provider. To view a list of common parameters and Service Provider specific parameters go to the Providers Tab in this documentation.
  • Optional:
    No
int iValueSubType
  • Use:
    This member is used to specify the type of the value the initialization parameter specified in member usParameterID will hold.
  • Description:
    This is an unsigned 2 byte integer used to specify what type of value an initialization parameter will hold.
    Following are the values this member can hold:
    • PARAM_VAL_NONE
      This specifies that the parameter supplied in member usParameterID has no value.
    • PARAM_VAL_NUM
      This specifies that the parameter supplied in member usParameterID will hold numeric value and it will be specified by member uiVal.
    • PARAM_VAL_WC
      This specifies that the parameter supplied in member usParameterID will hold wide character (Unicode) string value and it will be specified by member pWC.
    • PARAM_VAL_MC
      This specifies that the parameter supplied in member usParameterID will hold mixed character(SBCS/MBCS) character string value and it will be specified by member pMC.
    • Any value other than above values are user defined values and indicates the use of pUserVal
  • Optional:
    No
int iValueBufBytes
  • Use:
    This member is used to specify the size of the initialization parameter value buffer in bytes.
  • Description:
    This is an integer used to specify buffer size of the string supplied as a parameter value. This parameter is used when member pWC, pMC and pUserVal is used to supply value otherwise it will be ignored.
  • Optional:
    No
unsigned int uiVal
  • Use:
    This member is used to specify a numeric parameter value and is mutually exclusive with member pUserVal, pWC, pMC.
  • Description:
    This is an unsigned integer which is used to specify a numeric value for the current parameter specified in member usParameterID. To use this member to supply value for the parameter set the iValueSubType member to PARAM_VAL_NUM.
  • Optional:
    No
  • Use:
    This member is used to point to wide character (Unicode) sub-structure DPPRM_VAL_WC_SS to supply wide character (Unicode) value. This member is mutually exclusive with member uiVal, pUserVal, pMC.
  • Description:
    This is an pointer which points to the DPPRM_VAL_WC_SS to supply wide character (Unicode) string value for the parameter specified in member usParameterID. To use this member to supply value for the parameter set the iValueSubType member to PARAM_VAL_WC.
  • Optional:
    No
  • Use:
    This member is used to point to mixed character (SBCS/MBCS) sub-structure DPPRM_VAL_MC_SS to supply mixed character (SBCS/MBCS) value. This member is mutually exclusive with members uiVal, pUserVal, pWC.
  • Description:
    This is an pointer which points to the DPPRM_VAL_MC_SS to supply mixed character (SBCS/MBCS) string value for the parameter specified in member usParameterID. To use this member to supply value for the parameter set the iValueSubType member to PARAM_VAL_MC.
  • Optional:
    No
void* pUserVal
  • Use:
    This member is used to specify the user specified value for the current parameter and it is mutually exclusive with member pMC, pWC, uiVal.
  • Optional:
    No