root/lm-sensors/tags/V3-0-1/lib/error.h
| Revision 4899, 2.5 kB (checked in by khali, 1 year ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /* |
| 2 | error.h - Part of libsensors, a Linux library for reading sensor data. |
| 3 | Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> |
| 4 | Copyright (C) 2007 Jean Delvare <khali@linux-fr.org> |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 2 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program; if not, write to the Free Software |
| 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef LIB_SENSORS_ERROR_H |
| 22 | #define LIB_SENSORS_ERROR_H |
| 23 | |
| 24 | #define SENSORS_ERR_WILDCARDS 1 /* Wildcard found in chip name */ |
| 25 | #define SENSORS_ERR_NO_ENTRY 2 /* No such subfeature known */ |
| 26 | #define SENSORS_ERR_ACCESS_R 3 /* Can't read */ |
| 27 | #define SENSORS_ERR_KERNEL 4 /* Kernel interface error */ |
| 28 | #define SENSORS_ERR_DIV_ZERO 5 /* Divide by zero */ |
| 29 | #define SENSORS_ERR_CHIP_NAME 6 /* Can't parse chip name */ |
| 30 | #define SENSORS_ERR_BUS_NAME 7 /* Can't parse bus name */ |
| 31 | #define SENSORS_ERR_PARSE 8 /* General parse error */ |
| 32 | #define SENSORS_ERR_ACCESS_W 9 /* Can't write */ |
| 33 | #define SENSORS_ERR_IO 10 /* I/O error */ |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | extern "C" { |
| 37 | #endif /* __cplusplus */ |
| 38 | |
| 39 | |
| 40 | /* This function returns a pointer to a string which describes the error. |
| 41 | errnum may be negative (the corresponding positive error is returned). |
| 42 | You may not modify the result! */ |
| 43 | const char *sensors_strerror(int errnum); |
| 44 | |
| 45 | /* This function is called when a parse error is detected. Give it a new |
| 46 | value, and your own function is called instead of the default (which |
| 47 | prints to stderr). This function may terminate the program, but it |
| 48 | usually outputs an error and returns. */ |
| 49 | extern void (*sensors_parse_error) (const char *err, int lineno); |
| 50 | |
| 51 | /* This function is called when an immediately fatal error (like no |
| 52 | memory left) is detected. Give it a new value, and your own function |
| 53 | is called instead of the default (which prints to stderr and ends |
| 54 | the program). Never let it return! */ |
| 55 | extern void (*sensors_fatal_error) (const char *proc, const char *err); |
| 56 | |
| 57 | #ifdef __cplusplus |
| 58 | } |
| 59 | #endif /* __cplusplus */ |
| 60 | |
| 61 | #endif /* def LIB_SENSORS_ERROR_H */ |
Note: See TracBrowser for help on using the browser.
