Previous Topic

Next Topic

ctUPDICU

ctUPDATICU() allows a user to update the Unicode version stored in the resource of their files.

Declaration

NINT ctUpdateICUversion(pTEXT filnam,pTEXT fileword)
NINT ctUPDATICU(pTEXT filnam,pTEXT fileword)

Description

ctUPDATICU() takes the name of a data file containing IFIL resources and an optional password and attempts to open the file and associated indices exclusively, skipping the ICU version check. If the open succeeds, then the data file and associated indices have their UNICODE resource version changed to agree with the current ICU library version, and indices that reference the ICU resources are marked for rebuild.

  • filenam is the name of the file to update
  • fileword is the file password assigned, NULL if not assigned

Return Values

ctUPDATICU() returns NO_ERROR (0) if the files are opened successfully, and no ICU version mismatch is found.

Value

Symbolic Constant

Explanation

-828

ICUV_COD

One or more ICU resources had versions updated, but no index was found that used ICU segments.

-829

ICUV_REB

ICU version updates, and one or more indices marked for rebuild.

See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.

Example


#include ctreep.h

NINT rc = 0;
char[255] filename;
strncpy(filename, “mydata.dat”, 10);

/* Initialize c-tree Plus */
rc = (InitISAMXtd(16, 16, 16, 16, 0, "ADMIN", "ADMIN", "FAIRCOMS"))
if (rc)
    printf(“ctree Plus failed to initialize with error %d”, rc);

/* block the data file mydata.dat and associated indices */
rc = ctUPDTICU(filename, NULL);
if (rc) {
    printf(“ctUPDTICU returned with with condition %d”, filename, rc);

/* If ICUV_REB, then the indices require rebuild */
    if (ICUV_REB == rc)
        printf("One or more indices marked for rebuild.\n");
}

CloseISAM();
exit(0);