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

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

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.

  • 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(sensors_chip_name chip1,
39                       \fBsensors_chip_name chip2);\fP
40.B const char *sensors_get_adapter_name(int bus_nr);
41.B int sensors_get_label(sensors_chip_name name, int feature,
42                      \fBchar **result);\fP
43.B int sensors_get_feature(sensors_chip_name name, int feature,
44                        \fBdouble *result);\fP
45.B int sensors_set_feature(sensors_chip_name name, int feature,
46                        \fBdouble value);\fP
47.B int sensors_do_chip_sets(sensors_chip_name name);
48.B extern int sensors_do_all_sets(void);
49.B const sensors_chip_name *sensors_get_detected_chips(int *nr);
50.B const sensors_feature_data *sensors_get_all_features
51             \fB(sensors_chip_name name, int *nr);\fP
52.B const char *libsensors_version;
53.fi
54.SH DESCRIPTION
55.B int sensors_init(FILE *input);
56.br
57(Re)load the configuration file and the detected chips list. If this returns a value unequal to zero, you are in trouble; you can not assume anything will be initialized properly.
58
59.B void sensors_cleanup(void);
60.br
61Clean-up function: You can't access anything after this, until the next sensors_init() call!
62.br
63
64\fBint sensors_parse_chip_name(const char *orig_name,
65                            sensors_chip_name *res);\fP
66.br
67Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
68
69\fBint sensors_match_chip(sensors_chip_name chip1,
70                       sensors_chip_name chip2);\fP
71.br
72Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match.
73
74.B const char *sensors_get_adapter_name(int bus_nr);
75.br
76This function returns the adapter name of a bus number, as used within the
77sensors_chip_name structure. If it could not be found, it returns NULL.
78
79\fBint sensors_get_label(sensors_chip_name name, int feature,
80                      char **result);\fP
81.br
82Look 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.
83
84\fBint sensors_get_feature(sensors_chip_name name,
85                        int feature, double *result);\fP
86.br
87Read 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.
88
89\fBint sensors_set_feature(sensors_chip_name name,
90                        int feature, double value);\fP
91.br
92Set 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.
93
94.B int sensors_do_chip_sets(sensors_chip_name name);
95.br
96Execute all set statements for this particular chip. The chip may contain wildcards!  This function will return 0 on success, and <0 on failure.
97
98.B int sensors_do_all_sets(void);
99.br
100Execute all set statements for all detected chips. This is the same as calling sensors_do_chip_sets with an all wildcards chip name
101
102\fBconst sensors_chip_name *sensors_get_detected_chips
103                        (int *nr);\fP
104.br
105This 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.
106
107This structure is used when you want to get all features of a specific chip.
108.br
109\fBtypedef struct sensors_feature_data {
110.br
111  int number;
112.br
113  const char *name;
114.br
115  sensors_feature_type type;
116.br
117  int mapping;
118.br
119  int compute_mapping;
120.br
121  int mode;
122.br
123} sensors_feature_data;\fP
124.br
125The mode field can be one of:
126.br
127SENSORS_MODE_NO_RW, SENSORS_MODE_R, SENSORS_MODE_W or SENSORS_MODE_RW.
128
129\fBconst sensors_feature_data *sensors_get_all_features
130      (sensors_chip_name name, int *nr);\fP
131.br
132This returns all features of a specific chip. They are returned in bunches:
133everything with the same mapping is returned just after each other, with
134the master feature in front (that feature does not map to itself, but
135has SENSORS_NO_MAPPING as mapping field). nr is an internally used variable.
136Set it to zero to start again at the begin of the list. If no more features
137are found NULL is returned. Do not try to change the returned structure; you
138will corrupt internal data structures.
139
140\fBconst char *libsensors_version;\fP
141.br
142A string representing the version of libsensors.
143
144
145.SH "CONFORMING TO"
146lm_sensors-2.x
147.SH SEE ALSO
148sensors.conf(5)
149
150.SH AUTHOR
151Frodo Looijaard and the lm_sensors group
152http://www.lm-sensors.org/
153
Note: See TracBrowser for help on using the browser.