GNU libmicrohttpd
1.0.6
Toggle main menu visibility
Loading...
Searching...
No Matches
mhd_panic.c
Go to the documentation of this file.
1
/*
2
This file is part of libmicrohttpd
3
Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff
4
Copyright (C) 2014-2022 Evgeny Grin (Karlson2k)
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
28
29
#include "
mhd_panic.h
"
30
#include "
platform.h
"
31
#include "
microhttpd.h
"
32
36
MHD_PanicCallback
mhd_panic
= (
MHD_PanicCallback
)
NULL
;
37
41
void
*
mhd_panic_cls
=
NULL
;
42
43
53
_MHD_NORETURN
static
void
54
mhd_panic_std
(
void
*cls,
55
const
char
*file,
56
unsigned
int
line,
57
const
char
*reason)
58
{
59
(void) cls;
/* Mute compiler warning. */
60
#ifdef HAVE_MESSAGES
61
fprintf (stderr,
62
_
(
"Fatal error in GNU libmicrohttpd %s:%u: %s\n"
),
63
file,
64
line,
65
reason);
66
#else
/* ! HAVE_MESSAGES */
67
(void) file;
/* Mute compiler warning. */
68
(void) line;
/* Mute compiler warning. */
69
(void) reason;
/* Mute compiler warning. */
70
#endif
71
abort ();
72
}
73
74
93
_MHD_EXTERN
void
94
MHD_set_panic_func
(
MHD_PanicCallback
cb,
95
void
*cls)
96
{
97
if
((
MHD_PanicCallback
)
NULL
!= cb)
98
mhd_panic
= cb;
99
else
100
mhd_panic
= &
mhd_panic_std
;
101
102
mhd_panic_cls
= cls;
103
}
MHD_PanicCallback
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition
microhttpd.h:2660
MHD_set_panic_func
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition
mhd_panic.c:94
NULL
#define NULL
Definition
mhd_mono_clock.c:66
_
#define _(String)
Definition
mhd_options.h:42
_MHD_EXTERN
#define _MHD_EXTERN
Definition
mhd_options.h:53
mhd_panic
MHD_PanicCallback mhd_panic
Definition
mhd_panic.c:36
mhd_panic_std
static _MHD_NORETURN void mhd_panic_std(void *cls, const char *file, unsigned int line, const char *reason)
Definition
mhd_panic.c:54
mhd_panic_cls
void * mhd_panic_cls
Definition
mhd_panic.c:41
mhd_panic.h
MHD_panic() function and helpers.
microhttpd.h
public interface to libmicrohttpd
platform.h
platform-specific includes for libmicrohttpd
src
microhttpd
mhd_panic.c
Generated by
1.17.0