From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Misc API changes for libsensors4
Date: Fri, 17 Aug 2007 20:54:54 +0000 [thread overview]
Message-ID: <20070817225454.2e3bc43d@hyperion.delvare> (raw)
Hi all,
As libsensors4 won't be compatible with libsensors3 (thus the major
version number change) it's the right time for small adjustments to the
API, which we won't be allowed to do later. After reviewing the current
API, I have the following proposals, and I would like to know if there
are objections to me doing these changes.
* Drop support for reloading the configuration from sensors_init().
Instead, the application will have to call sensors_exit() explicitly
before calling sensors_init() again. Rationale: most applications don't
offer any way to reload the configuration file, so better optimize for
the initial load.
* Change the prototype of sensors_get_label() from
int sensors_get_label(const sensors_chip_name *name, int feature, char **result)
to
char *sensors_get_label(const sensors_chip_name *name, int feature)
Errors can be reported with a NULL pointer.
* Rename sensors_get_feature() and sensors_set_feature() to
sensors_get_value() and sensors_set_value(), respectively. Rationale:
the new names better reflect what the functions do.
* Change the prototype of sensors_get_detected_chips from
const sensors_chip_name *sensors_get_detected_chips(int *nr)
to
const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name *name, int *nr)
The application would pass a chip name possibly containing wildcards,
so sensors_get_detected_chips() could check for matches itself (using
sensors_match_chip). Passing an all-wildcard chip name (or NULL?) would
restore the old behavior. This makes it easier to let the user chose a
subset of chips to print (as can be done with sensors' command line) by
moving the code into the library. We may then be able to make
sensors_match_chip private, as this is the last use in sensors and
sensord.
* Drop SENSORS_MODE_NO_RW and SENSORS_MODE_RW. The mode is a bitfield,
we typically set, or test for, a specific bit. As a matter of fact,
these two symbols aren't used anywhere in libsensors, sensors, sensord,
ksensors nor xsensors.
If anyone has objections or comments, please let me know.
Thanks,
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2007-08-17 20:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 20:54 Jean Delvare [this message]
2007-08-17 21:17 ` [lm-sensors] Misc API changes for libsensors4 Hans de Goede
2007-08-21 9:40 ` Ivo Manca
2007-08-21 14:48 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070817225454.2e3bc43d@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.