IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15347


Ignore:
Timestamp:
Oct 19, 2007, 4:08:12 PM (19 years ago)
Author:
jhoblitt
Message:

implement addskyfilemaskMode

File:
1 edited

Legend:

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

    r15341 r15347  
    684684        return false;
    685685    }
     686
    686687    return true;
    687688}
     
    698699{
    699700    PS_ASSERT_PTR_NON_NULL(config, false);
     701
     702    bool status = false;
     703    psString magic_id = psMetadataLookupStr(&status, config->args, "-magic_id");
     704    if (!status) {
     705        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -magic_id");
     706        return false;
     707    }
     708    if (!magic_id) {
     709        psError(PS_ERR_UNKNOWN, true, "-magic_id is required");
     710        return false;
     711    }
     712
     713    psString diff_id = psMetadataLookupStr(&status, config->args, "-diff_id");
     714    if (!status) {
     715        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -diff_id");
     716        return false;
     717    }
     718    if (!diff_id) {
     719        psError(PS_ERR_UNKNOWN, true, "-diff_id is required");
     720        return false;
     721    }
     722
     723    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
     724    if (!status) {
     725        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
     726        return false;
     727    }
     728    if (!uri) {
     729        psError(PS_ERR_UNKNOWN, true, "-uri is required");
     730        return false;
     731    }
     732
     733    if (!magicSkyfileMaskInsert(config->dbh,
     734                (psS64)atoll(magic_id),
     735                (psS64)atoll(diff_id),
     736                uri
     737        )) {
     738        psError(PS_ERR_UNKNOWN, false, "database error");
     739        return false;
     740    }
     741
    700742    return true;
    701743}
Note: See TracChangeset for help on using the changeset viewer.