IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11027


Ignore:
Timestamp:
Jan 10, 2007, 6:44:06 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.71

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r11005 r11027  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.70], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.71], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r11005 r11027  
    77647764static void p3PendingExpRowFree(p3PendingExpRow *object);
    77657765
    7766 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label)
     7766p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
    77677767{
    77687768    p3PendingExpRow *_object;
     
    77757775    _object->p3_version = p3_version;
    77767776    _object->label = psStringCopy(label);
     7777    _object->fault = fault;
    77777778
    77787779    return _object;
     
    78087809        return false;
    78097810    }
     7811    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     7812        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7813        psFree(md);
     7814        return false;
     7815    }
    78107816
    78117817    bool status = psDBCreateTable(dbh, P3PENDINGEXP_TABLE_NAME, md);
     
    78217827}
    78227828
    7823 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label)
     7829bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
    78247830{
    78257831    psMetadata *md = psMetadataAlloc();
     
    78417847    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    78427848        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     7849        psFree(md);
     7850        return false;
     7851    }
     7852    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     7853        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    78437854        psFree(md);
    78447855        return false;
     
    78677878bool p3PendingExpInsertObject(psDB *dbh, p3PendingExpRow *object)
    78687879{
    7869     return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label);
     7880    return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label, object->fault);
    78707881}
    78717882
     
    79607971        return false;
    79617972    }
     7973    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     7974        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7975        psFree(md);
     7976        return false;
     7977    }
    79627978
    79637979
     
    79898005        return false;
    79908006    }
    7991 
    7992     return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label);
     8007    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     8008    if (!status) {
     8009        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     8010        return false;
     8011    }
     8012
     8013    return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label, fault);
    79938014}
    79948015psArray *p3PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r11005 r11027  
    40054005    psS32           p3_version;
    40064006    char            *label;
     4007    psS16           fault;
    40074008} p3PendingExpRow;
    40084009
     
    40164017    psS32           p2_version,
    40174018    psS32           p3_version,
    4018     const char      *label
     4019    const char      *label,
     4020    psS16           fault
    40194021);
    40204022
     
    40494051    psS32           p2_version,
    40504052    psS32           p3_version,
    4051     const char      *label
     4053    const char      *label,
     4054    psS16           fault
    40524055);
    40534056
  • trunk/ippdb/tests/alloc.c

    r11005 r11027  
    787787        p3PendingExpRow *object;
    788788
    789         object = p3PendingExpRowAlloc("a string", -32, -32, "a string"    );
     789        object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16    );
    790790
    791791        if (!object) {
     
    806806        }
    807807        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     808            psFree(object);
     809            exit(EXIT_FAILURE);
     810        }
    808811            psFree(object);
    809812            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r11005 r11027  
    283283        }
    284284
    285         if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string")) {
     285        if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string", -16)) {
    286286            exit(EXIT_FAILURE);
    287287        }
  • trunk/ippdb/tests/insertobject.c

    r11005 r11027  
    410410        }
    411411
    412         object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
     412        object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16);
    413413        if (!object) {
    414414            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r11005 r11027  
    933933        bool            status;
    934934
    935         object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
     935        object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16);
    936936        if (!object) {
    937937            exit(EXIT_FAILURE);
     
    958958        }
    959959        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
     960            psFree(md);
     961            exit(EXIT_FAILURE);
     962        }
    960963            psFree(md);
    961964            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r11005 r11027  
    14371437            exit(EXIT_FAILURE);
    14381438        }
     1439            psFree(md);
     1440            exit(EXIT_FAILURE);
     1441        }
    14391442
    14401443        object = p3PendingExpObjectFromMetadata(md);
     
    14591462        }
    14601463        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     1464            psFree(object);
     1465            exit(EXIT_FAILURE);
     1466        }
    14611467            psFree(object);
    14621468            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.