summaryrefslogtreecommitdiffstats
path: root/lib/qdebug_nb.h
blob: 6da2a1201a3f2c71d6fe229a0cba7d64b1125446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* Debug definitions for non-blocking I/O testing
 * Copyright (C) 2010 Chris Hall (GMCH), Highwayman
 *
 * This file is part of GNU Zebra.
 *
 * GNU Zebra is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * GNU Zebra 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 GNU Zebra; see the file COPYING.  If not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef _ZEBRA_QDEBUG_NB_H
#define _ZEBRA_QDEBUG_NB_H

#include "misc.h"
#include "qrand.h"

/*------------------------------------------------------------------------------
 * Sort out QDEBUG_NB_DEBUG.
 *
 *   Set to 1 if defined, but blank.
 *   Set to QDEBUG if not defined.
 *
 *   Force to 0 if VTY_NO_DEBUG is defined and not zero.
 *
 * So: defaults to same as QDEBUG, but no matter what QDEBUG is set to:
 *
 *       * can set QDEBUG_NB_DEBUG    == 0 to turn off debug
 *       *  or set QDEBUG_NB_DEBUG    != 0 to turn on debug
 *       *  or set QDEBUG_NB_NO_DEBUG != to force debug off
 */

#ifdef QDEBUG_NB                /* If defined, make it 1 or 0           */
# if IS_BLANK_OPTION(QDEBUG_NB)
#  undef  QDEBUG_NB
#  define QDEBUG_NB 1
# endif
#else                           /* If not defined, follow QDEBUG        */
# define QDEBUG_NB QDEBUG
#endif

#ifdef QDEBUG_NB_NO             /* Override, if defined                 */
# if IS_NOT_ZERO_OPTION(QDEBUG_NB_NO)
#  undef  QDEBUG_NB
#  define QDEBUG_NB 0
# endif
#endif

enum { qdebug_nb = QDEBUG_NB } ;

#endif /* _ZEBRA_QDEBUG_NB_H */