| | 161 | |
| | 162 | .B sensors_strerror() |
| | 163 | returns a pointer to a string which describes the error. |
| | 164 | errnum may be negative (the corresponding positive error is returned). |
| | 165 | You may not modify the result! |
| | 166 | |
| | 167 | .B sensors_parse_error() |
| | 168 | and |
| | 169 | .B sensors_parse_error_wfn() |
| | 170 | are functions which are called when a parse error is detected. Give them |
| | 171 | new values, and your own functions are called instead of the default (which |
| | 172 | print to stderr). These functions may terminate the program, but they |
| | 173 | usually output an error and return. The first function is the original |
| | 174 | one, the second one was added later when support for multiple |
| | 175 | configuration files was added. |
| | 176 | The library code now only calls the second function. However, for |
| | 177 | backwards compatibility, if an application provides a custom handling |
| | 178 | function for the first function but not the second, then all parse |
| | 179 | errors will be reported using the first function (that is, the filename |
| | 180 | is never reported.) |
| | 181 | Note that filename can be NULL (if filename isn't known) and lineno |
| | 182 | can be 0 (if the error occurs before the actual parsing starts.) |
| | 183 | |
| | 184 | .B sensors_fatal_error() |
| | 185 | Is a function which is called when an immediately fatal error (like no |
| | 186 | memory left) is detected. Give it a new value, and your own function |
| | 187 | is called instead of the default (which prints to stderr and ends |
| | 188 | the program). Never let it return! |