IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17833


Ignore:
Timestamp:
May 28, 2008, 11:52:21 AM (18 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.36

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r17570 r17833  
    77AC_PREREQ(2.61)
    88
    9 AC_INIT([ippdb], [1.1.33], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.36], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r17570 r17833  
    30743074static void rawExpRowFree(rawExpRow *object);
    30753075
    3076 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)
     3076rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault)
    30773077{
    30783078    rawExpRow       *_object;
     
    31363136    _object->object = psStringCopy(object);
    31373137    _object->solang = solang;
     3138    _object->hostname = psStringCopy(hostname);
    31383139    _object->fault = fault;
    31393140
     
    31583159    psFree(object->comment);
    31593160    psFree(object->object);
     3161    psFree(object->hostname);
    31603162}
    31613163
     
    31683170        return false;
    31693171    }
    3170     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, NULL, "64")) {
     3172    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, "Key", "64")) {
    31713173        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name");
    31723174        psFree(md);
     
    34383440        return false;
    34393441    }
     3442    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, "64")) {
     3443        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
     3444        psFree(md);
     3445        return false;
     3446    }
    34403447    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key NOT NULL", 0)) {
    34413448        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    34563463}
    34573464
    3458 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)
     3465bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault)
    34593466{
    34603467    psMetadata *md = psMetadataAlloc();
     
    37313738    if (!psMetadataAdd(md, PS_LIST_TAIL, "solang", PS_DATA_F32, NULL, solang)) {
    37323739        psError(PS_ERR_UNKNOWN, false, "failed to add item solang");
     3740        psFree(md);
     3741        return false;
     3742    }
     3743    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, hostname)) {
     3744        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
    37333745        psFree(md);
    37343746        return false;
     
    37623774bool rawExpInsertObject(psDB *dbh, rawExpRow *object)
    37633775{
    3764     return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->fault);
     3776    return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault);
    37653777}
    37663778
     
    41104122        return false;
    41114123    }
     4124    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, object->hostname)) {
     4125        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
     4126        psFree(md);
     4127        return false;
     4128    }
    41124129    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    41134130        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    43994416        return false;
    44004417    }
     4418    char* hostname = psMetadataLookupPtr(&status, md, "hostname");
     4419    if (!status) {
     4420        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item hostname");
     4421        return false;
     4422    }
    44014423    psS16 fault = psMetadataLookupS16(&status, md, "fault");
    44024424    if (!status) {
     
    44054427    }
    44064428
    4407     return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, fault);
     4429    return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault);
    44084430}
    44094431psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    45234545static void rawImfileRowFree(rawImfileRow *object);
    45244546
    4525 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psS16 fault)
     4547rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault)
    45264548{
    45274549    rawImfileRow    *_object;
     
    45814603    _object->user_5 = user_5;
    45824604    _object->object = psStringCopy(object);
     4605    _object->hostname = psStringCopy(hostname);
    45834606    _object->fault = fault;
    45844607
     
    46004623    psFree(object->comment);
    46014624    psFree(object->object);
     4625    psFree(object->hostname);
    46024626}
    46034627
     
    46104634        return false;
    46114635    }
    4612     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, NULL, "64")) {
     4636    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, "UNIQUE(exp_id, tmp_class_id)", "64")) {
    46134637        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name");
    46144638        psFree(md);
     
    48604884        return false;
    48614885    }
     4886    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, "64")) {
     4887        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
     4888        psFree(md);
     4889        return false;
     4890    }
    48624891    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key NOT NULL", 0)) {
    48634892        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    48784907}
    48794908
    4880 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psS16 fault)
     4909bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault)
    48814910{
    48824911    psMetadata *md = psMetadataAlloc();
     
    51335162    if (!psMetadataAdd(md, PS_LIST_TAIL, "object", PS_DATA_STRING, NULL, object)) {
    51345163        psError(PS_ERR_UNKNOWN, false, "failed to add item object");
     5164        psFree(md);
     5165        return false;
     5166    }
     5167    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, hostname)) {
     5168        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
    51355169        psFree(md);
    51365170        return false;
     
    51645198bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object)
    51655199{
    5166     return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->fault);
     5200    return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault);
    51675201}
    51685202
     
    54925526        return false;
    54935527    }
     5528    if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, object->hostname)) {
     5529        psError(PS_ERR_UNKNOWN, false, "failed to add item hostname");
     5530        psFree(md);
     5531        return false;
     5532    }
    54945533    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    54955534        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    57615800        return false;
    57625801    }
     5802    char* hostname = psMetadataLookupPtr(&status, md, "hostname");
     5803    if (!status) {
     5804        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item hostname");
     5805        return false;
     5806    }
    57635807    psS16 fault = psMetadataLookupS16(&status, md, "fault");
    57645808    if (!status) {
     
    57675811    }
    57685812
    5769     return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, fault);
     5813    return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault);
    57705814}
    57715815psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1043110475static void warpSkyfileRowFree(warpSkyfileRow *object);
    1043210476
    10433 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, bool ignored, psS16 fault)
     10477warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, psS32 xmin, psS32 xmax, psS32 ymin, psS32 ymax, bool ignored, psS16 fault)
    1043410478{
    1043510479    warpSkyfileRow  *_object;
     
    1044810492    _object->hostname = psStringCopy(hostname);
    1044910493    _object->good_frac = good_frac;
     10494    _object->xmin = xmin;
     10495    _object->xmax = xmax;
     10496    _object->ymin = ymin;
     10497    _object->ymax = ymax;
    1045010498    _object->ignored = ignored;
    1045110499    _object->fault = fault;
     
    1051610564        return false;
    1051710565    }
     10566    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, 0)) {
     10567        psError(PS_ERR_UNKNOWN, false, "failed to add item xmin");
     10568        psFree(md);
     10569        return false;
     10570    }
     10571    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, 0)) {
     10572        psError(PS_ERR_UNKNOWN, false, "failed to add item xmax");
     10573        psFree(md);
     10574        return false;
     10575    }
     10576    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, 0)) {
     10577        psError(PS_ERR_UNKNOWN, false, "failed to add item ymin");
     10578        psFree(md);
     10579        return false;
     10580    }
     10581    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, 0)) {
     10582        psError(PS_ERR_UNKNOWN, false, "failed to add item ymax");
     10583        psFree(md);
     10584        return false;
     10585    }
    1051810586    if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, "Key", 0)) {
    1051910587        psError(PS_ERR_UNKNOWN, false, "failed to add item ignored");
     
    1053910607}
    1054010608
    10541 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, bool ignored, psS16 fault)
     10609bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, psS32 xmin, psS32 xmax, psS32 ymin, psS32 ymax, bool ignored, psS16 fault)
    1054210610{
    1054310611    psMetadata *md = psMetadataAlloc();
     
    1058910657    if (!psMetadataAdd(md, PS_LIST_TAIL, "good_frac", PS_DATA_F32, NULL, good_frac)) {
    1059010658        psError(PS_ERR_UNKNOWN, false, "failed to add item good_frac");
     10659        psFree(md);
     10660        return false;
     10661    }
     10662    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, xmin)) {
     10663        psError(PS_ERR_UNKNOWN, false, "failed to add item xmin");
     10664        psFree(md);
     10665        return false;
     10666    }
     10667    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, xmax)) {
     10668        psError(PS_ERR_UNKNOWN, false, "failed to add item xmax");
     10669        psFree(md);
     10670        return false;
     10671    }
     10672    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, ymin)) {
     10673        psError(PS_ERR_UNKNOWN, false, "failed to add item ymin");
     10674        psFree(md);
     10675        return false;
     10676    }
     10677    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, ymax)) {
     10678        psError(PS_ERR_UNKNOWN, false, "failed to add item ymax");
    1059110679        psFree(md);
    1059210680        return false;
     
    1062510713bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object)
    1062610714{
    10627     return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->dtime_warp, object->hostname, object->good_frac, object->ignored, object->fault);
     10715    return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->dtime_warp, object->hostname, object->good_frac, object->xmin, object->xmax, object->ymin, object->ymax, object->ignored, object->fault);
    1062810716}
    1062910717
     
    1074810836        return false;
    1074910837    }
     10838    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, object->xmin)) {
     10839        psError(PS_ERR_UNKNOWN, false, "failed to add item xmin");
     10840        psFree(md);
     10841        return false;
     10842    }
     10843    if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, object->xmax)) {
     10844        psError(PS_ERR_UNKNOWN, false, "failed to add item xmax");
     10845        psFree(md);
     10846        return false;
     10847    }
     10848    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, object->ymin)) {
     10849        psError(PS_ERR_UNKNOWN, false, "failed to add item ymin");
     10850        psFree(md);
     10851        return false;
     10852    }
     10853    if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, object->ymax)) {
     10854        psError(PS_ERR_UNKNOWN, false, "failed to add item ymax");
     10855        psFree(md);
     10856        return false;
     10857    }
    1075010858    if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, NULL, object->ignored)) {
    1075110859        psError(PS_ERR_UNKNOWN, false, "failed to add item ignored");
     
    1081710925        return false;
    1081810926    }
     10927    psS32 xmin = psMetadataLookupS32(&status, md, "xmin");
     10928    if (!status) {
     10929        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item xmin");
     10930        return false;
     10931    }
     10932    psS32 xmax = psMetadataLookupS32(&status, md, "xmax");
     10933    if (!status) {
     10934        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item xmax");
     10935        return false;
     10936    }
     10937    psS32 ymin = psMetadataLookupS32(&status, md, "ymin");
     10938    if (!status) {
     10939        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ymin");
     10940        return false;
     10941    }
     10942    psS32 ymax = psMetadataLookupS32(&status, md, "ymax");
     10943    if (!status) {
     10944        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ymax");
     10945        return false;
     10946    }
    1081910947    bool ignored = psMetadataLookupBool(&status, md, "ignored");
    1082010948    if (!status) {
     
    1082810956    }
    1082910957
    10830     return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, dtime_warp, hostname, good_frac, ignored, fault);
     10958    return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, dtime_warp, hostname, good_frac, xmin, xmax, ymin, ymax, ignored, fault);
    1083110959}
    1083210960psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1204512173static void diffSkyfileRowFree(diffSkyfileRow *object);
    1204612174
    12047 diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)
     12175diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS32 stamps_num, psF32 stamps_rms, psS32 sources, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)
    1204812176{
    1204912177    diffSkyfileRow  *_object;
     
    1205712185    _object->bg = bg;
    1205812186    _object->bg_stdev = bg_stdev;
     12187    _object->stamps_num = stamps_num;
     12188    _object->stamps_rms = stamps_rms;
     12189    _object->sources = sources;
    1205912190    _object->dtime_diff = dtime_diff;
    1206012191    _object->hostname = psStringCopy(hostname);
     
    1210012231        return false;
    1210112232    }
     12233    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, 0)) {
     12234        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num");
     12235        psFree(md);
     12236        return false;
     12237    }
     12238    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, 0.0)) {
     12239        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms");
     12240        psFree(md);
     12241        return false;
     12242    }
     12243    if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, 0)) {
     12244        psError(PS_ERR_UNKNOWN, false, "failed to add item sources");
     12245        psFree(md);
     12246        return false;
     12247    }
    1210212248    if (!psMetadataAdd(md, PS_LIST_TAIL, "dtime_diff", PS_DATA_F32, NULL, 0.0)) {
    1210312249        psError(PS_ERR_UNKNOWN, false, "failed to add item dtime_diff");
     
    1213312279}
    1213412280
    12135 bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)
     12281bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS32 stamps_num, psF32 stamps_rms, psS32 sources, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)
    1213612282{
    1213712283    psMetadata *md = psMetadataAlloc();
     
    1215812304    if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) {
    1215912305        psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev");
     12306        psFree(md);
     12307        return false;
     12308    }
     12309    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, stamps_num)) {
     12310        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num");
     12311        psFree(md);
     12312        return false;
     12313    }
     12314    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, stamps_rms)) {
     12315        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms");
     12316        psFree(md);
     12317        return false;
     12318    }
     12319    if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, sources)) {
     12320        psError(PS_ERR_UNKNOWN, false, "failed to add item sources");
    1216012321        psFree(md);
    1216112322        return false;
     
    1220412365bool diffSkyfileInsertObject(psDB *dbh, diffSkyfileRow *object)
    1220512366{
    12206     return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->dtime_diff, object->hostname, object->good_frac, object->fault);
     12367    return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->stamps_num, object->stamps_rms, object->sources, object->dtime_diff, object->hostname, object->good_frac, object->fault);
    1220712368}
    1220812369
     
    1230212463        return false;
    1230312464    }
     12465    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, object->stamps_num)) {
     12466        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num");
     12467        psFree(md);
     12468        return false;
     12469    }
     12470    if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, object->stamps_rms)) {
     12471        psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms");
     12472        psFree(md);
     12473        return false;
     12474    }
     12475    if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, object->sources)) {
     12476        psError(PS_ERR_UNKNOWN, false, "failed to add item sources");
     12477        psFree(md);
     12478        return false;
     12479    }
    1230412480    if (!psMetadataAdd(md, PS_LIST_TAIL, "dtime_diff", PS_DATA_F32, NULL, object->dtime_diff)) {
    1230512481        psError(PS_ERR_UNKNOWN, false, "failed to add item dtime_diff");
     
    1235612532        return false;
    1235712533    }
     12534    psS32 stamps_num = psMetadataLookupS32(&status, md, "stamps_num");
     12535    if (!status) {
     12536        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stamps_num");
     12537        return false;
     12538    }
     12539    psF32 stamps_rms = psMetadataLookupF32(&status, md, "stamps_rms");
     12540    if (!status) {
     12541        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stamps_rms");
     12542        return false;
     12543    }
     12544    psS32 sources = psMetadataLookupS32(&status, md, "sources");
     12545    if (!status) {
     12546        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item sources");
     12547        return false;
     12548    }
    1235812549    psF32 dtime_diff = psMetadataLookupF32(&status, md, "dtime_diff");
    1235912550    if (!status) {
     
    1237712568    }
    1237812569
    12379     return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev, dtime_diff, hostname, good_frac, fault);
     12570    return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev, stamps_num, stamps_rms, sources, dtime_diff, hostname, good_frac, fault);
    1238012571}
    1238112572psArray *diffSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r17570 r17833  
    16681668    char            *object;
    16691669    psF32           solang;
     1670    char            *hostname;
    16701671    psS16           fault;
    16711672} rawExpRow;
     
    17321733    const char      *object,
    17331734    psF32           solang,
     1735    const char      *hostname,
    17341736    psS16           fault
    17351737);
     
    18171819    const char      *object,
    18181820    psF32           solang,
     1821    const char      *hostname,
    18191822    psS16           fault
    18201823);
     
    20242027    psF64           user_5;
    20252028    char            *object;
     2029    char            *hostname;
    20262030    psS16           fault;
    20272031} rawImfileRow;
     
    20842088    psF64           user_5,
    20852089    const char      *object,
     2090    const char      *hostname,
    20862091    psS16           fault
    20872092);
     
    21652170    psF64           user_5,
    21662171    const char      *object,
     2172    const char      *hostname,
    21672173    psS16           fault
    21682174);
     
    43714377    char            *hostname;
    43724378    psF32           good_frac;
     4379    psS32           xmin;
     4380    psS32           xmax;
     4381    psS32           ymin;
     4382    psS32           ymax;
    43734383    bool            ignored;
    43744384    psS16           fault;
     
    43914401    const char      *hostname,
    43924402    psF32           good_frac,
     4403    psS32           xmin,
     4404    psS32           xmax,
     4405    psS32           ymin,
     4406    psS32           ymax,
    43934407    bool            ignored,
    43944408    psS16           fault
     
    44324446    const char      *hostname,
    44334447    psF32           good_frac,
     4448    psS32           xmin,
     4449    psS32           xmax,
     4450    psS32           ymin,
     4451    psS32           ymax,
    44344452    bool            ignored,
    44354453    psS16           fault
     
    52155233    psF64           bg;
    52165234    psF64           bg_stdev;
     5235    psS32           stamps_num;
     5236    psF32           stamps_rms;
     5237    psS32           sources;
    52175238    psF32           dtime_diff;
    52185239    char            *hostname;
     
    52325253    psF64           bg,
    52335254    psF64           bg_stdev,
     5255    psS32           stamps_num,
     5256    psF32           stamps_rms,
     5257    psS32           sources,
    52345258    psF32           dtime_diff,
    52355259    const char      *hostname,
     
    52705294    psF64           bg,
    52715295    psF64           bg_stdev,
     5296    psS32           stamps_num,
     5297    psF32           stamps_rms,
     5298    psS32           sources,
    52725299    psF32           dtime_diff,
    52735300    const char      *hostname,
  • trunk/ippdb/tests/alloc.c

    r17570 r17833  
    285285        rawExpRow       *object;
    286286
    287         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16    );
     287        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16    );
    288288
    289289        if (!object) {
     
    510510            exit(EXIT_FAILURE);
    511511        }
     512        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
     513            psFree(object);
     514            exit(EXIT_FAILURE);
     515        }
    512516        if (!object->fault == -16) {
    513517            psFree(object);
     
    521525        rawImfileRow    *object;
    522526
    523         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     527        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16    );
    524528
    525529        if (!object) {
     
    730734            exit(EXIT_FAILURE);
    731735        }
     736        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
     737            psFree(object);
     738            exit(EXIT_FAILURE);
     739        }
    732740        if (!object->fault == -16) {
    733741            psFree(object);
     
    12731281        warpSkyfileRow  *object;
    12741282
    1275         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16    );
     1283        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16    );
    12761284
    12771285        if (!object) {
     
    13191327            exit(EXIT_FAILURE);
    13201328        }
     1329        if (!object->xmin == -32) {
     1330            psFree(object);
     1331            exit(EXIT_FAILURE);
     1332        }
     1333        if (!object->xmax == -32) {
     1334            psFree(object);
     1335            exit(EXIT_FAILURE);
     1336        }
     1337        if (!object->ymin == -32) {
     1338            psFree(object);
     1339            exit(EXIT_FAILURE);
     1340        }
     1341        if (!object->ymax == -32) {
     1342            psFree(object);
     1343            exit(EXIT_FAILURE);
     1344        }
    13211345        if (!object->ignored == true) {
    13221346            psFree(object);
     
    14321456        diffSkyfileRow  *object;
    14331457
    1434         object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16    );
     1458        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16    );
    14351459
    14361460        if (!object) {
     
    14551479        }
    14561480        if (!object->bg_stdev == 64.64) {
     1481            psFree(object);
     1482            exit(EXIT_FAILURE);
     1483        }
     1484        if (!object->stamps_num == -32) {
     1485            psFree(object);
     1486            exit(EXIT_FAILURE);
     1487        }
     1488        if (!object->stamps_rms == 32.32) {
     1489            psFree(object);
     1490            exit(EXIT_FAILURE);
     1491        }
     1492        if (!object->sources == -32) {
    14571493            psFree(object);
    14581494            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r17570 r17833  
    118118        }
    119119
    120         if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.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 (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16)) {
     120        if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -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 (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16)) {
    136136            exit(EXIT_FAILURE);
    137137        }
     
    283283        }
    284284
    285         if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16)) {
     285        if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16)) {
    286286            exit(EXIT_FAILURE);
    287287        }
     
    343343        }
    344344
    345         if (!diffSkyfileInsert(dbh, -64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16)) {
     345        if (!diffSkyfileInsert(dbh, -64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16)) {
    346346            exit(EXIT_FAILURE);
    347347        }
  • trunk/ippdb/tests/insertobject.c

    r17570 r17833  
    168168        }
    169169
    170         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16);
     170        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16);
    171171        if (!object) {
    172172            exit(EXIT_FAILURE);
     
    190190        }
    191191
    192         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16);
     192        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16);
    193193        if (!object) {
    194194            exit(EXIT_FAILURE);
     
    410410        }
    411411
    412         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16);
     412        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16);
    413413        if (!object) {
    414414            exit(EXIT_FAILURE);
     
    498498        }
    499499
    500         object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16);
     500        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16);
    501501        if (!object) {
    502502            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r17570 r17833  
    339339        bool            status;
    340340
    341         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16);
     341        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16);
    342342        if (!object) {
    343343            exit(EXIT_FAILURE);
     
    569569            exit(EXIT_FAILURE);
    570570        }
     571        if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) {
     572            psFree(md);
     573            exit(EXIT_FAILURE);
     574        }
    571575            psFree(md);
    572576            exit(EXIT_FAILURE);
     
    581585        bool            status;
    582586
    583         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16);
     587        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16);
    584588        if (!object) {
    585589            exit(EXIT_FAILURE);
     
    795799            exit(EXIT_FAILURE);
    796800        }
     801        if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) {
     802            psFree(md);
     803            exit(EXIT_FAILURE);
     804        }
    797805            psFree(md);
    798806            exit(EXIT_FAILURE);
     
    13941402        bool            status;
    13951403
    1396         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16);
     1404        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16);
    13971405        if (!object) {
    13981406            exit(EXIT_FAILURE);
     
    14451453            exit(EXIT_FAILURE);
    14461454        }
     1455        if (!psMetadataLookupS32(&status, md, "xmin") == -32) {
     1456            psFree(md);
     1457            exit(EXIT_FAILURE);
     1458        }
     1459        if (!psMetadataLookupS32(&status, md, "xmax") == -32) {
     1460            psFree(md);
     1461            exit(EXIT_FAILURE);
     1462        }
     1463        if (!psMetadataLookupS32(&status, md, "ymin") == -32) {
     1464            psFree(md);
     1465            exit(EXIT_FAILURE);
     1466        }
     1467        if (!psMetadataLookupS32(&status, md, "ymax") == -32) {
     1468            psFree(md);
     1469            exit(EXIT_FAILURE);
     1470        }
    14471471        if (!psMetadataLookupBool(&status, md, "ignored") == true) {
    14481472            psFree(md);
     
    15791603        bool            status;
    15801604
    1581         object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16);
     1605        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16);
    15821606        if (!object) {
    15831607            exit(EXIT_FAILURE);
     
    16071631        }
    16081632        if (!psMetadataLookupF64(&status, md, "bg_stdev") == 64.64) {
     1633            psFree(md);
     1634            exit(EXIT_FAILURE);
     1635        }
     1636        if (!psMetadataLookupS32(&status, md, "stamps_num") == -32) {
     1637            psFree(md);
     1638            exit(EXIT_FAILURE);
     1639        }
     1640        if (!psMetadataLookupF32(&status, md, "stamps_rms") == 32.32) {
     1641            psFree(md);
     1642            exit(EXIT_FAILURE);
     1643        }
     1644        if (!psMetadataLookupS32(&status, md, "sources") == -32) {
    16091645            psFree(md);
    16101646            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r17570 r17833  
    715715            exit(EXIT_FAILURE);
    716716        }
     717        if (!psMetadataAddStr(md, PS_LIST_TAIL, "hostname", 0, NULL, "a string")) {
     718            psFree(md);
     719            exit(EXIT_FAILURE);
     720        }
    717721            psFree(md);
    718722            exit(EXIT_FAILURE);
     
    942946        }
    943947        if (!object->solang == 32.32) {
     948            psFree(object);
     949            exit(EXIT_FAILURE);
     950        }
     951        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
    944952            psFree(object);
    945953            exit(EXIT_FAILURE);
     
    11591167            exit(EXIT_FAILURE);
    11601168        }
     1169        if (!psMetadataAddStr(md, PS_LIST_TAIL, "hostname", 0, NULL, "a string")) {
     1170            psFree(md);
     1171            exit(EXIT_FAILURE);
     1172        }
    11611173            psFree(md);
    11621174            exit(EXIT_FAILURE);
     
    13701382        }
    13711383        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
     1384            psFree(object);
     1385            exit(EXIT_FAILURE);
     1386        }
     1387        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
    13721388            psFree(object);
    13731389            exit(EXIT_FAILURE);
     
    23822398            exit(EXIT_FAILURE);
    23832399        }
     2400        if (!psMetadataAddS32(md, PS_LIST_TAIL, "xmin", 0, NULL, -32)) {
     2401            psFree(md);
     2402            exit(EXIT_FAILURE);
     2403        }
     2404        if (!psMetadataAddS32(md, PS_LIST_TAIL, "xmax", 0, NULL, -32)) {
     2405            psFree(md);
     2406            exit(EXIT_FAILURE);
     2407        }
     2408        if (!psMetadataAddS32(md, PS_LIST_TAIL, "ymin", 0, NULL, -32)) {
     2409            psFree(md);
     2410            exit(EXIT_FAILURE);
     2411        }
     2412        if (!psMetadataAddS32(md, PS_LIST_TAIL, "ymax", 0, NULL, -32)) {
     2413            psFree(md);
     2414            exit(EXIT_FAILURE);
     2415        }
    23842416        if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, NULL, true)) {
    23852417            psFree(md);
     
    24342466        }
    24352467        if (!object->good_frac == 32.32) {
     2468            psFree(object);
     2469            exit(EXIT_FAILURE);
     2470        }
     2471        if (!object->xmin == -32) {
     2472            psFree(object);
     2473            exit(EXIT_FAILURE);
     2474        }
     2475        if (!object->xmax == -32) {
     2476            psFree(object);
     2477            exit(EXIT_FAILURE);
     2478        }
     2479        if (!object->ymin == -32) {
     2480            psFree(object);
     2481            exit(EXIT_FAILURE);
     2482        }
     2483        if (!object->ymax == -32) {
    24362484            psFree(object);
    24372485            exit(EXIT_FAILURE);
     
    26362684            exit(EXIT_FAILURE);
    26372685        }
     2686        if (!psMetadataAddS32(md, PS_LIST_TAIL, "stamps_num", 0, NULL, -32)) {
     2687            psFree(md);
     2688            exit(EXIT_FAILURE);
     2689        }
     2690        if (!psMetadataAddF32(md, PS_LIST_TAIL, "stamps_rms", 0, NULL, 32.32)) {
     2691            psFree(md);
     2692            exit(EXIT_FAILURE);
     2693        }
     2694        if (!psMetadataAddS32(md, PS_LIST_TAIL, "sources", 0, NULL, -32)) {
     2695            psFree(md);
     2696            exit(EXIT_FAILURE);
     2697        }
    26382698        if (!psMetadataAddF32(md, PS_LIST_TAIL, "dtime_diff", 0, NULL, 32.32)) {
    26392699            psFree(md);
     
    26762736        }
    26772737        if (!object->bg_stdev == 64.64) {
     2738            psFree(object);
     2739            exit(EXIT_FAILURE);
     2740        }
     2741        if (!object->stamps_num == -32) {
     2742            psFree(object);
     2743            exit(EXIT_FAILURE);
     2744        }
     2745        if (!object->stamps_rms == 32.32) {
     2746            psFree(object);
     2747            exit(EXIT_FAILURE);
     2748        }
     2749        if (!object->sources == -32) {
    26782750            psFree(object);
    26792751            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.