Fix.
[shishi.git] / asn1 / errors.h
blob38395f619fd55f8f46cba143772bcf71a851e64d
1 /*
2 * Copyright (C) 2002 Fabio Fiorina
4 * This file is part of LIBASN1.
6 * LIBASN1 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 * LIBASN1 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 #ifndef ERRORS_H
22 #define ERRORS_H
25 #include "int.h"
26 #include "errors_int.h"
28 #ifdef LIBTASN1_DEBUG
29 # ifdef __FILE__
30 # ifdef __LINE__
31 # define _libtasn1_assert() fprintf(stderr, "LIBTASN1_ASSERT: %s:%d\n", __FILE__,__LINE__);
32 # else
33 # define _libtasn1_assert()
34 # endif
35 # else /* __FILE__ defined */
36 # define _libtasn1_assert()
37 # endif
38 #else /* no debug */
39 # define _libtasn1_assert()
40 #endif
42 const char* libtasn1_strerror(int error);
43 void libtasn1_perror(int error);
45 #ifdef LIBTASN1_DEBUG
46 void _libtasn1_log( const char *fmt, ...);
47 #else
49 /* These macros only work with C99 compliant compilers
51 # ifdef C99_MACROS
52 # define _libtasn1_log(...)
53 # else
54 # define _libtasn1_log _libtasn1_null_log
55 void _libtasn1_null_log( void*, ...);
56 # endif /* C99_MACROS */
58 #endif /* DEBUG */
60 #endif /* ERRORS_H */