ROHC compression/decompression library
rohc_traces.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 2 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * This program is distributed in the hope that it will be useful,
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  * GNU General Public License for more details.
00011  *
00012  * You should have received a copy of the GNU General Public License
00013  * along with this program; if not, write to the Free Software
00014  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  */
00016 
00023 #ifndef ROHC_TRACES_H
00024 #define ROHC_TRACES_H
00025 
00026 #include <stdio.h>
00027 #include "config.h" /* for ROHC_DEBUG_LEVEL */
00028 
00031 #define rohc_debugf(level, format, ...) \
00032         rohc_debugf_(level, "%s[%s:%d %s()] " format, \
00033                      (level == 0 ? "[ERROR] " : ""), \
00034                      __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)
00035 
00037 #define rohc_debugf_(level, format, ...) \
00038         do { \
00039                 if((level) <= ROHC_DEBUG_LEVEL) \
00040                         printf(format, ##__VA_ARGS__); \
00041         } while(0)
00042 
00043 
00044 #endif