File: scamper_debug.h

package info (click to toggle)
scamper 20211212-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,268 kB
  • sloc: ansic: 115,786; sh: 4,281; makefile: 499; perl: 193
file content (57 lines) | stat: -rw-r--r-- 1,924 bytes parent folder | download | duplicates (2)
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
/*
 * scamper_debug.h
 *
 * $Id: scamper_debug.h,v 1.20 2020/04/08 07:55:51 mjl Exp $
 *
 * Copyright (C) 2004-2006 Matthew Luckie
 * Copyright (C) 2006-2009 The University of Waikato
 * Copyright (C) 2015-2020 Matthew Luckie
 * Author: Matthew Luckie
 *
 * This program 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, version 2.
 *
 * 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  02111-1307  USA
 *
 */

#ifndef __SCAMPER_DEBUG_H
#define __SCAMPER_DEBUG_H

void printerror(const char *func, const char *format, ...);
void printerror_gai(const char *func, int ecode, const char *format, ...);
void printerror_msg(const char *func, const char *format, ...);

#ifdef NDEBUG
#define scamper_assert(expr, task) ((void)0)
#else
#define scamper_assert(expr, task) ((expr) ? (void)0 : \
      __scamper_assert(__FILE__,__LINE__,__FUNC__, #expr, task))
void __scamper_assert(const char *file, int line, const char *func,
		      const char *expr, void *task);
#endif

/* only define scamper_debug if scamper is being built in debugging mode */
#if defined(NDEBUG) && defined(WITHOUT_DEBUGFILE)
#define scamper_debug(func, format, ...) ((void)0)
#else
#define HAVE_SCAMPER_DEBUG
void scamper_debug(const char *func, const char *format, ...);
#endif

#ifndef WITHOUT_DEBUGFILE
int scamper_debug_open(const char *debugfile);
void scamper_debug_close(void);
#endif

void scamper_debug_daemon(void);

#endif /* scamper_debug.h */