Changeset 31070 for trunk/ippToPsps/src/InitData.c
- Timestamp:
- Mar 28, 2011, 4:12:43 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/InitData.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/InitData.c
r31033 r31070 66 66 } 67 67 68 69 68 /** 70 69 Gets a value from the 'init' data … … 108 107 } 109 108 110 /* 109 /** 110 Gets model fit ID from name 111 */ 112 static bool getModelFitId(InitData* this, const char* name, int8_t* id) { 113 114 char buffer[10]; 115 if (!getInitValue(this, "FitModel", "name", name, "fitModelID", buffer)) { 116 117 *id = -1; 118 return false; 119 } 120 121 *id = atoi(buffer); 122 return true; 123 } 124 125 /** 111 126 Gets survey ID from survey name 112 127 */ 113 static bool getSurveyId(InitData* this, const char* surveyType, int8_t* surveyId) {128 static bool getSurveyId(InitData* this, const char* name, int8_t* id) { 114 129 115 130 char buffer[10]; 116 if (!getInitValue(this, "Survey", "name", surveyType, "surveyID", buffer)) { 117 118 *surveyId = -1; 119 return false; 120 } 121 122 *surveyId = atoi(buffer); 123 return true; 124 } 125 126 /* 127 Gets filter ID from filter type 128 */ 129 static bool getFilterId(InitData* this, const char* filterType, int8_t* filterId) { 131 if (!getInitValue(this, "Survey", "name", name, "surveyID", buffer)) { 132 133 *id = -1; 134 return false; 135 } 136 137 *id = atoi(buffer); 138 return true; 139 } 140 141 /** 142 Gets stack type ID from stack type string 143 */ 144 static bool getStackTypeId(InitData* this, const char* type, int8_t* id) { 145 146 char buffer[20]; 147 if (!getInitValue(this, "StackType", "stackType", type, "stackTypeID", buffer)) { 148 149 *id = -1; 150 return false; 151 } 152 153 *id = atoi(buffer); 154 return true; 155 } 156 157 /** 158 Gets filter ID from filter type string 159 */ 160 static bool getFilterId(InitData* this, const char* type, int8_t* id) { 130 161 131 162 char tmp[2]; 132 strncpy(tmp, filterType,1);163 strncpy(tmp, type,1); 133 164 tmp[1] = '\0'; 134 165 char buffer[10]; 135 166 if (!getInitValue(this, "Filter", "filterType", tmp, "filterID", buffer)) { 136 167 137 * filterId = -1;138 return false; 139 } 140 141 * filterId = atoi(buffer);168 *id = -1; 169 return false; 170 } 171 172 *id = atoi(buffer); 142 173 return true; 143 174 } … … 186 217 this->getFilterId = getFilterId; 187 218 this->getSurveyId = getSurveyId; 219 this->getStackTypeId = getStackTypeId; 220 this->getModelFitId = getModelFitId; 188 221 this->destroy = destroy; 189 222
Note:
See TracChangeset
for help on using the changeset viewer.
