Changeset 10115
- Timestamp:
- Nov 20, 2006, 2:03:03 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
pxinject.c (modified) (5 diffs)
-
pxinjectConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxinject.c
r10047 r10115 26 26 27 27 #include "pxtools.h" 28 #include "pxtag.h" 28 29 #include "pxinject.h" 29 30 … … 69 70 static bool newExpMode(pxConfig *config) 70 71 { 72 PS_ASSERT_PTR_NON_NULL(config, false); 73 71 74 bool status = false; 72 73 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");74 if (!status) {75 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");76 return false;77 }78 if (!exp_tag) {79 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");80 return false;81 }82 75 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 83 76 if (!status) { … … 136 129 } 137 130 131 psString exp_tag = pxGenExpTag(config, exp_id); 132 if (!exp_tag) { 133 psError(PS_ERR_UNKNOWN, false, "database error"); 134 return false; 135 } 138 136 139 137 if (!newExpInsert(config->dbh, 140 (psU64)atoll(exp_tag),138 exp_tag, 141 139 exp_id, 142 140 camera, … … 148 146 ) { 149 147 psError(PS_ERR_UNKNOWN, false, "database error"); 150 return false; 151 } 148 psFree(exp_tag); 149 return false; 150 } 151 152 psMetadata *md = psMetadataAlloc(); 153 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_tag", 0, NULL, exp_tag)) { 154 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag"); 155 psFree(md); 156 psFree(exp_tag); 157 psFree(md); 158 } 159 psFree(exp_tag); 160 161 bool simple = false; 162 { 163 bool status = false; 164 simple = psMetadataLookupBool(&status, config->args, "-simple"); 165 if (!status) { 166 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 167 psFree(md); 168 return false; 169 } 170 } 171 172 // negate simple so the default is true 173 if (!ippdbPrintMetadata(stdout, md, !simple)) { 174 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 175 psFree(md); 176 return false; 177 } 178 179 psFree(md); 152 180 153 181 return true; … … 156 184 static bool newImfileMode(pxConfig *config) 157 185 { 186 PS_ASSERT_PTR_NON_NULL(config, false); 187 158 188 bool status = false; 159 160 189 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 161 190 if (!status) { -
trunk/ippTools/src/pxinjectConfig.c
r10039 r10115 42 42 // -newExp 43 43 psMetadata *newExpArgs = psMetadataAlloc(); 44 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-exp_tag", 0,45 "define the exp_tag (required)", NULL);46 44 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-exp_id", 0, 47 45 "define the exp_id (required)", NULL); … … 56 54 psMetadataAddS32(newExpArgs, PS_LIST_TAIL, "-imfiles", 0, 57 55 "define the number of imfiles in this exp (required)", 0); 56 psMetadataAddBool(newExpArgs, PS_LIST_TAIL, "-simple", 0, 57 "use the simple output format", false); 58 58 59 59 // -newImfile
Note:
See TracChangeset
for help on using the changeset viewer.
