KCMS Application Developer's Guide

KcsOptimizeProfile()

KcsStatusId
 KcsOptimizeProfile(KcsProfileId profile,
         KcsOptimizationType optimizationType,
         KcsLoadHints operationLoadSet)

Purpose

Use KcsOptimizeProfile() to optimize the profile by:

Optimization is CMM dependent. The CMM always interprets the load hints in terms of the particular situation.


Note -

If your application has minimized a profile's load operation or state with operationLoadSet or with KcsOptimizeProfile(), only that load operation or state is saved with KcsSaveProfile(). Therefore, operations not included in the profile are not available the next time the profile is loaded.


Arguments

Table 4-19 KcsOptimizeProfile() Arguments

Argument 

Description 

profile

The identifier of the profile. 

optimizationType

The kinds of optimization (size, speed, and accuracy) your application wants to perform on the profile. (See "KcsOptimizationType" for more information.) When a combination of values is specified, it is up to the CMM to determine which value is more important.

operationLoadSet

One or more flags symbolizing the kind of information wanted in profile. It also describes what, how, when, and where to load and unload profile. See "KcsLoadHints" for more information.

Returns

Table 4-20 KcsOptimizeProfile() Return Strings

KCS_SUCCESS

KCS_OPERATION_CANCELLED

KCS_MEM_ALLOC_ERROR

KCS_PROF_ID_BAD

Example


Example 4-9 KcsOptimizeProfile()

KcsProfileId                monitorProfile, scannerProfile, completeProfile;
 KcsStatusId                status;
 KcsErrDesc                errDesc;

 /* The monitor profile and scanner profile have been loaded and connected *
  * to become a complete profile, now optimize. */

 status = KcsOptimizeProfile(completeProfile, KcsOptSpeed, KcsLoadAllNow);
 if (status != KCS_SUCCESS) {
     status = KcsGetLastError(&errDesc);
     fprintf(stderr,"KcsOptimizeProfile failed error = %s\n", errDesc.desc);
     KcsFreeProfile(monitorProfile);
     KcsFreeProfile(scannerProfile);
     return(-1);
 }