chiark / gitweb /
Regression tests compile on systems without poll(2). Do not install adnstest_s....
[adns] / regress / harness.h.m4
CommitLineData
078c4fd0 1m4_dnl harness.h.m4
2m4_dnl (part of complex test harness, not of the library)
3m4_dnl - function and other declarations
4
3ff64957 5m4_dnl This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
078c4fd0 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>
9ba9f156 28#include <sys/uio.h>
078c4fd0 29#include <unistd.h>
30
31#include "internal.h"
32
125de2a9 33#ifdef HAVE_POLL
34#include <sys/poll.h>
35#endif
36
078c4fd0 37/* We override several system calls with #define's */
38
39hm_create_proto_h
40m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
41m4_include(`hsyscalls.i4')
42
9ba9f156 43int Hwritev(int fd, const struct iovec *vector, size_t count);
3c5796f7 44int Hgettimeofday(struct timeval *tv, struct timezone *tz);
9ba9f156 45
078c4fd0 46/* There is a Q function (Q for Question) for each such syscall;
47 * it constructs a string representing the call, and calls Q_str
48 * on it, or constructs it in vb and calls Q_vb;
49 */
50
51hm_create_proto_q
52m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
53m4_include(`hsyscalls.i4')
54
55void Q_vb(void);
56
57/* General help functions */
58
59void Tfailed(const char *why);
60void Toutputerr(void);
61void Tnomem(void);
62void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
63void Tensureoutputfile(void);
64void Tmust(const char *call, const char *arg, int cond);
65
66void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
67void Tvbvf(const char *fmt, va_list al);
68void Tvbfdset(int max, const fd_set *set);
2d5cce62 69void Tvbpollfds(const struct pollfd *fds, int nfds);
078c4fd0 70void Tvbaddr(const struct sockaddr *addr, int addrlen);
71void Tvbbytes(const void *buf, int len);
72void Tvberrno(int e);
73void Tvba(const char *str);
74
75/* Shared globals */
76
77extern vbuf vb;
3c5796f7 78extern struct timeval currenttime;
078c4fd0 79extern const struct Terrno { const char *n; int v; } Terrnos[];
80
81#endif