Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

libraries_debug.h

Go to the documentation of this file.
00001 // $Header: /cvsroot/libcwd/libcwd/include/libcwd/libraries_debug.h,v 1.2 2004/07/15 10:14:34 libcw Exp $
00002 //
00003 // Copyright (C) 2000 - 2004, by
00004 // 
00005 // Carlo Wood, Run on IRC <carlo@alinoe.com>
00006 // RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
00007 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
00008 //
00009 // This file may be distributed under the terms of the Q Public License
00010 // version 1.0 as appearing in the file LICENSE.QPL included in the
00011 // packaging of this file.
00012 //
00013 
00022 #ifndef LIBCWD_LIBRARIES_DEBUG_H
00023 #define LIBCWD_LIBRARIES_DEBUG_H
00024 
00025 #ifdef CWDEBUG
00026 
00027 #include <libcwd/config.h>
00028 
00029 //===================================================================================================
00030 // The global debug channels used by libcwd.
00031 //
00032 
00033 #include <libcwd/class_channel.h>
00034 #include <libcwd/class_fatal_channel.h>
00035 #include <libcwd/class_continued_channel.h>
00036 #include <libcwd/class_always_channel.h>
00037 
00038 namespace libcwd {
00039 
00040 namespace channels {
00041 
00049   namespace dc {
00050     extern channel_ct debug;
00051     extern channel_ct notice;
00052     extern channel_ct system;
00053     extern channel_ct warning;
00054 #if CWDEBUG_ALLOC
00055 #ifdef LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
00056     extern channel_ct malloc;
00057 #else
00058     extern channel_ct __libcwd_malloc;
00059 #endif
00060 #else // !CWDEBUG_ALLOC
00061     extern channel_ct malloc;
00062 #endif
00063 #if CWDEBUG_LOCATION
00064     extern channel_ct bfd;
00065 #endif
00066     extern fatal_channel_ct fatal;
00067     extern fatal_channel_ct core;
00068     extern continued_channel_ct continued;
00069     extern continued_channel_ct finish;
00070     extern always_channel_ct always;
00071 
00072   } // namespace dc
00073 } // namespace channels
00074 
00075 } // namespace libcwd
00076 
00077 
00078 //===================================================================================================
00079 // The global debug object
00080 //
00081 
00082 #include <libcwd/class_debug.h>
00083 
00084 namespace libcwd {
00085 
00086 extern debug_ct libcw_do;
00087 
00088 } // namespace libcwd
00089 
00090 //===================================================================================================
00091 // Macros
00092 //
00093 
00094 #include <libcwd/macro_Libcwd_macros.h>
00095 
00096 // For use in (libcwd) library header files: do not redefine these!
00097 // Developers of libraries are recommended to define their own macro names,
00098 // see "Libraries" on reference-manual/group__chapter__custom__debug__h.html
00099 #define __Debug(x) \
00100     LibcwDebug(::libcwd::channels, x)
00101 #define __Dout(cntrl, data) \
00102     LibcwDout(::libcwd::channels, ::libcwd::libcw_do, cntrl, data)
00103 #define __DoutFatal(cntrl, data) \
00104     LibcwDoutFatal(::libcwd::channels, ::libcwd::libcw_do, cntrl, data)
00105 
00106 //===================================================================================================
00107 // Miscellaneous
00108 //
00109 
00110 namespace libcwd {
00111 
00112 extern channel_ct* find_channel(char const* label);
00113 extern void list_channels_on(debug_ct& debug_object);
00114 
00115 // Make the inserter functions of std accessible in libcwd.
00116 using std::operator<<;
00117 
00118 } // namespace libcwd
00119 
00120 // Make the inserter functions of libcwd accessible in global namespace.
00121 #ifndef HIDE_FROM_DOXYGEN
00122 namespace libcwd_inserters {
00123   using libcwd::operator<<;
00124 } // namespace libcwd_inserters
00125 using namespace libcwd_inserters;
00126 #endif
00127 
00128 #include <libcwd/macro_ForAllDebugChannels.h>
00129 #include <libcwd/macro_ForAllDebugObjects.h>
00130 #include <libcwd/private_environ.h>
00131 #include <libcwd/class_rcfile.h>
00132 #include <libcwd/attach_gdb.h>
00133 #include <libcwd/demangle.h>
00134 
00135 // Include the inline functions.
00136 #include <libcwd/private_allocator.inl>         // Implementation of allocator_adaptor template.
00137 #include <libcwd/class_channel.inl>             // Debug channels.
00138 #include <libcwd/class_fatal_channel.inl>
00139 #include <libcwd/class_continued_channel.inl>
00140 #include <libcwd/class_always_channel.inl>
00141 #include <libcwd/class_debug.inl>               // Debug objects (debug_ct).
00142 #include <libcwd/class_debug_string.inl>        // Public member of debug_ct.
00143 #include <libcwd/class_channel_set.inl>         // Used in macro Dout et al.
00144 #include <libcwd/class_location.inl>
00145 
00146 // Include optional features.
00147 #if CWDEBUG_LOCATION                            // --enable-location
00148 #include <libcwd/bfd.h>
00149 #endif
00150 #include <libcwd/debugmalloc.h>                 // --enable-alloc
00151 
00152 #endif // CWDEBUG
00153 #endif // LIBCWD_LIBRARIES_DEBUG_H
00154 
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.