2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-05 08:45:26 +00:00
Commit Graph

44 Commits

Author SHA1 Message Date
Jean Delvare
eb5cf8b2ec Update my e-mail address and copyright years 2014-03-20 10:23:35 +00:00
Jean Delvare
a3f215218f Extend the documentation of sensors_init() and
sensors_get_adapter_name(). Paul Crawford asked questions about these
as he found the original documentation unclear. I'm including my
answers to his questions here, reformatted, so that other developers
can benefit from them too.
2013-09-11 11:56:08 +00:00
Jean Delvare
e369e65d42 Change libsensors license from GPL to LGPL.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5844 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-07-01 11:56:42 +00:00
Jean Delvare
78f496ca62 libsensors: New method to free the memory allocated for the internal
representation of chip names.
sensord, sensors: Fix a memory leak when one or more chip names are
provided on the command line.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5740 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-06-20 10:04:52 +00:00
Jean Delvare
cba60674e5 Document error-related functions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5654 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 20:47:33 +00:00
Jean Delvare
5d30872044 Document function sensors_snprintf_chip_name.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5653 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 20:46:13 +00:00
Jean Delvare
42beaab3fc Reorder description section to match synopsis order. Move structure
definitions to their own subsection.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5652 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 20:45:36 +00:00
Jean Delvare
fa3d63daeb Reformat description section.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5651 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 20:43:36 +00:00
Jean Delvare
e8ff9211ff Reformat synopsis section.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5650 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 20:42:43 +00:00
Jean Delvare
e4ee28d5c8 Read extra configuration files from /etc/sensors.d.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5647 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-15 17:22:38 +00:00
Jean Delvare
35a5a7dbce Use /etc/sensors3.conf as the default configuration file. If it can't
be found, fallback to /etc/sensors.conf. This allows for an old
libsensors and a new libsensors to be installed in parallel, and each
one has its own configuration file.

One important change here is that the default configuration file will
be installed as /etc/sensors3.conf by "make install".


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4990 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:59:05 +00:00
Jean Delvare
fb920578a9 Let libsensors know the default path to its configuration file.
That way, applications no longer have to care.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4985 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:48:18 +00:00
Jean Delvare
56e301c8b5 Document struct_feature.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4860 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 18:00:20 +00:00
Jean Delvare
e01466d993 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
2007-09-23 12:30:28 +00:00
Jean Delvare
da7b4e48da Introduce a separate type for main features. Make subfeatures map to
the real main feature rather than the first subfeature.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4838 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:16:50 +00:00
Jean Delvare
e13c11d353 Update the comments and symbols in the whole library code to refer to
features and subfeatures as appropriate.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4836 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:07:53 +00:00
Jean Delvare
96c914bfda 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
2007-09-23 12:05:16 +00:00
Jean Delvare
79086fb7b8 Rename struct sensors_feature_data to sensors_subfeature. This is a
first step towards a clean separation between main features and
subfeatures.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4832 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:02:22 +00:00
Jean Delvare
eba601a964 Split sensors_get_all_features() into two distinct functions, one to
get the list of all main features, and one to get the list of all the
subfeatures of a given main feature. This is a more logical interface for
applications to use. The current implementation is admittedly less than
optimal, because the storage structures weren't meant for it, but this
issue can (and will) be addressed later.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4831 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:00:59 +00:00
Jean Delvare
20c98f41b7 The compute mapping value is either SENSORS_NO_MAPPING or the same
feature number as the logical mapping. This means that the compute
mapping can be turned into a simple boolean flag. Doing so makes
struct sensors_feature_data smaller, which saves some memory (about
17 kB in my tests.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4758 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 08:17:22 +00:00
Jean Delvare
87efbc06c5 Rename sensors_feature_data.mode to flags, as we plan to use it to
store non-mode flags soon.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4757 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 08:13:15 +00:00
Jean Delvare
c00e21cf38 Reorder the members of the structures sensors_feature_data and
sensors_bus_id. This prevents wasting space with padding on 64-bit
systems, saving some memory (128 bytes for sensors_bus_id, nothing
yet for sensors_feature_data but it will come later).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4733 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-30 21:23:22 +00:00
Jean Delvare
a9a48ea2a9 Make sensors_match_chip internal to libsensors. It is no longer used by
applications in practice.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4702 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:51 +00:00
Jean Delvare
4d6bec8bb2 Add a parameter to sensors_get_detected_chips(), to optionally let the
caller select which subset of chips it wants. This is slightly better
size-wise than letting all applications do the filtering by themselves.

This will change the way the command line parameters of "sensors" are
interpreted. Beforehand, the chips were always returned in the order
in which they were listed by the library. Also, each chip could be listed
only once. From now on, the chips will be listed in the order in which
they are passed on the command line, which I think makes more sense. A
side effect is that chips can be listed more than once, if that's what
the user asks for. Not very useful though.

This change makes it possible to make sensors_match_chip() internal
to the library. Filtering the list of chips returned by
sensors_get_detected_chips() was the last known external use for this
function.

This patch looks much bigger than it really is, but the largest part is
really only code reindentation.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4701 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:20 +00:00
Jean Delvare
0c24a60643 Drop the CONFORMING TO sections from the man pages. lm-sensors is in no way
an official standard so it doesn't make much sense. Instead, use the 4th
field of .TH to mention that these tools are part of lm-sensors.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4699 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 08:14:48 +00:00
Jean Delvare
a30d37899f Drop SENSORS_MODE_NO_RW and SENSORS_MODE_RW. The mode is a bitfield,
we typically set, or test for, a specific bit.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4696 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:07:11 +00:00
Jean Delvare
b0fb417996 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
2007-08-22 17:06:13 +00:00
Jean Delvare
8bcdc331a0 Change the prototype of sensors_get_label(). Errors can be reported
with a NULL pointer.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4694 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:05:01 +00:00
Jean Delvare
12655c1d85 Drop support for reloading the configuration with sensors_init().
Instead, the application will have to call sensors_exit() explicitly
before calling sensors_init() again. Most applications don't offer
any way to reload the configuration file, so better optimize for the
initial load.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4693 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:04:12 +00:00
Jean Delvare
3bab00fff9 Change the libsensors API so that all structures are passed by
reference. This is more efficient that way.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4666 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:16:03 +00:00
Jean Delvare
1b51800541 Delete sensors_do_all_sets(). I couldn't find any application using it,
and sensors_do_chip_sets() can be used instead if really needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4648 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-09 08:43:40 +00:00
Jean Delvare
5fb9a1689f Don't export sensors_chip_name_has_wildcards(). I don't know of any
application using it, and I can't think of any use case for it outside
of libsensors. I'm not even sure if the inside calls are all legitimate.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4647 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-09 08:39:41 +00:00
Jean Delvare
6505fef0fd The way we build the feature lists guarantees that subfeatures always
immediately follow their main feature. This makes it possible to simplify
sensors_get_all_features() quite a bit. We no longer need to maintain
separate pointers for the last main feature and the last subfeature,
we can simply walk the list linearly.

Note that I am still not entirely happy with this API. It was obviously
designed for debugging purposes (sensors -u) and without performance
concernes nor interface cleanliness in mind. I believe that we want to
tag main features and subfeatures as such, and let the application ask
specifically for the list of main features, and for each feature, for
its list of subfeatures (i.e. two functions instead of one.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4643 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-24 08:19:59 +00:00
Jean Delvare
70317e1a0e The way we use sensors_feature_get_type() is rather suboptimal. It is
first called during the library initialization to generate the feature
tables. Then it is called again by sensors itself. This is because we
do not store the result the first time. I propose that we add a type
field to struct sensors_feature_data, where libsensors would store
the result of sensors_feature_get_type(). That way, the application
can get the information without calling sensors_feature_get_type()
again.

This change has the following benefits:
* Obviously, a small speed-up.
* sensors_feature_get_type() can be removed from the public interface.
  This means that we can turn it into something that fits the
  libsensors needs better, allowing for more optimizations (see next
  patches.)

Note: the patch looks bigger that it really is, because I had to move
definitions around in sensors.h.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4629 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-19 20:46:09 +00:00
Jean Delvare
7b8fdf0188 Advertise and document libsensors_version.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4602 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-10 19:55:06 +00:00
Jean Delvare
cc1700958b Fix the description of the mode field.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4525 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 12:30:58 +00:00
Jean Delvare
24f6b62c3f Delete all remnants of algorithm names.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4465 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 14:21:01 +00:00
Jean Delvare
6270cf381a libsensors: Drop support for algorithm names.
I2C algorithms no longer have names in Linux 2.6, and anyway they are
implementation details user-space doesn't care about. No third party
application is known to have ever used this particular feature of
libsensors. "sensord" and "sensors" no longer do.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4208 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-13 19:55:41 +00:00
Rudolf Marek
c9bd83748b Fix the homepage address
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4157 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-09-17 21:01:35 +00:00
Mark D. Studebaker
379a2143d3 add code authors to man pages
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2456 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-20 01:25:22 +00:00
Jean Delvare
5c8b8dd34b Fix bad include in example (Aurelien Jarno).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2378 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-20 18:41:50 +00:00
Jean Delvare
4277208906 Remove nasty comment. No, freeing memory is not "strictly
optional."


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2090 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-11-23 21:26:37 +00:00
Frodo Looijaard
24792039f6 Adrian's copyright patch applied
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@207 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-08 22:50:29 +00:00
Frodo Looijaard
73026248d4 Man-pages
I finally merged in Adrian's man-pages. libsensors.3 is unchanged from his
version; sensors.conf.5 is heavily edited, not because he did a bad job,
but because his source material was not very well written :-). It should
now tell you more about the config file than you ever wanted to know...


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@205 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-08 19:57:30 +00:00