KcsStatusId KcsModifyLoadHints(KcsProfileId profile, KcsLoadHints newHints) |
KcsModifyLoadHints() applies a new set of load hints to a profile already loaded. If, for example, your application no longer needs to simulate a profile and available memory is limited, it can use this function to unload the simulation portion of the profile immediately, making more memory available for it to run.
Typically you would use this function to load the operation hints (transforms) for a profile whose attributes only were previously loaded. (For details on operation hints, see "Operation Hint Constants".)
Remember that the load hints are just that--hints to the KCMS framework. Although the KCMS framework tries to accomplish what is specified, and typically does, it cannot guarantee everything exactly as hinted. It is subject to what the CMM supports.
Argument |
Description |
---|---|
profile |
The identifier of the loaded profile. |
newHints |
The set of bits describing what, how, when, and where to load and unload profile. See "KcsLoadHints" for more information. |
KCS_SUCCESS |
KCS_PROF_ID_BAD |
KCS_MEM_ALLOC_ERROR |
KcsProfileId profileid; KcsErrDesc errDesc; KcsProfileDesc profileDesc; KcsProfileId profile; KcsStatusId status; KcsLoadHints newhints; /* profile name is a command line argument */ profileDesc.type = KcsSolarisProfile; profileDesc.desc.solarisFile.fileName = argv[1]; profileDesc.desc.solarisFile.hostName = NULL; profileDesc.desc.solarisFile.mode = 0; profileDesc.desc.solarisFile.oflag = NULL; status = KcsLoadProfile(&profile, &profileDesc, KcsLoadAttributesNow); if (status != KCS_SUCCESS) { status = KcsGetLastError(&errDesc); fprintf(stderr,"%s KcsLoadProfile failed error = %s\n", argv[optind], errDesc.desc); exit(1); } /* suppose it was determined that this is the profile we want to * * use for evaluating data. We want to load it all in now. */ newhints = KcsLoadAllNow; status = KcsModifyLoadHints(profile, newhints); if (status != KCS_SUCCESS) { status = KcsGetLastError(&errDesc); fprintf(stderr," ModifyHints failed error = %s\n", errDesc.desc); exit(1); } |