C

The source files are provided in the c and cobol subdirectories of src within your Data Express installation directory, along with template sources to assist in the creation of new routines.

Creating C Masking Routines

To create a C masking routine:

  1. Make a copy of the template masking routine UDCDEMO.c file.
  2. Update the CHANGER_NAME definition by replacing the name CHANGER with the name of your masking routine:
     #define CHANGER_NAME "CHANGER" /* Apply changer's name here! */ 
    					 
  3. Review the processing logic in the ProcessColumns() function in order to verify that the data type is correct and that the masking routine specified for that data element is in this particular routine:
     /* Data processing example */
    if ((pData->nType[i] == TYPE_STRING || 
    pData->nType[i] == TYPE_INT_STR ||
    pData->nType[i] == TYPE_CLOB) &&
    strcmp(pTable[i].szChangerProgram, CHANGER_NAME) == 0)
    {
    pData->uData[i].szData = ProcessString(pData->uData[i].szData, &pTable[i])
    ;
    }
  4. Code your masking logic within the ProcessString() function.
  5. Edit the makefile:
    • Add an entry to the CHANGERS macro for your new masking routine.
    • Apply the appropriate rules for building your masking routine:

    For your Windows makefile, copy the entry below and then replace UDCDEMO with the name of your masking routine:

     UDCDEMO.obj: dxe_common.h $(COMMON_HEADERS) UDCDEMO.c 
        !$(CPP) $(CFLAGS) $*.c 
    					 

    For your UNIX makefile, copy the entry below and then replace UDCDEMO with the name of your masking routine:

     UDCDEMO: libdecommon.a UDCDEMO.o 
        $(CC) $@.o $(LDFLAGS) -o $@ 
    					 

Building C Masking Routines

On Windows platforms, build your C masking routine by invoking nmake from a Visual Studio command prompt. On UNIX platforms, build your C masking routine by invoking make.