Changeset 17148
- Timestamp:
- Mar 25, 2008, 4:43:13 PM (18 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 5 edited
-
chiptool.c (modified) (3 diffs)
-
chiptool.h (modified) (1 diff)
-
chiptoolConfig.c (modified) (2 diffs)
-
pxchip.c (modified) (2 diffs)
-
pxchip.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r16725 r17148 35 35 36 36 static bool queueMode(pxConfig *config); 37 static bool updaterunMode(pxConfig *config); 37 38 static bool pendingimfileMode(pxConfig *config); 38 39 static bool addprocessedimfileMode(pxConfig *config); … … 65 66 switch (config->mode) { 66 67 MODECASE(CHIPTOOL_MODE_QUEUE, queueMode); 68 MODECASE(CHIPTOOL_MODE_UPDATERUN, updaterunMode); 67 69 MODECASE(CHIPTOOL_MODE_PENDINGIMFILE, pendingimfileMode); 68 70 MODECASE(CHIPTOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileMode); … … 247 249 } 248 250 251 252 static bool updaterunMode(pxConfig *config) 253 { 254 PS_ASSERT_PTR_NON_NULL(config, NULL); 255 256 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", true, false); 257 PXOPT_LOOKUP_STR(state, config->args, "-state", false, false); 258 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 259 260 if ((!state) && (!label)) { 261 psError(PXTOOLS_ERR_DATA, false, "parameters are required"); 262 return false; 263 } 264 265 if (state) { 266 // set chipRun.state to state 267 if (!pxchipRunSetState(config, (psS64)atoll(chip_id), state)) { 268 return false; 269 } 270 } 271 272 if (label) { 273 // set chipRun.label to label 274 if (!pxchipRunSetLabel(config, (psS64)atoll(chip_id), label)) { 275 return false; 276 } 277 } 278 279 return true; 280 } 281 282 249 283 static bool pendingimfileMode(pxConfig *config) 250 284 { -
trunk/ippTools/src/chiptool.h
r16613 r17148 26 26 CHIPTOOL_MODE_NONE = 0x0, 27 27 CHIPTOOL_MODE_QUEUE, 28 CHIPTOOL_MODE_UPDATERUN, 28 29 CHIPTOOL_MODE_PENDINGIMFILE, 29 30 CHIPTOOL_MODE_ADDPROCESSEDIMFILE, -
trunk/ippTools/src/chiptoolConfig.c
r16667 r17148 139 139 psMetadataAddBool(queueArgs, PS_LIST_TAIL, "-pretend", 0, 140 140 "do not actually modify the database", false); 141 142 143 // -updaterun 144 psMetadata *updaterunArgs = psMetadataAlloc(); 145 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-chip_id", 0, 146 "define stack ID (required)", NULL); 147 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, 148 "set state", NULL); 149 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, 150 "set label", NULL); 141 151 142 152 … … 299 309 300 310 PXOPT_ADD_MODE("-queue", "", CHIPTOOL_MODE_QUEUE, queueArgs); 311 PXOPT_ADD_MODE("-updaterun", "", CHIPTOOL_MODE_UPDATERUN, updaterunArgs); 301 312 PXOPT_ADD_MODE("-pendingimfile", "", CHIPTOOL_MODE_PENDINGIMFILE, pendingimfileArgs); 302 313 PXOPT_ADD_MODE("-addprocessedimfile", "", CHIPTOOL_MODE_ADDPROCESSEDIMFILE,addprocessedimfileArgs); -
trunk/ippTools/src/pxchip.c
r16170 r17148 31 31 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state) 32 32 { 33 PS_ASSERT_PTR_NON_NULL(config, false); 33 34 PS_ASSERT_PTR_NON_NULL(state, false); 34 35 … … 47 48 char *query = "UPDATE chipRun SET state = '%s' WHERE chip_id = %" PRId64; 48 49 if (!p_psDBRunQuery(config->dbh, query, state, chip_id)) { 50 psError(PS_ERR_UNKNOWN, false, 51 "failed to change state for chip_id %" PRId64, chip_id); 52 return false; 53 } 54 55 return true; 56 } 57 58 59 bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label) 60 { 61 PS_ASSERT_PTR_NON_NULL(config, false); 62 // note label == NULL should be explicitly allowed 63 64 char *query = "UPDATE chipRun SET label = '%s' WHERE chip_id = %" PRId64; 65 if (!p_psDBRunQuery(config->dbh, query, label, chip_id)) { 49 66 psError(PS_ERR_UNKNOWN, false, 50 67 "failed to change state for chip_id %" PRId64, chip_id); -
trunk/ippTools/src/pxchip.h
r16170 r17148 26 26 27 27 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state); 28 bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label); 28 29 29 30 psS64 pxchipQueueByExpTag(pxConfig *config,
Note:
See TracChangeset
for help on using the changeset viewer.
