IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10989


Ignore:
Timestamp:
Jan 8, 2007, 4:08:31 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION to 0.0.69

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r10752 r10989  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.68
     4    pkg_version     STR     0.0.69
    55END
  • trunk/dbconfig/tasks.md

    r10327 r10989  
    1 # $Id: tasks.md,v 1.100 2006-12-01 00:45:06 jhoblitt Exp $
     1# $Id: tasks.md,v 1.101 2007-01-09 02:08:31 jhoblitt Exp $
    22
    33# this table records all exposure ID ever seen from the summit
     
    9090    exp_type    STR         64
    9191    imfiles     S32         0
     92    fault       S16         0       # NOT NULL
    9293END
    9394
     
    99100    class_id    STR         64      # Primary Key
    100101    uri         STR         255
     102    fault       S16         0       # NOT NULL
    101103END
    102104
  • trunk/ippdb/configure.ac

    r10753 r10989  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.68], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.69], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r10753 r10989  
    28002800static void newExpRowFree(newExpRow *object);
    28012801
    2802 newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles)
     2802newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, psS16 fault)
    28032803{
    28042804    newExpRow       *_object;
     
    28142814    _object->exp_type = psStringCopy(exp_type);
    28152815    _object->imfiles = imfiles;
     2816    _object->fault = fault;
    28162817
    28172818    return _object;
     
    28662867        return false;
    28672868    }
     2869    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     2870        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     2871        psFree(md);
     2872        return false;
     2873    }
    28682874
    28692875    bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md);
     
    28792885}
    28802886
    2881 bool newExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles)
     2887bool newExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, psS16 fault)
    28822888{
    28832889    psMetadata *md = psMetadataAlloc();
     
    29142920    if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, imfiles)) {
    29152921        psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
     2922        psFree(md);
     2923        return false;
     2924    }
     2925    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     2926        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    29162927        psFree(md);
    29172928        return false;
     
    29402951bool newExpInsertObject(psDB *dbh, newExpRow *object)
    29412952{
    2942     return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles);
     2953    return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->fault);
    29432954}
    29442955
     
    30483059        return false;
    30493060    }
     3061    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     3062        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     3063        psFree(md);
     3064        return false;
     3065    }
    30503066
    30513067
     
    30923108        return false;
    30933109    }
    3094 
    3095     return newExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles);
     3110    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     3111    if (!status) {
     3112        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     3113        return false;
     3114    }
     3115
     3116    return newExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, fault);
    30963117}
    30973118psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    32053226static void newImfileRowFree(newImfileRow *object);
    32063227
    3207 newImfileRow *newImfileRowAlloc(const char *exp_tag, const char *class, const char *class_id, const char *uri)
     3228newImfileRow *newImfileRowAlloc(const char *exp_tag, const char *class, const char *class_id, const char *uri, psS16 fault)
    32083229{
    32093230    newImfileRow    *_object;
     
    32163237    _object->class_id = psStringCopy(class_id);
    32173238    _object->uri = psStringCopy(uri);
     3239    _object->fault = fault;
    32183240
    32193241    return _object;
     
    32513273        return false;
    32523274    }
     3275    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     3276        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     3277        psFree(md);
     3278        return false;
     3279    }
    32533280
    32543281    bool status = psDBCreateTable(dbh, NEWIMFILE_TABLE_NAME, md);
     
    32643291}
    32653292
    3266 bool newImfileInsert(psDB * dbh, const char *exp_tag, const char *class, const char *class_id, const char *uri)
     3293bool newImfileInsert(psDB * dbh, const char *exp_tag, const char *class, const char *class_id, const char *uri, psS16 fault)
    32673294{
    32683295    psMetadata *md = psMetadataAlloc();
     
    32843311    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
    32853312        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     3313        psFree(md);
     3314        return false;
     3315    }
     3316    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     3317        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    32863318        psFree(md);
    32873319        return false;
     
    33103342bool newImfileInsertObject(psDB *dbh, newImfileRow *object)
    33113343{
    3312     return newImfileInsert(dbh, object->exp_tag, object->class, object->class_id, object->uri);
     3344    return newImfileInsert(dbh, object->exp_tag, object->class, object->class_id, object->uri, object->fault);
    33133345}
    33143346
     
    34033435        return false;
    34043436    }
     3437    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     3438        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     3439        psFree(md);
     3440        return false;
     3441    }
    34053442
    34063443
     
    34323469        return false;
    34333470    }
    3434 
    3435     return newImfileRowAlloc(exp_tag, class, class_id, uri);
     3471    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     3472    if (!status) {
     3473        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     3474        return false;
     3475    }
     3476
     3477    return newImfileRowAlloc(exp_tag, class, class_id, uri, fault);
    34363478}
    34373479psArray *newImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r10753 r10989  
    15901590    char            *exp_type;
    15911591    psS32           imfiles;
     1592    psS16           fault;
    15921593} newExpRow;
    15931594
     
    16041605    psTime*         dateobs,
    16051606    const char      *exp_type,
    1606     psS32           imfiles
     1607    psS32           imfiles,
     1608    psS16           fault
    16071609);
    16081610
     
    16401642    psTime*         dateobs,
    16411643    const char      *exp_type,
    1642     psS32           imfiles
     1644    psS32           imfiles,
     1645    psS16           fault
    16431646);
    16441647
     
    18001803    char            *class_id;
    18011804    char            *uri;
     1805    psS16           fault;
    18021806} newImfileRow;
    18031807
     
    18111815    const char      *class,
    18121816    const char      *class_id,
    1813     const char      *uri
     1817    const char      *uri,
     1818    psS16           fault
    18141819);
    18151820
     
    18441849    const char      *class,
    18451850    const char      *class_id,
    1846     const char      *uri
     1851    const char      *uri,
     1852    psS16           fault
    18471853);
    18481854
  • trunk/ippdb/tests/alloc.c

    r10753 r10989  
    244244        newExpRow       *object;
    245245
    246         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32    );
     246        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, -16    );
    247247
    248248        if (!object) {
     
    277277            exit(EXIT_FAILURE);
    278278        }
     279            psFree(object);
     280            exit(EXIT_FAILURE);
     281        }
    279282
    280283        psFree(object);
     
    284287        newImfileRow    *object;
    285288
    286         object = newImfileRowAlloc("a string", "a string", "a string", "a string"    );
     289        object = newImfileRowAlloc("a string", "a string", "a string", "a string", -16    );
    287290
    288291        if (!object) {
     
    303306        }
    304307        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     308            psFree(object);
     309            exit(EXIT_FAILURE);
     310        }
    305311            psFree(object);
    306312            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r10753 r10989  
    118118        }
    119119
    120         if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32)) {
    121             exit(EXIT_FAILURE);
    122         }
    123 
    124         psDBCleanup(dbh);
    125     }
    126 
    127     {
    128         psDB            *dbh;
    129 
    130         dbh = psDBInit("localhost", "test", NULL, "test");
    131         if (!dbh) {
    132             exit(EXIT_FAILURE);
    133         }
    134 
    135         if (!newImfileInsert(dbh, "a string", "a string", "a string", "a string")) {
     120        if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, -16)) {
     121            exit(EXIT_FAILURE);
     122        }
     123
     124        psDBCleanup(dbh);
     125    }
     126
     127    {
     128        psDB            *dbh;
     129
     130        dbh = psDBInit("localhost", "test", NULL, "test");
     131        if (!dbh) {
     132            exit(EXIT_FAILURE);
     133        }
     134
     135        if (!newImfileInsert(dbh, "a string", "a string", "a string", "a string", -16)) {
    136136            exit(EXIT_FAILURE);
    137137        }
  • trunk/ippdb/tests/insertobject.c

    r10753 r10989  
    168168        }
    169169
    170         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
     170        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, -16);
    171171        if (!object) {
    172172            exit(EXIT_FAILURE);
     
    190190        }
    191191
    192         object = newImfileRowAlloc("a string", "a string", "a string", "a string");
     192        object = newImfileRowAlloc("a string", "a string", "a string", "a string", -16);
    193193        if (!object) {
    194194            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r10753 r10989  
    302302        bool            status;
    303303
    304         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
     304        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, -16);
    305305        if (!object) {
    306306            exit(EXIT_FAILURE);
     
    341341            exit(EXIT_FAILURE);
    342342        }
     343            psFree(md);
     344            exit(EXIT_FAILURE);
     345        }
    343346
    344347        psFree(md);
     
    350353        bool            status;
    351354
    352         object = newImfileRowAlloc("a string", "a string", "a string", "a string");
     355        object = newImfileRowAlloc("a string", "a string", "a string", "a string", -16);
    353356        if (!object) {
    354357            exit(EXIT_FAILURE);
     
    375378        }
    376379        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
     380            psFree(md);
     381            exit(EXIT_FAILURE);
     382        }
    377383            psFree(md);
    378384            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r10753 r10989  
    450450            exit(EXIT_FAILURE);
    451451        }
     452            psFree(md);
     453            exit(EXIT_FAILURE);
     454        }
    452455
    453456        object = newExpObjectFromMetadata(md);
     
    486489            exit(EXIT_FAILURE);
    487490        }
     491            psFree(object);
     492            exit(EXIT_FAILURE);
     493        }
    488494
    489495        psFree(object);
     
    511517            exit(EXIT_FAILURE);
    512518        }
     519            psFree(md);
     520            exit(EXIT_FAILURE);
     521        }
    513522
    514523        object = newImfileObjectFromMetadata(md);
     
    533542        }
    534543        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     544            psFree(object);
     545            exit(EXIT_FAILURE);
     546        }
    535547            psFree(object);
    536548            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.