Changeset 14018 for trunk/ippTools/src/pxinject.c
- Timestamp:
- Jul 5, 2007, 10:15:41 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxinject.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxinject.c
r11854 r14018 24 24 #include <stdlib.h> 25 25 #include <ippdb.h> 26 #include <string.h> 26 27 27 28 #include "pxtools.h" 28 #include "pxtag.h"29 29 #include "pxinject.h" 30 30 31 31 static bool newExpMode(pxConfig *config); 32 32 static bool newImfileMode(pxConfig *config); 33 static bool updatenewExpMode(pxConfig *config); 33 34 34 35 # define MODECASE(caseName, func) \ … … 52 53 MODECASE(PXINJECT_MODE_NEWEXP, newExpMode); 53 54 MODECASE(PXINJECT_MODE_NEWIMFILE, newImfileMode); 55 MODECASE(PXINJECT_MODE_UPDATENEWEXP, updatenewExpMode); 54 56 default: 55 57 psAbort("invalid option (this should not happen)"); … … 134 136 exp_tag, 135 137 exp_id, 138 "reg", // state 136 139 camera, 137 140 telescope, 138 141 imfiles, 139 workdir 142 workdir, 143 "dirty" 140 144 ) 141 145 ) { … … 191 195 return false; 192 196 } 197 #if 0 193 198 psString class = psMetadataLookupStr(&status, config->args, "-class"); 194 199 if (!status) { … … 200 205 return false; 201 206 } 207 #endif 202 208 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 203 209 if (!status) { … … 220 226 221 227 // insert with error flag state set to 0 (no errors) 222 if (!newImfileInsert(config->dbh, exp_tag, class , class_id, uri)) {228 if (!newImfileInsert(config->dbh, exp_tag, class_id, uri)) { 223 229 psError(PS_ERR_UNKNOWN, false, "database error"); 224 230 return false; … … 227 233 return true; 228 234 } 235 236 237 static bool updatenewExpMode(pxConfig *config) 238 { 239 PS_ASSERT_PTR_NON_NULL(config, false); 240 241 bool status = false; 242 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 243 if (!status) { 244 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 245 return false; 246 } 247 if (!exp_tag) { 248 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required"); 249 return false; 250 } 251 252 psString state = psMetadataLookupStr(&status, config->args, "-state"); 253 if (!status) { 254 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state"); 255 return false; 256 } 257 if (!state) { 258 psError(PS_ERR_UNKNOWN, true, "-state is required"); 259 return false; 260 } 261 262 if (state) { 263 // set detRun.state to state 264 return pxnewExpSetState(config, exp_tag, state); 265 } 266 267 return true; 268 }
Note:
See TracChangeset
for help on using the changeset viewer.
