+ Core library bugfixes:
[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
d942707d 5m4_dnl This file is
6m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
7m4_dnl
8m4_dnl It is part of adns, which is
9m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
10m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
bb7ba677 11m4_dnl
12m4_dnl This program is free software; you can redistribute it and/or modify
13m4_dnl it under the terms of the GNU General Public License as published by
14m4_dnl the Free Software Foundation; either version 2, or (at your option)
15m4_dnl any later version.
16m4_dnl
17m4_dnl This program is distributed in the hope that it will be useful,
18m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20m4_dnl GNU General Public License for more details.
21m4_dnl
22m4_dnl You should have received a copy of the GNU General Public License
23m4_dnl along with this program; if not, write to the Free Software Foundation,
24m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26m4_include(hmacros.i4)
27
28#ifndef HARNESS_H_INCLUDED
29#define HARNESS_H_INCLUDED
30
31#include <sys/time.h>
32#include <sys/socket.h>
70a778e5 33#include <sys/uio.h>
bb7ba677 34#include <unistd.h>
35
36#include "internal.h"
37
636b69b1 38#ifdef HAVE_POLL
39#include <sys/poll.h>
40#endif
41
bb7ba677 42/* We override several system calls with #define's */
43
44hm_create_proto_h
45m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
46m4_include(`hsyscalls.i4')
47
70a778e5 48int Hwritev(int fd, const struct iovec *vector, size_t count);
98b6d5b4 49int Hgettimeofday(struct timeval *tv, struct timezone *tz);
70a778e5 50
bb7ba677 51/* There is a Q function (Q for Question) for each such syscall;
52 * it constructs a string representing the call, and calls Q_str
53 * on it, or constructs it in vb and calls Q_vb;
54 */
55
56hm_create_proto_q
57m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
58m4_include(`hsyscalls.i4')
59
60void Q_vb(void);
61
62/* General help functions */
63
64void Tfailed(const char *why);
65void Toutputerr(void);
66void Tnomem(void);
67void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
68void Tensureoutputfile(void);
69void Tmust(const char *call, const char *arg, int cond);
70
71void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
72void Tvbvf(const char *fmt, va_list al);
73void Tvbfdset(int max, const fd_set *set);
8b1171e6 74void Tvbpollfds(const struct pollfd *fds, int nfds);
bb7ba677 75void Tvbaddr(const struct sockaddr *addr, int addrlen);
76void Tvbbytes(const void *buf, int len);
77void Tvberrno(int e);
78void Tvba(const char *str);
79
80/* Shared globals */
81
82extern vbuf vb;
98b6d5b4 83extern struct timeval currenttime;
bb7ba677 84extern const struct Terrno { const char *n; int v; } Terrnos[];
85
86#endif