Flow123d  jenkins-Flow123d-linux-release-multijob-282
global_defs.h File Reference

Global macros to enhance readability and debugging, general constants. More...

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "system/exc_common.hh"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define INPUT_CHECK(i,...)   do { if (!(i)) xprintf(UsrErr,__VA_ARGS__); } while (0)
 Debugging macros. More...
 
#define ASSERT(...)
 
#define WARN_ASSERT(...)
 
#define ASSERT_EQUAL(a, b)
 
#define ASSERT_LESS(a, b)
 
#define ASSERT_LE(a, b)
 
#define DBGMSG(...)
 
#define DBGCOUT(...)
 
#define DBGVAR(var)
 
static const int debug_asserts_view = 0
 

Detailed Description

Global macros to enhance readability and debugging, general constants.

Copyright (C) 2007 Technical University of Liberec. All rights reserved.

Please make a following refer to Flow123d on your project site if you use the program for any purpose, especially for academic research: Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.

$Id$ $Revision$ $LastChangedBy$ $LastChangedDate$

Definition in file global_defs.h.

Macro Definition Documentation

#define ASSERT (   ...)

Actually there are following debugging switches DEBUG_MESSAGES - use various debugging messages introduced by DBGMSG DEBUG_ASSERTS - use assertion checks introduced by ASSERT DEBUG_PROFILER - use profiling introduced by START_TIMER, END_TIMER

You can turn all off defining: Flow123d_NODEBUG or turn all on defining: Flow123d_DEBUG

Flow123d_DEBUG overrides Flow123d_NODEBUG

Definition at line 121 of file global_defs.h.

#define ASSERT_EQUAL (   a,
 
)

Definition at line 136 of file global_defs.h.

#define ASSERT_LE (   a,
 
)

Definition at line 165 of file global_defs.h.

#define ASSERT_LESS (   a,
 
)

Definition at line 164 of file global_defs.h.

#define DBGCOUT (   ...)

Definition at line 197 of file global_defs.h.

#define DBGMSG (   ...)

Definition at line 196 of file global_defs.h.

#define DBGVAR (   var)

Definition at line 198 of file global_defs.h.

#define INPUT_CHECK (   i,
  ... 
)    do { if (!(i)) xprintf(UsrErr,__VA_ARGS__); } while (0)

Debugging macros.

The macro ASSERT has to be used for assertion tests. An error occures if given condition is violated. Macro accepts additional variables to print.

Example:

*  ASSERT( i<size , "Array X overflow: index %d >= alocated size %d.\n",i,size);
*  

The macro INPUT_CHECK should be used for assertions about user input. So they produce User Error instead of Program error.

The macro DBGMSG should be used for debugging messages, so they can be removed in production version.

WARN_ASSERT - can be used for consistency tests in debugging version.

Definition at line 61 of file global_defs.h.

#define WARN_ASSERT (   ...)

Definition at line 122 of file global_defs.h.

Variable Documentation

const int debug_asserts_view = 0
static

Definition at line 209 of file global_defs.h.