Changeset 8266
- Timestamp:
- Aug 9, 2006, 7:18:19 PM (20 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 9 edited
-
configure.ac (modified) (1 diff)
-
src/ippdb.c (modified) (44 diffs)
-
src/ippdb.h (modified) (35 diffs)
-
tests/alloc.c (modified) (2 diffs)
-
tests/insert.c (modified) (1 diff)
-
tests/insertobject.c (modified) (1 diff)
-
tests/metadatafromobject.c (modified) (2 diffs)
-
tests/objectfrommetadata.c (modified) (2 diffs)
-
tests/pop.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/configure.ac
r8228 r8266 1 1 AC_PREREQ(2.59) 2 2 3 AC_INIT([ippdb], [0.0.2 3], [pan-starrs.ifa.hawaii.edu])3 AC_INIT([ippdb], [0.0.24], [pan-starrs.ifa.hawaii.edu]) 4 4 AC_CONFIG_SRCDIR([ippdb.pc.in]) 5 5 -
trunk/ippdb/src/ippdb.c
r8228 r8266 718 718 return returnSet; 719 719 } 720 bool 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 } 720 738 long long weatherDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 721 739 { … … 1248 1266 return returnSet; 1249 1267 } 1268 bool 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 } 1250 1286 long long skyp_transparencyDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 1251 1287 { … … 1836 1872 return returnSet; 1837 1873 } 1874 bool 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 } 1838 1892 long long skyp_absorptionDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 1839 1893 { … … 2337 2391 return returnSet; 2338 2392 } 2393 bool 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 } 2339 2411 long long skyp_emissionDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 2340 2412 { … … 2867 2939 return returnSet; 2868 2940 } 2941 bool 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 } 2869 2959 long long dimmDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 2870 2960 { … … 3367 3457 return returnSet; 3368 3458 } 3459 bool 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 } 3369 3477 long long skyp_irDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 3370 3478 { … … 3809 3917 return returnSet; 3810 3918 } 3919 bool 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 } 3811 3937 long long domeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 3812 3938 { … … 4281 4407 return returnSet; 4282 4408 } 4409 bool 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 } 4283 4427 long long telescopeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 4284 4428 { … … 4757 4901 return returnSet; 4758 4902 } 4903 bool 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 } 4759 4921 long long summitExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 4760 4922 { … … 5232 5394 return returnSet; 5233 5395 } 5396 bool 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 } 5234 5414 long long pzPendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 5235 5415 { … … 5737 5917 return returnSet; 5738 5918 } 5919 bool 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 } 5739 5937 long long pzPendingImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 5740 5938 { … … 6212 6410 return returnSet; 6213 6411 } 6412 bool 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 } 6214 6430 long long newExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 6215 6431 { … … 6658 6874 return returnSet; 6659 6875 } 6876 bool 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 } 6660 6894 long long newImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 6661 6895 { … … 7308 7542 return returnSet; 7309 7543 } 7544 bool 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 } 7310 7562 long long rawDetrendExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 7311 7563 { … … 7957 8209 7958 8210 return returnSet; 8211 } 8212 bool 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; 7959 8229 } 7960 8230 long long rawScienceExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) … … 8753 9023 return returnSet; 8754 9024 } 9025 bool 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 } 8755 9043 long long rawImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 8756 9044 { … … 9462 9750 return returnSet; 9463 9751 } 9752 bool 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 } 9464 9770 long long p1PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 9465 9771 { … … 10200 10506 return returnSet; 10201 10507 } 10508 bool 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 } 10202 10526 long long p2PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 10203 10527 { … … 10704 11028 return returnSet; 10705 11029 } 11030 bool 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 } 10706 11048 long long p2PendingImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 10707 11049 { … … 11442 11784 return returnSet; 11443 11785 } 11786 bool 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 } 11444 11804 long long p2DoneExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 11445 11805 { … … 11946 12306 return returnSet; 11947 12307 } 12308 bool 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 } 11948 12326 long long p2DoneImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 11949 12327 { … … 12654 13032 return returnSet; 12655 13033 } 13034 bool 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 } 12656 13052 long long p3PendingExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 12657 13053 { … … 13039 13435 return returnSet; 13040 13436 } 13437 bool 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 } 13041 13455 long long detRunDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 13042 13456 { … … 13747 14161 return returnSet; 13748 14162 } 14163 bool 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 } 13749 14181 long long detInputExpDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 13750 14182 { … … 14222 14654 return returnSet; 14223 14655 } 14656 bool 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 } 14224 14674 long long detProcessedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 14225 14675 { … … 14696 15146 return returnSet; 14697 15147 } 15148 bool 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 } 14698 15166 long long detStackedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 14699 15167 { … … 15170 15638 return returnSet; 15171 15639 } 15640 bool 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 } 15172 15658 long long detNormalizedImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 15173 15659 { … … 15584 16070 return returnSet; 15585 16071 } 16072 bool 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 } 15586 16090 long long detMasterFrameDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 15587 16091 { … … 16029 16533 return returnSet; 16030 16534 } 16535 bool 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 } 16031 16553 long long detMasterImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 16032 16554 { … … 16593 17115 return returnSet; 16594 17116 } 17117 bool 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 } 16595 17135 long long detResidImfileAnalysisDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) 16596 17136 { … … 16645 17185 static void detResidExpAnalysisRowFree(detResidExpAnalysisRow *object); 16646 17186 16647 detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept)17187 detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool keep, bool accept) 16648 17188 { 16649 17189 detResidExpAnalysisRow *object; … … 16656 17196 object->exp_id = psStringCopy(exp_id); 16657 17197 object->recipe = psStringCopy(recipe); 17198 object->keep = keep; 16658 17199 object->accept = accept; 16659 17200 … … 16698 17239 return false; 16699 17240 } 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 } 16700 17246 if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, false)) { 16701 17247 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); … … 16716 17262 } 16717 17263 16718 bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept)17264 bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool keep, bool accept) 16719 17265 { 16720 17266 psMetadata *md; … … 16739 17285 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 16740 17286 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"); 16741 17292 psFree(md); 16742 17293 return false; … … 16768 17319 return deleted; 16769 17320 } 16770 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool * accept)17321 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool *keep, bool *accept) 16771 17322 { 16772 17323 psArray *rowSet; … … 16836 17387 return false; 16837 17388 } 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 } 16838 17395 *accept = psMetadataLookupBool(&status, row, "accept"); 16839 17396 if (!status) { … … 16850 17407 bool detResidExpAnalysisInsertObject(psDB *dbh, detResidExpAnalysisRow *object) 16851 17408 { 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); 16853 17410 } 16854 17411 … … 16859 17416 char exp_id[256]; 16860 17417 char recipe[256]; 17418 bool keep; 16861 17419 bool accept; 16862 17420 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)) { 16864 17422 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 16865 17423 return NULL; 16866 17424 } 16867 17425 16868 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept);17426 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, keep, accept); 16869 17427 } 16870 17428 … … 16985 17543 return NULL; 16986 17544 } 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 } 16987 17550 if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, object->accept)) { 16988 17551 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); … … 17001 17564 char *exp_id; 17002 17565 char *recipe; 17566 bool keep; 17003 17567 bool accept; 17004 17568 … … 17023 17587 return false; 17024 17588 } 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 } 17025 17594 accept = psMetadataLookupBool(&status, md, "accept"); 17026 17595 if (!status) { … … 17029 17598 } 17030 17599 17031 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept);17600 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, keep, accept); 17032 17601 } 17033 17602 psArray *detResidExpAnalysisSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 17065 17634 17066 17635 return returnSet; 17636 } 17637 bool 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; 17067 17654 } 17068 17655 long long detResidExpAnalysisDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r8228 r8266 286 286 unsigned long long limit ///< Maximum number of elements to return 287 287 ); 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 296 bool weatherDeleteObject( 297 psDB *dbh, ///< Database handle 298 const weatherRow *object ///< Object to delete 299 ); 288 300 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 289 301 * … … 500 512 const psMetadata *where, ///< Row match criteria 501 513 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 523 bool skyp_transparencyDeleteObject( 524 psDB *dbh, ///< Database handle 525 const skyp_transparencyRow *object ///< Object to delete 502 526 ); 503 527 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 724 748 unsigned long long limit ///< Maximum number of elements to return 725 749 ); 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 758 bool skyp_absorptionDeleteObject( 759 psDB *dbh, ///< Database handle 760 const skyp_absorptionRow *object ///< Object to delete 761 ); 726 762 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 727 763 * … … 934 970 const psMetadata *where, ///< Row match criteria 935 971 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 981 bool skyp_emissionDeleteObject( 982 psDB *dbh, ///< Database handle 983 const skyp_emissionRow *object ///< Object to delete 936 984 ); 937 985 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 1150 1198 unsigned long long limit ///< Maximum number of elements to return 1151 1199 ); 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 1208 bool dimmDeleteObject( 1209 psDB *dbh, ///< Database handle 1210 const dimmRow *object ///< Object to delete 1211 ); 1152 1212 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1153 1213 * … … 1361 1421 unsigned long long limit ///< Maximum number of elements to return 1362 1422 ); 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 1431 bool skyp_irDeleteObject( 1432 psDB *dbh, ///< Database handle 1433 const skyp_irRow *object ///< Object to delete 1434 ); 1363 1435 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1364 1436 * … … 1563 1635 const psMetadata *where, ///< Row match criteria 1564 1636 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 1646 bool domeDeleteObject( 1647 psDB *dbh, ///< Database handle 1648 const domeRow *object ///< Object to delete 1565 1649 ); 1566 1650 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 1771 1855 unsigned long long limit ///< Maximum number of elements to return 1772 1856 ); 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 1865 bool telescopeDeleteObject( 1866 psDB *dbh, ///< Database handle 1867 const telescopeRow *object ///< Object to delete 1868 ); 1773 1869 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1774 1870 * … … 1978 2074 unsigned long long limit ///< Maximum number of elements to return 1979 2075 ); 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 2084 bool summitExpDeleteObject( 2085 psDB *dbh, ///< Database handle 2086 const summitExpRow *object ///< Object to delete 2087 ); 1980 2088 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1981 2089 * … … 2184 2292 const psMetadata *where, ///< Row match criteria 2185 2293 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 2303 bool pzPendingExpDeleteObject( 2304 psDB *dbh, ///< Database handle 2305 const pzPendingExpRow *object ///< Object to delete 2186 2306 ); 2187 2307 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 2396 2516 unsigned long long limit ///< Maximum number of elements to return 2397 2517 ); 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 2526 bool pzPendingImfileDeleteObject( 2527 psDB *dbh, ///< Database handle 2528 const pzPendingImfileRow *object ///< Object to delete 2529 ); 2398 2530 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 2399 2531 * … … 2603 2735 unsigned long long limit ///< Maximum number of elements to return 2604 2736 ); 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 2745 bool newExpDeleteObject( 2746 psDB *dbh, ///< Database handle 2747 const newExpRow *object ///< Object to delete 2748 ); 2605 2749 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 2606 2750 * … … 2805 2949 const psMetadata *where, ///< Row match criteria 2806 2950 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 2960 bool newImfileDeleteObject( 2961 psDB *dbh, ///< Database handle 2962 const newImfileRow *object ///< Object to delete 2807 2963 ); 2808 2964 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 3037 3193 unsigned long long limit ///< Maximum number of elements to return 3038 3194 ); 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 3203 bool rawDetrendExpDeleteObject( 3204 psDB *dbh, ///< Database handle 3205 const rawDetrendExpRow *object ///< Object to delete 3206 ); 3039 3207 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3040 3208 * … … 3267 3435 const psMetadata *where, ///< Row match criteria 3268 3436 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 3446 bool rawScienceExpDeleteObject( 3447 psDB *dbh, ///< Database handle 3448 const rawScienceExpRow *object ///< Object to delete 3269 3449 ); 3270 3450 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 3519 3699 unsigned long long limit ///< Maximum number of elements to return 3520 3700 ); 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 3709 bool rawImfileDeleteObject( 3710 psDB *dbh, ///< Database handle 3711 const rawImfileRow *object ///< Object to delete 3712 ); 3521 3713 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3522 3714 * … … 3757 3949 const psMetadata *where, ///< Row match criteria 3758 3950 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 3960 bool p1PendingExpDeleteObject( 3961 psDB *dbh, ///< Database handle 3962 const p1PendingExpRow *object ///< Object to delete 3759 3963 ); 3760 3964 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 4001 4205 unsigned long long limit ///< Maximum number of elements to return 4002 4206 ); 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 4215 bool p2PendingExpDeleteObject( 4216 psDB *dbh, ///< Database handle 4217 const p2PendingExpRow *object ///< Object to delete 4218 ); 4003 4219 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4004 4220 * … … 4211 4427 const psMetadata *where, ///< Row match criteria 4212 4428 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 4438 bool p2PendingImfileDeleteObject( 4439 psDB *dbh, ///< Database handle 4440 const p2PendingImfileRow *object ///< Object to delete 4213 4441 ); 4214 4442 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 4455 4683 unsigned long long limit ///< Maximum number of elements to return 4456 4684 ); 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 4693 bool p2DoneExpDeleteObject( 4694 psDB *dbh, ///< Database handle 4695 const p2DoneExpRow *object ///< Object to delete 4696 ); 4457 4697 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4458 4698 * … … 4665 4905 const psMetadata *where, ///< Row match criteria 4666 4906 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 4916 bool p2DoneImfileDeleteObject( 4917 psDB *dbh, ///< Database handle 4918 const p2DoneImfileRow *object ///< Object to delete 4667 4919 ); 4668 4920 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 4905 5157 unsigned long long limit ///< Maximum number of elements to return 4906 5158 ); 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 5167 bool p3PendingExpDeleteObject( 5168 psDB *dbh, ///< Database handle 5169 const p3PendingExpRow *object ///< Object to delete 5170 ); 4907 5171 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4908 5172 * … … 5099 5363 const psMetadata *where, ///< Row match criteria 5100 5364 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 5374 bool detRunDeleteObject( 5375 psDB *dbh, ///< Database handle 5376 const detRunRow *object ///< Object to delete 5101 5377 ); 5102 5378 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 5339 5615 unsigned long long limit ///< Maximum number of elements to return 5340 5616 ); 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 5625 bool detInputExpDeleteObject( 5626 psDB *dbh, ///< Database handle 5627 const detInputExpRow *object ///< Object to delete 5628 ); 5341 5629 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5342 5630 * … … 5546 5834 unsigned long long limit ///< Maximum number of elements to return 5547 5835 ); 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 5844 bool detProcessedImfileDeleteObject( 5845 psDB *dbh, ///< Database handle 5846 const detProcessedImfileRow *object ///< Object to delete 5847 ); 5548 5848 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5549 5849 * … … 5753 6053 unsigned long long limit ///< Maximum number of elements to return 5754 6054 ); 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 6063 bool detStackedImfileDeleteObject( 6064 psDB *dbh, ///< Database handle 6065 const detStackedImfileRow *object ///< Object to delete 6066 ); 5755 6067 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5756 6068 * … … 5960 6272 unsigned long long limit ///< Maximum number of elements to return 5961 6273 ); 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 6282 bool detNormalizedImfileDeleteObject( 6283 psDB *dbh, ///< Database handle 6284 const detNormalizedImfileRow *object ///< Object to delete 6285 ); 5962 6286 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5963 6287 * … … 6158 6482 const psMetadata *where, ///< Row match criteria 6159 6483 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 6493 bool detMasterFrameDeleteObject( 6494 psDB *dbh, ///< Database handle 6495 const detMasterFrameRow *object ///< Object to delete 6160 6496 ); 6161 6497 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 6361 6697 const psMetadata *where, ///< Row match criteria 6362 6698 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 6708 bool detMasterImfileDeleteObject( 6709 psDB *dbh, ///< Database handle 6710 const detMasterImfileRow *object ///< Object to delete 6363 6711 ); 6364 6712 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 6581 6929 unsigned long long limit ///< Maximum number of elements to return 6582 6930 ); 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 6939 bool detResidImfileAnalysisDeleteObject( 6940 psDB *dbh, ///< Database handle 6941 const detResidImfileAnalysisRow *object ///< Object to delete 6942 ); 6583 6943 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6584 6944 * … … 6617 6977 char *exp_id; 6618 6978 char *recipe; 6979 bool keep; 6619 6980 bool accept; 6620 6981 } detResidExpAnalysisRow; … … 6630 6991 const char *exp_id, 6631 6992 const char *recipe, 6993 bool keep, 6632 6994 bool accept 6633 6995 ); … … 6664 7026 const char *exp_id, 6665 7027 const char *recipe, 7028 bool keep, 6666 7029 bool accept 6667 7030 ); … … 6689 7052 char **exp_id, 6690 7053 char **recipe, 7054 bool *keep, 6691 7055 bool *accept 6692 7056 ); … … 6788 7152 unsigned long long limit ///< Maximum number of elements to return 6789 7153 ); 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 7162 bool detResidExpAnalysisDeleteObject( 7163 psDB *dbh, ///< Database handle 7164 const detResidExpAnalysisRow *object ///< Object to delete 7165 ); 6790 7166 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6791 7167 * -
trunk/ippdb/tests/alloc.c
r8228 r8266 1300 1300 detResidExpAnalysisRow *object; 1301 1301 1302 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true );1302 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true ); 1303 1303 1304 1304 if (!object) { … … 1319 1319 } 1320 1320 if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) { 1321 psFree(object); 1322 exit(EXIT_FAILURE); 1323 } 1324 if (!object->keep == true) { 1321 1325 psFree(object); 1322 1326 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r8228 r8266 463 463 } 464 464 465 if (!detResidExpAnalysisInsert(dbh, -32, -32, "a string", "a string", true )) {465 if (!detResidExpAnalysisInsert(dbh, -32, -32, "a string", "a string", true, true)) { 466 466 exit(EXIT_FAILURE); 467 467 } -
trunk/ippdb/tests/insertobject.c
r8228 r8266 674 674 } 675 675 676 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true );676 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true); 677 677 if (!object) { 678 678 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r8228 r8266 1543 1543 bool status; 1544 1544 1545 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true );1545 object = detResidExpAnalysisRowAlloc(-32, -32, "a string", "a string", true, true); 1546 1546 if (!object) { 1547 1547 exit(EXIT_FAILURE); … … 1568 1568 } 1569 1569 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) { 1570 1574 psFree(md); 1571 1575 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r8228 r8266 2369 2369 exit(EXIT_FAILURE); 2370 2370 } 2371 if (!psMetadataAdd(md, PS_LIST_TAIL, "keep", PS_DATA_BOOL, NULL, true)) { 2372 psFree(md); 2373 exit(EXIT_FAILURE); 2374 } 2371 2375 if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, true)) { 2372 2376 psFree(md); … … 2395 2399 } 2396 2400 if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) { 2401 psFree(object); 2402 exit(EXIT_FAILURE); 2403 } 2404 if (!object->keep == true) { 2397 2405 psFree(object); 2398 2406 exit(EXIT_FAILURE); -
trunk/ippdb/tests/pop.c
r8228 r8266 686 686 char exp_id[256]; 687 687 char recipe[256]; 688 bool keep; 688 689 bool accept; 689 690 … … 693 694 } 694 695 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)) { 696 697 exit(EXIT_FAILURE); 697 698 }
Note:
See TracChangeset
for help on using the changeset viewer.
