IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2006, 12:06:42 PM (20 years ago)
Author:
jhoblitt
Message:

implement -newImfile

File:
1 edited

Legend:

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

    r8011 r8012  
    7777        return false;
    7878    }
    79     psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");    if (!status) {
     79    psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
     80    if (!status) {
    8081        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");
    8182        return false;
     
    105106static bool newImfileMode(pxConfig *config)
    106107{
     108    bool status = false;
     109
     110    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     111    if (!status) {
     112        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     113        return false;
     114    }
     115    if (!exp_id) {
     116        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     117        return false;
     118    }
     119    psString class = psMetadataLookupStr(&status, config->args, "-class");
     120    if (!status) {
     121        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class");
     122        return false;
     123    }
     124    if (!class) {
     125        psError(PS_ERR_UNKNOWN, true, "-class is required");
     126        return false;
     127    }
     128    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
     129    if (!status) {
     130        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
     131        return false;
     132    }
     133    if (!class_id) {
     134        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
     135        return false;
     136    }
     137    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
     138    if (!status) {
     139        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
     140        return false;
     141    }
     142    if (!uri) {
     143        psError(PS_ERR_UNKNOWN, true, "-uri is required");
     144        return false;
     145    }
     146
     147    if (!newImfileInsert(config->dbh, exp_id, class, class_id, uri)) {
     148        psError(PS_ERR_UNKNOWN, false, "database error");
     149        return false;
     150    }
     151
    107152    return true;
    108153}
Note: See TracChangeset for help on using the changeset viewer.