"Fossies" - the Fresh Open Source Software Archive

Member "libsafe-2.0-16/src/log.h" (30 May 2002, 1755 Bytes) of package /linux/misc/old/libsafe-2.0-16.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * $Name: release2_0-16 $
    3  * $Id: log.h,v 1.12 2002/05/30 14:13:08 ttsai Exp $
    4  *
    5  * Copyright (C) 2002 Avaya Labs, Avaya Inc.
    6  * Copyright (C) 1999 Bell Labs, Lucent Technologies.
    7  * Copyright (C) Arash Baratloo, Timothy Tsai, and Navjot Singh.
    8  *
    9  * This file is part of the Libsafe library.
   10  * Libsafe version 2.x: protecting against stack smashing attacks.
   11  *
   12  * This library is free software; you can redistribute it and/or
   13  * modify it under the terms of the GNU Lesser General Public
   14  * License as published by the Free Software Foundation; either
   15  * version 2.1 of the License, or (at your option) any later version.
   16  *
   17  * This library is distributed in the hope that it will be useful,
   18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20  * Lesser General Public License for more details.
   21  *
   22  * You should have received a copy of the GNU Lesser General Public
   23  * License along with this library; if not, write to the Free Software
   24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   25  *
   26  * For more information, 
   27  *   visit http://www.research.avayalabs.com/project/libsafe/index.html
   28  *   or email libsafe@research.avayalabs.com
   29  */
   30 
   31 #ifndef _LOG_H
   32 #define _LOG_H
   33 
   34 /*
   35  * If you want to log lots of stuff, define and change the
   36  * LOG_LEVEL to something higher.  This will slow down the
   37  * execution.
   38  * undef=no overhead, 0=none, 1=errors, ..., 5=everything
   39  */
   40 #ifndef LOG_LEVEL
   41 #define LOG_LEVEL 1
   42 #endif              /* LOG_LEVEL */
   43 
   44 #ifdef LOG_LEVEL
   45 #include <stdio.h>
   46 #define LOG(level, format, args...) \
   47    if (level <= LOG_LEVEL) fprintf(stderr, format, ## args)
   48 #else
   49 #define LOG(level, format, args...)
   50 #endif
   51 
   52 
   53 #endif              /* _LOG_H */