Changeset 4832 for lm-sensors/branches/lm-sensors-3.0.0/lib/access.c
- Timestamp:
- 09/23/07 14:02:22 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/lib/access.c
r4831 r4832 90 90 Do not modify the struct the return value points to! Returns NULL if 91 91 not found.*/ 92 const sensors_ feature_data*sensors_lookup_feature_nr(const sensors_chip_name *chip,92 const sensors_subfeature *sensors_lookup_feature_nr(const sensors_chip_name *chip, 93 93 int feature) 94 94 { … … 98 98 if (sensors_match_chip(&sensors_proc_chips[i].chip, chip)) { 99 99 if (feature < 0 || 100 feature >= sensors_proc_chips[i]. feature_count)100 feature >= sensors_proc_chips[i].subfeature_count) 101 101 return NULL; 102 return sensors_proc_chips[i]. feature + feature;102 return sensors_proc_chips[i].subfeature + feature; 103 103 } 104 104 return NULL; … … 108 108 Do not modify the struct the return value points to! Returns NULL if 109 109 not found.*/ 110 static const sensors_ feature_data*110 static const sensors_subfeature * 111 111 sensors_lookup_feature_name(const sensors_chip_name *chip, const char *feature) 112 112 { 113 113 int i, j; 114 const sensors_ feature_data *features;114 const sensors_subfeature *subfeatures; 115 115 116 116 for (i = 0; i < sensors_proc_chips_count; i++) 117 117 if (sensors_match_chip(&sensors_proc_chips[i].chip, chip)) { 118 features = sensors_proc_chips[i].feature;119 for (j = 0; j < sensors_proc_chips[i]. feature_count; j++)120 if (!strcmp( features[j].name, feature))121 return features + j;118 subfeatures = sensors_proc_chips[i].subfeature; 119 for (j = 0; j < sensors_proc_chips[i].subfeature_count; j++) 120 if (!strcmp(subfeatures[j].name, feature)) 121 return subfeatures + j; 122 122 } 123 123 return NULL; … … 146 146 char *label; 147 147 const sensors_chip *chip; 148 const sensors_ feature_data*featureptr;148 const sensors_subfeature *featureptr; 149 149 char buf[128], path[PATH_MAX]; 150 150 FILE *f; … … 192 192 mappings into account. */ 193 193 static int sensors_get_ignored(const sensors_chip_name *name, 194 const sensors_ feature_data*feature)194 const sensors_subfeature *feature) 195 195 { 196 196 const sensors_chip *chip; … … 219 219 double *result) 220 220 { 221 const sensors_ feature_data*main_feature;222 const sensors_ feature_data*alt_feature;221 const sensors_subfeature *main_feature; 222 const sensors_subfeature *alt_feature; 223 223 const sensors_chip *chip; 224 224 const sensors_expr *expr = NULL; … … 266 266 double value) 267 267 { 268 const sensors_ feature_data*main_feature;269 const sensors_ feature_data*alt_feature;268 const sensors_subfeature *main_feature; 269 const sensors_subfeature *alt_feature; 270 270 const sensors_chip *chip; 271 271 const sensors_expr *expr = NULL; … … 344 344 } 345 345 346 static const sensors_ feature_data*346 static const sensors_subfeature * 347 347 sensors_get_all_features(const sensors_chip_name *name, int *nr) 348 348 { 349 sensors_ feature_data *feature_list;349 sensors_subfeature *subfeature_list; 350 350 int i; 351 351 352 352 for (i = 0; i < sensors_proc_chips_count; i++) 353 353 if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) { 354 feature_list = sensors_proc_chips[i].feature;355 while (*nr < sensors_proc_chips[i]. feature_count356 && sensors_get_ignored(name, & feature_list[*nr]))354 subfeature_list = sensors_proc_chips[i].subfeature; 355 while (*nr < sensors_proc_chips[i].subfeature_count 356 && sensors_get_ignored(name, &subfeature_list[*nr])) 357 357 (*nr)++; 358 if (*nr == sensors_proc_chips[i]. feature_count)358 if (*nr == sensors_proc_chips[i].subfeature_count) 359 359 return NULL; 360 return & feature_list[(*nr)++];360 return &subfeature_list[(*nr)++]; 361 361 } 362 362 return NULL; 363 363 } 364 364 365 const sensors_ feature_data*365 const sensors_subfeature * 366 366 sensors_get_features(const sensors_chip_name *name, int *nr) 367 367 { 368 const sensors_ feature_data*feature;368 const sensors_subfeature *feature; 369 369 370 370 while ((feature = sensors_get_all_features(name, nr))) { … … 375 375 } 376 376 377 const sensors_ feature_data*377 const sensors_subfeature * 378 378 sensors_get_all_subfeatures(const sensors_chip_name *name, int feature, int *nr) 379 379 { 380 const sensors_ feature_data*subfeature;380 const sensors_subfeature *subfeature; 381 381 382 382 /* Seek directly to the first subfeature */ … … 400 400 double res1, res2; 401 401 int res; 402 const sensors_ feature_data*feature;402 const sensors_subfeature *feature; 403 403 404 404 if (expr->kind == sensors_kind_val) { … … 462 462 int i, j; 463 463 int err = 0, res; 464 const sensors_ feature_data*feature;464 const sensors_subfeature *feature; 465 465 int *feature_list = NULL; 466 466 int feature_count = 0;
