From e01466d9931624f6b34e1e2ef9efab1e82e60030 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 23 Sep 2007 12:30:28 +0000 Subject: New public library function: sensors_get_subfeature(). Applications can use it to retrieve a specific subfeature by type. While it is slighly less efficient than looping over sensors_get_all_subfeatures(), it often makes the application code much more elegant. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4846 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/sensors.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/sensors.h') diff --git a/lib/sensors.h b/lib/sensors.h index e6fc8414..1cae70f3 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -221,6 +221,15 @@ const sensors_subfeature * sensors_get_all_subfeatures(const sensors_chip_name *name, const sensors_feature *feature, int *nr); +/* This returns the subfeature of the given type for a given main feature, + if it exists, NULL otherwise. + Do not try to change the returned structure; you will corrupt internal + data structures. */ +const sensors_subfeature * +sensors_get_subfeature(const sensors_chip_name *name, + const sensors_feature *feature, + sensors_subfeature_type type); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.1