sensors_get_value() and sensors_set_value(), respectively.

The new names better reflect what the functions do.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4695 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-08-22 17:06:13 +00:00
1 parent 8bcdc331a0
commit b0fb417996
6 files changed
+25 -25

No files matched your search

+6 -6
View File
@@ -216,8 +216,8 @@ static int sensors_get_ignored(const sensors_chip_name *name,
/* Read the value of a feature of a certain chip. Note that chip should not
contain wildcard values! This function will return 0 on success, and <0
on failure. */
int sensors_get_feature(const sensors_chip_name *name, int feature,
double *result)
int sensors_get_value(const sensors_chip_name *name, int feature,
double *result)
{
const sensors_chip_feature *main_feature;
const sensors_chip_feature *alt_feature;
@@ -261,8 +261,8 @@ int sensors_get_feature(const sensors_chip_name *name, int feature,
/* Set the value of a feature of a certain chip. Note that chip should not
contain wildcard values! This function will return 0 on success, and <0
on failure. */
int sensors_set_feature(const sensors_chip_name *name, int feature,
double value)
int sensors_set_value(const sensors_chip_name *name, int feature,
double value)
{
const sensors_chip_feature *main_feature;
const sensors_chip_feature *alt_feature;
@@ -377,7 +377,7 @@ int sensors_eval_expr(const sensors_chip_name *name,
if (!(feature = sensors_lookup_feature_name(name,
expr->data.var)))
return SENSORS_ERR_NO_ENTRY;
if (!(res = sensors_get_feature(name, feature->data.number, result)))
if (!(res = sensors_get_value(name, feature->data.number, result)))
return res;
return 0;
}
@@ -461,7 +461,7 @@ static int sensors_do_this_chip_sets(const sensors_chip_name *name)
err = res;
continue;
}
if ((res = sensors_set_feature(name, feature_nr, value))) {
if ((res = sensors_set_value(name, feature_nr, value))) {
sensors_parse_error("Failed to set feature",
chip->sets[i].lineno);
err = res;
+8 -8
View File
@@ -39,10 +39,10 @@ libsensors \- publicly accessible functions provided by the sensors library
\fBconst sensors_chip_name *chip2);\fP
.B const char *sensors_get_adapter_name(int bus_nr);
.B char *sensors_get_label(const sensors_chip_name *name, int feature);\fP
.B int sensors_get_feature(const sensors_chip_name *name, int feature,
\fBdouble *result);\fP
.B int sensors_set_feature(const sensors_chip_name *name, int feature,
\fBdouble value);\fP
.B int sensors_get_value(const sensors_chip_name *name, int feature,
\fBdouble *value);\fP
.B int sensors_set_value(const sensors_chip_name *name, int feature,
\fBdouble value);\fP
.B int sensors_do_chip_sets(const sensors_chip_name *name);
.B const sensors_chip_name *sensors_get_detected_chips(int *nr);
.B const sensors_feature_data *sensors_get_all_features
@@ -84,13 +84,13 @@ contain wildcard values! The returned string is newly allocated (free it
yourself). On failure, NULL is returned.
If no label exists for this feature, its name is returned itself.
\fBint sensors_get_feature(const sensors_chip_name *name,
int feature, double *result);\fP
\fBint sensors_get_value(const sensors_chip_name *name,
int feature, double *value);\fP
.br
Read the value of a feature of a certain chip. Note that chip should not contain wildcard values! This function will return 0 on success, and <0 on failure.
\fBint sensors_set_feature(const sensors_chip_name *name,
int feature, double value);\fP
\fBint sensors_set_value(const sensors_chip_name *name,
int feature, double value);\fP
.br
Set the value of a feature of a certain chip. Note that chip should not contain wildcard values! This function will return 0 on success, and <0 on failure.
+4 -4
View File
@@ -96,14 +96,14 @@ char *sensors_get_label(const sensors_chip_name *name, int feature);
/* Read the value of a feature of a certain chip. Note that chip should not
contain wildcard values! This function will return 0 on success, and <0
on failure. */
int sensors_get_feature(const sensors_chip_name *name, int feature,
double *result);
int sensors_get_value(const sensors_chip_name *name, int feature,
double *value);
/* Set the value of a feature of a certain chip. Note that chip should not
contain wildcard values! This function will return 0 on success, and <0
on failure. */
int sensors_set_feature(const sensors_chip_name *name, int feature,
double value);
int sensors_set_value(const sensors_chip_name *name, int feature,
double value);
/* Execute all set statements for this particular chip. The chip may contain
wildcards! This function will return 0 on success, and <0 on failure. */
+4 -4
View File
@@ -108,7 +108,7 @@ readUnknownChip
/* skip invalid */
} else if (!(sensor->mode & SENSORS_MODE_R)) {
sensorLog (LOG_INFO, "%s: %s", sensor->name, label);
} else if ((ret = sensors_get_feature (chip, sensor->number, &value))) {
} else if ((ret = sensors_get_value (chip, sensor->number, &value))) {
sensorLog (LOG_ERR, "Error getting sensor data: %s/%s: %s", chip->prefix, sensor->name, sensors_strerror (ret));
ret = 22;
} else {
@@ -133,7 +133,7 @@ doKnownChip
if (action == DO_READ)
ret = idChip (chip);
if (!ret && descriptor->alarmNumber) {
if ((ret = sensors_get_feature (chip, descriptor->alarmNumber, &tmp))) {
if ((ret = sensors_get_value (chip, descriptor->alarmNumber, &tmp))) {
sensorLog (LOG_ERR, "Error getting sensor data: %s/#%d: %s", chip->prefix, descriptor->alarmNumber, sensors_strerror (ret));
ret = 20;
} else {
@@ -141,7 +141,7 @@ doKnownChip
}
}
if (!ret && descriptor->beepNumber) {
if ((ret = sensors_get_feature (chip, descriptor->beepNumber, &tmp))) {
if ((ret = sensors_get_value (chip, descriptor->beepNumber, &tmp))) {
sensorLog (LOG_ERR, "Error getting sensor data: %s/#%d: %s", chip->prefix, descriptor->beepNumber, sensors_strerror (ret));
ret = 21;
} else {
@@ -168,7 +168,7 @@ doKnownChip
double values[MAX_DATA];
for (subindex = 0; !ret && (feature->dataNumbers[subindex] >= 0); ++ subindex) {
if ((ret = sensors_get_feature (chip, feature->dataNumbers[subindex], values + subindex))) {
if ((ret = sensors_get_value (chip, feature->dataNumbers[subindex], values + subindex))) {
sensorLog (LOG_ERR, "Error getting sensor data: %s/#%d: %s", chip->prefix, feature->dataNumbers[subindex], sensors_strerror (ret));
ret = 23;
}
+2 -2
View File
@@ -92,7 +92,7 @@ void print_vid_info(const sensors_chip_name *name, int f_vid, int label_size)
double vid;
if ((label = sensors_get_label(name, f_vid))
&& !sensors_get_feature(name, f_vid, &vid)) {
&& !sensors_get_value(name, f_vid, &vid)) {
print_label(label, label_size);
printf("%+6.3f V\n", vid);
}
@@ -113,7 +113,7 @@ void print_unknown_chip(const sensors_chip_name *name)
continue;
}
if (data->mode & SENSORS_MODE_R) {
if(sensors_get_feature(name, data->number, &val)) {
if (sensors_get_value(name, data->number, &val)) {
printf("ERROR: Can't get feature `%s' data!\n",data->name);
continue;
}
+1 -1
View File
@@ -30,7 +30,7 @@ static int get_feature_value(const sensors_chip_name *name,
const sensors_feature_data *feature,
double *val)
{
return sensors_get_feature(name, feature->number, val);
return sensors_get_value(name, feature->number, val);
}
static void sensors_get_available_features(const sensors_chip_name *name,