IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 19, 2007, 3:27:00 PM (19 years ago)
Author:
jhoblitt
Message:

implement -addmask

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/magictool.c

    r15340 r15341  
    655655{
    656656    PS_ASSERT_PTR_NON_NULL(config, false);
     657
     658    bool status = false;
     659    psString magic_id = psMetadataLookupStr(&status, config->args, "-magic_id");
     660    if (!status) {
     661        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -magic_id");
     662        return false;
     663    }
     664    if (!magic_id) {
     665        psError(PS_ERR_UNKNOWN, true, "-magic_id is required");
     666        return false;
     667    }
     668
     669    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
     670    if (!status) {
     671        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
     672        return false;
     673    }
     674    if (!uri) {
     675        psError(PS_ERR_UNKNOWN, true, "-uri is required");
     676        return false;
     677    }
     678
     679    if (!magicMaskInsert(config->dbh,
     680                (psS64)atoll(magic_id),
     681                uri
     682        )) {
     683        psError(PS_ERR_UNKNOWN, false, "database error");
     684        return false;
     685    }
    657686    return true;
    658687}
Note: See TracChangeset for help on using the changeset viewer.