*** empty log message ***
[gnutls.git] / lib / gnutls_errors.h
blobd720bd1130b8f222cbf0852b151358994d93d8b7
1 /*
2 * Copyright (C) 2000 Nikos Mavroyanopoulos
4 * This file is part of GNUTLS.
6 * GNUTLS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GNUTLS 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 #include "gnutls_int.h"
22 #include "gnutls_errors_int.h"
24 #ifdef DEBUG
25 # ifdef __FILE__
26 # ifdef __LINE__
27 # define gnutls_assert() fprintf(stderr, "GNUTLS_ASSERT: %s:%d\n", __FILE__,__LINE__);
28 # else
29 # define gnutls_assert()
30 # endif
31 # else /* __FILE__ defined */
32 # define gnutls_assert()
33 # endif
34 #else /* no debug */
35 # define gnutls_assert()
36 #endif
38 int _gnutls_asn2err( int asn_err);
39 const char* gnutls_strerror(int error);
40 void gnutls_perror(int error);
41 int gnutls_error_is_fatal( int error);
43 #ifdef DEBUG
44 void _gnutls_log( const char *fmt, ...);
46 # ifdef HANDSHAKE_DEBUG
47 # define _gnutls_handshake_log _gnutls_log
48 # else
49 # define _gnutls_handshake_log( ...)
50 # endif
52 # ifdef IO_DEBUG
53 # define _gnutls_io_log _gnutls_log
54 # else
55 # define _gnutls_io_log( ...)
56 # endif
58 # ifdef BUFFERS_DEBUG
59 # define _gnutls_buffers_log _gnutls_log
60 # else
61 # define _gnutls_buffers_log( ...)
62 # endif
64 # ifdef HARD_DEBUG
65 # define _gnutls_hard_log _gnutls_log
66 # else
67 # define _gnutls_hard_log( ...)
68 # endif
70 # ifdef RECORD_DEBUG
71 # define _gnutls_record_log _gnutls_log
72 # else
73 # define _gnutls_record_log( ...)
74 # endif
76 # ifdef READ_DEBUG
77 # define _gnutls_read_log _gnutls_log
78 # else
79 # define _gnutls_read_log( ...)
80 # endif
82 # ifdef WRITE_DEBUG
83 # define _gnutls_write_log _gnutls_log
84 # else
85 # define _gnutls_write_log( ...)
86 # endif
88 # ifdef X509_DEBUG
89 # define _gnutls_x509_log _gnutls_log
90 # else
91 # define _gnutls_x509_log( ...)
92 # endif
94 #else
96 /* FIXME: These macros only work with C99 compliant compilers
98 # define _gnutls_log(...)
99 # define _gnutls_handshake_log( ...)
100 # define _gnutls_io_log( ...)
101 # define _gnutls_buffers_log( ...)
102 # define _gnutls_hard_log( ...)
103 # define _gnutls_record_log( ...)
104 # define _gnutls_read_log( ...)
105 # define _gnutls_write_log( ...)
106 # define _gnutls_x509_log( ...)
107 #endif /* DEBUG */