IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12231


Ignore:
Timestamp:
Mar 5, 2007, 12:04:47 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.15

Location:
trunk/ippdb
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.c

    r12202 r12231  
    52675267static void chipPendingExpRowFree(chipPendingExpRow *object);
    52685268
    5269 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     5269chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
    52705270{
    52715271    chipPendingExpRow *_object;
     
    52775277    _object->exp_tag = psStringCopy(exp_tag);
    52785278    _object->guide_id = guide_id;
     5279    _object->workdir = psStringCopy(workdir);
    52795280    _object->label = psStringCopy(label);
    52805281    _object->recipe = psStringCopy(recipe);
     
    52885289{
    52895290    psFree(object->exp_tag);
     5291    psFree(object->workdir);
    52905292    psFree(object->label);
    52915293    psFree(object->recipe);
     
    53125314        return false;
    53135315    }
     5316    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, "255")) {
     5317        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     5318        psFree(md);
     5319        return false;
     5320    }
    53145321    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, "key", "64")) {
    53155322        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     
    53455352}
    53465353
    5347 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     5354bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
    53485355{
    53495356    psMetadata *md = psMetadataAlloc();
     
    53605367    if (!psMetadataAdd(md, PS_LIST_TAIL, "guide_id", PS_DATA_S64, NULL, guide_id)) {
    53615368        psError(PS_ERR_UNKNOWN, false, "failed to add item guide_id");
     5369        psFree(md);
     5370        return false;
     5371    }
     5372    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     5373        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
    53625374        psFree(md);
    53635375        return false;
     
    54065418bool chipPendingExpInsertObject(psDB *dbh, chipPendingExpRow *object)
    54075419{
    5408     return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->label, object->recipe, object->expgroup, object->dvodb);
     5420    return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb);
    54095421}
    54105422
     
    54945506        return false;
    54955507    }
     5508    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     5509        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     5510        psFree(md);
     5511        return false;
     5512    }
    54965513    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, object->label)) {
    54975514        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     
    55385555        return false;
    55395556    }
     5557    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     5558    if (!status) {
     5559        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     5560        return false;
     5561    }
    55405562    char* label = psMetadataLookupPtr(&status, md, "label");
    55415563    if (!status) {
     
    55595581    }
    55605582
    5561     return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, label, recipe, expgroup, dvodb);
     5583    return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, recipe, expgroup, dvodb);
    55625584}
    55635585psArray *chipPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r12202 r12231  
    27142714    char            *exp_tag;
    27152715    psS64           guide_id;
     2716    char            *workdir;
    27162717    char            *label;
    27172718    char            *recipe;
     
    27292730    const char      *exp_tag,
    27302731    psS64           guide_id,
     2732    const char      *workdir,
    27312733    const char      *label,
    27322734    const char      *recipe,
     
    27652767    const char      *exp_tag,
    27662768    psS64           guide_id,
     2769    const char      *workdir,
    27672770    const char      *label,
    27682771    const char      *recipe,
  • trunk/ippdb/tests/alloc.c

    r12202 r12231  
    532532        chipPendingExpRow *object;
    533533
    534         object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string"    );
     534        object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string"    );
    535535
    536536        if (!object) {
     
    547547        }
    548548        if (!object->guide_id == -64) {
     549            psFree(object);
     550            exit(EXIT_FAILURE);
     551        }
     552        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    549553            psFree(object);
    550554            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r12202 r12231  
    193193        }
    194194
    195         if (!chipPendingExpInsert(dbh, -64, "a string", -64, "a string", "a string", "a string", "a string")) {
     195        if (!chipPendingExpInsert(dbh, -64, "a string", -64, "a string", "a string", "a string", "a string", "a string")) {
    196196            exit(EXIT_FAILURE);
    197197        }
  • trunk/ippdb/tests/insertobject.c

    r12202 r12231  
    278278        }
    279279
    280         object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string");
     280        object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string");
    281281        if (!object) {
    282282            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r12202 r12231  
    626626        bool            status;
    627627
    628         object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string");
     628        object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string");
    629629        if (!object) {
    630630            exit(EXIT_FAILURE);
     
    645645            exit(EXIT_FAILURE);
    646646        }
     647            psFree(md);
     648            exit(EXIT_FAILURE);
     649        }
     650        if (strncmp(psMetadataLookupPtr(&status, md, "workdir"), "a string", MAX_STRING_LENGTH)) {
    647651            psFree(md);
    648652            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r12202 r12231  
    961961            exit(EXIT_FAILURE);
    962962        }
     963        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir", 0, NULL, "a string")) {
     964            psFree(md);
     965            exit(EXIT_FAILURE);
     966        }
    963967        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
    964968            psFree(md);
     
    993997            exit(EXIT_FAILURE);
    994998        }
     999            psFree(object);
     1000            exit(EXIT_FAILURE);
     1001        }
     1002        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    9951003            psFree(object);
    9961004            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.