IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10328


Ignore:
Timestamp:
Nov 30, 2006, 2:46:56 PM (20 years ago)
Author:
jhoblitt
Message:

version 0.0.62

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r10237 r10328  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.60
     4    pkg_version     STR     0.0.62
    55END
  • trunk/ippdb/configure.ac

    r10238 r10328  
    11dnl
    2 dnl This file was generated by glueforge 0.32
     2dnl This file was generated by glueforge 0.33
    33dnl
    44dnl Do NOT directly edit this file.
     
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.60], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.62], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r10238 r10328  
    2020/*
    2121 *
    22  * This file was generated by glueforge 0.32
     22 * This file was generated by glueforge 0.33
    2323 *
    2424 * Do NOT directly edit this file.
     
    131131            METADATAITEM_STRIFY_CASE(PS_DATA_F64, "%f", F64);
    132132            case PS_DATA_STRING:
     133                psStringSubstitute(str, " ", "_");
    133134                psStringAppend(&str, "%s", item->data.str);
    134135                break;
     
    884885static void summitImfileRowFree(summitImfileRow *object);
    885886
    886 summitImfileRow *summitImfileRowAlloc(const char *exp_id, const char *camera, const char *telescope, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
     887summitImfileRow *summitImfileRowAlloc(const char *exp_id, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
    887888{
    888889    summitImfileRow *_object;
     
    894895    _object->camera = psStringCopy(camera);
    895896    _object->telescope = psStringCopy(telescope);
     897    _object->file_id = psStringCopy(file_id);
    896898    _object->bytes = bytes;
    897899    _object->md5sum = psStringCopy(md5sum);
     
    908910    psFree(object->camera);
    909911    psFree(object->telescope);
     912    psFree(object->file_id);
    910913    psFree(object->md5sum);
    911914    psFree(object->class);
     
    932935        return false;
    933936    }
     937    if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, "Key", "64")) {
     938        psError(PS_ERR_UNKNOWN, false, "failed to add item file_id");
     939        psFree(md);
     940        return false;
     941    }
    934942    if (!psMetadataAdd(md, PS_LIST_TAIL, "bytes", PS_DATA_S32, NULL, 0)) {
    935943        psError(PS_ERR_UNKNOWN, false, "failed to add item bytes");
     
    970978}
    971979
    972 bool summitImfileInsert(psDB * dbh, const char *exp_id, const char *camera, const char *telescope, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
     980bool summitImfileInsert(psDB * dbh, const char *exp_id, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
    973981{
    974982    psMetadata *md = psMetadataAlloc();
     
    985993    if (!psMetadataAdd(md, PS_LIST_TAIL, "telescope", PS_DATA_STRING, NULL, telescope)) {
    986994        psError(PS_ERR_UNKNOWN, false, "failed to add item telescope");
     995        psFree(md);
     996        return false;
     997    }
     998    if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, NULL, file_id)) {
     999        psError(PS_ERR_UNKNOWN, false, "failed to add item file_id");
    9871000        psFree(md);
    9881001        return false;
     
    10361049bool summitImfileInsertObject(psDB *dbh, summitImfileRow *object)
    10371050{
    1038     return summitImfileInsert(dbh, object->exp_id, object->camera, object->telescope, object->bytes, object->md5sum, object->class, object->class_id, object->uri);
     1051    return summitImfileInsert(dbh, object->exp_id, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri);
    10391052}
    10401053
     
    11241137        return false;
    11251138    }
     1139    if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, NULL, object->file_id)) {
     1140        psError(PS_ERR_UNKNOWN, false, "failed to add item file_id");
     1141        psFree(md);
     1142        return false;
     1143    }
    11261144    if (!psMetadataAdd(md, PS_LIST_TAIL, "bytes", PS_DATA_S32, NULL, object->bytes)) {
    11271145        psError(PS_ERR_UNKNOWN, false, "failed to add item bytes");
     
    11731191        return false;
    11741192    }
     1193    char* file_id = psMetadataLookupPtr(&status, md, "file_id");
     1194    if (!status) {
     1195        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item file_id");
     1196        return false;
     1197    }
    11751198    psS32 bytes = psMetadataLookupS32(&status, md, "bytes");
    11761199    if (!status) {
     
    11991222    }
    12001223
    1201     return summitImfileRowAlloc(exp_id, camera, telescope, bytes, md5sum, class, class_id, uri);
     1224    return summitImfileRowAlloc(exp_id, camera, telescope, file_id, bytes, md5sum, class, class_id, uri);
    12021225}
    12031226psArray *summitImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r10238 r10328  
    2020/*
    2121 *
    22  * This file was generated by glueforge 0.32
     22 * This file was generated by glueforge 0.33
    2323 *
    2424 * Do NOT directly edit this file.
     
    516516    char            *camera;
    517517    char            *telescope;
     518    char            *file_id;
    518519    psS32           bytes;
    519520    char            *md5sum;
     
    532533    const char      *camera,
    533534    const char      *telescope,
     535    const char      *file_id,
    534536    psS32           bytes,
    535537    const char      *md5sum,
     
    569571    const char      *camera,
    570572    const char      *telescope,
     573    const char      *file_id,
    571574    psS32           bytes,
    572575    const char      *md5sum,
  • trunk/ippdb/tests/alloc.c

    r10238 r10328  
    6767        summitImfileRow *object;
    6868
    69         object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string"    );
     69        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string"    );
    7070
    7171        if (!object) {
     
    8282        }
    8383        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
     84            psFree(object);
     85            exit(EXIT_FAILURE);
     86        }
     87        if (strncmp(object->file_id, "a string", MAX_STRING_LENGTH)) {
    8488            psFree(object);
    8589            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r10238 r10328  
    4343        }
    4444
    45         if (!summitImfileInsert(dbh, "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string")) {
     45        if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string")) {
    4646            exit(EXIT_FAILURE);
    4747        }
  • trunk/ippdb/tests/insertobject.c

    r10238 r10328  
    5858        }
    5959
    60         object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
     60        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
    6161        if (!object) {
    6262            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r10238 r10328  
    8585        bool            status;
    8686
    87         object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
     87        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
    8888        if (!object) {
    8989            exit(EXIT_FAILURE);
     
    106106        }
    107107        if (strncmp(psMetadataLookupPtr(&status, md, "telescope"), "a string", MAX_STRING_LENGTH)) {
     108            psFree(md);
     109            exit(EXIT_FAILURE);
     110        }
     111        if (strncmp(psMetadataLookupPtr(&status, md, "file_id"), "a string", MAX_STRING_LENGTH)) {
    108112            psFree(md);
    109113            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r10238 r10328  
    121121            exit(EXIT_FAILURE);
    122122        }
     123        if (!psMetadataAddStr(md, PS_LIST_TAIL, "file_id", 0, NULL, "a string")) {
     124            psFree(md);
     125            exit(EXIT_FAILURE);
     126        }
    123127        if (!psMetadataAddS32(md, PS_LIST_TAIL, "bytes", 0, NULL, -32)) {
    124128            psFree(md);
     
    159163        }
    160164        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
     165            psFree(object);
     166            exit(EXIT_FAILURE);
     167        }
     168        if (strncmp(object->file_id, "a string", MAX_STRING_LENGTH)) {
    161169            psFree(object);
    162170            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.