libg722_1 0.1.0
lt_error.h
1/* lt_error.h -- error propagation interface
2
3 Copyright (C) 1999-2001, 2004, 2007, 2011-2019, 2021-2024 Free
4 Software Foundation, Inc.
5 Written by Thomas Tanner, 1999
6
7 NOTE: The canonical source of this file is maintained with the
8 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
9
10GNU Libltdl is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2 of the License, or (at your option) any later version.
14
15As a special exception to the GNU Lesser General Public License,
16if you distribute this file as part of a program or library that
17is built using GNU Libtool, you may include this file under the
18same distribution terms that you use for the rest of that program.
19
20GNU Libltdl is distributed in the hope that it will be useful,
21but WITHOUT ANY WARRANTY; without even the implied warranty of
22MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23GNU Lesser General Public License for more details.
24
25You should have received a copy of the GNU Lesser General Public
26License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
27*/
28
29/* Only include this header file once. */
30#if !defined LT_ERROR_H
31#define LT_ERROR_H 1
32
33#include <libltdl/lt_system.h>
34
35LT_BEGIN_C_DECLS
36
37/* Defining error strings alongside their symbolic names in a macro in
38 this way allows us to expand the macro in different contexts with
39 confidence that the enumeration of symbolic names will map correctly
40 onto the table of error strings. \0 is appended to the strings to
41 explicitly initialize the string terminator. */
42#define lt_dlerror_table \
43 LT_ERROR(UNKNOWN, "unknown error\0") \
44 LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \
45 LT_ERROR(INVALID_LOADER, "invalid loader\0") \
46 LT_ERROR(INIT_LOADER, "loader initialization failed\0") \
47 LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \
48 LT_ERROR(FILE_NOT_FOUND, "file not found\0") \
49 LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \
50 LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \
51 LT_ERROR(CANNOT_OPEN, "can't open the module\0") \
52 LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \
53 LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \
54 LT_ERROR(NO_MEMORY, "not enough memory\0") \
55 LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \
56 LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \
57 LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \
58 LT_ERROR(SHUTDOWN, "library already shutdown\0") \
59 LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \
60 LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\
61 LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\
62 LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0")
63
64/* Enumerate the symbolic error names. */
65enum {
66#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
67 lt_dlerror_table
68#undef LT_ERROR
69
70 LT_ERROR_MAX
71};
72
73/* Should be max of the error string lengths above (plus one for C++) */
74#define LT_ERROR_LEN_MAX (41)
75
76/* These functions are only useful from inside custom module loaders. */
77LT_SCOPE int lt_dladderror (const char *diagnostic);
78LT_SCOPE int lt_dlseterror (int errorcode);
79
80
81LT_END_C_DECLS
82
83#endif /*!defined LT_ERROR_H*/