Changeset 27838 for branches/tap_branches/ippTools/src/pxregister.c
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/pxregister.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippTools/src
- Property svn:ignore
-
old new 16 16 difftool 17 17 disttool 18 dqstatstool 18 19 faketool 19 20 flatcorr
-
- Property svn:ignore
-
branches/tap_branches/ippTools/src/pxregister.c
r21402 r27838 58 58 return true; 59 59 } 60 61 bool pxrawExpSetState(pxConfig *config, psS64 exp_id, const char *state) 62 { 63 if (!exp_id) { 64 psError(PS_ERR_UNKNOWN, true, "0 is not a valid exp_id"); 65 return false; 66 } 67 PS_ASSERT_PTR_NON_NULL(state, false); 68 69 // check that state is a valid string value 70 if (!( 71 (strncmp(state, "full", 5) == 0) 72 || (strncmp(state, "new", 4) == 0) 73 || (strncmp(state, "goto_compressed", 14) == 0) 74 || (strncmp(state, "compressed", 11) == 0) 75 || (strncmp(state, "goto_lossy", 11) == 0) 76 || (strncmp(state, "lossy", 6) == 0) 77 ) 78 ) { 79 psError(PS_ERR_UNKNOWN, false, 80 "invalid rawExp state: %s", state); 81 return false; 82 } 83 84 char *query = "UPDATE rawExp SET state = '%s' WHERE exp_id = %"PRId64; 85 if (!p_psDBRunQueryF(config->dbh, query, state, exp_id)) { 86 psError(PS_ERR_UNKNOWN, false, 87 "failed to change state for exp_id %"PRId64, exp_id); 88 return false; 89 } 90 91 return true; 92 } 93 bool pxrawImfileSetState(pxConfig *config, psS64 exp_id, const char *class_id, const char *state) 94 { 95 if (!exp_id) { 96 psError(PS_ERR_UNKNOWN, true, "0 is not a valid exp_id"); 97 return false; 98 } 99 PS_ASSERT_PTR_NON_NULL(state, false); 100 101 // check that state is a valid string value 102 if (!( 103 (strncmp(state, "full", 5) == 0) 104 || (strncmp(state, "new", 4) == 0) 105 || (strncmp(state, "goto_compressed", 14) == 0) 106 || (strncmp(state, "compressed", 11) == 0) 107 || (strncmp(state, "goto_lossy", 11) == 0) 108 || (strncmp(state, "lossy", 6) == 0) 109 ) 110 ) { 111 psError(PS_ERR_UNKNOWN, false, 112 "invalid rawImfile data_state: %s", state); 113 return false; 114 } 115 116 char *query = "UPDATE rawImfile SET data_state = '%s' WHERE class_id = %s AND exp_id = %"PRId64; 117 if (!p_psDBRunQueryF(config->dbh, query, state, class_id, exp_id)) { 118 psError(PS_ERR_UNKNOWN, false, 119 "failed to change state for exp_id %"PRId64, exp_id); 120 return false; 121 } 122 123 return true; 124 }
Note:
See TracChangeset
for help on using the changeset viewer.
