2 * Copyright (c) 2012 Dag-Erling Smørgrav
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote
14 * products derived from this software without specific prior written
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * $Id: t.h 657 2013-03-06 22:59:05Z des $
35 #include <security/openpam_attr.h>
43 #define T_FUNC(n, d) \
44 static int t_ ## n ## _func(void *); \
45 static const struct t_test t_ ## n = \
46 { t_ ## n ## _func, d, NULL }; \
47 static int t_ ## n ## _func(OPENPAM_UNUSED(void *arg))
49 #define T_FUNC_ARG(n, d, a) \
50 static int t_ ## n ## _func(void *); \
51 static const struct t_test t_ ## n = \
52 { t_ ## n ## _func, d, a }; \
53 static int t_ ## n ## _func(void *arg)
58 extern const char *t_progname;
60 const struct t_test **t_prepare(int, char **);
63 void t_verbose(const char *, ...)
64 OPENPAM_FORMAT((__printf__, 1, 2));
67 * Convenience functions for temp files
72 struct t_file *prev, *next;
75 struct t_file *t_fopen(const char *);
76 int t_fprintf(struct t_file *, const char *, ...);
77 int t_ferror(struct t_file *);
78 int t_feof(struct t_file *);
79 void t_frewind(struct t_file *);
80 void t_fclose(struct t_file *);
81 void t_fcloseall(void);