Define a separate structure to represent main features. This allows

for faster main features lookup. One side effect of this change is
that subfeatures can no longer have labels nor be ignored. I do not
think that this is a problem in practice, and actually this makes a
lot of sense.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4834 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-09-23 12:05:16 +00:00
1 parent bfe337fe76
commit 96c914bfda
11 files changed
+160 -126

No files matched your search

+7 -9
View File
@@ -36,7 +36,7 @@ libsensors \- publicly accessible functions provided by the sensors library
.B int sensors_parse_chip_name(const char *orig_name,
\fBsensors_chip_name *res);\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 char *sensors_get_label(const sensors_chip_name *name, const sensors_feature *feature);\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,
@@ -44,10 +44,8 @@ libsensors \- publicly accessible functions provided by the sensors library
.B int sensors_do_chip_sets(const sensors_chip_name *name);
.B const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
\fB*match, int *nr);\fP
.B const sensors_feature_data *sensors_get_features
\fB(const sensors_chip_name *name, int *nr);\fP
.B const sensors_feature_data *sensors_get_all_subfeatures
\fB(const sensors_chip_name *name, int feature, int *nr);\fP
.B const sensors_feature *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
.B const sensors_subfeature *sensors_get_all_subfeatures(const sensors_chip_name *name, const sensors_feature *feature, int *nr);\fP
.B const char *libsensors_version;
.fi
.SH DESCRIPTION
@@ -73,7 +71,7 @@ Parse a chip name to the internal representation. Return 0 on succes, <0 on erro
This function returns the adapter name of a bus number, as used within the
sensors_chip_name structure. If it could not be found, it returns NULL.
\fBchar *sensors_get_label(const sensors_chip_name *name, int feature);\fP
\fBchar *sensors_get_label(const sensors_chip_name *name, const sensors_feature *feature);\fP
.br
Look up the label which belongs to this chip. Note that chip should not
contain wildcard values! The returned string is newly allocated (free it
@@ -124,7 +122,7 @@ The flags field is a bitfield, its value is a combination of
SENSORS_MODE_R (readable), SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING
(affected by the computation rules of the main feature).
\fBconst sensors_feature_data *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
\fBconst sensors_feature *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
.br
This returns all main features of a specific chip. nr is an internally
used variable. Set it to zero to start at the begin of the list. If no
@@ -132,12 +130,12 @@ more features are found NULL is returned.
Do not try to change the returned structure; you will corrupt internal
data structures.
\fBconst sensors_feature_data *sensors_get_all_subfeatures(const sensors_chip_name *name, int feature, int *nr);\fP
\fBconst sensors_subfeature *sensors_get_all_subfeatures(const sensors_chip_name *name, const sensors_feature *feature, int *nr);\fP
.br
This returns all subfeatures of a given main feature (including that
main feature itself, in first position.) nr is an internally used
variable. Set it to zero to start at the begin of the list. If no more
features are found NULL is returned.
subfeatures are found NULL is returned.
Do not try to change the returned structure; you will corrupt internal
data structures.