Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_error.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_RW_ERROR_H_INCLUDED
33#define _RWSTD_RW_ERROR_H_INCLUDED
34
35#ifndef _RWSTD_NO_INCLUDES
36 // prevent inclusion if compiling a .rc file with MSVC
37
38# ifndef _RWSTD_RW_DEFS_H_INCLUDED
39# include <rw/_defs.h>
40# endif // _RWSTD_RW_DEFS_H_INCLUDED
41
42
44
45// throws an exception identified by first argument, optional arguments
46// (if any) used to format the exception object's what() string
47_RWSTD_EXPORT void __rw_throw (int, ...);
48
49// frees memory buffer used for what() message
50_RWSTD_EXPORT void __rw_free_what_buf (char*);
51
52// throws an exception identified by first argument with the second
53// argument containing the exception object's what() string, which
54// if non-0, is must be freed using __rw_free_what_buf()
55// may be assigned to a user-defined handler (e.g., to prevent
56// the library from throwing exceptions or to implement logging)
57_RWSTD_EXPORT extern void (*__rw_throw_proc)(int, char*);
58
59} // namespace __rw
60
61#endif
62
63#ifndef _RWSTD_ERROR_CATALOG
64 // name of catalog optionally followed by a colon and a set number
65 // catalog looked up according to rules of catopen(3)
66 // may be customized at lib build time (pathname okay)
67# define _RWSTD_ERROR_CATALOG "rwstderr:1"
68#endif // _RWSTD_ERROR_CATALOG
69
70#ifndef _RWSTD_ERROR_ENVVAR
71 // environment variable name - overrides _RWSTD_ERROR_CATALOG
72 // may be customized at lib build time
73# define _RWSTD_ERROR_ENVVAR "RWSTDERR"
74#endif // _RWSTD_ERROR_ENVVAR
75
76#ifndef _RWSTD_ERROR_FIRST
77 // id of first message - 1, may be customized at lib build time
78# define _RWSTD_ERROR_FIRST 0
79#endif // _RWSTD_ERROR_FIRST
80
81
82// these must be macros to accomodate MSVC's resource compiler, with values
83// expected to be consecutive starting with _RWSTD_ERROR_FIRST + 1
84
85// # define _RWSTD_ERROR_EXCEPTION (_RWSTD_ERROR_FIRST + 1)
86// # define _RWSTD_ERROR_BAD_EXCEPTION (_RWSTD_ERROR_FIRST + 2)
87// # define _RWSTD_ERROR_BAD_ALLOC (_RWSTD_ERROR_FIRST + 3)
88# define _RWSTD_ERROR_BAD_CAST (_RWSTD_ERROR_FIRST + 4)
89# define _RWSTD_ERROR_LOGIC_ERROR (_RWSTD_ERROR_FIRST + 5)
90# define _RWSTD_ERROR_DOMAIN_ERROR (_RWSTD_ERROR_FIRST + 6)
91# define _RWSTD_ERROR_INVALID_ARGUMENT (_RWSTD_ERROR_FIRST + 7)
92# define _RWSTD_ERROR_LENGTH_ERROR (_RWSTD_ERROR_FIRST + 8)
93# define _RWSTD_ERROR_OUT_OF_RANGE (_RWSTD_ERROR_FIRST + 9)
94# define _RWSTD_ERROR_RUNTIME_ERROR (_RWSTD_ERROR_FIRST + 10)
95# define _RWSTD_ERROR_RANGE_ERROR (_RWSTD_ERROR_FIRST + 11)
96# define _RWSTD_ERROR_OVERFLOW_ERROR (_RWSTD_ERROR_FIRST + 12)
97# define _RWSTD_ERROR_UNDERFLOW_ERROR (_RWSTD_ERROR_FIRST + 13)
98
99# define _RWSTD_ERROR_FAILBIT_SET (_RWSTD_ERROR_FIRST + 14)
100# define _RWSTD_ERROR_BADBIT_SET (_RWSTD_ERROR_FIRST + 15)
101# define _RWSTD_ERROR_EOFBIT_SET (_RWSTD_ERROR_FIRST + 16)
102# define _RWSTD_ERROR_IOSTATE_BIT_SET (_RWSTD_ERROR_FIRST + 17)
103
104# define _RWSTD_ERROR_FACET_NOT_FOUND (_RWSTD_ERROR_FIRST + 18)
105# define _RWSTD_ERROR_LOCALE_BAD_NAME (_RWSTD_ERROR_FIRST + 19)
106# define _RWSTD_ERROR_LOCALE_ERROR_NAME (_RWSTD_ERROR_FIRST + 20)
107# define _RWSTD_ERROR_CODECVT (_RWSTD_ERROR_FIRST + 21)
108
109# define _RWSTD_ERROR_BAD_POINTER (_RWSTD_ERROR_FIRST + 22)
110# define _RWSTD_ERROR_TRANSFORM (_RWSTD_ERROR_FIRST + 23)
111# define _RWSTD_ERROR_LOCALE_BAD_CAT (_RWSTD_ERROR_FIRST + 24)
112
113# define _RWSTD_ERROR_STRINGS \
114 "%s: %s: unspecified error", \
115 "%s: %s: exception", \
116 "%s: %s: unexpected exception", \
117 "%s: %s: bad_alloc: out of memory", \
118 "%s: %s: bad cast", \
119 "%s: %s: logic error", \
120 "%s: %s: domain error", \
121 "%s: %s: invalid argument", \
122 "%s: %s: length error: size %u out of range [0, %u)", \
123 "%s: %s: argument value %u out of range [0, %u)", \
124 "%s: %s: runtime error", \
125 "%s: %s: range error: invalid range [%d, %d)", \
126 "%s: %s: overflow error", \
127 "%s: %s: underflow error", \
128 /* the following take a single arg because */ \
129 /* they are generated in a .cpp file */ \
130 "%s: stream object has set ios::failbit", \
131 "%s: stream object has set ios::badbit", \
132 "%s: stream object has set ios::eofbit", \
133 "%s: stream object has set %s", \
134 "%s: %s: facet %u not found in locale (\"%s\")", \
135 "%s: %s: bad locale name: \"%s\"", \
136 "%s: %s: failed to construct locale name", \
137 "%s: %s: conversion failed", \
138 "%s: %s: invalid pointer %p", \
139 "%s: %s: transformation failed", \
140 "%s: %s: bad category value: %#x"
141
142#define _RWSTD_ERROR_EXCEPTION "exception"
143#define _RWSTD_ERROR_BAD_EXCEPTION "unexpected exception"
144#define _RWSTD_ERROR_BAD_ALLOC "bad_alloc: out of memory"
145
146
147#endif // _RWSTD_RW_ERROR_H_INCLUDED
#define _RWSTD_EXPORT
Definition _defs.h:485
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567