Changeset 8122 for branches/jhoblitt/ippdb/src/ippdb.c
- Timestamp:
- Aug 3, 2006, 6:28:25 PM (20 years ago)
- File:
-
- 1 edited
-
branches/jhoblitt/ippdb/src/ippdb.c (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/jhoblitt/ippdb/src/ippdb.c
r8103 r8122 206 206 } 207 207 208 long long weatherDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 209 { 210 long long deleted = 0; 211 212 long long count = psDBDeleteRows(dbh, WEATHER_TABLE_NAME, where, limit); 213 if (count < 0) { 214 psError(PS_ERR_UNKNOWN, true, "failed to delete row from weather"); 215 return count; 216 217 deleted += count; 218 } 219 220 return deleted; 221 } 208 222 bool weatherPop(psDB *dbh, psF32 *temp01, psF32 *humi01, psF32 *temp02, psF32 *humi02, psF32 *temp03, psF32 *humi03, psF32 *pressure) 209 223 { … … 691 705 } 692 706 707 long long skyp_transparencyDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 708 { 709 long long deleted = 0; 710 711 long long count = psDBDeleteRows(dbh, SKYP_TRANSPARENCY_TABLE_NAME, where, limit); 712 if (count < 0) { 713 psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_transparency"); 714 return count; 715 716 deleted += count; 717 } 718 719 return deleted; 720 } 693 721 bool skyp_transparencyPop(psDB *dbh, char **filter, psF64 *trans, psS32 *nstars, psF64 *ra, psF64 *decl, psF32 *exptime, psF64 *sky_bright) 694 722 { … … 1198 1226 } 1199 1227 1228 long long skyp_absorptionDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 1229 { 1230 long long deleted = 0; 1231 1232 long long count = psDBDeleteRows(dbh, SKYP_ABSORPTION_TABLE_NAME, where, limit); 1233 if (count < 0) { 1234 psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_absorption"); 1235 return count; 1236 1237 deleted += count; 1238 } 1239 1240 return deleted; 1241 } 1200 1242 bool skyp_absorptionPop(psDB *dbh, char **disperser_id, psF32 *atmcomp1, psF32 *atmcomp2, psF32 *atmcomp3, psS32 *nstars, psF64 *ra, psF64 *decl, psF32 *exptime, psF64 *sky_bright) 1201 1243 { … … 1708 1750 } 1709 1751 1752 long long skyp_emissionDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 1753 { 1754 long long deleted = 0; 1755 1756 long long count = psDBDeleteRows(dbh, SKYP_EMISSION_TABLE_NAME, where, limit); 1757 if (count < 0) { 1758 psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_emission"); 1759 return count; 1760 1761 deleted += count; 1762 } 1763 1764 return deleted; 1765 } 1710 1766 bool skyp_emissionPop(psDB *dbh, char **disperser_id, psF32 *atmcomp1, psF32 *atmcomp2, psF32 *atmcomp3, psF32 *continuum, psF32 *exptime) 1711 1767 { … … 2175 2231 } 2176 2232 2233 long long dimmDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 2234 { 2235 long long deleted = 0; 2236 2237 long long count = psDBDeleteRows(dbh, DIMM_TABLE_NAME, where, limit); 2238 if (count < 0) { 2239 psError(PS_ERR_UNKNOWN, true, "failed to delete row from dimm"); 2240 return count; 2241 2242 deleted += count; 2243 } 2244 2245 return deleted; 2246 } 2177 2247 bool dimmPop(psDB *dbh, psF32 *sigmax, psF32 *sigmay, psF32 *fwhm, psF64 *ra, psF64 *decl, psF32 *expttime, char **telescope_id) 2178 2248 { … … 2648 2718 } 2649 2719 2720 long long skyp_irDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 2721 { 2722 long long deleted = 0; 2723 2724 long long count = psDBDeleteRows(dbh, SKYP_IR_TABLE_NAME, where, limit); 2725 if (count < 0) { 2726 psError(PS_ERR_UNKNOWN, true, "failed to delete row from skyp_ir"); 2727 return count; 2728 2729 deleted += count; 2730 } 2731 2732 return deleted; 2733 } 2650 2734 bool skyp_irPop(psDB *dbh, psF64 *sky_bright, psF64 *sky_var, psF64 *ra, psF64 *decl, psF32 *fov_x, psF32 *fov_y) 2651 2735 { … … 3081 3165 } 3082 3166 3167 long long domeDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 3168 { 3169 long long deleted = 0; 3170 3171 long long count = psDBDeleteRows(dbh, DOME_TABLE_NAME, where, limit); 3172 if (count < 0) { 3173 psError(PS_ERR_UNKNOWN, true, "failed to delete row from dome"); 3174 return count; 3175 3176 deleted += count; 3177 } 3178 3179 return deleted; 3180 } 3083 3181 bool domePop(psDB *dbh, psF32 *az, bool *open, bool *light, bool *track) 3084 3182 { … … 3490 3588 } 3491 3589 3590 long long telescopeDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 3591 { 3592 long long deleted = 0; 3593 3594 long long count = psDBDeleteRows(dbh, TELESCOPE_TABLE_NAME, where, limit); 3595 if (count < 0) { 3596 psError(PS_ERR_UNKNOWN, true, "failed to delete row from telescope"); 3597 return count; 3598 3599 deleted += count; 3600 } 3601 3602 return deleted; 3603 } 3492 3604 bool telescopePop(psDB *dbh, char **guide, psF32 *alt, psF32 *az, psF64 *ra, psF64 *decl) 3493 3605 { … … 3921 4033 } 3922 4034 4035 long long summitExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 4036 { 4037 long long deleted = 0; 4038 4039 long long count = psDBDeleteRows(dbh, SUMMITEXP_TABLE_NAME, where, limit); 4040 if (count < 0) { 4041 psError(PS_ERR_UNKNOWN, true, "failed to delete row from summitExp"); 4042 return count; 4043 4044 deleted += count; 4045 } 4046 4047 return deleted; 4048 } 3923 4049 bool summitExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, char **uri) 3924 4050 { … … 4351 4477 } 4352 4478 4479 long long pzPendingExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 4480 { 4481 long long deleted = 0; 4482 4483 long long count = psDBDeleteRows(dbh, PZPENDINGEXP_TABLE_NAME, where, limit); 4484 if (count < 0) { 4485 psError(PS_ERR_UNKNOWN, true, "failed to delete row from pzPendingExp"); 4486 return count; 4487 4488 deleted += count; 4489 } 4490 4491 return deleted; 4492 } 4353 4493 bool pzPendingExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles) 4354 4494 { … … 4793 4933 } 4794 4934 4935 long long pzPendingImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 4936 { 4937 long long deleted = 0; 4938 4939 long long count = psDBDeleteRows(dbh, PZPENDINGIMFILE_TABLE_NAME, where, limit); 4940 if (count < 0) { 4941 psError(PS_ERR_UNKNOWN, true, "failed to delete row from pzPendingImfile"); 4942 return count; 4943 4944 deleted += count; 4945 } 4946 4947 return deleted; 4948 } 4795 4949 bool pzPendingImfilePop(psDB *dbh, char **exp_id, psS32 *bytes, char **md5sum, char **class, char **class_id, char **uri) 4796 4950 { … … 5241 5395 } 5242 5396 5397 long long newExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 5398 { 5399 long long deleted = 0; 5400 5401 long long count = psDBDeleteRows(dbh, NEWEXP_TABLE_NAME, where, limit); 5402 if (count < 0) { 5403 psError(PS_ERR_UNKNOWN, true, "failed to delete row from newExp"); 5404 return count; 5405 5406 deleted += count; 5407 } 5408 5409 return deleted; 5410 } 5243 5411 bool newExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles) 5244 5412 { … … 5660 5828 } 5661 5829 5830 long long newImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 5831 { 5832 long long deleted = 0; 5833 5834 long long count = psDBDeleteRows(dbh, NEWIMFILE_TABLE_NAME, where, limit); 5835 if (count < 0) { 5836 psError(PS_ERR_UNKNOWN, true, "failed to delete row from newImfile"); 5837 return count; 5838 5839 deleted += count; 5840 } 5841 5842 return deleted; 5843 } 5662 5844 bool newImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri) 5663 5845 { … … 6139 6321 } 6140 6322 6323 long long rawDetrendExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 6324 { 6325 long long deleted = 0; 6326 6327 long long count = psDBDeleteRows(dbh, RAWDETRENDEXP_TABLE_NAME, where, limit); 6328 if (count < 0) { 6329 psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawDetrendExp"); 6330 return count; 6331 6332 deleted += count; 6333 } 6334 6335 return deleted; 6336 } 6141 6337 bool rawDetrendExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background) 6142 6338 { … … 6744 6940 } 6745 6941 6942 long long rawScienceExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 6943 { 6944 long long deleted = 0; 6945 6946 long long count = psDBDeleteRows(dbh, RAWSCIENCEEXP_TABLE_NAME, where, limit); 6947 if (count < 0) { 6948 psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawScienceExp"); 6949 return count; 6950 6951 deleted += count; 6952 } 6953 6954 return deleted; 6955 } 6746 6956 bool rawScienceExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background) 6747 6957 { … … 7271 7481 } 7272 7482 7483 long long rawImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 7484 { 7485 long long deleted = 0; 7486 7487 long long count = psDBDeleteRows(dbh, RAWIMFILE_TABLE_NAME, where, limit); 7488 if (count < 0) { 7489 psError(PS_ERR_UNKNOWN, true, "failed to delete row from rawImfile"); 7490 return count; 7491 7492 deleted += count; 7493 } 7494 7495 return deleted; 7496 } 7273 7497 bool rawImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri) 7274 7498 { … … 7773 7997 } 7774 7998 7999 long long p1PendingExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 8000 { 8001 long long deleted = 0; 8002 8003 long long count = psDBDeleteRows(dbh, P1PENDINGEXP_TABLE_NAME, where, limit); 8004 if (count < 0) { 8005 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p1PendingExp"); 8006 return count; 8007 8008 deleted += count; 8009 } 8010 8011 return deleted; 8012 } 7775 8013 bool p1PendingExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background, char **recipe, psS32 *p1_version) 7776 8014 { … … 8448 8686 } 8449 8687 8688 long long p2PendingExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 8689 { 8690 long long deleted = 0; 8691 8692 long long count = psDBDeleteRows(dbh, P2PENDINGEXP_TABLE_NAME, where, limit); 8693 if (count < 0) { 8694 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2PendingExp"); 8695 return count; 8696 8697 deleted += count; 8698 } 8699 8700 return deleted; 8701 } 8450 8702 bool p2PendingExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF32 *ra, psF64 *decl, psF64 *exp_time, psF64 *background, char **recipe, psS32 *p1_version, psS32 *p2_version) 8451 8703 { … … 9051 9303 } 9052 9304 9305 long long p2PendingImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 9306 { 9307 long long deleted = 0; 9308 9309 long long count = psDBDeleteRows(dbh, P2PENDINGIMFILE_TABLE_NAME, where, limit); 9310 if (count < 0) { 9311 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2PendingImfile"); 9312 return count; 9313 9314 deleted += count; 9315 } 9316 9317 return deleted; 9318 } 9053 9319 bool p2PendingImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char **recipe, psS32 *p1_version, psS32 *p2_version) 9054 9320 { … … 9600 9866 } 9601 9867 9868 long long p2DoneExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 9869 { 9870 long long deleted = 0; 9871 9872 long long count = psDBDeleteRows(dbh, P2DONEEXP_TABLE_NAME, where, limit); 9873 if (count < 0) { 9874 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2DoneExp"); 9875 return count; 9876 9877 deleted += count; 9878 } 9879 9880 return deleted; 9881 } 9602 9882 bool p2DoneExpPop(psDB *dbh, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background, char **recipe, psS32 *p1_version, psS32 *p2_version) 9603 9883 { … … 10203 10483 } 10204 10484 10485 long long p2DoneImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 10486 { 10487 long long deleted = 0; 10488 10489 long long count = psDBDeleteRows(dbh, P2DONEIMFILE_TABLE_NAME, where, limit); 10490 if (count < 0) { 10491 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p2DoneImfile"); 10492 return count; 10493 10494 deleted += count; 10495 } 10496 10497 return deleted; 10498 } 10205 10499 bool p2DoneImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char **recipe, psS32 *p1_version, psS32 *p2_version) 10206 10500 { … … 10740 11034 } 10741 11035 11036 long long p3PendingExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 11037 { 11038 long long deleted = 0; 11039 11040 long long count = psDBDeleteRows(dbh, P3PENDINGEXP_TABLE_NAME, where, limit); 11041 if (count < 0) { 11042 psError(PS_ERR_UNKNOWN, true, "failed to delete row from p3PendingExp"); 11043 return count; 11044 11045 deleted += count; 11046 } 11047 11048 return deleted; 11049 } 10742 11050 bool p3PendingExpPop(psDB *dbh, char **exp_id, char **camera, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background, char **recipe, psS32 *p2_version, psS32 *p3_version) 10743 11051 { … … 11278 11586 } 11279 11587 11588 long long detRunDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 11589 { 11590 long long deleted = 0; 11591 11592 long long count = psDBDeleteRows(dbh, DETRUN_TABLE_NAME, where, limit); 11593 if (count < 0) { 11594 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detRun"); 11595 return count; 11596 11597 deleted += count; 11598 } 11599 11600 return deleted; 11601 } 11280 11602 bool detRunPop(psDB *dbh, psS32 *iteration, char **det_type) 11281 11603 { … … 11743 12065 } 11744 12066 12067 long long detInputExpDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 12068 { 12069 long long deleted = 0; 12070 12071 long long count = psDBDeleteRows(dbh, DETINPUTEXP_TABLE_NAME, where, limit); 12072 if (count < 0) { 12073 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detInputExp"); 12074 return count; 12075 12076 deleted += count; 12077 } 12078 12079 return deleted; 12080 } 11745 12081 bool detInputExpPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *background) 11746 12082 { … … 12317 12653 } 12318 12654 12655 long long detProcessedImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 12656 { 12657 long long deleted = 0; 12658 12659 long long count = psDBDeleteRows(dbh, DETPROCESSEDIMFILE_TABLE_NAME, where, limit); 12660 if (count < 0) { 12661 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detProcessedImfile"); 12662 return count; 12663 12664 deleted += count; 12665 } 12666 12667 return deleted; 12668 } 12319 12669 bool detProcessedImfilePop(psDB *dbh, psS32 *det_id, char **exp_id, char **class_id, char **uri, char **recipe) 12320 12670 { … … 12746 13096 } 12747 13097 13098 long long detStackedImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 13099 { 13100 long long deleted = 0; 13101 13102 long long count = psDBDeleteRows(dbh, DETSTACKEDIMFILE_TABLE_NAME, where, limit); 13103 if (count < 0) { 13104 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detStackedImfile"); 13105 return count; 13106 13107 deleted += count; 13108 } 13109 13110 return deleted; 13111 } 12748 13112 bool detStackedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe) 12749 13113 { … … 13175 13539 } 13176 13540 13541 long long detNormalizedImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 13542 { 13543 long long deleted = 0; 13544 13545 long long count = psDBDeleteRows(dbh, DETNORMALIZEDIMFILE_TABLE_NAME, where, limit); 13546 if (count < 0) { 13547 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detNormalizedImfile"); 13548 return count; 13549 13550 deleted += count; 13551 } 13552 13553 return deleted; 13554 } 13177 13555 bool detNormalizedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe) 13178 13556 { … … 13580 13958 } 13581 13959 13960 long long detMasterFrameDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 13961 { 13962 long long deleted = 0; 13963 13964 long long count = psDBDeleteRows(dbh, DETMASTERFRAME_TABLE_NAME, where, limit); 13965 if (count < 0) { 13966 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detMasterFrame"); 13967 return count; 13968 13969 deleted += count; 13970 } 13971 13972 return deleted; 13973 } 13582 13974 bool detMasterFramePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **comment) 13583 13975 { … … 13962 14354 } 13963 14355 14356 long long detMasterImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 14357 { 14358 long long deleted = 0; 14359 14360 long long count = psDBDeleteRows(dbh, DETMASTERIMFILE_TABLE_NAME, where, limit); 14361 if (count < 0) { 14362 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detMasterImfile"); 14363 return count; 14364 14365 deleted += count; 14366 } 14367 14368 return deleted; 14369 } 13964 14370 bool detMasterImfilePop(psDB *dbh, psS32 *det_id, char **class_id, char **uri, char **recipe) 13965 14371 { … … 14373 14779 } 14374 14780 14781 long long detResidImfileAnalysisDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 14782 { 14783 long long deleted = 0; 14784 14785 long long count = psDBDeleteRows(dbh, DETRESIDIMFILEANALYSIS_TABLE_NAME, where, limit); 14786 if (count < 0) { 14787 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detResidImfileAnalysis"); 14788 return count; 14789 14790 deleted += count; 14791 } 14792 14793 return deleted; 14794 } 14375 14795 bool detResidImfileAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **class_id, char **recipe) 14376 14796 { … … 14801 15221 } 14802 15222 15223 long long detResidExpAnalysisDelete(psDB *dbh, const psMetadata *where, unsigned long long limit) 15224 { 15225 long long deleted = 0; 15226 15227 long long count = psDBDeleteRows(dbh, DETRESIDEXPANALYSIS_TABLE_NAME, where, limit); 15228 if (count < 0) { 15229 psError(PS_ERR_UNKNOWN, true, "failed to delete row from detResidExpAnalysis"); 15230 return count; 15231 15232 deleted += count; 15233 } 15234 15235 return deleted; 15236 } 14803 15237 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool *accept) 14804 15238 {
Note:
See TracChangeset
for help on using the changeset viewer.
