Changeset 4629
- Timestamp:
- 07/19/07 22:46:09 (1 year ago)
- Files:
-
- lm-sensors/branches/lm-sensors-3.0.0/lib/access.h (modified) (1 diff)
- lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3 (modified) (1 diff)
- lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h (modified) (2 diffs)
- lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c (modified) (1 diff)
- lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips_generic.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/branches/lm-sensors-3.0.0/lib/access.h
r4545 r4629 30 30 int feature); 31 31 32 sensors_feature_type sensors_feature_get_type(const sensors_feature_data *feature); 33 32 34 #endif /* def LIB_SENSORS_ACCESS_H */ lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3
r4602 r4629 119 119 const char *name; 120 120 .br 121 sensors_feature_type type; 122 .br 121 123 int mapping; 122 124 .br 123 int unused;125 int compute_mapping; 124 126 .br 125 127 int mode; lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h
r4602 r4629 126 126 #define SENSORS_NO_MAPPING -1 127 127 128 /* This structure is used when you want to get all features of a specific129 chip. */130 typedef struct sensors_feature_data {131 int number;132 char *name;133 int mapping;134 int compute_mapping;135 int mode;136 } sensors_feature_data;137 138 /* This returns all features of a specific chip. They are returned in139 bunches: everything with the same mapping is returned just after each140 other, with the master feature in front (that feature does not map to141 itself, but has SENSORS_NO_MAPPING as mapping field). nr1 and nr2 are142 two internally used variables. Set both to zero to start again at the143 begin of the list. If no more features are found NULL is returned.144 Do not try to change the returned structure; you will corrupt internal145 data structures. */146 extern const sensors_feature_data *sensors_get_all_features147 (sensors_chip_name name, int *nr1,int *nr2);148 149 128 /* This enum contains some "magic" used by sensors_read_dynamic_chip() from 150 129 lib/sysfs.c. All the sensor types (in, fan, temp, vid) are a multiple of … … 187 166 } sensors_feature_type; 188 167 189 sensors_feature_type sensors_feature_get_type 190 (const sensors_feature_data *feature); 168 /* This structure is used when you want to get all features of a specific 169 chip. */ 170 typedef struct sensors_feature_data { 171 int number; 172 char *name; 173 sensors_feature_type type; 174 int mapping; 175 int compute_mapping; 176 int mode; 177 } sensors_feature_data; 178 179 /* This returns all features of a specific chip. They are returned in 180 bunches: everything with the same mapping is returned just after each 181 other, with the master feature in front (that feature does not map to 182 itself, but has SENSORS_NO_MAPPING as mapping field). nr1 and nr2 are 183 two internally used variables. Set both to zero to start again at the 184 begin of the list. If no more features are found NULL is returned. 185 Do not try to change the returned structure; you will corrupt internal 186 data structures. */ 187 extern const sensors_feature_data *sensors_get_all_features 188 (sensors_chip_name name, int *nr1,int *nr2); 191 189 192 190 #ifdef __cplusplus lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
r4616 r4629 149 149 /* fill in the other feature members */ 150 150 feature.data.number = i + 1; 151 feature.data.type = type; 151 152 152 153 if ((type & 0x00FF) == 0) { lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips_generic.c
r4598 r4629 47 47 iter->mapping != SENSORS_NO_MAPPING && 48 48 iter->mapping == feature->number) { 49 sensors_feature_type type = sensors_feature_get_type(iter);50 49 int indx; 51 50 52 if (type == SENSORS_FEATURE_UNKNOWN) 53 continue; 54 55 indx = type - first_val - 1; 51 indx = iter->type - first_val - 1; 56 52 if (indx < 0 || indx >= size) { 57 53 printf("ERROR: Bug in sensors: index out of bound"); … … 346 342 continue; 347 343 348 switch (sensors_feature_get_type(feature)) {344 switch (feature->type) { 349 345 case SENSORS_FEATURE_TEMP: 350 346 print_generic_chip_temp(name, feature, i, j, label_size); break;
