KCMS Application Developer's Guide

Example


Example 4-8 KcsModifyLoadHints()

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);
 }