xref: /freebsd/contrib/libpcap/fmtutils.h (revision afdbf109c6a661a729938f68211054a0a50d38ac)
1b00ab754SHans Petter Selasky /*
2b00ab754SHans Petter Selasky  * Copyright (c) 1994, 1995, 1996
3b00ab754SHans Petter Selasky  *	The Regents of the University of California.  All rights reserved.
4b00ab754SHans Petter Selasky  *
5b00ab754SHans Petter Selasky  * Redistribution and use in source and binary forms, with or without
6b00ab754SHans Petter Selasky  * modification, are permitted provided that the following conditions
7b00ab754SHans Petter Selasky  * are met:
8b00ab754SHans Petter Selasky  * 1. Redistributions of source code must retain the above copyright
9b00ab754SHans Petter Selasky  *    notice, this list of conditions and the following disclaimer.
10b00ab754SHans Petter Selasky  * 2. Redistributions in binary form must reproduce the above copyright
11b00ab754SHans Petter Selasky  *    notice, this list of conditions and the following disclaimer in the
12b00ab754SHans Petter Selasky  *    documentation and/or other materials provided with the distribution.
13b00ab754SHans Petter Selasky  * 3. All advertising materials mentioning features or use of this software
14b00ab754SHans Petter Selasky  *    must display the following acknowledgement:
15b00ab754SHans Petter Selasky  *	This product includes software developed by the Computer Systems
16b00ab754SHans Petter Selasky  *	Engineering Group at Lawrence Berkeley Laboratory.
17b00ab754SHans Petter Selasky  * 4. Neither the name of the University nor of the Laboratory may be used
18b00ab754SHans Petter Selasky  *    to endorse or promote products derived from this software without
19b00ab754SHans Petter Selasky  *    specific prior written permission.
20b00ab754SHans Petter Selasky  *
21b00ab754SHans Petter Selasky  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22b00ab754SHans Petter Selasky  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23b00ab754SHans Petter Selasky  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24b00ab754SHans Petter Selasky  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25b00ab754SHans Petter Selasky  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26b00ab754SHans Petter Selasky  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27b00ab754SHans Petter Selasky  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28b00ab754SHans Petter Selasky  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29b00ab754SHans Petter Selasky  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30b00ab754SHans Petter Selasky  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31b00ab754SHans Petter Selasky  * SUCH DAMAGE.
32b00ab754SHans Petter Selasky  */
33b00ab754SHans Petter Selasky 
34b00ab754SHans Petter Selasky #ifndef fmtutils_h
35b00ab754SHans Petter Selasky #define	fmtutils_h
36b00ab754SHans Petter Selasky 
376f9cba8fSJoseph Mingrone #include <stdarg.h>	/* we declare varargs functions */
386f9cba8fSJoseph Mingrone 
39b00ab754SHans Petter Selasky #include "pcap/funcattrs.h"
40b00ab754SHans Petter Selasky 
41b00ab754SHans Petter Selasky #ifdef __cplusplus
42b00ab754SHans Petter Selasky extern "C" {
43b00ab754SHans Petter Selasky #endif
44b00ab754SHans Petter Selasky 
45*afdbf109SJoseph Mingrone void	pcapint_fmt_set_encoding(unsigned int);
466f9cba8fSJoseph Mingrone 
47*afdbf109SJoseph Mingrone void	pcapint_fmt_errmsg_for_errno(char *, size_t, int,
48b00ab754SHans Petter Selasky     PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(4, 5);
49*afdbf109SJoseph Mingrone void	pcapint_vfmt_errmsg_for_errno(char *, size_t, int,
506f9cba8fSJoseph Mingrone     PCAP_FORMAT_STRING(const char *), va_list) PCAP_PRINTFLIKE(4, 0);
51b00ab754SHans Petter Selasky 
5257e22627SCy Schubert #ifdef _WIN32
53*afdbf109SJoseph Mingrone void	pcapint_fmt_errmsg_for_win32_err(char *, size_t, DWORD,
5457e22627SCy Schubert     PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(4, 5);
55*afdbf109SJoseph Mingrone void	pcapint_vfmt_errmsg_for_win32_err(char *, size_t, DWORD,
566f9cba8fSJoseph Mingrone     PCAP_FORMAT_STRING(const char *), va_list) PCAP_PRINTFLIKE(4, 0);
5757e22627SCy Schubert #endif
5857e22627SCy Schubert 
59b00ab754SHans Petter Selasky #ifdef __cplusplus
60b00ab754SHans Petter Selasky }
61b00ab754SHans Petter Selasky #endif
62b00ab754SHans Petter Selasky 
63b00ab754SHans Petter Selasky #endif
64