Changeset 9146
- Timestamp:
- Oct 3, 2006, 12:01:12 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r9138 r9146 2822 2822 PS_ASSERT_PTR_NON_NULL(config, false); 2823 2823 2824 psString query = psStringCopy("SELECT * FROM detNormalizedExp"); 2825 2826 if (config->where) { 2827 psString whereClause = psDBGenerateWhereSQL(config->where, NULL); 2828 psStringAppend(&query, " %s", whereClause); 2829 psFree(whereClause); 2830 } 2831 2832 if (!p_psDBRunQuery(config->dbh, query)) { 2833 psError(PS_ERR_UNKNOWN, false, "database error"); 2834 psFree(query); 2835 return false; 2836 } 2837 psFree(query); 2838 2839 psArray *output = p_psDBFetchResult(config->dbh); 2840 if (!output) { 2841 psError(PS_ERR_UNKNOWN, false, "database error"); 2842 return false; 2843 } 2844 if (!psArrayLength(output)) { 2845 // XXX check psError here 2846 psError(PS_ERR_UNKNOWN, false, "no detNormalizedExp rows found"); 2847 psFree(output) 2848 return true; 2849 } 2850 2851 bool simple = false; 2852 { 2853 bool status = false; 2854 simple = psMetadataLookupBool(&status, config->args, "-simple"); 2855 if (!status) { 2856 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 2857 return false; 2858 } 2859 } 2860 2861 // negative simple so the default is true 2862 if (!ippdbPrintMetadatas(stdout, output, "detNormalizedExp", !simple)) { 2863 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 2864 psFree(output); 2865 return false; 2866 } 2867 2868 psFree(output); 2869 2824 2870 return true; 2825 2871 }
Note:
See TracChangeset
for help on using the changeset viewer.
