root/lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3 @ 4693

Revision 4693, 6.1 KB (checked in by khali, 6 years ago)

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.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1.\" Copyright 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk>
2.\" based on sensors.h, part of libsensors by Frodo Looijaard
3.\" libsensors is distributed under the GPL
4.\"
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one
13.\"
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date.  The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein.  The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
24.\"
25.\" References consulted:
26.\"     libsensors source code
27.TH libsensors 3  "June 2007" "" "Linux Programmer's Manual"
28.SH NAME
29libsensors \- publicly accessible functions provided by the sensors library
30.SH SYNOPSIS
31.nf
32.B #include <sensors/sensors.h>
33
34.B int sensors_init(FILE *input);
35.B void sensors_cleanup(void);
36.B int sensors_parse_chip_name(const char *orig_name,
37                            \fBsensors_chip_name *res);\fP
38.B int sensors_match_chip(const sensors_chip_name *chip1,
39                       \fBconst sensors_chip_name *chip2);\fP
40.B const char *sensors_get_adapter_name(int bus_nr);
41.B int sensors_get_label(const sensors_chip_name *name, int feature,
42                      \fBchar **result);\fP
43.B int sensors_get_feature(const sensors_chip_name *name, int feature,
44                        \fBdouble *result);\fP
45.B int sensors_set_feature(const sensors_chip_name *name, int feature,
46                        \fBdouble value);\fP
47.B int sensors_do_chip_sets(const sensors_chip_name *name);
48.B const sensors_chip_name *sensors_get_detected_chips(int *nr);
49.B const sensors_feature_data *sensors_get_all_features
50             \fB(const sensors_chip_name *name, int *nr);\fP
51.B const char *libsensors_version;
52.fi
53.SH DESCRIPTION
54.B int sensors_init(FILE *input);
55.br
56Load the configuration file and the detected chips list. If this returns a
57value unequal to zero, you are in trouble; you can not assume anything will
58be initialized properly. If you want to reload the configuration file, call
59sensors_cleanup() below before calling sensors_init() again.
60
61.B void sensors_cleanup(void);
62.br
63Clean-up function: You can't access anything after this, until the next sensors_init() call!
64.br
65
66\fBint sensors_parse_chip_name(const char *orig_name,
67                            sensors_chip_name *res);\fP
68.br
69Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
70
71\fBint sensors_match_chip(const sensors_chip_name *chip1,
72                       const sensors_chip_name *chip2);\fP
73.br
74Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match.
75
76.B const char *sensors_get_adapter_name(int bus_nr);
77.br
78This function returns the adapter name of a bus number, as used within the
79sensors_chip_name structure. If it could not be found, it returns NULL.
80
81\fBint sensors_get_label(const sensors_chip_name *name, int feature,
82                      char **result);\fP
83.br
84Look up the label which belongs to this chip. Note that chip should not contain wildcard values! *result is newly allocated (free it yourself). This function will return 0 on success, and <0 on failure.
85
86\fBint sensors_get_feature(const sensors_chip_name *name,
87                        int feature, double *result);\fP
88.br
89Read 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.
90
91\fBint sensors_set_feature(const sensors_chip_name *name,
92                        int feature, double value);\fP
93.br
94Set 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.
95
96.B int sensors_do_chip_sets(const sensors_chip_name *name);
97.br
98Execute all set statements for this particular chip. The chip may contain wildcards!  This function will return 0 on success, and <0 on failure.
99
100\fBconst sensors_chip_name *sensors_get_detected_chips
101                        (int *nr);\fP
102.br
103This function returns all detected chips, one by one. To start at the beginning of the list, use 0 for nr; NULL is returned if we are at the end of the list. Do not try to change these chip names, as they point to internal structures! Do not use nr for anything else.
104
105This structure is used when you want to get all features of a specific chip.
106.br
107\fBtypedef struct sensors_feature_data {
108.br
109  int number;
110.br
111  const char *name;
112.br
113  sensors_feature_type type;
114.br
115  int mapping;
116.br
117  int compute_mapping;
118.br
119  int mode;
120.br
121} sensors_feature_data;\fP
122.br
123The mode field can be one of:
124.br
125SENSORS_MODE_NO_RW, SENSORS_MODE_R, SENSORS_MODE_W or SENSORS_MODE_RW.
126
127\fBconst sensors_feature_data *sensors_get_all_features
128      (const sensors_chip_name *name, int *nr);\fP
129.br
130This returns all features of a specific chip. They are returned in bunches:
131everything with the same mapping is returned just after each other, with
132the master feature in front (that feature does not map to itself, but
133has SENSORS_NO_MAPPING as mapping field). nr is an internally used variable.
134Set it to zero to start again at the begin of the list. If no more features
135are found NULL is returned. Do not try to change the returned structure; you
136will corrupt internal data structures.
137
138\fBconst char *libsensors_version;\fP
139.br
140A string representing the version of libsensors.
141
142
143.SH "CONFORMING TO"
144lm_sensors-2.x
145.SH SEE ALSO
146sensors.conf(5)
147
148.SH AUTHOR
149Frodo Looijaard and the lm_sensors group
150http://www.lm-sensors.org/
151
Note: See TracBrowser for help on using the browser.