New m4-based test harness stuff.
[adns] / regress / harness.h.m4
CommitLineData
bb7ba677 1m4_dnl harness.h.m4
2m4_dnl (part of complex test harness, not of the library)
3m4_dnl - function and other declarations
4
5m4_dnl This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
6m4_dnl
7m4_dnl This program is free software; you can redistribute it and/or modify
8m4_dnl it under the terms of the GNU General Public License as published by
9m4_dnl the Free Software Foundation; either version 2, or (at your option)
10m4_dnl any later version.
11m4_dnl
12m4_dnl This program is distributed in the hope that it will be useful,
13m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15m4_dnl GNU General Public License for more details.
16m4_dnl
17m4_dnl You should have received a copy of the GNU General Public License
18m4_dnl along with this program; if not, write to the Free Software Foundation,
19m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21m4_include(hmacros.i4)
22
23#ifndef HARNESS_H_INCLUDED
24#define HARNESS_H_INCLUDED
25
26#include <sys/time.h>
27#include <sys/socket.h>
28#include <unistd.h>
29
30#include "internal.h"
31
32/* We override several system calls with #define's */
33
34hm_create_proto_h
35m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
36m4_include(`hsyscalls.i4')
37
38/* There is a Q function (Q for Question) for each such syscall;
39 * it constructs a string representing the call, and calls Q_str
40 * on it, or constructs it in vb and calls Q_vb;
41 */
42
43hm_create_proto_q
44m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
45m4_include(`hsyscalls.i4')
46
47void Q_vb(void);
48
49/* General help functions */
50
51void Tfailed(const char *why);
52void Toutputerr(void);
53void Tnomem(void);
54void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
55void Tensureoutputfile(void);
56void Tmust(const char *call, const char *arg, int cond);
57
58void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
59void Tvbvf(const char *fmt, va_list al);
60void Tvbfdset(int max, const fd_set *set);
61void Tvbaddr(const struct sockaddr *addr, int addrlen);
62void Tvbbytes(const void *buf, int len);
63void Tvberrno(int e);
64void Tvba(const char *str);
65
66/* Shared globals */
67
68extern vbuf vb;
69extern FILE *Toutputfile;
70
71extern const struct Terrno { const char *n; int v; } Terrnos[];
72
73#endif