IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11140


Ignore:
Timestamp:
Jan 18, 2007, 2:23:24 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.76

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r11136 r11140  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.76
     4    pkg_version     STR     0.0.77
    55END
  • trunk/ippdb/configure.ac

    r11136 r11140  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.76], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.77], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r11136 r11140  
    27992799static void newExpRowFree(newExpRow *object);
    28002800
    2801 newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir)
     2801newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psS32 imfiles, const char *workdir)
    28022802{
    28032803    newExpRow       *_object;
     
    28102810    _object->camera = psStringCopy(camera);
    28112811    _object->telescope = psStringCopy(telescope);
    2812     _object->dateobs = psTimeCopy(dateobs);
    2813     _object->exp_type = psStringCopy(exp_type);
    28142812    _object->imfiles = imfiles;
    28152813    _object->workdir = psStringCopy(workdir);
     
    28242822    psFree(object->camera);
    28252823    psFree(object->telescope);
    2826     psFree(object->dateobs);
    2827     psFree(object->exp_type);
    28282824    psFree(object->workdir);
    28292825}
     
    28522848        return false;
    28532849    }
    2854     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, NULL)) {
    2855         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    2856         psFree(md);
    2857         return false;
    2858     }
    2859     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, "64")) {
    2860         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
    2861         psFree(md);
    2862         return false;
    2863     }
    28642850    if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, 0)) {
    28652851        psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
     
    28852871}
    28862872
    2887 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, const char *workdir)
     2873bool newExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psS32 imfiles, const char *workdir)
    28882874{
    28892875    psMetadata *md = psMetadataAlloc();
     
    29052891    if (!psMetadataAdd(md, PS_LIST_TAIL, "telescope", PS_DATA_STRING, NULL, telescope)) {
    29062892        psError(PS_ERR_UNKNOWN, false, "failed to add item telescope");
    2907         psFree(md);
    2908         return false;
    2909     }
    2910     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, dateobs)) {
    2911         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    2912         psFree(md);
    2913         return false;
    2914     }
    2915     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, exp_type)) {
    2916         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
    29172893        psFree(md);
    29182894        return false;
     
    29512927bool newExpInsertObject(psDB *dbh, newExpRow *object)
    29522928{
    2953     return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->workdir);
     2929    return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->imfiles, object->workdir);
    29542930}
    29552931
     
    30443020        return false;
    30453021    }
    3046     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, object->dateobs)) {
    3047         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    3048         psFree(md);
    3049         return false;
    3050     }
    3051     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, object->exp_type)) {
    3052         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
    3053         psFree(md);
    3054         return false;
    3055     }
    30563022    if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, object->imfiles)) {
    30573023        psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
     
    30933059        return false;
    30943060    }
    3095     psTime* dateobs = psMetadataLookupPtr(&status, md, "dateobs");
    3096     if (!status) {
    3097         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dateobs");
    3098         return false;
    3099     }
    3100     char* exp_type = psMetadataLookupPtr(&status, md, "exp_type");
    3101     if (!status) {
    3102         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_type");
    3103         return false;
    3104     }
    31053061    psS32 imfiles = psMetadataLookupS32(&status, md, "imfiles");
    31063062    if (!status) {
     
    31143070    }
    31153071
    3116     return newExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, workdir);
     3072    return newExpRowAlloc(exp_tag, exp_id, camera, telescope, imfiles, workdir);
    31173073}
    31183074psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r11136 r11140  
    15871587    char            *camera;
    15881588    char            *telescope;
    1589     psTime*         dateobs;
    1590     char            *exp_type;
    15911589    psS32           imfiles;
    15921590    char            *workdir;
     
    16031601    const char      *camera,
    16041602    const char      *telescope,
    1605     psTime*         dateobs,
    1606     const char      *exp_type,
    16071603    psS32           imfiles,
    16081604    const char      *workdir
     
    16401636    const char      *camera,
    16411637    const char      *telescope,
    1642     psTime*         dateobs,
    1643     const char      *exp_type,
    16441638    psS32           imfiles,
    16451639    const char      *workdir
  • trunk/ippdb/tests/alloc.c

    r11136 r11140  
    244244        newExpRow       *object;
    245245
    246         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string"    );
     246        object = newExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string"    );
    247247
    248248        if (!object) {
     
    263263        }
    264264        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
    265             psFree(object);
    266             exit(EXIT_FAILURE);
    267         }
    268             psFree(object);
    269             exit(EXIT_FAILURE);
    270         }
    271         if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
    272265            psFree(object);
    273266            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r11136 r11140  
    118118        }
    119119
    120         if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string")) {
     120        if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string")) {
    121121            exit(EXIT_FAILURE);
    122122        }
  • trunk/ippdb/tests/insertobject.c

    r11136 r11140  
    168168        }
    169169
    170         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string");
     170        object = newExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string");
    171171        if (!object) {
    172172            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r11136 r11140  
    302302        bool            status;
    303303
    304         object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string");
     304        object = newExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string");
    305305        if (!object) {
    306306            exit(EXIT_FAILURE);
     
    327327        }
    328328        if (strncmp(psMetadataLookupPtr(&status, md, "telescope"), "a string", MAX_STRING_LENGTH)) {
    329             psFree(md);
    330             exit(EXIT_FAILURE);
    331         }
    332             psFree(md);
    333             exit(EXIT_FAILURE);
    334         }
    335         if (strncmp(psMetadataLookupPtr(&status, md, "exp_type"), "a string", MAX_STRING_LENGTH)) {
    336329            psFree(md);
    337330            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r11136 r11140  
    439439            exit(EXIT_FAILURE);
    440440        }
    441             psFree(md);
    442             exit(EXIT_FAILURE);
    443         }
    444         if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
    445             psFree(md);
    446             exit(EXIT_FAILURE);
    447         }
    448441        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
    449442            psFree(md);
     
    476469        }
    477470        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
    478             psFree(object);
    479             exit(EXIT_FAILURE);
    480         }
    481             psFree(object);
    482             exit(EXIT_FAILURE);
    483         }
    484         if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
    485471            psFree(object);
    486472            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.