1998-12-19 00:10:48 +00:00
|
|
|
/*
|
|
|
|
error.h - Part of libsensors, a Linux library for reading sensor data.
|
1999-02-08 22:50:29 +00:00
|
|
|
Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
|
1998-12-19 00:10:48 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIB_SENSORS_ERROR_H
|
|
|
|
#define LIB_SENSORS_ERROR_H
|
|
|
|
|
|
|
|
#define SENSORS_ERR_WILDCARDS 1 /* Wildcard found in chip name */
|
|
|
|
#define SENSORS_ERR_NO_ENTRY 2 /* No such feature known */
|
|
|
|
#define SENSORS_ERR_ACCESS 3 /* Can't read or write */
|
|
|
|
#define SENSORS_ERR_PROC 4 /* Can't access /proc file */
|
|
|
|
#define SENSORS_ERR_DIV_ZERO 5 /* Divide by zero */
|
|
|
|
#define SENSORS_ERR_CHIP_NAME 6 /* Can't parse chip name */
|
|
|
|
#define SENSORS_ERR_BUS_NAME 7 /* Can't parse bus name */
|
1998-12-20 21:57:39 +00:00
|
|
|
#define SENSORS_ERR_PARSE 8 /* General parse error */
|
2003-08-25 00:28:26 +00:00
|
|
|
#define SENSORS_ERR_ACCESS_W 9 /* Can't write */
|
|
|
|
#define SENSORS_ERR_ACCESS_R 10 /* Can't read */
|
1998-12-19 00:10:48 +00:00
|
|
|
|
2000-02-02 20:19:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
1998-12-19 00:10:48 +00:00
|
|
|
/* This function returns a pointer to a string which describes the error.
|
|
|
|
errnum may be negative (the corresponding positive error is returned).
|
|
|
|
You may not modify the result! */
|
1998-12-20 21:57:39 +00:00
|
|
|
extern const char *sensors_strerror(int errnum);
|
1998-12-19 00:10:48 +00:00
|
|
|
|
|
|
|
/* This function is called when a parse error is detected. Give it a new
|
|
|
|
value, and your own function is called instead of the default (which
|
1998-12-22 01:25:25 +00:00
|
|
|
prints to stderr). This function may terminate the program, but it
|
|
|
|
usually outputs an error and returns. */
|
1998-12-19 00:10:48 +00:00
|
|
|
extern void (*sensors_parse_error) (const char *err, int lineno);
|
|
|
|
|
|
|
|
/* This function is called when an immediately fatal error (like no
|
|
|
|
memory left) is detected. Give it a new value, and your own function
|
|
|
|
is called instead of the default (which prints to stderr and ends
|
1998-12-25 21:51:59 +00:00
|
|
|
the program). Never let it return! */
|
1998-12-19 00:10:48 +00:00
|
|
|
extern void (*sensors_fatal_error) (const char *proc, const char *err);
|
|
|
|
|
2000-02-02 20:19:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
1998-12-19 00:10:48 +00:00
|
|
|
|
|
|
|
#endif /* def LIB_SENSORS_ERROR_H */
|