xref: /minix3/crypto/external/bsd/netpgp/dist/src/libbn/misc.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc /*-
2ebfedea0SLionel Sambuc  * Copyright (c) 2012 Alistair Crooks <agc@NetBSD.org>
3ebfedea0SLionel Sambuc  * All rights reserved.
4ebfedea0SLionel Sambuc  *
5ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
6ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
7ebfedea0SLionel Sambuc  * are met:
8ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
9ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
10ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
11ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
12ebfedea0SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
13ebfedea0SLionel Sambuc  *
14ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16ebfedea0SLionel Sambuc  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17ebfedea0SLionel Sambuc  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18ebfedea0SLionel Sambuc  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19ebfedea0SLionel Sambuc  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20ebfedea0SLionel Sambuc  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21ebfedea0SLionel Sambuc  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22ebfedea0SLionel Sambuc  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23ebfedea0SLionel Sambuc  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24ebfedea0SLionel Sambuc  */
25ebfedea0SLionel Sambuc #ifndef MISC_H_
26ebfedea0SLionel Sambuc #define MISC_H_	20110705
27ebfedea0SLionel Sambuc 
28ebfedea0SLionel Sambuc #include <sys/types.h>
29ebfedea0SLionel Sambuc 
30ebfedea0SLionel Sambuc #include <inttypes.h>
31ebfedea0SLionel Sambuc 
32ebfedea0SLionel Sambuc #ifndef __BEGIN_DECLS
33ebfedea0SLionel Sambuc #  if defined(__cplusplus)
34ebfedea0SLionel Sambuc #  define __BEGIN_DECLS           extern "C" {
35ebfedea0SLionel Sambuc #  define __END_DECLS             }
36ebfedea0SLionel Sambuc #  else
37ebfedea0SLionel Sambuc #  define __BEGIN_DECLS
38ebfedea0SLionel Sambuc #  define __END_DECLS
39ebfedea0SLionel Sambuc #  endif
40ebfedea0SLionel Sambuc #endif
41ebfedea0SLionel Sambuc 
42ebfedea0SLionel Sambuc __BEGIN_DECLS
43ebfedea0SLionel Sambuc 
44ebfedea0SLionel Sambuc void *netpgp_allocate(size_t /*n*/, size_t /*nels*/);
45ebfedea0SLionel Sambuc void netpgp_deallocate(void */*ptr*/, size_t /*size*/);
46ebfedea0SLionel Sambuc 
47ebfedea0SLionel Sambuc #ifndef _KERNEL
48*0a6a1f1dSLionel Sambuc #  ifndef __printflike
49*0a6a1f1dSLionel Sambuc #  define __printflike(n, m)        __attribute__((format(printf,n,m)))
50*0a6a1f1dSLionel Sambuc #  endif
51*0a6a1f1dSLionel Sambuc 
52*0a6a1f1dSLionel Sambuc void logmessage(const int /*level*/, const char */*fmt*/, ...)
53*0a6a1f1dSLionel Sambuc     __printflike(2, 3);
54ebfedea0SLionel Sambuc #endif
55ebfedea0SLionel Sambuc 
56ebfedea0SLionel Sambuc __END_DECLS
57ebfedea0SLionel Sambuc 
58ebfedea0SLionel Sambuc #endif
59