Changeset 16587 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Feb 21, 2008, 6:09:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (57 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r16177 r16587 758 758 bool mdcf ///< format as mdconfig or simple 759 759 ); 760 /** pz PendingExpRow data structure761 * 762 * Structure for representing a single row of pz PendingExp table data.760 /** pzDownloadExpRow data structure 761 * 762 * Structure for representing a single row of pzDownloadExp table data. 763 763 */ 764 764 … … 767 767 char *camera; 768 768 char *telescope; 769 } pzPendingExpRow; 770 771 /** Creates a new pzPendingExpRow object 772 * 773 * @return A new pzPendingExpRow object or NULL on failure. 774 */ 775 776 pzPendingExpRow *pzPendingExpRowAlloc( 769 char *state; 770 } pzDownloadExpRow; 771 772 /** Creates a new pzDownloadExpRow object 773 * 774 * @return A new pzDownloadExpRow object or NULL on failure. 775 */ 776 777 pzDownloadExpRow *pzDownloadExpRowAlloc( 777 778 const char *exp_name, 778 779 const char *camera, 779 const char *telescope 780 ); 781 782 /** Creates a new pzPendingExp table 783 * 784 * @return true on success 785 */ 786 787 bool pzPendingExpCreateTable( 780 const char *telescope, 781 const char *state 782 ); 783 784 /** Creates a new pzDownloadExp table 785 * 786 * @return true on success 787 */ 788 789 bool pzDownloadExpCreateTable( 788 790 psDB *dbh ///< Database handle 789 791 ); 790 792 791 /** Deletes a pz PendingExp table792 * 793 * @return true on success 794 */ 795 796 bool pz PendingExpDropTable(793 /** Deletes a pzDownloadExp table 794 * 795 * @return true on success 796 */ 797 798 bool pzDownloadExpDropTable( 797 799 psDB *dbh ///< Database handle 798 800 ); … … 805 807 */ 806 808 807 bool pz PendingExpInsert(809 bool pzDownloadExpInsert( 808 810 psDB *dbh, ///< Database handle 809 811 const char *exp_name, 810 812 const char *camera, 811 const char *telescope 813 const char *telescope, 814 const char *state 812 815 ); 813 816 … … 817 820 */ 818 821 819 long long pz PendingExpDelete(822 long long pzDownloadExpDelete( 820 823 psDB *dbh, ///< Database handle 821 824 const psMetadata *where, ///< Row match criteria … … 823 826 ); 824 827 825 /** Insert a single pz PendingExpRow object into a table828 /** Insert a single pzDownloadExpRow object into a table 826 829 * 827 830 * This function constructs and inserts a single row based on it's parameters. … … 830 833 */ 831 834 832 bool pz PendingExpInsertObject(833 psDB *dbh, ///< Database handle 834 pz PendingExpRow *object ///< pzPendingExpRow object835 ); 836 837 /** Insert an array of pz PendingExpRow object into a table835 bool pzDownloadExpInsertObject( 836 psDB *dbh, ///< Database handle 837 pzDownloadExpRow *object ///< pzDownloadExpRow object 838 ); 839 840 /** Insert an array of pzDownloadExpRow object into a table 838 841 * 839 842 * This function constructs and inserts multiple rows based on it's parameters. … … 842 845 */ 843 846 844 bool pz PendingExpInsertObjects(845 psDB *dbh, ///< Database handle 846 psArray *objects ///< array of pz PendingExpRow objects847 ); 848 849 /** Insert data from a binary FITS table pz PendingExpRow into the database847 bool pzDownloadExpInsertObjects( 848 psDB *dbh, ///< Database handle 849 psArray *objects ///< array of pzDownloadExpRow objects 850 ); 851 852 /** Insert data from a binary FITS table pzDownloadExpRow into the database 850 853 * 851 854 * This function expects a psFits object with a FITS table as the first … … 857 860 */ 858 861 859 bool pz PendingExpInsertFits(862 bool pzDownloadExpInsertFits( 860 863 psDB *dbh, ///< Database handle 861 864 const psFits *fits ///< psFits object … … 872 875 */ 873 876 874 bool pz PendingExpSelectRowsFits(877 bool pzDownloadExpSelectRowsFits( 875 878 psDB *dbh, ///< Database handle 876 879 psFits *fits, ///< psFits object … … 879 882 ); 880 883 881 /** Convert a pz PendingExpRow into an equivalent psMetadata884 /** Convert a pzDownloadExpRow into an equivalent psMetadata 882 885 * 883 886 * @return A psMetadata pointer or NULL on error 884 887 */ 885 888 886 psMetadata *pz PendingExpMetadataFromObject(887 const pz PendingExpRow *object ///< fooRow to convert into a psMetadata889 psMetadata *pzDownloadExpMetadataFromObject( 890 const pzDownloadExpRow *object ///< fooRow to convert into a psMetadata 888 891 ); 889 892 890 893 /** Convert a psMetadata into an equivalent fooRow 891 894 * 892 * @return A pz PendingExpRow pointer or NULL on error893 */ 894 895 pz PendingExpRow *pzPendingExpObjectFromMetadata(895 * @return A pzDownloadExpRow pointer or NULL on error 896 */ 897 898 pzDownloadExpRow *pzDownloadExpObjectFromMetadata( 896 899 psMetadata *md ///< psMetadata to convert into a fooRow 897 900 ); 898 /** Selects up to limit rows from the database and returns as pz PendingExpRow objects in a psArray901 /** Selects up to limit rows from the database and returns as pzDownloadExpRow objects in a psArray 899 902 * 900 903 * See psDBSelectRows() for documentation on the format of where. … … 903 906 */ 904 907 905 psArray *pz PendingExpSelectRowObjects(908 psArray *pzDownloadExpSelectRowObjects( 906 909 psDB *dbh, ///< Database handle 907 910 const psMetadata *where, ///< Row match criteria 908 911 unsigned long long limit ///< Maximum number of elements to return 909 912 ); 910 /** Deletes a row from the database coresponding to an pz PendingExp913 /** Deletes a row from the database coresponding to an pzDownloadExp 911 914 * 912 915 * Note that a 'where' search psMetadata is constructed from each object and … … 916 919 */ 917 920 918 bool pz PendingExpDeleteObject(919 psDB *dbh, ///< Database handle 920 const pz PendingExpRow *object ///< Object to delete921 bool pzDownloadExpDeleteObject( 922 psDB *dbh, ///< Database handle 923 const pzDownloadExpRow *object ///< Object to delete 921 924 ); 922 925 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 928 931 */ 929 932 930 long long pz PendingExpDeleteRowObjects(933 long long pzDownloadExpDeleteRowObjects( 931 934 psDB *dbh, ///< Database handle 932 935 const psArray *objects, ///< Array of objects to delete 933 936 unsigned long long limit ///< Maximum number of elements to delete 934 937 ); 935 /** Formats and prints an array of pz PendingExpRow objects938 /** Formats and prints an array of pzDownloadExpRow objects 936 939 * 937 940 * When mdcf is set the formated output is in psMetadataConfig … … 941 944 */ 942 945 943 bool pz PendingExpPrintObjects(946 bool pzDownloadExpPrintObjects( 944 947 FILE *stream, ///< a stream 945 psArray *objects, ///< An array of pz PendingExpRow objects948 psArray *objects, ///< An array of pzDownloadExpRow objects 946 949 bool mdcf ///< format as mdconfig or simple 947 950 ); 948 /** Formats and prints an pz PendingExpRow object951 /** Formats and prints an pzDownloadExpRow object 949 952 * 950 953 * When mdcf is set the formated output is in psMetadataConfig … … 954 957 */ 955 958 956 bool pz PendingExpPrintObject(959 bool pzDownloadExpPrintObject( 957 960 FILE *stream, ///< a stream 958 pz PendingExpRow *object, ///< an pzPendingExpRow object961 pzDownloadExpRow *object, ///< an pzDownloadExpRow object 959 962 bool mdcf ///< format as mdconfig or simple 960 963 ); 961 /** pzPendingImfileRow data structure 962 * 963 * Structure for representing a single row of pzPendingImfile table data. 964 */ 965 966 typedef struct { 967 char *exp_name; 968 char *camera; 969 char *telescope; 970 char *class; 971 char *class_id; 972 } pzPendingImfileRow; 973 974 /** Creates a new pzPendingImfileRow object 975 * 976 * @return A new pzPendingImfileRow object or NULL on failure. 977 */ 978 979 pzPendingImfileRow *pzPendingImfileRowAlloc( 980 const char *exp_name, 981 const char *camera, 982 const char *telescope, 983 const char *class, 984 const char *class_id 985 ); 986 987 /** Creates a new pzPendingImfile table 988 * 989 * @return true on success 990 */ 991 992 bool pzPendingImfileCreateTable( 993 psDB *dbh ///< Database handle 994 ); 995 996 /** Deletes a pzPendingImfile table 997 * 998 * @return true on success 999 */ 1000 1001 bool pzPendingImfileDropTable( 1002 psDB *dbh ///< Database handle 1003 ); 1004 1005 /** Insert a single row into a table 1006 * 1007 * This function constructs and inserts a single row based on it's parameters. 1008 * 1009 * @return true on success 1010 */ 1011 1012 bool pzPendingImfileInsert( 1013 psDB *dbh, ///< Database handle 1014 const char *exp_name, 1015 const char *camera, 1016 const char *telescope, 1017 const char *class, 1018 const char *class_id 1019 ); 1020 1021 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1022 * 1023 * @return A The number of rows removed or a negative value on error 1024 */ 1025 1026 long long pzPendingImfileDelete( 1027 psDB *dbh, ///< Database handle 1028 const psMetadata *where, ///< Row match criteria 1029 unsigned long long limit ///< Maximum number of elements to delete 1030 ); 1031 1032 /** Insert a single pzPendingImfileRow object into a table 1033 * 1034 * This function constructs and inserts a single row based on it's parameters. 1035 * 1036 * @return true on success 1037 */ 1038 1039 bool pzPendingImfileInsertObject( 1040 psDB *dbh, ///< Database handle 1041 pzPendingImfileRow *object ///< pzPendingImfileRow object 1042 ); 1043 1044 /** Insert an array of pzPendingImfileRow object into a table 1045 * 1046 * This function constructs and inserts multiple rows based on it's parameters. 1047 * 1048 * @return true on success 1049 */ 1050 1051 bool pzPendingImfileInsertObjects( 1052 psDB *dbh, ///< Database handle 1053 psArray *objects ///< array of pzPendingImfileRow objects 1054 ); 1055 1056 /** Insert data from a binary FITS table pzPendingImfileRow into the database 1057 * 1058 * This function expects a psFits object with a FITS table as the first 1059 * extension. The table must have at least one row of data in it, that is of 1060 * the appropriate format (number of columns and their type). All other 1061 * extensions are ignored. 1062 * 1063 * @return true on success 1064 */ 1065 1066 bool pzPendingImfileInsertFits( 1067 psDB *dbh, ///< Database handle 1068 const psFits *fits ///< psFits object 1069 ); 1070 1071 /** Selects up to limit from the database and returns them in a binary FITS table 1072 * 1073 * This function assumes an empty psFits object and will create a FITS table 1074 * as the first extension. 1075 * 1076 * See psDBSelectRows() for documentation on the format of where. 1077 * 1078 * @return true on success 1079 */ 1080 1081 bool pzPendingImfileSelectRowsFits( 1082 psDB *dbh, ///< Database handle 1083 psFits *fits, ///< psFits object 1084 const psMetadata *where, ///< Row match criteria 1085 unsigned long long limit ///< Maximum number of elements to return 1086 ); 1087 1088 /** Convert a pzPendingImfileRow into an equivalent psMetadata 1089 * 1090 * @return A psMetadata pointer or NULL on error 1091 */ 1092 1093 psMetadata *pzPendingImfileMetadataFromObject( 1094 const pzPendingImfileRow *object ///< fooRow to convert into a psMetadata 1095 ); 1096 1097 /** Convert a psMetadata into an equivalent fooRow 1098 * 1099 * @return A pzPendingImfileRow pointer or NULL on error 1100 */ 1101 1102 pzPendingImfileRow *pzPendingImfileObjectFromMetadata( 1103 psMetadata *md ///< psMetadata to convert into a fooRow 1104 ); 1105 /** Selects up to limit rows from the database and returns as pzPendingImfileRow objects in a psArray 1106 * 1107 * See psDBSelectRows() for documentation on the format of where. 1108 * 1109 * @return A psArray pointer or NULL on error 1110 */ 1111 1112 psArray *pzPendingImfileSelectRowObjects( 1113 psDB *dbh, ///< Database handle 1114 const psMetadata *where, ///< Row match criteria 1115 unsigned long long limit ///< Maximum number of elements to return 1116 ); 1117 /** Deletes a row from the database coresponding to an pzPendingImfile 1118 * 1119 * Note that a 'where' search psMetadata is constructed from each object and 1120 * used to find rows to delete. 1121 * 1122 * @return A The number of rows removed or a negative value on error 1123 */ 1124 1125 bool pzPendingImfileDeleteObject( 1126 psDB *dbh, ///< Database handle 1127 const pzPendingImfileRow *object ///< Object to delete 1128 ); 1129 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1130 * 1131 * Note that a 'where' search psMetadata is constructed from each object and 1132 * used to find rows to delete. 1133 * 1134 * @return A The number of rows removed or a negative value on error 1135 */ 1136 1137 long long pzPendingImfileDeleteRowObjects( 1138 psDB *dbh, ///< Database handle 1139 const psArray *objects, ///< Array of objects to delete 1140 unsigned long long limit ///< Maximum number of elements to delete 1141 ); 1142 /** Formats and prints an array of pzPendingImfileRow objects 1143 * 1144 * When mdcf is set the formated output is in psMetadataConfig 1145 * format, otherwise it is in a simple tabular format. 1146 * 1147 * @return true on success 1148 */ 1149 1150 bool pzPendingImfilePrintObjects( 1151 FILE *stream, ///< a stream 1152 psArray *objects, ///< An array of pzPendingImfileRow objects 1153 bool mdcf ///< format as mdconfig or simple 1154 ); 1155 /** Formats and prints an pzPendingImfileRow object 1156 * 1157 * When mdcf is set the formated output is in psMetadataConfig 1158 * format, otherwise it is in a simple tabular format. 1159 * 1160 * @return true on success 1161 */ 1162 1163 bool pzPendingImfilePrintObject( 1164 FILE *stream, ///< a stream 1165 pzPendingImfileRow *object, ///< an pzPendingImfileRow object 1166 bool mdcf ///< format as mdconfig or simple 1167 ); 1168 /** pzDoneExpRow data structure 1169 * 1170 * Structure for representing a single row of pzDoneExp table data. 1171 */ 1172 1173 typedef struct { 1174 char *exp_name; 1175 char *camera; 1176 char *telescope; 1177 } pzDoneExpRow; 1178 1179 /** Creates a new pzDoneExpRow object 1180 * 1181 * @return A new pzDoneExpRow object or NULL on failure. 1182 */ 1183 1184 pzDoneExpRow *pzDoneExpRowAlloc( 1185 const char *exp_name, 1186 const char *camera, 1187 const char *telescope 1188 ); 1189 1190 /** Creates a new pzDoneExp table 1191 * 1192 * @return true on success 1193 */ 1194 1195 bool pzDoneExpCreateTable( 1196 psDB *dbh ///< Database handle 1197 ); 1198 1199 /** Deletes a pzDoneExp table 1200 * 1201 * @return true on success 1202 */ 1203 1204 bool pzDoneExpDropTable( 1205 psDB *dbh ///< Database handle 1206 ); 1207 1208 /** Insert a single row into a table 1209 * 1210 * This function constructs and inserts a single row based on it's parameters. 1211 * 1212 * @return true on success 1213 */ 1214 1215 bool pzDoneExpInsert( 1216 psDB *dbh, ///< Database handle 1217 const char *exp_name, 1218 const char *camera, 1219 const char *telescope 1220 ); 1221 1222 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1223 * 1224 * @return A The number of rows removed or a negative value on error 1225 */ 1226 1227 long long pzDoneExpDelete( 1228 psDB *dbh, ///< Database handle 1229 const psMetadata *where, ///< Row match criteria 1230 unsigned long long limit ///< Maximum number of elements to delete 1231 ); 1232 1233 /** Insert a single pzDoneExpRow object into a table 1234 * 1235 * This function constructs and inserts a single row based on it's parameters. 1236 * 1237 * @return true on success 1238 */ 1239 1240 bool pzDoneExpInsertObject( 1241 psDB *dbh, ///< Database handle 1242 pzDoneExpRow *object ///< pzDoneExpRow object 1243 ); 1244 1245 /** Insert an array of pzDoneExpRow object into a table 1246 * 1247 * This function constructs and inserts multiple rows based on it's parameters. 1248 * 1249 * @return true on success 1250 */ 1251 1252 bool pzDoneExpInsertObjects( 1253 psDB *dbh, ///< Database handle 1254 psArray *objects ///< array of pzDoneExpRow objects 1255 ); 1256 1257 /** Insert data from a binary FITS table pzDoneExpRow into the database 1258 * 1259 * This function expects a psFits object with a FITS table as the first 1260 * extension. The table must have at least one row of data in it, that is of 1261 * the appropriate format (number of columns and their type). All other 1262 * extensions are ignored. 1263 * 1264 * @return true on success 1265 */ 1266 1267 bool pzDoneExpInsertFits( 1268 psDB *dbh, ///< Database handle 1269 const psFits *fits ///< psFits object 1270 ); 1271 1272 /** Selects up to limit from the database and returns them in a binary FITS table 1273 * 1274 * This function assumes an empty psFits object and will create a FITS table 1275 * as the first extension. 1276 * 1277 * See psDBSelectRows() for documentation on the format of where. 1278 * 1279 * @return true on success 1280 */ 1281 1282 bool pzDoneExpSelectRowsFits( 1283 psDB *dbh, ///< Database handle 1284 psFits *fits, ///< psFits object 1285 const psMetadata *where, ///< Row match criteria 1286 unsigned long long limit ///< Maximum number of elements to return 1287 ); 1288 1289 /** Convert a pzDoneExpRow into an equivalent psMetadata 1290 * 1291 * @return A psMetadata pointer or NULL on error 1292 */ 1293 1294 psMetadata *pzDoneExpMetadataFromObject( 1295 const pzDoneExpRow *object ///< fooRow to convert into a psMetadata 1296 ); 1297 1298 /** Convert a psMetadata into an equivalent fooRow 1299 * 1300 * @return A pzDoneExpRow pointer or NULL on error 1301 */ 1302 1303 pzDoneExpRow *pzDoneExpObjectFromMetadata( 1304 psMetadata *md ///< psMetadata to convert into a fooRow 1305 ); 1306 /** Selects up to limit rows from the database and returns as pzDoneExpRow objects in a psArray 1307 * 1308 * See psDBSelectRows() for documentation on the format of where. 1309 * 1310 * @return A psArray pointer or NULL on error 1311 */ 1312 1313 psArray *pzDoneExpSelectRowObjects( 1314 psDB *dbh, ///< Database handle 1315 const psMetadata *where, ///< Row match criteria 1316 unsigned long long limit ///< Maximum number of elements to return 1317 ); 1318 /** Deletes a row from the database coresponding to an pzDoneExp 1319 * 1320 * Note that a 'where' search psMetadata is constructed from each object and 1321 * used to find rows to delete. 1322 * 1323 * @return A The number of rows removed or a negative value on error 1324 */ 1325 1326 bool pzDoneExpDeleteObject( 1327 psDB *dbh, ///< Database handle 1328 const pzDoneExpRow *object ///< Object to delete 1329 ); 1330 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 1331 * 1332 * Note that a 'where' search psMetadata is constructed from each object and 1333 * used to find rows to delete. 1334 * 1335 * @return A The number of rows removed or a negative value on error 1336 */ 1337 1338 long long pzDoneExpDeleteRowObjects( 1339 psDB *dbh, ///< Database handle 1340 const psArray *objects, ///< Array of objects to delete 1341 unsigned long long limit ///< Maximum number of elements to delete 1342 ); 1343 /** Formats and prints an array of pzDoneExpRow objects 1344 * 1345 * When mdcf is set the formated output is in psMetadataConfig 1346 * format, otherwise it is in a simple tabular format. 1347 * 1348 * @return true on success 1349 */ 1350 1351 bool pzDoneExpPrintObjects( 1352 FILE *stream, ///< a stream 1353 psArray *objects, ///< An array of pzDoneExpRow objects 1354 bool mdcf ///< format as mdconfig or simple 1355 ); 1356 /** Formats and prints an pzDoneExpRow object 1357 * 1358 * When mdcf is set the formated output is in psMetadataConfig 1359 * format, otherwise it is in a simple tabular format. 1360 * 1361 * @return true on success 1362 */ 1363 1364 bool pzDoneExpPrintObject( 1365 FILE *stream, ///< a stream 1366 pzDoneExpRow *object, ///< an pzDoneExpRow object 1367 bool mdcf ///< format as mdconfig or simple 1368 ); 1369 /** pzDoneImfileRow data structure 1370 * 1371 * Structure for representing a single row of pzDoneImfile table data. 964 /** pzDownloadImfileRow data structure 965 * 966 * Structure for representing a single row of pzDownloadImfile table data. 1372 967 */ 1373 968 … … 1379 974 char *class_id; 1380 975 char *uri; 1381 } pzDoneImfileRow; 1382 1383 /** Creates a new pzDoneImfileRow object 1384 * 1385 * @return A new pzDoneImfileRow object or NULL on failure. 1386 */ 1387 1388 pzDoneImfileRow *pzDoneImfileRowAlloc( 976 psS16 fault; 977 } pzDownloadImfileRow; 978 979 /** Creates a new pzDownloadImfileRow object 980 * 981 * @return A new pzDownloadImfileRow object or NULL on failure. 982 */ 983 984 pzDownloadImfileRow *pzDownloadImfileRowAlloc( 1389 985 const char *exp_name, 1390 986 const char *camera, … … 1392 988 const char *class, 1393 989 const char *class_id, 1394 const char *uri 1395 ); 1396 1397 /** Creates a new pzDoneImfile table 1398 * 1399 * @return true on success 1400 */ 1401 1402 bool pzDoneImfileCreateTable( 990 const char *uri, 991 psS16 fault 992 ); 993 994 /** Creates a new pzDownloadImfile table 995 * 996 * @return true on success 997 */ 998 999 bool pzDownloadImfileCreateTable( 1403 1000 psDB *dbh ///< Database handle 1404 1001 ); 1405 1002 1406 /** Deletes a pzDo neImfile table1407 * 1408 * @return true on success 1409 */ 1410 1411 bool pzDo neImfileDropTable(1003 /** Deletes a pzDownloadImfile table 1004 * 1005 * @return true on success 1006 */ 1007 1008 bool pzDownloadImfileDropTable( 1412 1009 psDB *dbh ///< Database handle 1413 1010 ); … … 1420 1017 */ 1421 1018 1422 bool pzDo neImfileInsert(1019 bool pzDownloadImfileInsert( 1423 1020 psDB *dbh, ///< Database handle 1424 1021 const char *exp_name, … … 1427 1024 const char *class, 1428 1025 const char *class_id, 1429 const char *uri 1026 const char *uri, 1027 psS16 fault 1430 1028 ); 1431 1029 … … 1435 1033 */ 1436 1034 1437 long long pzDo neImfileDelete(1035 long long pzDownloadImfileDelete( 1438 1036 psDB *dbh, ///< Database handle 1439 1037 const psMetadata *where, ///< Row match criteria … … 1441 1039 ); 1442 1040 1443 /** Insert a single pzDo neImfileRow object into a table1041 /** Insert a single pzDownloadImfileRow object into a table 1444 1042 * 1445 1043 * This function constructs and inserts a single row based on it's parameters. … … 1448 1046 */ 1449 1047 1450 bool pzDo neImfileInsertObject(1451 psDB *dbh, ///< Database handle 1452 pzDo neImfileRow *object ///< pzDoneImfileRow object1453 ); 1454 1455 /** Insert an array of pzDo neImfileRow object into a table1048 bool pzDownloadImfileInsertObject( 1049 psDB *dbh, ///< Database handle 1050 pzDownloadImfileRow *object ///< pzDownloadImfileRow object 1051 ); 1052 1053 /** Insert an array of pzDownloadImfileRow object into a table 1456 1054 * 1457 1055 * This function constructs and inserts multiple rows based on it's parameters. … … 1460 1058 */ 1461 1059 1462 bool pzDo neImfileInsertObjects(1463 psDB *dbh, ///< Database handle 1464 psArray *objects ///< array of pzDo neImfileRow objects1465 ); 1466 1467 /** Insert data from a binary FITS table pzDo neImfileRow into the database1060 bool pzDownloadImfileInsertObjects( 1061 psDB *dbh, ///< Database handle 1062 psArray *objects ///< array of pzDownloadImfileRow objects 1063 ); 1064 1065 /** Insert data from a binary FITS table pzDownloadImfileRow into the database 1468 1066 * 1469 1067 * This function expects a psFits object with a FITS table as the first … … 1475 1073 */ 1476 1074 1477 bool pzDo neImfileInsertFits(1075 bool pzDownloadImfileInsertFits( 1478 1076 psDB *dbh, ///< Database handle 1479 1077 const psFits *fits ///< psFits object … … 1490 1088 */ 1491 1089 1492 bool pzDo neImfileSelectRowsFits(1090 bool pzDownloadImfileSelectRowsFits( 1493 1091 psDB *dbh, ///< Database handle 1494 1092 psFits *fits, ///< psFits object … … 1497 1095 ); 1498 1096 1499 /** Convert a pzDo neImfileRow into an equivalent psMetadata1097 /** Convert a pzDownloadImfileRow into an equivalent psMetadata 1500 1098 * 1501 1099 * @return A psMetadata pointer or NULL on error 1502 1100 */ 1503 1101 1504 psMetadata *pzDo neImfileMetadataFromObject(1505 const pzDo neImfileRow *object ///< fooRow to convert into a psMetadata1102 psMetadata *pzDownloadImfileMetadataFromObject( 1103 const pzDownloadImfileRow *object ///< fooRow to convert into a psMetadata 1506 1104 ); 1507 1105 1508 1106 /** Convert a psMetadata into an equivalent fooRow 1509 1107 * 1510 * @return A pzDo neImfileRow pointer or NULL on error1511 */ 1512 1513 pzDo neImfileRow *pzDoneImfileObjectFromMetadata(1108 * @return A pzDownloadImfileRow pointer or NULL on error 1109 */ 1110 1111 pzDownloadImfileRow *pzDownloadImfileObjectFromMetadata( 1514 1112 psMetadata *md ///< psMetadata to convert into a fooRow 1515 1113 ); 1516 /** Selects up to limit rows from the database and returns as pzDo neImfileRow objects in a psArray1114 /** Selects up to limit rows from the database and returns as pzDownloadImfileRow objects in a psArray 1517 1115 * 1518 1116 * See psDBSelectRows() for documentation on the format of where. … … 1521 1119 */ 1522 1120 1523 psArray *pzDo neImfileSelectRowObjects(1121 psArray *pzDownloadImfileSelectRowObjects( 1524 1122 psDB *dbh, ///< Database handle 1525 1123 const psMetadata *where, ///< Row match criteria 1526 1124 unsigned long long limit ///< Maximum number of elements to return 1527 1125 ); 1528 /** Deletes a row from the database coresponding to an pzDo neImfile1126 /** Deletes a row from the database coresponding to an pzDownloadImfile 1529 1127 * 1530 1128 * Note that a 'where' search psMetadata is constructed from each object and … … 1534 1132 */ 1535 1133 1536 bool pzDo neImfileDeleteObject(1537 psDB *dbh, ///< Database handle 1538 const pzDo neImfileRow *object ///< Object to delete1134 bool pzDownloadImfileDeleteObject( 1135 psDB *dbh, ///< Database handle 1136 const pzDownloadImfileRow *object ///< Object to delete 1539 1137 ); 1540 1138 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 1546 1144 */ 1547 1145 1548 long long pzDo neImfileDeleteRowObjects(1146 long long pzDownloadImfileDeleteRowObjects( 1549 1147 psDB *dbh, ///< Database handle 1550 1148 const psArray *objects, ///< Array of objects to delete 1551 1149 unsigned long long limit ///< Maximum number of elements to delete 1552 1150 ); 1553 /** Formats and prints an array of pzDo neImfileRow objects1151 /** Formats and prints an array of pzDownloadImfileRow objects 1554 1152 * 1555 1153 * When mdcf is set the formated output is in psMetadataConfig … … 1559 1157 */ 1560 1158 1561 bool pzDo neImfilePrintObjects(1159 bool pzDownloadImfilePrintObjects( 1562 1160 FILE *stream, ///< a stream 1563 psArray *objects, ///< An array of pzDo neImfileRow objects1161 psArray *objects, ///< An array of pzDownloadImfileRow objects 1564 1162 bool mdcf ///< format as mdconfig or simple 1565 1163 ); 1566 /** Formats and prints an pzDo neImfileRow object1164 /** Formats and prints an pzDownloadImfileRow object 1567 1165 * 1568 1166 * When mdcf is set the formated output is in psMetadataConfig … … 1572 1170 */ 1573 1171 1574 bool pzDo neImfilePrintObject(1172 bool pzDownloadImfilePrintObject( 1575 1173 FILE *stream, ///< a stream 1576 pzDo neImfileRow *object, ///< an pzDoneImfileRow object1174 pzDownloadImfileRow *object, ///< an pzDownloadImfileRow object 1577 1175 bool mdcf ///< format as mdconfig or simple 1578 1176 ); … … 1594 1192 char *tess_id; 1595 1193 char *end_stage; 1194 char *label; 1596 1195 } newExpRow; 1597 1196 … … 1612 1211 const char *dvodb, 1613 1212 const char *tess_id, 1614 const char *end_stage 1213 const char *end_stage, 1214 const char *label 1615 1215 ); 1616 1216 … … 1652 1252 const char *dvodb, 1653 1253 const char *tess_id, 1654 const char *end_stage 1254 const char *end_stage, 1255 const char *label 1655 1256 ); 1656 1257 … … 3159 2760 psF32 ap_resid; 3160 2761 psF32 ap_resid_stdev; 3161 psF32 fwhm; 3162 psF32 fwhm_range; 2762 psF32 zp_mean; 2763 psF32 zp_stdev; 2764 psF32 fwhm_major; 2765 psF32 fwhm_minor; 2766 psF32 dtime_detrend; 2767 psF32 dtime_photom; 2768 psF32 dtime_astrom; 2769 char *hostname; 3163 2770 psS32 n_stars; 3164 2771 psS32 n_extended; … … 3191 2798 psF32 ap_resid, 3192 2799 psF32 ap_resid_stdev, 3193 psF32 fwhm, 3194 psF32 fwhm_range, 2800 psF32 zp_mean, 2801 psF32 zp_stdev, 2802 psF32 fwhm_major, 2803 psF32 fwhm_minor, 2804 psF32 dtime_detrend, 2805 psF32 dtime_photom, 2806 psF32 dtime_astrom, 2807 const char *hostname, 3195 2808 psS32 n_stars, 3196 2809 psS32 n_extended, … … 3244 2857 psF32 ap_resid, 3245 2858 psF32 ap_resid_stdev, 3246 psF32 fwhm, 3247 psF32 fwhm_range, 2859 psF32 zp_mean, 2860 psF32 zp_stdev, 2861 psF32 fwhm_major, 2862 psF32 fwhm_minor, 2863 psF32 dtime_detrend, 2864 psF32 dtime_photom, 2865 psF32 dtime_astrom, 2866 const char *hostname, 3248 2867 psS32 n_stars, 3249 2868 psS32 n_extended, … … 3833 3452 psF32 bg_stdev; 3834 3453 psF32 bg_mean_stdev; 3454 psF32 bias; 3455 psF32 bias_stdev; 3456 psF32 fringe_0; 3457 psF32 fringe_1; 3458 psF32 fringe_2; 3835 3459 psF32 sigma_ra; 3836 3460 psF32 sigma_dec; 3461 psF32 ap_resid; 3462 psF32 ap_resid_stdev; 3837 3463 psF32 zp_mean; 3838 3464 psF32 zp_stdev; 3839 psF32 fwhm; 3840 psF32 fwhm_range; 3465 psF32 fwhm_major; 3466 psF32 fwhm_minor; 3467 psF32 dtime_detrend; 3468 psF32 dtime_photom; 3469 psF32 dtime_astrom; 3470 char *hostname; 3841 3471 psS32 n_stars; 3842 3472 psS32 n_extended; … … 3859 3489 psF32 bg_stdev, 3860 3490 psF32 bg_mean_stdev, 3491 psF32 bias, 3492 psF32 bias_stdev, 3493 psF32 fringe_0, 3494 psF32 fringe_1, 3495 psF32 fringe_2, 3861 3496 psF32 sigma_ra, 3862 3497 psF32 sigma_dec, 3498 psF32 ap_resid, 3499 psF32 ap_resid_stdev, 3863 3500 psF32 zp_mean, 3864 3501 psF32 zp_stdev, 3865 psF32 fwhm, 3866 psF32 fwhm_range, 3502 psF32 fwhm_major, 3503 psF32 fwhm_minor, 3504 psF32 dtime_detrend, 3505 psF32 dtime_photom, 3506 psF32 dtime_astrom, 3507 const char *hostname, 3867 3508 psS32 n_stars, 3868 3509 psS32 n_extended, … … 3906 3547 psF32 bg_stdev, 3907 3548 psF32 bg_mean_stdev, 3549 psF32 bias, 3550 psF32 bias_stdev, 3551 psF32 fringe_0, 3552 psF32 fringe_1, 3553 psF32 fringe_2, 3908 3554 psF32 sigma_ra, 3909 3555 psF32 sigma_dec, 3556 psF32 ap_resid, 3557 psF32 ap_resid_stdev, 3910 3558 psF32 zp_mean, 3911 3559 psF32 zp_stdev, 3912 psF32 fwhm, 3913 psF32 fwhm_range, 3560 psF32 fwhm_major, 3561 psF32 fwhm_minor, 3562 psF32 dtime_detrend, 3563 psF32 dtime_photom, 3564 psF32 dtime_astrom, 3565 const char *hostname, 3914 3566 psS32 n_stars, 3915 3567 psS32 n_extended, … … 4905 4557 psF64 bg; 4906 4558 psF64 bg_stdev; 4907 psF64 good_frac; 4559 psF32 dtime_warp; 4560 char *hostname; 4561 psF32 good_frac; 4908 4562 bool ignored; 4909 4563 psS16 fault; … … 4923 4577 psF64 bg, 4924 4578 psF64 bg_stdev, 4925 psF64 good_frac, 4579 psF32 dtime_warp, 4580 const char *hostname, 4581 psF32 good_frac, 4926 4582 bool ignored, 4927 4583 psS16 fault … … 4962 4618 psF64 bg, 4963 4619 psF64 bg_stdev, 4964 psF64 good_frac, 4620 psF32 dtime_warp, 4621 const char *hostname, 4622 psF32 good_frac, 4965 4623 bool ignored, 4966 4624 psS16 fault … … 5551 5209 psF64 bg; 5552 5210 psF64 bg_stdev; 5553 psF64 good_frac; 5211 psF32 dtime_diff; 5212 char *hostname; 5213 psF32 good_frac; 5554 5214 psS16 fault; 5555 5215 } diffSkyfileRow; … … 5566 5226 psF64 bg, 5567 5227 psF64 bg_stdev, 5568 psF64 good_frac, 5228 psF32 dtime_diff, 5229 const char *hostname, 5230 psF32 good_frac, 5569 5231 psS16 fault 5570 5232 ); … … 5602 5264 psF64 bg, 5603 5265 psF64 bg_stdev, 5604 psF64 good_frac, 5266 psF32 dtime_diff, 5267 const char *hostname, 5268 psF32 good_frac, 5605 5269 psS16 fault 5606 5270 ); … … 6175 5839 psF64 bg; 6176 5840 psF64 bg_stdev; 6177 psF64 good_frac; 5841 psF32 dtime_stack; 5842 char *hostname; 5843 psF32 good_frac; 6178 5844 psS16 fault; 6179 5845 } stackSumSkyfileRow; … … 6190 5856 psF64 bg, 6191 5857 psF64 bg_stdev, 6192 psF64 good_frac, 5858 psF32 dtime_stack, 5859 const char *hostname, 5860 psF32 good_frac, 6193 5861 psS16 fault 6194 5862 ); … … 6226 5894 psF64 bg, 6227 5895 psF64 bg_stdev, 6228 psF64 good_frac, 5896 psF32 dtime_stack, 5897 const char *hostname, 5898 psF32 good_frac, 6229 5899 psS16 fault 6230 5900 ); … … 10878 10548 typedef struct { 10879 10549 psS64 cal_id; 10880 char * catdir;10550 char *dvodb; 10881 10551 char *state; 10882 10552 } calDBRow; … … 10889 10559 calDBRow *calDBRowAlloc( 10890 10560 psS64 cal_id, 10891 const char * catdir,10561 const char *dvodb, 10892 10562 const char *state 10893 10563 ); … … 10921 10591 psDB *dbh, ///< Database handle 10922 10592 psS64 cal_id, 10923 const char * catdir,10593 const char *dvodb, 10924 10594 const char *state 10925 10595 ); … … 11284 10954 psS64 corr_id; 11285 10955 char *dvodb; 10956 char *filter; 11286 10957 char *state; 11287 10958 char *workdir; … … 11298 10969 psS64 corr_id, 11299 10970 const char *dvodb, 10971 const char *filter, 11300 10972 const char *state, 11301 10973 const char *workdir, … … 11333 11005 psS64 corr_id, 11334 11006 const char *dvodb, 11007 const char *filter, 11335 11008 const char *state, 11336 11009 const char *workdir, … … 11684 11357 bool mdcf ///< format as mdconfig or simple 11685 11358 ); 11359 /** pstampDataStoreRow data structure 11360 * 11361 * Structure for representing a single row of pstampDataStore table data. 11362 */ 11363 11364 typedef struct { 11365 psS64 ds_id; 11366 char *uri; 11367 char *lastFileset; 11368 char *state; 11369 } pstampDataStoreRow; 11370 11371 /** Creates a new pstampDataStoreRow object 11372 * 11373 * @return A new pstampDataStoreRow object or NULL on failure. 11374 */ 11375 11376 pstampDataStoreRow *pstampDataStoreRowAlloc( 11377 psS64 ds_id, 11378 const char *uri, 11379 const char *lastFileset, 11380 const char *state 11381 ); 11382 11383 /** Creates a new pstampDataStore table 11384 * 11385 * @return true on success 11386 */ 11387 11388 bool pstampDataStoreCreateTable( 11389 psDB *dbh ///< Database handle 11390 ); 11391 11392 /** Deletes a pstampDataStore table 11393 * 11394 * @return true on success 11395 */ 11396 11397 bool pstampDataStoreDropTable( 11398 psDB *dbh ///< Database handle 11399 ); 11400 11401 /** Insert a single row into a table 11402 * 11403 * This function constructs and inserts a single row based on it's parameters. 11404 * 11405 * @return true on success 11406 */ 11407 11408 bool pstampDataStoreInsert( 11409 psDB *dbh, ///< Database handle 11410 psS64 ds_id, 11411 const char *uri, 11412 const char *lastFileset, 11413 const char *state 11414 ); 11415 11416 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11417 * 11418 * @return A The number of rows removed or a negative value on error 11419 */ 11420 11421 long long pstampDataStoreDelete( 11422 psDB *dbh, ///< Database handle 11423 const psMetadata *where, ///< Row match criteria 11424 unsigned long long limit ///< Maximum number of elements to delete 11425 ); 11426 11427 /** Insert a single pstampDataStoreRow object into a table 11428 * 11429 * This function constructs and inserts a single row based on it's parameters. 11430 * 11431 * @return true on success 11432 */ 11433 11434 bool pstampDataStoreInsertObject( 11435 psDB *dbh, ///< Database handle 11436 pstampDataStoreRow *object ///< pstampDataStoreRow object 11437 ); 11438 11439 /** Insert an array of pstampDataStoreRow object into a table 11440 * 11441 * This function constructs and inserts multiple rows based on it's parameters. 11442 * 11443 * @return true on success 11444 */ 11445 11446 bool pstampDataStoreInsertObjects( 11447 psDB *dbh, ///< Database handle 11448 psArray *objects ///< array of pstampDataStoreRow objects 11449 ); 11450 11451 /** Insert data from a binary FITS table pstampDataStoreRow into the database 11452 * 11453 * This function expects a psFits object with a FITS table as the first 11454 * extension. The table must have at least one row of data in it, that is of 11455 * the appropriate format (number of columns and their type). All other 11456 * extensions are ignored. 11457 * 11458 * @return true on success 11459 */ 11460 11461 bool pstampDataStoreInsertFits( 11462 psDB *dbh, ///< Database handle 11463 const psFits *fits ///< psFits object 11464 ); 11465 11466 /** Selects up to limit from the database and returns them in a binary FITS table 11467 * 11468 * This function assumes an empty psFits object and will create a FITS table 11469 * as the first extension. 11470 * 11471 * See psDBSelectRows() for documentation on the format of where. 11472 * 11473 * @return true on success 11474 */ 11475 11476 bool pstampDataStoreSelectRowsFits( 11477 psDB *dbh, ///< Database handle 11478 psFits *fits, ///< psFits object 11479 const psMetadata *where, ///< Row match criteria 11480 unsigned long long limit ///< Maximum number of elements to return 11481 ); 11482 11483 /** Convert a pstampDataStoreRow into an equivalent psMetadata 11484 * 11485 * @return A psMetadata pointer or NULL on error 11486 */ 11487 11488 psMetadata *pstampDataStoreMetadataFromObject( 11489 const pstampDataStoreRow *object ///< fooRow to convert into a psMetadata 11490 ); 11491 11492 /** Convert a psMetadata into an equivalent fooRow 11493 * 11494 * @return A pstampDataStoreRow pointer or NULL on error 11495 */ 11496 11497 pstampDataStoreRow *pstampDataStoreObjectFromMetadata( 11498 psMetadata *md ///< psMetadata to convert into a fooRow 11499 ); 11500 /** Selects up to limit rows from the database and returns as pstampDataStoreRow objects in a psArray 11501 * 11502 * See psDBSelectRows() for documentation on the format of where. 11503 * 11504 * @return A psArray pointer or NULL on error 11505 */ 11506 11507 psArray *pstampDataStoreSelectRowObjects( 11508 psDB *dbh, ///< Database handle 11509 const psMetadata *where, ///< Row match criteria 11510 unsigned long long limit ///< Maximum number of elements to return 11511 ); 11512 /** Deletes a row from the database coresponding to an pstampDataStore 11513 * 11514 * Note that a 'where' search psMetadata is constructed from each object and 11515 * used to find rows to delete. 11516 * 11517 * @return A The number of rows removed or a negative value on error 11518 */ 11519 11520 bool pstampDataStoreDeleteObject( 11521 psDB *dbh, ///< Database handle 11522 const pstampDataStoreRow *object ///< Object to delete 11523 ); 11524 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11525 * 11526 * Note that a 'where' search psMetadata is constructed from each object and 11527 * used to find rows to delete. 11528 * 11529 * @return A The number of rows removed or a negative value on error 11530 */ 11531 11532 long long pstampDataStoreDeleteRowObjects( 11533 psDB *dbh, ///< Database handle 11534 const psArray *objects, ///< Array of objects to delete 11535 unsigned long long limit ///< Maximum number of elements to delete 11536 ); 11537 /** Formats and prints an array of pstampDataStoreRow objects 11538 * 11539 * When mdcf is set the formated output is in psMetadataConfig 11540 * format, otherwise it is in a simple tabular format. 11541 * 11542 * @return true on success 11543 */ 11544 11545 bool pstampDataStorePrintObjects( 11546 FILE *stream, ///< a stream 11547 psArray *objects, ///< An array of pstampDataStoreRow objects 11548 bool mdcf ///< format as mdconfig or simple 11549 ); 11550 /** Formats and prints an pstampDataStoreRow object 11551 * 11552 * When mdcf is set the formated output is in psMetadataConfig 11553 * format, otherwise it is in a simple tabular format. 11554 * 11555 * @return true on success 11556 */ 11557 11558 bool pstampDataStorePrintObject( 11559 FILE *stream, ///< a stream 11560 pstampDataStoreRow *object, ///< an pstampDataStoreRow object 11561 bool mdcf ///< format as mdconfig or simple 11562 ); 11563 /** pstampRequestRow data structure 11564 * 11565 * Structure for representing a single row of pstampRequest table data. 11566 */ 11567 11568 typedef struct { 11569 psS64 req_id; 11570 psS64 ds_id; 11571 char *state; 11572 char *uri; 11573 } pstampRequestRow; 11574 11575 /** Creates a new pstampRequestRow object 11576 * 11577 * @return A new pstampRequestRow object or NULL on failure. 11578 */ 11579 11580 pstampRequestRow *pstampRequestRowAlloc( 11581 psS64 req_id, 11582 psS64 ds_id, 11583 const char *state, 11584 const char *uri 11585 ); 11586 11587 /** Creates a new pstampRequest table 11588 * 11589 * @return true on success 11590 */ 11591 11592 bool pstampRequestCreateTable( 11593 psDB *dbh ///< Database handle 11594 ); 11595 11596 /** Deletes a pstampRequest table 11597 * 11598 * @return true on success 11599 */ 11600 11601 bool pstampRequestDropTable( 11602 psDB *dbh ///< Database handle 11603 ); 11604 11605 /** Insert a single row into a table 11606 * 11607 * This function constructs and inserts a single row based on it's parameters. 11608 * 11609 * @return true on success 11610 */ 11611 11612 bool pstampRequestInsert( 11613 psDB *dbh, ///< Database handle 11614 psS64 req_id, 11615 psS64 ds_id, 11616 const char *state, 11617 const char *uri 11618 ); 11619 11620 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11621 * 11622 * @return A The number of rows removed or a negative value on error 11623 */ 11624 11625 long long pstampRequestDelete( 11626 psDB *dbh, ///< Database handle 11627 const psMetadata *where, ///< Row match criteria 11628 unsigned long long limit ///< Maximum number of elements to delete 11629 ); 11630 11631 /** Insert a single pstampRequestRow object into a table 11632 * 11633 * This function constructs and inserts a single row based on it's parameters. 11634 * 11635 * @return true on success 11636 */ 11637 11638 bool pstampRequestInsertObject( 11639 psDB *dbh, ///< Database handle 11640 pstampRequestRow *object ///< pstampRequestRow object 11641 ); 11642 11643 /** Insert an array of pstampRequestRow object into a table 11644 * 11645 * This function constructs and inserts multiple rows based on it's parameters. 11646 * 11647 * @return true on success 11648 */ 11649 11650 bool pstampRequestInsertObjects( 11651 psDB *dbh, ///< Database handle 11652 psArray *objects ///< array of pstampRequestRow objects 11653 ); 11654 11655 /** Insert data from a binary FITS table pstampRequestRow into the database 11656 * 11657 * This function expects a psFits object with a FITS table as the first 11658 * extension. The table must have at least one row of data in it, that is of 11659 * the appropriate format (number of columns and their type). All other 11660 * extensions are ignored. 11661 * 11662 * @return true on success 11663 */ 11664 11665 bool pstampRequestInsertFits( 11666 psDB *dbh, ///< Database handle 11667 const psFits *fits ///< psFits object 11668 ); 11669 11670 /** Selects up to limit from the database and returns them in a binary FITS table 11671 * 11672 * This function assumes an empty psFits object and will create a FITS table 11673 * as the first extension. 11674 * 11675 * See psDBSelectRows() for documentation on the format of where. 11676 * 11677 * @return true on success 11678 */ 11679 11680 bool pstampRequestSelectRowsFits( 11681 psDB *dbh, ///< Database handle 11682 psFits *fits, ///< psFits object 11683 const psMetadata *where, ///< Row match criteria 11684 unsigned long long limit ///< Maximum number of elements to return 11685 ); 11686 11687 /** Convert a pstampRequestRow into an equivalent psMetadata 11688 * 11689 * @return A psMetadata pointer or NULL on error 11690 */ 11691 11692 psMetadata *pstampRequestMetadataFromObject( 11693 const pstampRequestRow *object ///< fooRow to convert into a psMetadata 11694 ); 11695 11696 /** Convert a psMetadata into an equivalent fooRow 11697 * 11698 * @return A pstampRequestRow pointer or NULL on error 11699 */ 11700 11701 pstampRequestRow *pstampRequestObjectFromMetadata( 11702 psMetadata *md ///< psMetadata to convert into a fooRow 11703 ); 11704 /** Selects up to limit rows from the database and returns as pstampRequestRow objects in a psArray 11705 * 11706 * See psDBSelectRows() for documentation on the format of where. 11707 * 11708 * @return A psArray pointer or NULL on error 11709 */ 11710 11711 psArray *pstampRequestSelectRowObjects( 11712 psDB *dbh, ///< Database handle 11713 const psMetadata *where, ///< Row match criteria 11714 unsigned long long limit ///< Maximum number of elements to return 11715 ); 11716 /** Deletes a row from the database coresponding to an pstampRequest 11717 * 11718 * Note that a 'where' search psMetadata is constructed from each object and 11719 * used to find rows to delete. 11720 * 11721 * @return A The number of rows removed or a negative value on error 11722 */ 11723 11724 bool pstampRequestDeleteObject( 11725 psDB *dbh, ///< Database handle 11726 const pstampRequestRow *object ///< Object to delete 11727 ); 11728 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11729 * 11730 * Note that a 'where' search psMetadata is constructed from each object and 11731 * used to find rows to delete. 11732 * 11733 * @return A The number of rows removed or a negative value on error 11734 */ 11735 11736 long long pstampRequestDeleteRowObjects( 11737 psDB *dbh, ///< Database handle 11738 const psArray *objects, ///< Array of objects to delete 11739 unsigned long long limit ///< Maximum number of elements to delete 11740 ); 11741 /** Formats and prints an array of pstampRequestRow objects 11742 * 11743 * When mdcf is set the formated output is in psMetadataConfig 11744 * format, otherwise it is in a simple tabular format. 11745 * 11746 * @return true on success 11747 */ 11748 11749 bool pstampRequestPrintObjects( 11750 FILE *stream, ///< a stream 11751 psArray *objects, ///< An array of pstampRequestRow objects 11752 bool mdcf ///< format as mdconfig or simple 11753 ); 11754 /** Formats and prints an pstampRequestRow object 11755 * 11756 * When mdcf is set the formated output is in psMetadataConfig 11757 * format, otherwise it is in a simple tabular format. 11758 * 11759 * @return true on success 11760 */ 11761 11762 bool pstampRequestPrintObject( 11763 FILE *stream, ///< a stream 11764 pstampRequestRow *object, ///< an pstampRequestRow object 11765 bool mdcf ///< format as mdconfig or simple 11766 ); 11767 /** pstampJobRow data structure 11768 * 11769 * Structure for representing a single row of pstampJob table data. 11770 */ 11771 11772 typedef struct { 11773 psS64 job_id; 11774 psS64 req_id; 11775 char *state; 11776 psS32 result; 11777 char *uri; 11778 char *outputBase; 11779 char *args; 11780 } pstampJobRow; 11781 11782 /** Creates a new pstampJobRow object 11783 * 11784 * @return A new pstampJobRow object or NULL on failure. 11785 */ 11786 11787 pstampJobRow *pstampJobRowAlloc( 11788 psS64 job_id, 11789 psS64 req_id, 11790 const char *state, 11791 psS32 result, 11792 const char *uri, 11793 const char *outputBase, 11794 const char *args 11795 ); 11796 11797 /** Creates a new pstampJob table 11798 * 11799 * @return true on success 11800 */ 11801 11802 bool pstampJobCreateTable( 11803 psDB *dbh ///< Database handle 11804 ); 11805 11806 /** Deletes a pstampJob table 11807 * 11808 * @return true on success 11809 */ 11810 11811 bool pstampJobDropTable( 11812 psDB *dbh ///< Database handle 11813 ); 11814 11815 /** Insert a single row into a table 11816 * 11817 * This function constructs and inserts a single row based on it's parameters. 11818 * 11819 * @return true on success 11820 */ 11821 11822 bool pstampJobInsert( 11823 psDB *dbh, ///< Database handle 11824 psS64 job_id, 11825 psS64 req_id, 11826 const char *state, 11827 psS32 result, 11828 const char *uri, 11829 const char *outputBase, 11830 const char *args 11831 ); 11832 11833 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11834 * 11835 * @return A The number of rows removed or a negative value on error 11836 */ 11837 11838 long long pstampJobDelete( 11839 psDB *dbh, ///< Database handle 11840 const psMetadata *where, ///< Row match criteria 11841 unsigned long long limit ///< Maximum number of elements to delete 11842 ); 11843 11844 /** Insert a single pstampJobRow object into a table 11845 * 11846 * This function constructs and inserts a single row based on it's parameters. 11847 * 11848 * @return true on success 11849 */ 11850 11851 bool pstampJobInsertObject( 11852 psDB *dbh, ///< Database handle 11853 pstampJobRow *object ///< pstampJobRow object 11854 ); 11855 11856 /** Insert an array of pstampJobRow object into a table 11857 * 11858 * This function constructs and inserts multiple rows based on it's parameters. 11859 * 11860 * @return true on success 11861 */ 11862 11863 bool pstampJobInsertObjects( 11864 psDB *dbh, ///< Database handle 11865 psArray *objects ///< array of pstampJobRow objects 11866 ); 11867 11868 /** Insert data from a binary FITS table pstampJobRow into the database 11869 * 11870 * This function expects a psFits object with a FITS table as the first 11871 * extension. The table must have at least one row of data in it, that is of 11872 * the appropriate format (number of columns and their type). All other 11873 * extensions are ignored. 11874 * 11875 * @return true on success 11876 */ 11877 11878 bool pstampJobInsertFits( 11879 psDB *dbh, ///< Database handle 11880 const psFits *fits ///< psFits object 11881 ); 11882 11883 /** Selects up to limit from the database and returns them in a binary FITS table 11884 * 11885 * This function assumes an empty psFits object and will create a FITS table 11886 * as the first extension. 11887 * 11888 * See psDBSelectRows() for documentation on the format of where. 11889 * 11890 * @return true on success 11891 */ 11892 11893 bool pstampJobSelectRowsFits( 11894 psDB *dbh, ///< Database handle 11895 psFits *fits, ///< psFits object 11896 const psMetadata *where, ///< Row match criteria 11897 unsigned long long limit ///< Maximum number of elements to return 11898 ); 11899 11900 /** Convert a pstampJobRow into an equivalent psMetadata 11901 * 11902 * @return A psMetadata pointer or NULL on error 11903 */ 11904 11905 psMetadata *pstampJobMetadataFromObject( 11906 const pstampJobRow *object ///< fooRow to convert into a psMetadata 11907 ); 11908 11909 /** Convert a psMetadata into an equivalent fooRow 11910 * 11911 * @return A pstampJobRow pointer or NULL on error 11912 */ 11913 11914 pstampJobRow *pstampJobObjectFromMetadata( 11915 psMetadata *md ///< psMetadata to convert into a fooRow 11916 ); 11917 /** Selects up to limit rows from the database and returns as pstampJobRow objects in a psArray 11918 * 11919 * See psDBSelectRows() for documentation on the format of where. 11920 * 11921 * @return A psArray pointer or NULL on error 11922 */ 11923 11924 psArray *pstampJobSelectRowObjects( 11925 psDB *dbh, ///< Database handle 11926 const psMetadata *where, ///< Row match criteria 11927 unsigned long long limit ///< Maximum number of elements to return 11928 ); 11929 /** Deletes a row from the database coresponding to an pstampJob 11930 * 11931 * Note that a 'where' search psMetadata is constructed from each object and 11932 * used to find rows to delete. 11933 * 11934 * @return A The number of rows removed or a negative value on error 11935 */ 11936 11937 bool pstampJobDeleteObject( 11938 psDB *dbh, ///< Database handle 11939 const pstampJobRow *object ///< Object to delete 11940 ); 11941 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 11942 * 11943 * Note that a 'where' search psMetadata is constructed from each object and 11944 * used to find rows to delete. 11945 * 11946 * @return A The number of rows removed or a negative value on error 11947 */ 11948 11949 long long pstampJobDeleteRowObjects( 11950 psDB *dbh, ///< Database handle 11951 const psArray *objects, ///< Array of objects to delete 11952 unsigned long long limit ///< Maximum number of elements to delete 11953 ); 11954 /** Formats and prints an array of pstampJobRow objects 11955 * 11956 * When mdcf is set the formated output is in psMetadataConfig 11957 * format, otherwise it is in a simple tabular format. 11958 * 11959 * @return true on success 11960 */ 11961 11962 bool pstampJobPrintObjects( 11963 FILE *stream, ///< a stream 11964 psArray *objects, ///< An array of pstampJobRow objects 11965 bool mdcf ///< format as mdconfig or simple 11966 ); 11967 /** Formats and prints an pstampJobRow object 11968 * 11969 * When mdcf is set the formated output is in psMetadataConfig 11970 * format, otherwise it is in a simple tabular format. 11971 * 11972 * @return true on success 11973 */ 11974 11975 bool pstampJobPrintObject( 11976 FILE *stream, ///< a stream 11977 pstampJobRow *object, ///< an pstampJobRow object 11978 bool mdcf ///< format as mdconfig or simple 11979 ); 11686 11980 11687 11981 /// @} … … 11691 11985 #endif 11692 11986 11693 #endif // FLATCORREXP_DB_H11987 #endif // PSTAMPJOB_DB_H
Note:
See TracChangeset
for help on using the changeset viewer.
