File: config_errors.h

package info (click to toggle)
libt3config 0.2.11-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 524 kB
  • sloc: ansic: 3,753; sh: 828; xml: 172; lex: 87; makefile: 56
file content (69 lines) | stat: -rw-r--r-- 2,442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* Copyright (C) 2011 G.P. Halkes
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 3, as
   published by the Free Software Foundation.

   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, see <http://www.gnu.org/licenses/>.
*/
#ifndef T3_CONFIG_ERRORS_H
#define T3_CONFIG_ERRORS_H

#include "config_api.h"

/** @file */
/** @addtogroup t3config_other */
/** @{ */

/** @name Error codes (T3 generic) */
/*@{*/
#ifndef T3_ERR_SUCCESS
/** Error code: success */
#define T3_ERR_SUCCESS 0
/** Error code: see @c errno. */
/* Use large negative value, such that we don't have to number each and
   every value. */
#define T3_ERR_ERRNO (-128)
/** Error code: end of file reached. */
#define T3_ERR_EOF (-127)
/** Error code: unkown error. */
#define T3_ERR_UNKNOWN (-126)
/** Error code: bad argument. */
#define T3_ERR_BAD_ARG (-125)
/** Error code: out of memory. */
#define T3_ERR_OUT_OF_MEMORY (-124)
/** Error code: no information found for the terminal in the terminfo database. */
#define T3_ERR_TERMINFODB_NOT_FOUND (-123)
/** Error code: the file descriptor is a hard-copy terminal. */
#define T3_ERR_HARDCOPY_TERMINAL (-122)
/** Error code: terminal provides too limited possibilities for the library to function. */
#define T3_ERR_TERMINAL_TOO_LIMITED (-121)
/** Error code: no terminal given and @c TERM environment variable not set. */
#define T3_ERR_NO_TERM (-120)
/** Error code: internal error in the library. */
#define T3_ERR_INTERNAL (-119)
/** Warning code: the smallest value returned as warning. */
#define T3_WARN_MIN (-16)
#endif
/*@}*/

/* Each extension of the list of common errors should be done with an ifdef
   such that when several different versions of the config error header are
   included each symbol will be defined and only defined once. */

/** @} */

/** @internal
	@brief strerror routine for generic errors.

	Should only be called from the library's strerror function for all errors
	that are not defined specifically by the library itself.
*/
T3_CONFIG_LOCAL const char *t3_config_strerror_base(int error);

#endif