IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

VERSION 0.0.76

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.