IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8266


Ignore:
Timestamp:
Aug 9, 2006, 7:18:19 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION to 0.0.24

Location:
trunk/ippdb
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r8228 r8266  
    11AC_PREREQ(2.59)
    22
    3 AC_INIT([ippdb], [0.0.23], [pan-starrs.ifa.hawaii.edu])
     3AC_INIT([ippdb], [0.0.24], [pan-starrs.ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([ippdb.pc.in])
    55
  • trunk/ippdb/src/ippdb.c

    r8228 r8266  
    718718    return returnSet;
    719719}
     720bool weatherDeleteObject(psDB *dbh, const weatherRow *object)
     721{
     722    psMetadata *where = weatherMetadataFromObject(object);
     723    long long count = psDBDeleteRows(dbh, WEATHER_TABLE_NAME, where, 0);
     724    psFree(where)
     725    if (count < 0) {
     726        psError(PS_ERR_UNKNOWN, true, "failed to delete row from weather");
     727        return false;
     728    }
     729    if (count > 1) {
     730        // XXX should this be a psAbort() instead?  It is possible that
     731        // having an object match multiple rows was by design.
     732        psError(PS_ERR_UNKNOWN, true, "weatherRow object matched more then one row.  Check your database schema");
     733        return false;
     734    }
     735
     736    return true;
     737}
    720738long long weatherDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    721739{
     
    12481266    return returnSet;
    12491267}
     1268bool skyp_transparencyDeleteObject(psDB *dbh, const skyp_transparencyRow *object)
     1269{
     1270    psMetadata *where = skyp_transparencyMetadataFromObject(object);
     1271    long long count = psDBDeleteRows(dbh, SKYP_TRANSPARENCY_TABLE_NAME, where, 0);
     1272    psFree(where)
     1273    if (count < 0) {
     1274        psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_transparency");
     1275        return false;
     1276    }
     1277    if (count > 1) {
     1278        // XXX should this be a psAbort() instead?  It is possible that
     1279        // having an object match multiple rows was by design.
     1280        psError(PS_ERR_UNKNOWN, true, "skyp_transparencyRow object matched more then one row.  Check your database schema");
     1281        return false;
     1282    }
     1283
     1284    return true;
     1285}
    12501286long long skyp_transparencyDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    12511287{
     
    18361872    return returnSet;
    18371873}
     1874bool skyp_absorptionDeleteObject(psDB *dbh, const skyp_absorptionRow *object)
     1875{
     1876    psMetadata *where = skyp_absorptionMetadataFromObject(object);
     1877    long long count = psDBDeleteRows(dbh, SKYP_ABSORPTION_TABLE_NAME, where, 0);
     1878    psFree(where)
     1879    if (count < 0) {
     1880        psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_absorption");
     1881        return false;
     1882    }
     1883    if (count > 1) {
     1884        // XXX should this be a psAbort() instead?  It is possible that
     1885        // having an object match multiple rows was by design.
     1886        psError(PS_ERR_UNKNOWN, true, "skyp_absorptionRow object matched more then one row.  Check your database schema");
     1887        return false;
     1888    }
     1889
     1890    return true;
     1891}
    18381892long long skyp_absorptionDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    18391893{
     
    23372391    return returnSet;
    23382392}
     2393bool skyp_emissionDeleteObject(psDB *dbh, const skyp_emissionRow *object)
     2394{
     2395    psMetadata *where = skyp_emissionMetadataFromObject(object);
     2396    long long count = psDBDeleteRows(dbh, SKYP_EMISSION_TABLE_NAME, where, 0);
     2397    psFree(where)
     2398    if (count < 0) {
     2399        psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_emission");
     2400        return false;
     2401    }
     2402    if (count > 1) {
     2403        // XXX should this be a psAbort() instead?  It is possible that
     2404        // having an object match multiple rows was by design.
     2405        psError(PS_ERR_UNKNOWN, true, "skyp_emissionRow object matched more then one row.  Check your database schema");
     2406        return false;
     2407    }
     2408
     2409    return true;
     2410}
    23392411long long skyp_emissionDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    23402412{
     
    28672939    return returnSet;
    28682940}
     2941bool dimmDeleteObject(psDB *dbh, const dimmRow *object)
     2942{
     2943    psMetadata *where = dimmMetadataFromObject(object);
     2944    long long count = psDBDeleteRows(dbh, DIMM_TABLE_NAME, where, 0);
     2945    psFree(where)
     2946    if (count < 0) {
     2947        psError(PS_ERR_UNKNOWN, true, "failed to delete row from dimm");
     2948        return false;
     2949    }
     2950    if (count > 1) {
     2951        // XXX should this be a psAbort() instead?  It is possible that
     2952        // having an object match multiple rows was by design.
     2953        psError(PS_ERR_UNKNOWN, true, "dimmRow object matched more then one row.  Check your database schema");
     2954        return false;
     2955    }
     2956
     2957    return true;
     2958}
    28692959long long dimmDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    28702960{
     
    33673457    return returnSet;
    33683458}
     3459bool skyp_irDeleteObject(psDB *dbh, const skyp_irRow *object)
     3460{
     3461    psMetadata *where = skyp_irMetadataFromObject(object);
     3462    long long count = psDBDeleteRows(dbh, SKYP_IR_TABLE_NAME, where, 0);
     3463    psFree(where)
     3464    if (count < 0) {
     3465        psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_ir");
     3466        return false;
     3467    }
     3468    if (count > 1) {
     3469        // XXX should this be a psAbort() instead?  It is possible that
     3470        // having an object match multiple rows was by design.
     3471        psError(PS_ERR_UNKNOWN, true, "skyp_irRow object matched more then one row.  Check your database schema");
     3472        return false;
     3473    }
     3474
     3475    return true;
     3476}
    33693477long long skyp_irDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    33703478{
     
    38093917    return returnSet;
    38103918}
     3919bool domeDeleteObject(psDB *dbh, const domeRow *object)
     3920{
     3921    psMetadata *where = domeMetadataFromObject(object);
     3922    long long count = psDBDeleteRows(dbh, DOME_TABLE_NAME, where, 0);
     3923    psFree(where)
     3924    if (count < 0) {
     3925        psError(PS_ERR_UNKNOWN, true, "failed to delete row from dome");
     3926        return false;
     3927    }
     3928    if (count > 1) {
     3929        // XXX should this be a psAbort() instead?  It is possible that
     3930        // having an object match multiple rows was by design.
     3931        psError(PS_ERR_UNKNOWN, true, "domeRow object matched more then one row.  Check your database schema");
     3932        return false;
     3933    }
     3934
     3935    return true;
     3936}
    38113937long long domeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    38123938{
     
    42814407    return returnSet;
    42824408}
     4409bool telescopeDeleteObject(psDB *dbh, const telescopeRow *object)
     4410{
     4411    psMetadata *where = telescopeMetadataFromObject(object);
     4412    long long count = psDBDeleteRows(dbh, TELESCOPE_TABLE_NAME, where, 0);
     4413    psFree(where)
     4414    if (count < 0) {
     4415        psError(PS_ERR_UNKNOWN, true, "failed to delete row from telescope");
     4416        return false;
     4417    }
     4418    if (count > 1) {
     4419        // XXX should this be a psAbort() instead?  It is possible that
     4420        // having an object match multiple rows was by design.
     4421        psError(PS_ERR_UNKNOWN, true, "telescopeRow object matched more then one row.  Check your database schema");
     4422        return false;
     4423    }
     4424
     4425    return true;
     4426}
    42834427long long telescopeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    42844428{
     
    47574901    return returnSet;
    47584902}
     4903bool summitExpDeleteObject(psDB *dbh, const summitExpRow *object)
     4904{
     4905    psMetadata *where = summitExpMetadataFromObject(object);
     4906    long long count = psDBDeleteRows(dbh, SUMMITEXP_TABLE_NAME, where, 0);
     4907    psFree(where)
     4908    if (count < 0) {
     4909        psError(PS_ERR_UNKNOWN, true, "failed to delete row from summitExp");
     4910        return false;
     4911    }
     4912    if (count > 1) {
     4913        // XXX should this be a psAbort() instead?  It is possible that
     4914        // having an object match multiple rows was by design.
     4915        psError(PS_ERR_UNKNOWN, true, "summitExpRow object matched more then one row.  Check your database schema");
     4916        return false;
     4917    }
     4918
     4919    return true;
     4920}
    47594921long long summitExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    47604922{
     
    52325394    return returnSet;
    52335395}
     5396bool pzPendingExpDeleteObject(psDB *dbh, const pzPendingExpRow *object)
     5397{
     5398    psMetadata *where = pzPendingExpMetadataFromObject(object);
     5399    long long count = psDBDeleteRows(dbh, PZPENDINGEXP_TABLE_NAME, where, 0);
     5400    psFree(where)
     5401    if (count < 0) {
     5402        psError(PS_ERR_UNKNOWN, true, "failed to delete row from pzPendingExp");
     5403        return false;
     5404    }
     5405    if (count > 1) {
     5406        // XXX should this be a psAbort() instead?  It is possible that
     5407        // having an object match multiple rows was by design.
     5408        psError(PS_ERR_UNKNOWN, true, "pzPendingExpRow object matched more then one row.  Check your database schema");
     5409        return false;
     5410    }
     5411
     5412    return true;
     5413}
    52345414long long pzPendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    52355415{
     
    57375917    return returnSet;
    57385918}
     5919bool pzPendingImfileDeleteObject(psDB *dbh, const pzPendingImfileRow *object)
     5920{
     5921    psMetadata *where = pzPendingImfileMetadataFromObject(object);
     5922    long long count = psDBDeleteRows(dbh, PZPENDINGIMFILE_TABLE_NAME, where, 0);
     5923    psFree(where)
     5924    if (count < 0) {
     5925        psError(PS_ERR_UNKNOWN, true, "failed to delete row from pzPendingImfile");
     5926        return false;
     5927    }
     5928    if (count > 1) {
     5929        // XXX should this be a psAbort() instead?  It is possible that
     5930        // having an object match multiple rows was by design.
     5931        psError(PS_ERR_UNKNOWN, true, "pzPendingImfileRow object matched more then one row.  Check your database schema");
     5932        return false;
     5933    }
     5934
     5935    return true;
     5936}
    57395937long long pzPendingImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    57405938{
     
    62126410    return returnSet;
    62136411}
     6412bool newExpDeleteObject(psDB *dbh, const newExpRow *object)
     6413{
     6414    psMetadata *where = newExpMetadataFromObject(object);
     6415    long long count = psDBDeleteRows(dbh, NEWEXP_TABLE_NAME, where, 0);
     6416    psFree(where)
     6417    if (count < 0) {
     6418        psError(PS_ERR_UNKNOWN, true, "failed to delete row from newExp");
     6419        return false;
     6420    }
     6421    if (count > 1) {
     6422        // XXX should this be a psAbort() instead?  It is possible that
     6423        // having an object match multiple rows was by design.
     6424        psError(PS_ERR_UNKNOWN, true, "newExpRow object matched more then one row.  Check your database schema");
     6425        return false;
     6426    }
     6427
     6428    return true;
     6429}
    62146430long long newExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    62156431{
     
    66586874    return returnSet;
    66596875}
     6876bool newImfileDeleteObject(psDB *dbh, const newImfileRow *object)
     6877{
     6878    psMetadata *where = newImfileMetadataFromObject(object);
     6879    long long count = psDBDeleteRows(dbh, NEWIMFILE_TABLE_NAME, where, 0);
     6880    psFree(where)
     6881    if (count < 0) {
     6882        psError(PS_ERR_UNKNOWN, true, "failed to delete row from newImfile");
     6883        return false;
     6884    }
     6885    if (count > 1) {
     6886        // XXX should this be a psAbort() instead?  It is possible that
     6887        // having an object match multiple rows was by design.
     6888        psError(PS_ERR_UNKNOWN, true, "newImfileRow object matched more then one row.  Check your database schema");
     6889        return false;
     6890    }
     6891
     6892    return true;
     6893}
    66606894long long newImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    66616895{
     
    73087542    return returnSet;
    73097543}
     7544bool rawDetrendExpDeleteObject(psDB *dbh, const rawDetrendExpRow *object)
     7545{
     7546    psMetadata *where = rawDetrendExpMetadataFromObject(object);
     7547    long long count = psDBDeleteRows(dbh, RAWDETRENDEXP_TABLE_NAME, where, 0);
     7548    psFree(where)
     7549    if (count < 0) {
     7550        psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawDetrendExp");
     7551        return false;
     7552    }
     7553    if (count > 1) {
     7554        // XXX should this be a psAbort() instead?  It is possible that
     7555        // having an object match multiple rows was by design.
     7556        psError(PS_ERR_UNKNOWN, true, "rawDetrendExpRow object matched more then one row.  Check your database schema");
     7557        return false;
     7558    }
     7559
     7560    return true;
     7561}
    73107562long long rawDetrendExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    73117563{
     
    79578209
    79588210    return returnSet;
     8211}
     8212bool rawScienceExpDeleteObject(psDB *dbh, const rawScienceExpRow *object)
     8213{
     8214    psMetadata *where = rawScienceExpMetadataFromObject(object);
     8215    long long count = psDBDeleteRows(dbh, RAWSCIENCEEXP_TABLE_NAME, where, 0);
     8216    psFree(where)
     8217    if (count < 0) {
     8218        psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawScienceExp");
     8219        return false;
     8220    }
     8221    if (count > 1) {
     8222        // XXX should this be a psAbort() instead?  It is possible that
     8223        // having an object match multiple rows was by design.
     8224        psError(PS_ERR_UNKNOWN, true, "rawScienceExpRow object matched more then one row.  Check your database schema");
     8225        return false;
     8226    }
     8227
     8228    return true;
    79598229}
    79608230long long rawScienceExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     
    87539023    return returnSet;
    87549024}
     9025bool rawImfileDeleteObject(psDB *dbh, const rawImfileRow *object)
     9026{
     9027    psMetadata *where = rawImfileMetadataFromObject(object);
     9028    long long count = psDBDeleteRows(dbh, RAWIMFILE_TABLE_NAME, where, 0);
     9029    psFree(where)
     9030    if (count < 0) {
     9031        psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawImfile");
     9032        return false;
     9033    }
     9034    if (count > 1) {
     9035        // XXX should this be a psAbort() instead?  It is possible that
     9036        // having an object match multiple rows was by design.
     9037        psError(PS_ERR_UNKNOWN, true, "rawImfileRow object matched more then one row.  Check your database schema");
     9038        return false;
     9039    }
     9040
     9041    return true;
     9042}
    87559043long long rawImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    87569044{
     
    94629750    return returnSet;
    94639751}
     9752bool p1PendingExpDeleteObject(psDB *dbh, const p1PendingExpRow *object)
     9753{
     9754    psMetadata *where = p1PendingExpMetadataFromObject(object);
     9755    long long count = psDBDeleteRows(dbh, P1PENDINGEXP_TABLE_NAME, where, 0);
     9756    psFree(where)
     9757    if (count < 0) {
     9758        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p1PendingExp");
     9759        return false;
     9760    }
     9761    if (count > 1) {
     9762        // XXX should this be a psAbort() instead?  It is possible that
     9763        // having an object match multiple rows was by design.
     9764        psError(PS_ERR_UNKNOWN, true, "p1PendingExpRow object matched more then one row.  Check your database schema");
     9765        return false;
     9766    }
     9767
     9768    return true;
     9769}
    94649770long long p1PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    94659771{
     
    1020010506    return returnSet;
    1020110507}
     10508bool p2PendingExpDeleteObject(psDB *dbh, const p2PendingExpRow *object)
     10509{
     10510    psMetadata *where = p2PendingExpMetadataFromObject(object);
     10511    long long count = psDBDeleteRows(dbh, P2PENDINGEXP_TABLE_NAME, where, 0);
     10512    psFree(where)
     10513    if (count < 0) {
     10514        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2PendingExp");
     10515        return false;
     10516    }
     10517    if (count > 1) {
     10518        // XXX should this be a psAbort() instead?  It is possible that
     10519        // having an object match multiple rows was by design.
     10520        psError(PS_ERR_UNKNOWN, true, "p2PendingExpRow object matched more then one row.  Check your database schema");
     10521        return false;
     10522    }
     10523
     10524    return true;
     10525}
    1020210526long long p2PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1020310527{
     
    1070411028    return returnSet;
    1070511029}
     11030bool p2PendingImfileDeleteObject(psDB *dbh, const p2PendingImfileRow *object)
     11031{
     11032    psMetadata *where = p2PendingImfileMetadataFromObject(object);
     11033    long long count = psDBDeleteRows(dbh, P2PENDINGIMFILE_TABLE_NAME, where, 0);
     11034    psFree(where)
     11035    if (count < 0) {
     11036        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2PendingImfile");
     11037        return false;
     11038    }
     11039    if (count > 1) {
     11040        // XXX should this be a psAbort() instead?  It is possible that
     11041        // having an object match multiple rows was by design.
     11042        psError(PS_ERR_UNKNOWN, true, "p2PendingImfileRow object matched more then one row.  Check your database schema");
     11043        return false;
     11044    }
     11045
     11046    return true;
     11047}
    1070611048long long p2PendingImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1070711049{
     
    1144211784    return returnSet;
    1144311785}
     11786bool p2DoneExpDeleteObject(psDB *dbh, const p2DoneExpRow *object)
     11787{
     11788    psMetadata *where = p2DoneExpMetadataFromObject(object);
     11789    long long count = psDBDeleteRows(dbh, P2DONEEXP_TABLE_NAME, where, 0);
     11790    psFree(where)
     11791    if (count < 0) {
     11792        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2DoneExp");
     11793        return false;
     11794    }
     11795    if (count > 1) {
     11796        // XXX should this be a psAbort() instead?  It is possible that
     11797        // having an object match multiple rows was by design.
     11798        psError(PS_ERR_UNKNOWN, true, "p2DoneExpRow object matched more then one row.  Check your database schema");
     11799        return false;
     11800    }
     11801
     11802    return true;
     11803}
    1144411804long long p2DoneExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1144511805{
     
    1194612306    return returnSet;
    1194712307}
     12308bool p2DoneImfileDeleteObject(psDB *dbh, const p2DoneImfileRow *object)
     12309{
     12310    psMetadata *where = p2DoneImfileMetadataFromObject(object);
     12311    long long count = psDBDeleteRows(dbh, P2DONEIMFILE_TABLE_NAME, where, 0);
     12312    psFree(where)
     12313    if (count < 0) {
     12314        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2DoneImfile");
     12315        return false;
     12316    }
     12317    if (count > 1) {
     12318        // XXX should this be a psAbort() instead?  It is possible that
     12319        // having an object match multiple rows was by design.
     12320        psError(PS_ERR_UNKNOWN, true, "p2DoneImfileRow object matched more then one row.  Check your database schema");
     12321        return false;
     12322    }
     12323
     12324    return true;
     12325}
    1194812326long long p2DoneImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1194912327{
     
    1265413032    return returnSet;
    1265513033}
     13034bool p3PendingExpDeleteObject(psDB *dbh, const p3PendingExpRow *object)
     13035{
     13036    psMetadata *where = p3PendingExpMetadataFromObject(object);
     13037    long long count = psDBDeleteRows(dbh, P3PENDINGEXP_TABLE_NAME, where, 0);
     13038    psFree(where)
     13039    if (count < 0) {
     13040        psError(PS_ERR_UNKNOWN, true, "failed to delete row from p3PendingExp");
     13041        return false;
     13042    }
     13043    if (count > 1) {
     13044        // XXX should this be a psAbort() instead?  It is possible that
     13045        // having an object match multiple rows was by design.
     13046        psError(PS_ERR_UNKNOWN, true, "p3PendingExpRow object matched more then one row.  Check your database schema");
     13047        return false;
     13048    }
     13049
     13050    return true;
     13051}
    1265613052long long p3PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1265713053{
     
    1303913435    return returnSet;
    1304013436}
     13437bool detRunDeleteObject(psDB *dbh, const detRunRow *object)
     13438{
     13439    psMetadata *where = detRunMetadataFromObject(object);
     13440    long long count = psDBDeleteRows(dbh, DETRUN_TABLE_NAME, where, 0);
     13441    psFree(where)
     13442    if (count < 0) {
     13443        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detRun");
     13444        return false;
     13445    }
     13446    if (count > 1) {
     13447        // XXX should this be a psAbort() instead?  It is possible that
     13448        // having an object match multiple rows was by design.
     13449        psError(PS_ERR_UNKNOWN, true, "detRunRow object matched more then one row.  Check your database schema");
     13450        return false;
     13451    }
     13452
     13453    return true;
     13454}
    1304113455long long detRunDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1304213456{
     
    1374714161    return returnSet;
    1374814162}
     14163bool detInputExpDeleteObject(psDB *dbh, const detInputExpRow *object)
     14164{
     14165    psMetadata *where = detInputExpMetadataFromObject(object);
     14166    long long count = psDBDeleteRows(dbh, DETINPUTEXP_TABLE_NAME, where, 0);
     14167    psFree(where)
     14168    if (count < 0) {
     14169        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detInputExp");
     14170        return false;
     14171    }
     14172    if (count > 1) {
     14173        // XXX should this be a psAbort() instead?  It is possible that
     14174        // having an object match multiple rows was by design.
     14175        psError(PS_ERR_UNKNOWN, true, "detInputExpRow object matched more then one row.  Check your database schema");
     14176        return false;
     14177    }
     14178
     14179    return true;
     14180}
    1374914181long long detInputExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1375014182{
     
    1422214654    return returnSet;
    1422314655}
     14656bool detProcessedImfileDeleteObject(psDB *dbh, const detProcessedImfileRow *object)
     14657{
     14658    psMetadata *where = detProcessedImfileMetadataFromObject(object);
     14659    long long count = psDBDeleteRows(dbh, DETPROCESSEDIMFILE_TABLE_NAME, where, 0);
     14660    psFree(where)
     14661    if (count < 0) {
     14662        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detProcessedImfile");
     14663        return false;
     14664    }
     14665    if (count > 1) {
     14666        // XXX should this be a psAbort() instead?  It is possible that
     14667        // having an object match multiple rows was by design.
     14668        psError(PS_ERR_UNKNOWN, true, "detProcessedImfileRow object matched more then one row.  Check your database schema");
     14669        return false;
     14670    }
     14671
     14672    return true;
     14673}
    1422414674long long detProcessedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1422514675{
     
    1469615146    return returnSet;
    1469715147}
     15148bool detStackedImfileDeleteObject(psDB *dbh, const detStackedImfileRow *object)
     15149{
     15150    psMetadata *where = detStackedImfileMetadataFromObject(object);
     15151    long long count = psDBDeleteRows(dbh, DETSTACKEDIMFILE_TABLE_NAME, where, 0);
     15152    psFree(where)
     15153    if (count < 0) {
     15154        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detStackedImfile");
     15155        return false;
     15156    }
     15157    if (count > 1) {
     15158        // XXX should this be a psAbort() instead?  It is possible that
     15159        // having an object match multiple rows was by design.
     15160        psError(PS_ERR_UNKNOWN, true, "detStackedImfileRow object matched more then one row.  Check your database schema");
     15161        return false;
     15162    }
     15163
     15164    return true;
     15165}
    1469815166long long detStackedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1469915167{
     
    1517015638    return returnSet;
    1517115639}
     15640bool detNormalizedImfileDeleteObject(psDB *dbh, const detNormalizedImfileRow *object)
     15641{
     15642    psMetadata *where = detNormalizedImfileMetadataFromObject(object);
     15643    long long count = psDBDeleteRows(dbh, DETNORMALIZEDIMFILE_TABLE_NAME, where, 0);
     15644    psFree(where)
     15645    if (count < 0) {
     15646        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detNormalizedImfile");
     15647        return false;
     15648    }
     15649    if (count > 1) {
     15650        // XXX should this be a psAbort() instead?  It is possible that
     15651        // having an object match multiple rows was by design.
     15652        psError(PS_ERR_UNKNOWN, true, "detNormalizedImfileRow object matched more then one row.  Check your database schema");
     15653        return false;
     15654    }
     15655
     15656    return true;
     15657}
    1517215658long long detNormalizedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1517315659{
     
    1558416070    return returnSet;
    1558516071}
     16072bool detMasterFrameDeleteObject(psDB *dbh, const detMasterFrameRow *object)
     16073{
     16074    psMetadata *where = detMasterFrameMetadataFromObject(object);
     16075    long long count = psDBDeleteRows(dbh, DETMASTERFRAME_TABLE_NAME, where, 0);
     16076    psFree(where)
     16077    if (count < 0) {
     16078        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detMasterFrame");
     16079        return false;
     16080    }
     16081    if (count > 1) {
     16082        // XXX should this be a psAbort() instead?  It is possible that
     16083        // having an object match multiple rows was by design.
     16084        psError(PS_ERR_UNKNOWN, true, "detMasterFrameRow object matched more then one row.  Check your database schema");
     16085        return false;
     16086    }
     16087
     16088    return true;
     16089}
    1558616090long long detMasterFrameDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1558716091{
     
    1602916533    return returnSet;
    1603016534}
     16535bool detMasterImfileDeleteObject(psDB *dbh, const detMasterImfileRow *object)
     16536{
     16537    psMetadata *where = detMasterImfileMetadataFromObject(object);
     16538    long long count = psDBDeleteRows(dbh, DETMASTERIMFILE_TABLE_NAME, where, 0);
     16539    psFree(where)
     16540    if (count < 0) {
     16541        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detMasterImfile");
     16542        return false;
     16543    }
     16544    if (count > 1) {
     16545        // XXX should this be a psAbort() instead?  It is possible that
     16546        // having an object match multiple rows was by design.
     16547        psError(PS_ERR_UNKNOWN, true, "detMasterImfileRow object matched more then one row.  Check your database schema");
     16548        return false;
     16549    }
     16550
     16551    return true;
     16552}
    1603116553long long detMasterImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1603216554{
     
    1659317115    return returnSet;
    1659417116}
     17117bool detResidImfileAnalysisDeleteObject(psDB *dbh, const detResidImfileAnalysisRow *object)
     17118{
     17119    psMetadata *where = detResidImfileAnalysisMetadataFromObject(object);
     17120    long long count = psDBDeleteRows(dbh, DETRESIDIMFILEANALYSIS_TABLE_NAME, where, 0);
     17121    psFree(where)
     17122    if (count < 0) {
     17123        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detResidImfileAnalysis");
     17124        return false;
     17125    }
     17126    if (count > 1) {
     17127        // XXX should this be a psAbort() instead?  It is possible that
     17128        // having an object match multiple rows was by design.
     17129        psError(PS_ERR_UNKNOWN, true, "detResidImfileAnalysisRow object matched more then one row.  Check your database schema");
     17130        return false;
     17131    }
     17132
     17133    return true;
     17134}
    1659517135long long detResidImfileAnalysisDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
    1659617136{
     
    1664517185static void detResidExpAnalysisRowFree(detResidExpAnalysisRow *object);
    1664617186
    16647 detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept)
     17187detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool keep, bool accept)
    1664817188{
    1664917189    detResidExpAnalysisRow *object;
     
    1665617196    object->exp_id = psStringCopy(exp_id);
    1665717197    object->recipe = psStringCopy(recipe);
     17198    object->keep = keep;
    1665817199    object->accept = accept;
    1665917200
     
    1669817239        return false;
    1669917240    }
     17241    if (!psMetadataAdd(md, PS_LIST_TAIL, "keep", PS_DATA_BOOL, NULL, false)) {
     17242        psError(PS_ERR_UNKNOWN, false, "failed to add item keep");
     17243        psFree(md);
     17244        return false;
     17245    }
    1670017246    if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, false)) {
    1670117247        psError(PS_ERR_UNKNOWN, false, "failed to add item accept");
     
    1671617262}
    1671717263
    16718 bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept)
     17264bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool keep, bool accept)
    1671917265{
    1672017266    psMetadata      *md;
     
    1673917285    if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) {
    1674017286        psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     17287        psFree(md);
     17288        return false;
     17289    }
     17290    if (!psMetadataAdd(md, PS_LIST_TAIL, "keep", PS_DATA_BOOL, NULL, keep)) {
     17291        psError(PS_ERR_UNKNOWN, false, "failed to add item keep");
    1674117292        psFree(md);
    1674217293        return false;
     
    1676817319    return deleted;
    1676917320}
    16770 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool *accept)
     17321bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool *keep, bool *accept)
    1677117322{
    1677217323    psArray         *rowSet;
     
    1683617387        return false;
    1683717388    }
     17389    *keep = psMetadataLookupBool(&status, row, "keep");
     17390    if (!status) {
     17391        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item keep");
     17392        psFree(row);
     17393        return false;
     17394    }
    1683817395    *accept = psMetadataLookupBool(&status, row, "accept");
    1683917396    if (!status) {
     
    1685017407bool detResidExpAnalysisInsertObject(psDB *dbh, detResidExpAnalysisRow *object)
    1685117408{
    16852     return detResidExpAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->recipe, object->accept);
     17409    return detResidExpAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->recipe, object->keep, object->accept);
    1685317410}
    1685417411
     
    1685917416    char            exp_id[256];
    1686017417    char            recipe[256];
     17418    bool            keep;
    1686117419    bool            accept;
    1686217420
    16863     if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&recipe, &accept)) {
     17421    if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&recipe, &keep, &accept)) {
    1686417422        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    1686517423        return NULL;
    1686617424    }
    1686717425
    16868     return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept);
     17426    return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, keep, accept);
    1686917427}
    1687017428
     
    1698517543        return NULL;
    1698617544    }
     17545    if (!psMetadataAdd(md, PS_LIST_TAIL, "keep", PS_DATA_BOOL, NULL, object->keep)) {
     17546        psError(PS_ERR_UNKNOWN, false, "failed to add item keep");
     17547        psFree(md);
     17548        return NULL;
     17549    }
    1698717550    if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, object->accept)) {
    1698817551        psError(PS_ERR_UNKNOWN, false, "failed to add item accept");
     
    1700117564    char            *exp_id;
    1700217565    char            *recipe;
     17566    bool            keep;
    1700317567    bool            accept;
    1700417568
     
    1702317587        return false;
    1702417588    }
     17589    keep = psMetadataLookupBool(&status, md, "keep");
     17590    if (!status) {
     17591        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item keep");
     17592        return false;
     17593    }
    1702517594    accept = psMetadataLookupBool(&status, md, "accept");
    1702617595    if (!status) {
     
    1702917598    }
    1703017599
    17031     return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept);
     17600    return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, keep, accept);
    1703217601}
    1703317602psArray *detResidExpAnalysisSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1706517634
    1706617635    return returnSet;
     17636}
     17637bool detResidExpAnalysisDeleteObject(psDB *dbh, const detResidExpAnalysisRow *object)
     17638{
     17639    psMetadata *where = detResidExpAnalysisMetadataFromObject(object);
     17640    long long count = psDBDeleteRows(dbh, DETRESIDEXPANALYSIS_TABLE_NAME, where, 0);
     17641    psFree(where)
     17642    if (count < 0) {
     17643        psError(PS_ERR_UNKNOWN, true, "failed to delete row from detResidExpAnalysis");
     17644        return false;
     17645    }
     17646    if (count > 1) {
     17647        // XXX should this be a psAbort() instead?  It is possible that
     17648        // having an object match multiple rows was by design.
     17649        psError(PS_ERR_UNKNOWN, true, "detResidExpAnalysisRow object matched more then one row.  Check your database schema");
     17650        return false;
     17651    }
     17652
     17653    return true;
    1706717654}
    1706817655long long detResidExpAnalysisDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r8228 r8266  
    286286    unsigned long long limit            ///< Maximum number of elements to return
    287287);
     288/** Deletes a row from the database coresponding to an weather
     289 *
     290 *  Note that a 'where' search psMetadata is constructed from each object and
     291 *  used to find rows to delete.
     292 *
     293 * @return A The number of rows removed or a negative value on error
     294 */
     295
     296bool weatherDeleteObject(
     297    psDB            *dbh,               ///< Database handle
     298    const weatherRow *object    ///< Object to delete
     299);
    288300/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    289301 *
     
    500512    const psMetadata *where,            ///< Row match criteria
    501513    unsigned long long limit            ///< Maximum number of elements to return
     514);
     515/** Deletes a row from the database coresponding to an skyp_transparency
     516 *
     517 *  Note that a 'where' search psMetadata is constructed from each object and
     518 *  used to find rows to delete.
     519 *
     520 * @return A The number of rows removed or a negative value on error
     521 */
     522
     523bool skyp_transparencyDeleteObject(
     524    psDB            *dbh,               ///< Database handle
     525    const skyp_transparencyRow *object    ///< Object to delete
    502526);
    503527/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    724748    unsigned long long limit            ///< Maximum number of elements to return
    725749);
     750/** Deletes a row from the database coresponding to an skyp_absorption
     751 *
     752 *  Note that a 'where' search psMetadata is constructed from each object and
     753 *  used to find rows to delete.
     754 *
     755 * @return A The number of rows removed or a negative value on error
     756 */
     757
     758bool skyp_absorptionDeleteObject(
     759    psDB            *dbh,               ///< Database handle
     760    const skyp_absorptionRow *object    ///< Object to delete
     761);
    726762/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    727763 *
     
    934970    const psMetadata *where,            ///< Row match criteria
    935971    unsigned long long limit            ///< Maximum number of elements to return
     972);
     973/** Deletes a row from the database coresponding to an skyp_emission
     974 *
     975 *  Note that a 'where' search psMetadata is constructed from each object and
     976 *  used to find rows to delete.
     977 *
     978 * @return A The number of rows removed or a negative value on error
     979 */
     980
     981bool skyp_emissionDeleteObject(
     982    psDB            *dbh,               ///< Database handle
     983    const skyp_emissionRow *object    ///< Object to delete
    936984);
    937985/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    11501198    unsigned long long limit            ///< Maximum number of elements to return
    11511199);
     1200/** Deletes a row from the database coresponding to an dimm
     1201 *
     1202 *  Note that a 'where' search psMetadata is constructed from each object and
     1203 *  used to find rows to delete.
     1204 *
     1205 * @return A The number of rows removed or a negative value on error
     1206 */
     1207
     1208bool dimmDeleteObject(
     1209    psDB            *dbh,               ///< Database handle
     1210    const dimmRow *object    ///< Object to delete
     1211);
    11521212/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    11531213 *
     
    13611421    unsigned long long limit            ///< Maximum number of elements to return
    13621422);
     1423/** Deletes a row from the database coresponding to an skyp_ir
     1424 *
     1425 *  Note that a 'where' search psMetadata is constructed from each object and
     1426 *  used to find rows to delete.
     1427 *
     1428 * @return A The number of rows removed or a negative value on error
     1429 */
     1430
     1431bool skyp_irDeleteObject(
     1432    psDB            *dbh,               ///< Database handle
     1433    const skyp_irRow *object    ///< Object to delete
     1434);
    13631435/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    13641436 *
     
    15631635    const psMetadata *where,            ///< Row match criteria
    15641636    unsigned long long limit            ///< Maximum number of elements to return
     1637);
     1638/** Deletes a row from the database coresponding to an dome
     1639 *
     1640 *  Note that a 'where' search psMetadata is constructed from each object and
     1641 *  used to find rows to delete.
     1642 *
     1643 * @return A The number of rows removed or a negative value on error
     1644 */
     1645
     1646bool domeDeleteObject(
     1647    psDB            *dbh,               ///< Database handle
     1648    const domeRow *object    ///< Object to delete
    15651649);
    15661650/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    17711855    unsigned long long limit            ///< Maximum number of elements to return
    17721856);
     1857/** Deletes a row from the database coresponding to an telescope
     1858 *
     1859 *  Note that a 'where' search psMetadata is constructed from each object and
     1860 *  used to find rows to delete.
     1861 *
     1862 * @return A The number of rows removed or a negative value on error
     1863 */
     1864
     1865bool telescopeDeleteObject(
     1866    psDB            *dbh,               ///< Database handle
     1867    const telescopeRow *object    ///< Object to delete
     1868);
    17731869/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    17741870 *
     
    19782074    unsigned long long limit            ///< Maximum number of elements to return
    19792075);
     2076/** Deletes a row from the database coresponding to an summitExp
     2077 *
     2078 *  Note that a 'where' search psMetadata is constructed from each object and
     2079 *  used to find rows to delete.
     2080 *
     2081 * @return A The number of rows removed or a negative value on error
     2082 */
     2083
     2084bool summitExpDeleteObject(
     2085    psDB            *dbh,               ///< Database handle
     2086    const summitExpRow *object    ///< Object to delete
     2087);
    19802088/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    19812089 *
     
    21842292    const psMetadata *where,            ///< Row match criteria
    21852293    unsigned long long limit            ///< Maximum number of elements to return
     2294);
     2295/** Deletes a row from the database coresponding to an pzPendingExp
     2296 *
     2297 *  Note that a 'where' search psMetadata is constructed from each object and
     2298 *  used to find rows to delete.
     2299 *
     2300 * @return A The number of rows removed or a negative value on error
     2301 */
     2302
     2303bool pzPendingExpDeleteObject(
     2304    psDB            *dbh,               ///< Database handle
     2305    const pzPendingExpRow *object    ///< Object to delete
    21862306);
    21872307/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    23962516    unsigned long long limit            ///< Maximum number of elements to return
    23972517);
     2518/** Deletes a row from the database coresponding to an pzPendingImfile
     2519 *
     2520 *  Note that a 'where' search psMetadata is constructed from each object and
     2521 *  used to find rows to delete.
     2522 *
     2523 * @return A The number of rows removed or a negative value on error
     2524 */
     2525
     2526bool pzPendingImfileDeleteObject(
     2527    psDB            *dbh,               ///< Database handle
     2528    const pzPendingImfileRow *object    ///< Object to delete
     2529);
    23982530/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    23992531 *
     
    26032735    unsigned long long limit            ///< Maximum number of elements to return
    26042736);
     2737/** Deletes a row from the database coresponding to an newExp
     2738 *
     2739 *  Note that a 'where' search psMetadata is constructed from each object and
     2740 *  used to find rows to delete.
     2741 *
     2742 * @return A The number of rows removed or a negative value on error
     2743 */
     2744
     2745bool newExpDeleteObject(
     2746    psDB            *dbh,               ///< Database handle
     2747    const newExpRow *object    ///< Object to delete
     2748);
    26052749/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    26062750 *
     
    28052949    const psMetadata *where,            ///< Row match criteria
    28062950    unsigned long long limit            ///< Maximum number of elements to return
     2951);
     2952/** Deletes a row from the database coresponding to an newImfile
     2953 *
     2954 *  Note that a 'where' search psMetadata is constructed from each object and
     2955 *  used to find rows to delete.
     2956 *
     2957 * @return A The number of rows removed or a negative value on error
     2958 */
     2959
     2960bool newImfileDeleteObject(
     2961    psDB            *dbh,               ///< Database handle
     2962    const newImfileRow *object    ///< Object to delete
    28072963);
    28082964/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    30373193    unsigned long long limit            ///< Maximum number of elements to return
    30383194);
     3195/** Deletes a row from the database coresponding to an rawDetrendExp
     3196 *
     3197 *  Note that a 'where' search psMetadata is constructed from each object and
     3198 *  used to find rows to delete.
     3199 *
     3200 * @return A The number of rows removed or a negative value on error
     3201 */
     3202
     3203bool rawDetrendExpDeleteObject(
     3204    psDB            *dbh,               ///< Database handle
     3205    const rawDetrendExpRow *object    ///< Object to delete
     3206);
    30393207/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    30403208 *
     
    32673435    const psMetadata *where,            ///< Row match criteria
    32683436    unsigned long long limit            ///< Maximum number of elements to return
     3437);
     3438/** Deletes a row from the database coresponding to an rawScienceExp
     3439 *
     3440 *  Note that a 'where' search psMetadata is constructed from each object and
     3441 *  used to find rows to delete.
     3442 *
     3443 * @return A The number of rows removed or a negative value on error
     3444 */
     3445
     3446bool rawScienceExpDeleteObject(
     3447    psDB            *dbh,               ///< Database handle
     3448    const rawScienceExpRow *object    ///< Object to delete
    32693449);
    32703450/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    35193699    unsigned long long limit            ///< Maximum number of elements to return
    35203700);
     3701/** Deletes a row from the database coresponding to an rawImfile
     3702 *
     3703 *  Note that a 'where' search psMetadata is constructed from each object and
     3704 *  used to find rows to delete.
     3705 *
     3706 * @return A The number of rows removed or a negative value on error
     3707 */
     3708
     3709bool rawImfileDeleteObject(
     3710    psDB            *dbh,               ///< Database handle
     3711    const rawImfileRow *object    ///< Object to delete
     3712);
    35213713/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    35223714 *
     
    37573949    const psMetadata *where,            ///< Row match criteria
    37583950    unsigned long long limit            ///< Maximum number of elements to return
     3951);
     3952/** Deletes a row from the database coresponding to an p1PendingExp
     3953 *
     3954 *  Note that a 'where' search psMetadata is constructed from each object and
     3955 *  used to find rows to delete.
     3956 *
     3957 * @return A The number of rows removed or a negative value on error
     3958 */
     3959
     3960bool p1PendingExpDeleteObject(
     3961    psDB            *dbh,               ///< Database handle
     3962    const p1PendingExpRow *object    ///< Object to delete
    37593963);
    37603964/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    40014205    unsigned long long limit            ///< Maximum number of elements to return
    40024206);
     4207/** Deletes a row from the database coresponding to an p2PendingExp
     4208 *
     4209 *  Note that a 'where' search psMetadata is constructed from each object and
     4210 *  used to find rows to delete.
     4211 *
     4212 * @return A The number of rows removed or a negative value on error
     4213 */
     4214
     4215bool p2PendingExpDeleteObject(
     4216    psDB            *dbh,               ///< Database handle
     4217    const p2PendingExpRow *object    ///< Object to delete
     4218);
    40034219/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    40044220 *
     
    42114427    const psMetadata *where,            ///< Row match criteria
    42124428    unsigned long long limit            ///< Maximum number of elements to return
     4429);
     4430/** Deletes a row from the database coresponding to an p2PendingImfile
     4431 *
     4432 *  Note that a 'where' search psMetadata is constructed from each object and
     4433 *  used to find rows to delete.
     4434 *
     4435 * @return A The number of rows removed or a negative value on error
     4436 */
     4437
     4438bool p2PendingImfileDeleteObject(
     4439    psDB            *dbh,               ///< Database handle
     4440    const p2PendingImfileRow *object    ///< Object to delete
    42134441);
    42144442/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    44554683    unsigned long long limit            ///< Maximum number of elements to return
    44564684);
     4685/** Deletes a row from the database coresponding to an p2DoneExp
     4686 *
     4687 *  Note that a 'where' search psMetadata is constructed from each object and
     4688 *  used to find rows to delete.
     4689 *
     4690 * @return A The number of rows removed or a negative value on error
     4691 */
     4692
     4693bool p2DoneExpDeleteObject(
     4694    psDB            *dbh,               ///< Database handle
     4695    const p2DoneExpRow *object    ///< Object to delete
     4696);
    44574697/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    44584698 *
     
    46654905    const psMetadata *where,            ///< Row match criteria
    46664906    unsigned long long limit            ///< Maximum number of elements to return
     4907);
     4908/** Deletes a row from the database coresponding to an p2DoneImfile
     4909 *
     4910 *  Note that a 'where' search psMetadata is constructed from each object and
     4911 *  used to find rows to delete.
     4912 *
     4913 * @return A The number of rows removed or a negative value on error
     4914 */
     4915
     4916bool p2DoneImfileDeleteObject(
     4917    psDB            *dbh,               ///< Database handle
     4918    const p2DoneImfileRow *object    ///< Object to delete
    46674919);
    46684920/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    49055157    unsigned long long limit            ///< Maximum number of elements to return
    49065158);
     5159/** Deletes a row from the database coresponding to an p3PendingExp
     5160 *
     5161 *  Note that a 'where' search psMetadata is constructed from each object and
     5162 *  used to find rows to delete.
     5163 *
     5164 * @return A The number of rows removed or a negative value on error
     5165 */
     5166
     5167bool p3PendingExpDeleteObject(
     5168    psDB            *dbh,               ///< Database handle
     5169    const p3PendingExpRow *object    ///< Object to delete
     5170);
    49075171/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    49085172 *
     
    50995363    const psMetadata *where,            ///< Row match criteria
    51005364    unsigned long long limit            ///< Maximum number of elements to return
     5365);
     5366/** Deletes a row from the database coresponding to an detRun
     5367 *
     5368 *  Note that a 'where' search psMetadata is constructed from each object and
     5369 *  used to find rows to delete.
     5370 *
     5371 * @return A The number of rows removed or a negative value on error
     5372 */
     5373
     5374bool detRunDeleteObject(
     5375    psDB            *dbh,               ///< Database handle
     5376    const detRunRow *object    ///< Object to delete
    51015377);
    51025378/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    53395615    unsigned long long limit            ///< Maximum number of elements to return
    53405616);
     5617/** Deletes a row from the database coresponding to an detInputExp
     5618 *
     5619 *  Note that a 'where' search psMetadata is constructed from each object and
     5620 *  used to find rows to delete.
     5621 *
     5622 * @return A The number of rows removed or a negative value on error
     5623 */
     5624
     5625bool detInputExpDeleteObject(
     5626    psDB            *dbh,               ///< Database handle
     5627    const detInputExpRow *object    ///< Object to delete
     5628);
    53415629/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    53425630 *
     
    55465834    unsigned long long limit            ///< Maximum number of elements to return
    55475835);
     5836/** Deletes a row from the database coresponding to an detProcessedImfile
     5837 *
     5838 *  Note that a 'where' search psMetadata is constructed from each object and
     5839 *  used to find rows to delete.
     5840 *
     5841 * @return A The number of rows removed or a negative value on error
     5842 */
     5843
     5844bool detProcessedImfileDeleteObject(
     5845    psDB            *dbh,               ///< Database handle
     5846    const detProcessedImfileRow *object    ///< Object to delete
     5847);
    55485848/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    55495849 *
     
    57536053    unsigned long long limit            ///< Maximum number of elements to return
    57546054);
     6055/** Deletes a row from the database coresponding to an detStackedImfile
     6056 *
     6057 *  Note that a 'where' search psMetadata is constructed from each object and
     6058 *  used to find rows to delete.
     6059 *
     6060 * @return A The number of rows removed or a negative value on error
     6061 */
     6062
     6063bool detStackedImfileDeleteObject(
     6064    psDB            *dbh,               ///< Database handle
     6065    const detStackedImfileRow *object    ///< Object to delete
     6066);
    57556067/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    57566068 *
     
    59606272    unsigned long long limit            ///< Maximum number of elements to return
    59616273);
     6274/** Deletes a row from the database coresponding to an detNormalizedImfile
     6275 *
     6276 *  Note that a 'where' search psMetadata is constructed from each object and
     6277 *  used to find rows to delete.
     6278 *
     6279 * @return A The number of rows removed or a negative value on error
     6280 */
     6281
     6282bool detNormalizedImfileDeleteObject(
     6283    psDB            *dbh,               ///< Database handle
     6284    const detNormalizedImfileRow *object    ///< Object to delete
     6285);
    59626286/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    59636287 *
     
    61586482    const psMetadata *where,            ///< Row match criteria
    61596483    unsigned long long limit            ///< Maximum number of elements to return
     6484);
     6485/** Deletes a row from the database coresponding to an detMasterFrame
     6486 *
     6487 *  Note that a 'where' search psMetadata is constructed from each object and
     6488 *  used to find rows to delete.
     6489 *
     6490 * @return A The number of rows removed or a negative value on error
     6491 */
     6492
     6493bool detMasterFrameDeleteObject(
     6494    psDB            *dbh,               ///< Database handle
     6495    const detMasterFrameRow *object    ///< Object to delete
    61606496);
    61616497/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    63616697    const psMetadata *where,            ///< Row match criteria
    63626698    unsigned long long limit            ///< Maximum number of elements to return
     6699);
     6700/** Deletes a row from the database coresponding to an detMasterImfile
     6701 *
     6702 *  Note that a 'where' search psMetadata is constructed from each object and
     6703 *  used to find rows to delete.
     6704 *
     6705 * @return A The number of rows removed or a negative value on error
     6706 */
     6707
     6708bool detMasterImfileDeleteObject(
     6709    psDB            *dbh,               ///< Database handle
     6710    const detMasterImfileRow *object    ///< Object to delete
    63636711);
    63646712/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    65816929    unsigned long long limit            ///< Maximum number of elements to return
    65826930);
     6931/** Deletes a row from the database coresponding to an detResidImfileAnalysis
     6932 *
     6933 *  Note that a 'where' search psMetadata is constructed from each object and
     6934 *  used to find rows to delete.
     6935 *
     6936 * @return A The number of rows removed or a negative value on error
     6937 */
     6938
     6939bool detResidImfileAnalysisDeleteObject(
     6940    psDB            *dbh,               ///< Database handle
     6941    const detResidImfileAnalysisRow *object    ///< Object to delete
     6942);
    65836943/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    65846944 *
     
    66176977    char            *exp_id;
    66186978    char            *recipe;
     6979    bool            keep;
    66196980    bool            accept;
    66206981} detResidExpAnalysisRow;
     
    66306991    const char      *exp_id,
    66316992    const char      *recipe,
     6993    bool            keep,
    66326994    bool            accept
    66336995);
     
    66647026    const char      *exp_id,
    66657027    const char      *recipe,
     7028    bool            keep,
    66667029    bool            accept
    66677030);
     
    66897052    char            **exp_id,
    66907053    char            **recipe,
     7054    bool            *keep,
    66917055    bool            *accept
    66927056);
     
    67887152    unsigned long long limit            ///< Maximum number of elements to return
    67897153);
     7154/** Deletes a row from the database coresponding to an detResidExpAnalysis
     7155 *
     7156 *  Note that a 'where' search psMetadata is constructed from each object and
     7157 *  used to find rows to delete.
     7158 *
     7159 * @return A The number of rows removed or a negative value on error
     7160 */
     7161
     7162bool detResidExpAnalysisDeleteObject(
     7163    psDB            *dbh,               ///< Database handle
     7164    const detResidExpAnalysisRow *object    ///< Object to delete
     7165);
    67907166/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    67917167 *
  • trunk/ippdb/tests/alloc.c

    r8228 r8266  
    13001300        detResidExpAnalysisRow *object;
    13011301
    1302         object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true    );
     1302        object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true    );
    13031303
    13041304        if (!object) {
     
    13191319        }
    13201320        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1321            psFree(object);
     1322            exit(EXIT_FAILURE);
     1323        }
     1324        if (!object->keep == true) {
    13211325            psFree(object);
    13221326            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r8228 r8266  
    463463        }
    464464
    465         if (!detResidExpAnalysisInsert(dbh, -32, -32, "a string", "a string", true)) {
     465        if (!detResidExpAnalysisInsert(dbh, -32, -32, "a string", "a string", true, true)) {
    466466            exit(EXIT_FAILURE);
    467467        }
  • trunk/ippdb/tests/insertobject.c

    r8228 r8266  
    674674        }
    675675
    676         object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true);
     676        object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true);
    677677        if (!object) {
    678678            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r8228 r8266  
    15431543        bool            status;
    15441544
    1545         object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true);
     1545        object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true);
    15461546        if (!object) {
    15471547            exit(EXIT_FAILURE);
     
    15681568        }
    15691569        if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     1570            psFree(md);
     1571            exit(EXIT_FAILURE);
     1572        }
     1573        if (!psMetadataLookupBool(&status, md, "keep") == true) {
    15701574            psFree(md);
    15711575            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r8228 r8266  
    23692369            exit(EXIT_FAILURE);
    23702370        }
     2371        if (!psMetadataAdd(md, PS_LIST_TAIL, "keep", PS_DATA_BOOL, NULL, true)) {
     2372            psFree(md);
     2373            exit(EXIT_FAILURE);
     2374        }
    23712375        if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, true)) {
    23722376            psFree(md);
     
    23952399        }
    23962400        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     2401            psFree(object);
     2402            exit(EXIT_FAILURE);
     2403        }
     2404        if (!object->keep == true) {
    23972405            psFree(object);
    23982406            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/pop.c

    r8228 r8266  
    686686        char            exp_id[256];
    687687        char            recipe[256];
     688        bool            keep;
    688689        bool            accept;
    689690
     
    693694        }
    694695
    695         if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&recipe, &accept)) {
     696        if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&recipe, &keep, &accept)) {
    696697            exit(EXIT_FAILURE);
    697698        }
Note: See TracChangeset for help on using the changeset viewer.