libg722_1  0.0.1
lt_error.h
00001 /* lt_error.h -- error propogation interface
00002 
00003    Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
00004    Written by Thomas Tanner, 1999
00005 
00006    NOTE: The canonical source of this file is maintained with the
00007    GNU Libtool package.  Report bugs to bug-libtool@gnu.org.
00008 
00009 GNU Libltdl is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU Lesser General Public
00011 License as published by the Free Software Foundation; either
00012 version 2 of the License, or (at your option) any later version.
00013 
00014 As a special exception to the GNU Lesser General Public License,
00015 if you distribute this file as part of a program or library that
00016 is built using GNU Libtool, you may include this file under the
00017 same distribution terms that you use for the rest of that program.
00018 
00019 GNU Libltdl is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 GNU Lesser General Public License for more details.
00023 
00024 You should have received a copy of the GNU Lesser General Public
00025 License along with GNU Libltdl; see the file COPYING.LIB.  If not, a
00026 copy can be downloaded from  http://www.gnu.org/licenses/lgpl.html,
00027 or obtained by writing to the Free Software Foundation, Inc.,
00028 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00029 */
00030 
00031 /* Only include this header file once. */
00032 #if !defined(LT_ERROR_H)
00033 #define LT_ERROR_H 1
00034 
00035 #include <libltdl/lt_system.h>
00036 
00037 LT_BEGIN_C_DECLS
00038 
00039 /* Defining error strings alongside their symbolic names in a macro in
00040    this way allows us to expand the macro in different contexts with
00041    confidence that the enumeration of symbolic names will map correctly
00042    onto the table of error strings.  \0 is appended to the strings to
00043    expilicitely initialize the string terminator. */
00044 #define lt_dlerror_table                                                \
00045     LT_ERROR(UNKNOWN,               "unknown error\0")                  \
00046     LT_ERROR(DLOPEN_NOT_SUPPORTED,  "dlopen support not available\0")   \
00047     LT_ERROR(INVALID_LOADER,        "invalid loader\0")                 \
00048     LT_ERROR(INIT_LOADER,           "loader initialization failed\0")   \
00049     LT_ERROR(REMOVE_LOADER,         "loader removal failed\0")          \
00050     LT_ERROR(FILE_NOT_FOUND,        "file not found\0")                 \
00051     LT_ERROR(DEPLIB_NOT_FOUND,      "dependency library not found\0")   \
00052     LT_ERROR(NO_SYMBOLS,            "no symbols defined\0")             \
00053     LT_ERROR(CANNOT_OPEN,           "can't open the module\0")          \
00054     LT_ERROR(CANNOT_CLOSE,          "can't close the module\0")         \
00055     LT_ERROR(SYMBOL_NOT_FOUND,      "symbol not found\0")               \
00056     LT_ERROR(NO_MEMORY,             "not enough memory\0")              \
00057     LT_ERROR(INVALID_HANDLE,        "invalid module handle\0")          \
00058     LT_ERROR(BUFFER_OVERFLOW,       "internal buffer overflow\0")       \
00059     LT_ERROR(INVALID_ERRORCODE,     "invalid errorcode\0")              \
00060     LT_ERROR(SHUTDOWN,              "library already shutdown\0")       \
00061     LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0")    \
00062     LT_ERROR(INVALID_MUTEX_ARGS,    "internal error (code withdrawn)\0")\
00063     LT_ERROR(INVALID_POSITION,      "invalid search path insert position\0")\
00064     LT_ERROR(CONFLICTING_FLAGS,     "symbol visibility can be global or local\0")
00065 
00066 /* Enumerate the symbolic error names. */
00067 enum {
00068 #define LT_ERROR(name, diagnostic)      LT_CONC(LT_ERROR_, name),
00069         lt_dlerror_table
00070 #undef LT_ERROR
00071 
00072         LT_ERROR_MAX
00073 };
00074 
00075 /* Should be max of the error string lengths above (plus one for C++) */
00076 #define LT_ERROR_LEN_MAX (41)
00077 
00078 /* These functions are only useful from inside custom module loaders. */
00079 LT_SCOPE int    lt_dladderror   (const char *diagnostic);
00080 LT_SCOPE int    lt_dlseterror   (int errorcode);
00081 
00082 
00083 LT_END_C_DECLS
00084 
00085 #endif /*!defined(LT_ERROR_H)*/