IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 21, 2008, 6:09:25 PM (18 years ago)
Author:
jhoblitt
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.h

    r16177 r16587  
    758758    bool            mdcf                ///< format as mdconfig or simple
    759759);
    760 /** pzPendingExpRow data structure
    761  *
    762  * Structure for representing a single row of pzPendingExp table data.
     760/** pzDownloadExpRow data structure
     761 *
     762 * Structure for representing a single row of pzDownloadExp table data.
    763763 */
    764764
     
    767767    char            *camera;
    768768    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
     777pzDownloadExpRow *pzDownloadExpRowAlloc(
    777778    const char      *exp_name,
    778779    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
     789bool pzDownloadExpCreateTable(
    788790    psDB            *dbh                ///< Database handle
    789791);
    790792
    791 /** Deletes a pzPendingExp table
    792  *
    793  * @return true on success
    794  */
    795 
    796 bool pzPendingExpDropTable(
     793/** Deletes a pzDownloadExp table
     794 *
     795 * @return true on success
     796 */
     797
     798bool pzDownloadExpDropTable(
    797799    psDB            *dbh                ///< Database handle
    798800);
     
    805807 */
    806808
    807 bool pzPendingExpInsert(
     809bool pzDownloadExpInsert(
    808810    psDB            *dbh,               ///< Database handle
    809811    const char      *exp_name,
    810812    const char      *camera,
    811     const char      *telescope
     813    const char      *telescope,
     814    const char      *state
    812815);
    813816
     
    817820 */
    818821
    819 long long pzPendingExpDelete(
     822long long pzDownloadExpDelete(
    820823    psDB            *dbh,               ///< Database handle
    821824    const psMetadata *where,            ///< Row match criteria
     
    823826);
    824827
    825 /** Insert a single pzPendingExpRow object into a table
     828/** Insert a single pzDownloadExpRow object into a table
    826829 *
    827830 * This function constructs and inserts a single row based on it's parameters.
     
    830833 */
    831834
    832 bool pzPendingExpInsertObject(
    833     psDB            *dbh,               ///< Database handle
    834     pzPendingExpRow *object             ///< pzPendingExpRow object
    835 );
    836 
    837 /** Insert an array of pzPendingExpRow object into a table
     835bool pzDownloadExpInsertObject(
     836    psDB            *dbh,               ///< Database handle
     837    pzDownloadExpRow *object             ///< pzDownloadExpRow object
     838);
     839
     840/** Insert an array of pzDownloadExpRow object into a table
    838841 *
    839842 * This function constructs and inserts multiple rows based on it's parameters.
     
    842845 */
    843846
    844 bool pzPendingExpInsertObjects(
    845     psDB            *dbh,               ///< Database handle
    846     psArray         *objects            ///< array of pzPendingExpRow objects
    847 );
    848 
    849 /** Insert data from a binary FITS table pzPendingExpRow into the database
     847bool 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
    850853 *
    851854 * This function expects a psFits object with a FITS table as the first
     
    857860 */
    858861
    859 bool pzPendingExpInsertFits(
     862bool pzDownloadExpInsertFits(
    860863    psDB            *dbh,               ///< Database handle
    861864    const psFits    *fits               ///< psFits object
     
    872875 */
    873876
    874 bool pzPendingExpSelectRowsFits(
     877bool pzDownloadExpSelectRowsFits(
    875878    psDB            *dbh,               ///< Database handle
    876879    psFits          *fits,              ///< psFits object
     
    879882);
    880883
    881 /** Convert a pzPendingExpRow into an equivalent psMetadata
     884/** Convert a pzDownloadExpRow into an equivalent psMetadata
    882885 *
    883886 * @return A psMetadata pointer or NULL on error
    884887 */
    885888
    886 psMetadata *pzPendingExpMetadataFromObject(
    887     const pzPendingExpRow *object             ///< fooRow to convert into a psMetadata
     889psMetadata *pzDownloadExpMetadataFromObject(
     890    const pzDownloadExpRow *object             ///< fooRow to convert into a psMetadata
    888891);
    889892
    890893/** Convert a psMetadata into an equivalent fooRow
    891894 *
    892  * @return A pzPendingExpRow pointer or NULL on error
    893  */
    894 
    895 pzPendingExpRow *pzPendingExpObjectFromMetadata(
     895 * @return A pzDownloadExpRow pointer or NULL on error
     896 */
     897
     898pzDownloadExpRow *pzDownloadExpObjectFromMetadata(
    896899    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    897900);
    898 /** Selects up to limit rows from the database and returns as pzPendingExpRow objects in a psArray
     901/** Selects up to limit rows from the database and returns as pzDownloadExpRow objects in a psArray
    899902 *
    900903 *  See psDBSelectRows() for documentation on the format of where.
     
    903906 */
    904907
    905 psArray *pzPendingExpSelectRowObjects(
     908psArray *pzDownloadExpSelectRowObjects(
    906909    psDB            *dbh,               ///< Database handle
    907910    const psMetadata *where,            ///< Row match criteria
    908911    unsigned long long limit            ///< Maximum number of elements to return
    909912);
    910 /** Deletes a row from the database coresponding to an pzPendingExp
     913/** Deletes a row from the database coresponding to an pzDownloadExp
    911914 *
    912915 *  Note that a 'where' search psMetadata is constructed from each object and
     
    916919 */
    917920
    918 bool pzPendingExpDeleteObject(
    919     psDB            *dbh,               ///< Database handle
    920     const pzPendingExpRow *object    ///< Object to delete
     921bool pzDownloadExpDeleteObject(
     922    psDB            *dbh,               ///< Database handle
     923    const pzDownloadExpRow *object    ///< Object to delete
    921924);
    922925/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    928931 */
    929932
    930 long long pzPendingExpDeleteRowObjects(
     933long long pzDownloadExpDeleteRowObjects(
    931934    psDB            *dbh,               ///< Database handle
    932935    const psArray   *objects,           ///< Array of objects to delete
    933936    unsigned long long limit            ///< Maximum number of elements to delete
    934937);
    935 /** Formats and prints an array of pzPendingExpRow objects
     938/** Formats and prints an array of pzDownloadExpRow objects
    936939 *
    937940 * When mdcf is set the formated output is in psMetadataConfig
     
    941944 */
    942945
    943 bool pzPendingExpPrintObjects(
     946bool pzDownloadExpPrintObjects(
    944947    FILE            *stream,            ///< a stream
    945     psArray         *objects,           ///< An array of pzPendingExpRow objects
     948    psArray         *objects,           ///< An array of pzDownloadExpRow objects
    946949    bool            mdcf                ///< format as mdconfig or simple
    947950);
    948 /** Formats and prints an pzPendingExpRow object
     951/** Formats and prints an pzDownloadExpRow object
    949952 *
    950953 * When mdcf is set the formated output is in psMetadataConfig
     
    954957 */
    955958
    956 bool pzPendingExpPrintObject(
     959bool pzDownloadExpPrintObject(
    957960    FILE            *stream,            ///< a stream
    958     pzPendingExpRow *object,    ///< an pzPendingExpRow object
     961    pzDownloadExpRow *object,    ///< an pzDownloadExpRow object
    959962    bool            mdcf                ///< format as mdconfig or simple
    960963);
    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.
    1372967 */
    1373968
     
    1379974    char            *class_id;
    1380975    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
     984pzDownloadImfileRow *pzDownloadImfileRowAlloc(
    1389985    const char      *exp_name,
    1390986    const char      *camera,
     
    1392988    const char      *class,
    1393989    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
     999bool pzDownloadImfileCreateTable(
    14031000    psDB            *dbh                ///< Database handle
    14041001);
    14051002
    1406 /** Deletes a pzDoneImfile table
    1407  *
    1408  * @return true on success
    1409  */
    1410 
    1411 bool pzDoneImfileDropTable(
     1003/** Deletes a pzDownloadImfile table
     1004 *
     1005 * @return true on success
     1006 */
     1007
     1008bool pzDownloadImfileDropTable(
    14121009    psDB            *dbh                ///< Database handle
    14131010);
     
    14201017 */
    14211018
    1422 bool pzDoneImfileInsert(
     1019bool pzDownloadImfileInsert(
    14231020    psDB            *dbh,               ///< Database handle
    14241021    const char      *exp_name,
     
    14271024    const char      *class,
    14281025    const char      *class_id,
    1429     const char      *uri
     1026    const char      *uri,
     1027    psS16           fault
    14301028);
    14311029
     
    14351033 */
    14361034
    1437 long long pzDoneImfileDelete(
     1035long long pzDownloadImfileDelete(
    14381036    psDB            *dbh,               ///< Database handle
    14391037    const psMetadata *where,            ///< Row match criteria
     
    14411039);
    14421040
    1443 /** Insert a single pzDoneImfileRow object into a table
     1041/** Insert a single pzDownloadImfileRow object into a table
    14441042 *
    14451043 * This function constructs and inserts a single row based on it's parameters.
     
    14481046 */
    14491047
    1450 bool pzDoneImfileInsertObject(
    1451     psDB            *dbh,               ///< Database handle
    1452     pzDoneImfileRow *object             ///< pzDoneImfileRow object
    1453 );
    1454 
    1455 /** Insert an array of pzDoneImfileRow object into a table
     1048bool pzDownloadImfileInsertObject(
     1049    psDB            *dbh,               ///< Database handle
     1050    pzDownloadImfileRow *object             ///< pzDownloadImfileRow object
     1051);
     1052
     1053/** Insert an array of pzDownloadImfileRow object into a table
    14561054 *
    14571055 * This function constructs and inserts multiple rows based on it's parameters.
     
    14601058 */
    14611059
    1462 bool pzDoneImfileInsertObjects(
    1463     psDB            *dbh,               ///< Database handle
    1464     psArray         *objects            ///< array of pzDoneImfileRow objects
    1465 );
    1466 
    1467 /** Insert data from a binary FITS table pzDoneImfileRow into the database
     1060bool 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
    14681066 *
    14691067 * This function expects a psFits object with a FITS table as the first
     
    14751073 */
    14761074
    1477 bool pzDoneImfileInsertFits(
     1075bool pzDownloadImfileInsertFits(
    14781076    psDB            *dbh,               ///< Database handle
    14791077    const psFits    *fits               ///< psFits object
     
    14901088 */
    14911089
    1492 bool pzDoneImfileSelectRowsFits(
     1090bool pzDownloadImfileSelectRowsFits(
    14931091    psDB            *dbh,               ///< Database handle
    14941092    psFits          *fits,              ///< psFits object
     
    14971095);
    14981096
    1499 /** Convert a pzDoneImfileRow into an equivalent psMetadata
     1097/** Convert a pzDownloadImfileRow into an equivalent psMetadata
    15001098 *
    15011099 * @return A psMetadata pointer or NULL on error
    15021100 */
    15031101
    1504 psMetadata *pzDoneImfileMetadataFromObject(
    1505     const pzDoneImfileRow *object             ///< fooRow to convert into a psMetadata
     1102psMetadata *pzDownloadImfileMetadataFromObject(
     1103    const pzDownloadImfileRow *object             ///< fooRow to convert into a psMetadata
    15061104);
    15071105
    15081106/** Convert a psMetadata into an equivalent fooRow
    15091107 *
    1510  * @return A pzDoneImfileRow pointer or NULL on error
    1511  */
    1512 
    1513 pzDoneImfileRow *pzDoneImfileObjectFromMetadata(
     1108 * @return A pzDownloadImfileRow pointer or NULL on error
     1109 */
     1110
     1111pzDownloadImfileRow *pzDownloadImfileObjectFromMetadata(
    15141112    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    15151113);
    1516 /** Selects up to limit rows from the database and returns as pzDoneImfileRow objects in a psArray
     1114/** Selects up to limit rows from the database and returns as pzDownloadImfileRow objects in a psArray
    15171115 *
    15181116 *  See psDBSelectRows() for documentation on the format of where.
     
    15211119 */
    15221120
    1523 psArray *pzDoneImfileSelectRowObjects(
     1121psArray *pzDownloadImfileSelectRowObjects(
    15241122    psDB            *dbh,               ///< Database handle
    15251123    const psMetadata *where,            ///< Row match criteria
    15261124    unsigned long long limit            ///< Maximum number of elements to return
    15271125);
    1528 /** Deletes a row from the database coresponding to an pzDoneImfile
     1126/** Deletes a row from the database coresponding to an pzDownloadImfile
    15291127 *
    15301128 *  Note that a 'where' search psMetadata is constructed from each object and
     
    15341132 */
    15351133
    1536 bool pzDoneImfileDeleteObject(
    1537     psDB            *dbh,               ///< Database handle
    1538     const pzDoneImfileRow *object    ///< Object to delete
     1134bool pzDownloadImfileDeleteObject(
     1135    psDB            *dbh,               ///< Database handle
     1136    const pzDownloadImfileRow *object    ///< Object to delete
    15391137);
    15401138/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    15461144 */
    15471145
    1548 long long pzDoneImfileDeleteRowObjects(
     1146long long pzDownloadImfileDeleteRowObjects(
    15491147    psDB            *dbh,               ///< Database handle
    15501148    const psArray   *objects,           ///< Array of objects to delete
    15511149    unsigned long long limit            ///< Maximum number of elements to delete
    15521150);
    1553 /** Formats and prints an array of pzDoneImfileRow objects
     1151/** Formats and prints an array of pzDownloadImfileRow objects
    15541152 *
    15551153 * When mdcf is set the formated output is in psMetadataConfig
     
    15591157 */
    15601158
    1561 bool pzDoneImfilePrintObjects(
     1159bool pzDownloadImfilePrintObjects(
    15621160    FILE            *stream,            ///< a stream
    1563     psArray         *objects,           ///< An array of pzDoneImfileRow objects
     1161    psArray         *objects,           ///< An array of pzDownloadImfileRow objects
    15641162    bool            mdcf                ///< format as mdconfig or simple
    15651163);
    1566 /** Formats and prints an pzDoneImfileRow object
     1164/** Formats and prints an pzDownloadImfileRow object
    15671165 *
    15681166 * When mdcf is set the formated output is in psMetadataConfig
     
    15721170 */
    15731171
    1574 bool pzDoneImfilePrintObject(
     1172bool pzDownloadImfilePrintObject(
    15751173    FILE            *stream,            ///< a stream
    1576     pzDoneImfileRow *object,    ///< an pzDoneImfileRow object
     1174    pzDownloadImfileRow *object,    ///< an pzDownloadImfileRow object
    15771175    bool            mdcf                ///< format as mdconfig or simple
    15781176);
     
    15941192    char            *tess_id;
    15951193    char            *end_stage;
     1194    char            *label;
    15961195} newExpRow;
    15971196
     
    16121211    const char      *dvodb,
    16131212    const char      *tess_id,
    1614     const char      *end_stage
     1213    const char      *end_stage,
     1214    const char      *label
    16151215);
    16161216
     
    16521252    const char      *dvodb,
    16531253    const char      *tess_id,
    1654     const char      *end_stage
     1254    const char      *end_stage,
     1255    const char      *label
    16551256);
    16561257
     
    31592760    psF32           ap_resid;
    31602761    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;
    31632770    psS32           n_stars;
    31642771    psS32           n_extended;
     
    31912798    psF32           ap_resid,
    31922799    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,
    31952808    psS32           n_stars,
    31962809    psS32           n_extended,
     
    32442857    psF32           ap_resid,
    32452858    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,
    32482867    psS32           n_stars,
    32492868    psS32           n_extended,
     
    38333452    psF32           bg_stdev;
    38343453    psF32           bg_mean_stdev;
     3454    psF32           bias;
     3455    psF32           bias_stdev;
     3456    psF32           fringe_0;
     3457    psF32           fringe_1;
     3458    psF32           fringe_2;
    38353459    psF32           sigma_ra;
    38363460    psF32           sigma_dec;
     3461    psF32           ap_resid;
     3462    psF32           ap_resid_stdev;
    38373463    psF32           zp_mean;
    38383464    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;
    38413471    psS32           n_stars;
    38423472    psS32           n_extended;
     
    38593489    psF32           bg_stdev,
    38603490    psF32           bg_mean_stdev,
     3491    psF32           bias,
     3492    psF32           bias_stdev,
     3493    psF32           fringe_0,
     3494    psF32           fringe_1,
     3495    psF32           fringe_2,
    38613496    psF32           sigma_ra,
    38623497    psF32           sigma_dec,
     3498    psF32           ap_resid,
     3499    psF32           ap_resid_stdev,
    38633500    psF32           zp_mean,
    38643501    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,
    38673508    psS32           n_stars,
    38683509    psS32           n_extended,
     
    39063547    psF32           bg_stdev,
    39073548    psF32           bg_mean_stdev,
     3549    psF32           bias,
     3550    psF32           bias_stdev,
     3551    psF32           fringe_0,
     3552    psF32           fringe_1,
     3553    psF32           fringe_2,
    39083554    psF32           sigma_ra,
    39093555    psF32           sigma_dec,
     3556    psF32           ap_resid,
     3557    psF32           ap_resid_stdev,
    39103558    psF32           zp_mean,
    39113559    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,
    39143566    psS32           n_stars,
    39153567    psS32           n_extended,
     
    49054557    psF64           bg;
    49064558    psF64           bg_stdev;
    4907     psF64           good_frac;
     4559    psF32           dtime_warp;
     4560    char            *hostname;
     4561    psF32           good_frac;
    49084562    bool            ignored;
    49094563    psS16           fault;
     
    49234577    psF64           bg,
    49244578    psF64           bg_stdev,
    4925     psF64           good_frac,
     4579    psF32           dtime_warp,
     4580    const char      *hostname,
     4581    psF32           good_frac,
    49264582    bool            ignored,
    49274583    psS16           fault
     
    49624618    psF64           bg,
    49634619    psF64           bg_stdev,
    4964     psF64           good_frac,
     4620    psF32           dtime_warp,
     4621    const char      *hostname,
     4622    psF32           good_frac,
    49654623    bool            ignored,
    49664624    psS16           fault
     
    55515209    psF64           bg;
    55525210    psF64           bg_stdev;
    5553     psF64           good_frac;
     5211    psF32           dtime_diff;
     5212    char            *hostname;
     5213    psF32           good_frac;
    55545214    psS16           fault;
    55555215} diffSkyfileRow;
     
    55665226    psF64           bg,
    55675227    psF64           bg_stdev,
    5568     psF64           good_frac,
     5228    psF32           dtime_diff,
     5229    const char      *hostname,
     5230    psF32           good_frac,
    55695231    psS16           fault
    55705232);
     
    56025264    psF64           bg,
    56035265    psF64           bg_stdev,
    5604     psF64           good_frac,
     5266    psF32           dtime_diff,
     5267    const char      *hostname,
     5268    psF32           good_frac,
    56055269    psS16           fault
    56065270);
     
    61755839    psF64           bg;
    61765840    psF64           bg_stdev;
    6177     psF64           good_frac;
     5841    psF32           dtime_stack;
     5842    char            *hostname;
     5843    psF32           good_frac;
    61785844    psS16           fault;
    61795845} stackSumSkyfileRow;
     
    61905856    psF64           bg,
    61915857    psF64           bg_stdev,
    6192     psF64           good_frac,
     5858    psF32           dtime_stack,
     5859    const char      *hostname,
     5860    psF32           good_frac,
    61935861    psS16           fault
    61945862);
     
    62265894    psF64           bg,
    62275895    psF64           bg_stdev,
    6228     psF64           good_frac,
     5896    psF32           dtime_stack,
     5897    const char      *hostname,
     5898    psF32           good_frac,
    62295899    psS16           fault
    62305900);
     
    1087810548typedef struct {
    1087910549    psS64           cal_id;
    10880     char            *catdir;
     10550    char            *dvodb;
    1088110551    char            *state;
    1088210552} calDBRow;
     
    1088910559calDBRow *calDBRowAlloc(
    1089010560    psS64           cal_id,
    10891     const char      *catdir,
     10561    const char      *dvodb,
    1089210562    const char      *state
    1089310563);
     
    1092110591    psDB            *dbh,               ///< Database handle
    1092210592    psS64           cal_id,
    10923     const char      *catdir,
     10593    const char      *dvodb,
    1092410594    const char      *state
    1092510595);
     
    1128410954    psS64           corr_id;
    1128510955    char            *dvodb;
     10956    char            *filter;
    1128610957    char            *state;
    1128710958    char            *workdir;
     
    1129810969    psS64           corr_id,
    1129910970    const char      *dvodb,
     10971    const char      *filter,
    1130010972    const char      *state,
    1130110973    const char      *workdir,
     
    1133311005    psS64           corr_id,
    1133411006    const char      *dvodb,
     11007    const char      *filter,
    1133511008    const char      *state,
    1133611009    const char      *workdir,
     
    1168411357    bool            mdcf                ///< format as mdconfig or simple
    1168511358);
     11359/** pstampDataStoreRow data structure
     11360 *
     11361 * Structure for representing a single row of pstampDataStore table data.
     11362 */
     11363
     11364typedef 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
     11376pstampDataStoreRow *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
     11388bool pstampDataStoreCreateTable(
     11389    psDB            *dbh                ///< Database handle
     11390);
     11391
     11392/** Deletes a pstampDataStore table
     11393 *
     11394 * @return true on success
     11395 */
     11396
     11397bool 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
     11408bool 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
     11421long 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
     11434bool 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
     11446bool 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
     11461bool 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
     11476bool 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
     11488psMetadata *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
     11497pstampDataStoreRow *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
     11507psArray *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
     11520bool 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
     11532long 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
     11545bool 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
     11558bool 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
     11568typedef 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
     11580pstampRequestRow *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
     11592bool pstampRequestCreateTable(
     11593    psDB            *dbh                ///< Database handle
     11594);
     11595
     11596/** Deletes a pstampRequest table
     11597 *
     11598 * @return true on success
     11599 */
     11600
     11601bool 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
     11612bool 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
     11625long 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
     11638bool 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
     11650bool 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
     11665bool 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
     11680bool 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
     11692psMetadata *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
     11701pstampRequestRow *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
     11711psArray *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
     11724bool 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
     11736long 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
     11749bool 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
     11762bool 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
     11772typedef 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
     11787pstampJobRow *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
     11802bool pstampJobCreateTable(
     11803    psDB            *dbh                ///< Database handle
     11804);
     11805
     11806/** Deletes a pstampJob table
     11807 *
     11808 * @return true on success
     11809 */
     11810
     11811bool 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
     11822bool 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
     11838long 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
     11851bool 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
     11863bool 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
     11878bool 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
     11893bool 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
     11905psMetadata *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
     11914pstampJobRow *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
     11924psArray *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
     11937bool 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
     11949long 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
     11962bool 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
     11975bool pstampJobPrintObject(
     11976    FILE            *stream,            ///< a stream
     11977    pstampJobRow *object,    ///< an pstampJobRow object
     11978    bool            mdcf                ///< format as mdconfig or simple
     11979);
    1168611980
    1168711981/// @}
     
    1169111985#endif
    1169211986
    11693 #endif // FLATCORREXP_DB_H
     11987#endif // PSTAMPJOB_DB_H
Note: See TracChangeset for help on using the changeset viewer.