Changeset 17161 for trunk/ippTools/src/pxchip.c
- Timestamp:
- Mar 27, 2008, 4:24:35 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxchip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxchip.c
r17148 r17161 2 2 * pxchip.c 3 3 * 4 * Copyright (C) 2007 Joshua Hoblitt4 * Copyright (C) 2007-2008 Joshua Hoblitt 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it … … 57 57 58 58 59 bool pxchipRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state) 60 { 61 PS_ASSERT_PTR_NON_NULL(config, false); 62 PS_ASSERT_PTR_NON_NULL(state, false); 63 64 // check that state is a valid string value 65 if (!( 66 (strncmp(state, "run", 4) == 0) 67 || (strncmp(state, "stop", 5) == 0) 68 || (strncmp(state, "reg", 4) == 0) 69 ) 70 ) { 71 psError(PS_ERR_UNKNOWN, false, 72 "invalid chipRun state: %s", state); 73 return false; 74 } 75 76 psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET state = '%s'"); 77 78 if (where) { 79 psString whereClause = psDBGenerateWhereSQL(where, NULL); 80 psStringAppend(&query, " %s", whereClause); 81 psFree(whereClause); 82 } 83 84 if (!p_psDBRunQuery(config->dbh, query, state)) { 85 psFree(query); 86 psError(PS_ERR_UNKNOWN, false, "database error"); 87 return false; 88 } 89 90 psFree(query); 91 92 return true; 93 } 94 95 59 96 bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label) 60 97 { … … 73 110 74 111 112 bool pxchipRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label) 113 { 114 PS_ASSERT_PTR_NON_NULL(config, false); 115 // note label == NULL should be explicitly allowed 116 117 psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET label = '%s'"); 118 119 if (where) { 120 psString whereClause = psDBGenerateWhereSQL(where, NULL); 121 psStringAppend(&query, " %s", whereClause); 122 psFree(whereClause); 123 } 124 125 if (!p_psDBRunQuery(config->dbh, query, label)) { 126 psFree(query); 127 psError(PS_ERR_UNKNOWN, false, "database error"); 128 return false; 129 } 130 131 psFree(query); 132 133 return true; 134 } 135 136 75 137 psS64 pxchipQueueByExpTag(pxConfig *config, 76 138 psS64 exp_id, 77 c har *workdir,78 c har *label,79 c har *reduction,80 c har *expgroup,81 c har *dvodb,82 c har *tess_id,83 c har *end_stage)139 const char *workdir, 140 const char *label, 141 const char *reduction, 142 const char *expgroup, 143 const char *dvodb, 144 const char *tess_id, 145 const char *end_stage) 84 146 { 85 147 PS_ASSERT_PTR_NON_NULL(config, false);
Note:
See TracChangeset
for help on using the changeset viewer.
